mirror of
https://github.com/ipxe/ipxe
synced 2026-01-06 20:21:47 +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:
25
src/arch/x86_64/core/linux/linuxprefix.S
Normal file
25
src/arch/x86_64/core/linux/linuxprefix.S
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <linux/unistd.h>
|
||||
|
||||
.section ".text"
|
||||
.code64
|
||||
.globl _linux_start
|
||||
.type _linux_start, @function
|
||||
|
||||
_linux_start:
|
||||
xorq %rbp, %rbp
|
||||
|
||||
popq %rdi // argc -> C arg1
|
||||
movq %rsp, %rsi // argv -> C arg2
|
||||
|
||||
andq $~15, %rsp // 16-byte align the stack
|
||||
|
||||
call save_args
|
||||
|
||||
/* Our main doesn't use any arguments */
|
||||
call main
|
||||
|
||||
movq %rax, %rdi // rc -> syscall arg1
|
||||
movq $__NR_exit, %rax
|
||||
syscall
|
||||
|
||||
.size _start, . - _start
|
||||
Reference in New Issue
Block a user