~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/ipxe/src/arch/i386/core/linux/linuxprefix.S

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <linux/unistd.h>
 
2
 
 
3
        .section ".text"
 
4
        .code32
 
5
        .globl _linux_start
 
6
        .type _linux_start, @function
 
7
 
 
8
_linux_start:
 
9
        xorl    %ebp, %ebp
 
10
 
 
11
        popl    %esi       // save argc
 
12
        movl    %esp, %edi // save argv
 
13
 
 
14
        andl    $~15, %esp // 16-byte align the stack
 
15
 
 
16
        pushl   %edi // argv -> C arg2
 
17
        pushl   %esi // argc -> C arg1
 
18
 
 
19
        call    save_args
 
20
 
 
21
        /* Our main doesn't use any arguments */
 
22
        call    main
 
23
 
 
24
        movl    %eax, %ebx // rc -> syscall arg1
 
25
        movl    $__NR_exit, %eax
 
26
        int     $0x80
 
27
 
 
28
        .size _linux_start, . - _linux_start