-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
user mode : entry #3
Comments
|
|
代码 sysdeps/unix/sysv/linux/x86_64/syscall.S: /* Usage: long syscall (syscall_number, arg1, arg2, arg3, arg4, arg5, arg6)
We need to do some arg shifting, the syscall_number will be in
rax. */
.text
ENTRY (syscall)
movq %rdi, %rax /* Syscall number -> rax. */
movq %rsi, %rdi /* shift arg1 - arg5. */
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %r10
movq %r9, %r8
movq 8(%rsp),%r9 /* arg6 is on the stack. */
syscall /* Do the system call. */
cmpq $-4095, %rax /* Check %rax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
L(pseudo_end):
ret /* Return to caller. */ |
|
ret = __dune_enter(dune_fd, conf); // %rdi -> dune_fd %rsi->dune_conf .globl __dune_enter
__dune_enter:
pushfq
subq $REG_END, %rsp
SAVE_REGS 1, 0
SAVE_REST
movq %rsp, DUNE_CFG_RSP(%rsi) /* move %rsp to dune_conf::rsp */
movq %rsi, %rdx / * dune_conf : rdx, parameter 4 */
movq $IOCTL_DUNE_ENTER, %rsi /* paramter 3 */
movq $16, %rax /* __NR_ioctl */ /* paramter 1, and dune_fd in %rdi, the paramter 2 */
syscall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context Switch && Interrupt, here I came.
The text was updated successfully, but these errors were encountered: