xref: /freebsd/stand/kboot/libkboot/arch/aarch64/host_syscall.S (revision 58c99df2196c5564a6922dcfe4d03387cebdd10c)
109933581SWarner Losh#include <machine/asm.h>
209933581SWarner Losh
309933581SWarner Losh/*
409933581SWarner Losh * Emulate the Linux system call interface. System call number in x8.
509933581SWarner Losh * Args in x0, x1, x2, x3, x4 and x5. Return in x0.
609933581SWarner Losh */
709933581SWarner LoshENTRY(host_syscall)
809933581SWarner Losh	mov	x8, x0
909933581SWarner Losh	mov	x0, x1
1009933581SWarner Losh	mov	x1, x2
1109933581SWarner Losh	mov	x2, x3
1209933581SWarner Losh	mov	x3, x4
1309933581SWarner Losh	mov	x4, x5
1409933581SWarner Losh	mov	x5, x6
1509933581SWarner Losh	svc	0
1609933581SWarner Losh	ret
1709933581SWarner Losh/* Note: We're exposing the raw return value to the caller */
1809933581SWarner LoshEND(host_syscall)
19*58c99df2SWarner Losh
20*58c99df2SWarner Losh	.section .note.GNU-stack,"",%progbits
21