diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2025-05-11 08:48:57 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2025-05-11 08:48:57 +0000 |
| commit | 833cd6446d9981a262959749c0e248e33b54c174 (patch) | |
| tree | 4378760ddf5d6034d2c702274a6757940e7afe44 /arch/x86_64/src/context_switching/syscall/main.cpp | |
| parent | 955ab48fe6329b2cbc8c5855a8ba7290185d0ea3 (diff) | |
| download | kernel-833cd6446d9981a262959749c0e248e33b54c174.tar.xz kernel-833cd6446d9981a262959749c0e248e33b54c174.zip | |
Adjust user heap allocator with expanding heap functionality
Diffstat (limited to 'arch/x86_64/src/context_switching/syscall/main.cpp')
| -rw-r--r-- | arch/x86_64/src/context_switching/syscall/main.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/x86_64/src/context_switching/syscall/main.cpp b/arch/x86_64/src/context_switching/syscall/main.cpp index 93fc613..996d7fb 100644 --- a/arch/x86_64/src/context_switching/syscall/main.cpp +++ b/arch/x86_64/src/context_switching/syscall/main.cpp @@ -2,7 +2,7 @@ namespace teachos::arch::context_switching::syscall { - auto syscall(type syscall_number, arguments args) -> error + auto syscall(type syscall_number, arguments args) -> response { asm volatile("mov %[input], %%rax" : /* no output from call */ @@ -18,9 +18,18 @@ namespace teachos::arch::context_switching::syscall asm volatile("syscall"); - error error{}; - asm volatile("mov %%rax, %[output]" : [output] "=m"(error)); - return error; + error error_code{}; + asm volatile("mov %%rax, %[output]" : [output] "=m"(error_code)); + + arguments values{}; + asm volatile("mov %%rdi, %[output]" : [output] "=m"(values.arg_0)); + asm volatile("mov %%rsi, %[output]" : [output] "=m"(values.arg_1)); + asm volatile("mov %%rdx, %[output]" : [output] "=m"(values.arg_2)); + asm volatile("mov %%r10, %[output]" : [output] "=m"(values.arg_3)); + asm volatile("mov %%r8, %[output]" : [output] "=m"(values.arg_4)); + asm volatile("mov %%r9, %[output]" : [output] "=m"(values.arg_5)); + + return {error_code, values}; } } // namespace teachos::arch::context_switching::syscall |
