mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 18:12:36 +03:00
[linux] Avoid building Linux-specific prefix on non-Linux builds
Reported-by: David Yeske <dyeske@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
28
src/arch/i386/core/linux/linuxprefix.S
Normal file
28
src/arch/i386/core/linux/linuxprefix.S
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <linux/unistd.h>
|
||||
|
||||
.section ".text"
|
||||
.code32
|
||||
.globl _linux_start
|
||||
.type _linux_start, @function
|
||||
|
||||
_linux_start:
|
||||
xorl %ebp, %ebp
|
||||
|
||||
popl %esi // save argc
|
||||
movl %esp, %edi // save argv
|
||||
|
||||
andl $~15, %esp // 16-byte align the stack
|
||||
|
||||
pushl %edi // argv -> C arg2
|
||||
pushl %esi // argc -> C arg1
|
||||
|
||||
call save_args
|
||||
|
||||
/* Our main doesn't use any arguments */
|
||||
call main
|
||||
|
||||
movl %eax, %ebx // rc -> syscall arg1
|
||||
movl $__NR_exit, %eax
|
||||
int $0x80
|
||||
|
||||
.size _linux_start, . - _linux_start
|
||||
Reference in New Issue
Block a user