Kernel: Move sys_fork trampolines to kernel/arch/ directory
This commit is contained in:
18
kernel/arch/i386/Syscall.S
Normal file
18
kernel/arch/i386/Syscall.S
Normal file
@@ -0,0 +1,18 @@
|
||||
.global sys_fork_trampoline
|
||||
sys_fork_trampoline:
|
||||
subl $4, %esp
|
||||
pushl %ebx
|
||||
pushl %ebp
|
||||
call read_rip
|
||||
testl %eax, %eax
|
||||
je .done
|
||||
subl $8, %esp
|
||||
pushl %eax
|
||||
pushl %esp
|
||||
call sys_fork
|
||||
addl $16, %esp
|
||||
.done:
|
||||
popl %ebp
|
||||
popl %ebx
|
||||
addl $4, %esp
|
||||
ret
|
||||
22
kernel/arch/x86_64/Syscall.S
Normal file
22
kernel/arch/x86_64/Syscall.S
Normal file
@@ -0,0 +1,22 @@
|
||||
.global sys_fork_trampoline
|
||||
sys_fork_trampoline:
|
||||
pushq %rbx
|
||||
pushq %rbp
|
||||
pushq %r12
|
||||
pushq %r13
|
||||
pushq %r14
|
||||
pushq %r15
|
||||
call read_rip
|
||||
testq %rax, %rax
|
||||
je .done
|
||||
movq %rax, %rsi
|
||||
movq %rsp, %rdi
|
||||
call sys_fork
|
||||
.done:
|
||||
popq %r15
|
||||
popq %r14
|
||||
popq %r13
|
||||
popq %r12
|
||||
popq %rbp
|
||||
popq %rbx
|
||||
ret
|
||||
Reference in New Issue
Block a user