uti: Replace data types represented as arrays with C structures

Defining C structures for the following objects:
(1) Remote and local context
(2) Stack of system call arguments / return values

Change-Id: Iafbb6c795bd765e3c78c54a255d8a1e4d4536288
This commit is contained in:
Masamichi Takagi
2018-09-03 18:20:00 +09:00
parent 04d4145b3e
commit 781a69617b
12 changed files with 215 additions and 188 deletions

View File

@ -1,15 +1,22 @@
/*
arg: rdi, rsi, rdx, rcx, r8, r9
ret: rax
Calling convention:
arg: rdi, rsi, rdx, rcx, r8, r9
ret: rax
rax syscall number
syscall: (rax:num) rdi rsi rdx r10 r8 r9 (rcx:ret addr)
fd, cmd, param
rdi: fd
rsi: cmd
rdx: param
rcx: save area
r8: new thread context
rdi: fd
rsi: cmd
rdx: param
rcx: save area
r8: new thread context
Syscam call convention:
syscall number: rax
arg: rdi, rsi, rdx, r10, r8, r9
return addr: rcx
rdi: fd
rsi: cmd
rdx: param
*/
.global switch_ctx
@ -91,6 +98,7 @@ switch_ctx:
1:
mov $0xffffffffffffffff,%eax
retq
2:
pushq %rax
movq $158,%rax /* arch_prctl */