Files
mckernel/executer/user/arch/arm64/archdep.S
Takehiro Shiratori d4d78e9c61 Following arm64-support to development branch
This includes the following fixes:
* fix build of arch/arm64/kernel/vdso

Change-Id: I73b05034d29f7f8731ac17f9736edbba4fb2c639
2019-02-01 15:14:45 +09:00

40 lines
724 B
ArmAsm

/* archdep.S COPYRIGHT FUJITSU LIMITED 2017-2018 */
#include <sys/syscall.h>
/*
* int switch_ctx(int fd, unsigned long cmd, void **param, void *lctx,
* void *rctx);
* <register> : <argument>
* x0 : int fd
* x1 : unsigned long cmd
* x2 : void **param
* x3 : void *lctx
* x4 : void *rctx
*/
.global switch_ctx
switch_ctx:
/* send ioctl(fd, cmd, param) */
mov w8, #__NR_ioctl
svc #0x0
/* if (syscall_ret < 0 && -4095(-MAX_ERRNO) <= syscall_ret) goto 1f; */
cmp x0, #0xfffffffffffff000
b.hi 1f
/* if (syscall_ret != 0) goto 2f; */
cmp x0, #0x0
b.ne 2f
/* function_ret = 0 */
mov x0, #0x0
ret
/* error case */
1:
/* function_ret = -1 */
mov x0, #0xffffffffffffffff
2:
ret