mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:27:44 +00:00
Pass the register dump to syscall_entry() via an argument.
I'm not sure why this was using a global, but it was very racy and made processes walk over each other when multiple processes were doing syscalls simultaneously.
This commit is contained in:
parent
b4f3bc078f
commit
72e75c52e3
1 changed files with 3 additions and 7 deletions
|
@ -3,15 +3,12 @@
|
||||||
#include "Syscall.h"
|
#include "Syscall.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
||||||
extern "C" void syscall_entry();
|
extern "C" void syscall_entry(RegisterDump&);
|
||||||
extern "C" void syscall_ISR();
|
extern "C" void syscall_ISR();
|
||||||
extern volatile RegisterDump* syscallRegDump;
|
extern volatile RegisterDump* syscallRegDump;
|
||||||
|
|
||||||
asm(
|
asm(
|
||||||
".globl syscall_ISR \n"
|
".globl syscall_ISR \n"
|
||||||
".globl syscallRegDump \n"
|
|
||||||
"syscallRegDump: \n"
|
|
||||||
".long 0\n"
|
|
||||||
"syscall_ISR:\n"
|
"syscall_ISR:\n"
|
||||||
" pusha\n"
|
" pusha\n"
|
||||||
" pushw %ds\n"
|
" pushw %ds\n"
|
||||||
|
@ -27,7 +24,7 @@ asm(
|
||||||
" popw %es\n"
|
" popw %es\n"
|
||||||
" popw %fs\n"
|
" popw %fs\n"
|
||||||
" popw %gs\n"
|
" popw %gs\n"
|
||||||
" mov %esp, syscallRegDump\n"
|
" mov %esp, %eax\n"
|
||||||
" call syscall_entry\n"
|
" call syscall_entry\n"
|
||||||
" popw %gs\n"
|
" popw %gs\n"
|
||||||
" popw %gs\n"
|
" popw %gs\n"
|
||||||
|
@ -125,9 +122,8 @@ DWORD handle(DWORD function, DWORD arg1, DWORD arg2, DWORD arg3)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void syscall_entry()
|
void syscall_entry(RegisterDump& regs)
|
||||||
{
|
{
|
||||||
auto& regs = *syscallRegDump;
|
|
||||||
DWORD function = regs.eax;
|
DWORD function = regs.eax;
|
||||||
DWORD arg1 = regs.edx;
|
DWORD arg1 = regs.edx;
|
||||||
DWORD arg2 = regs.ecx;
|
DWORD arg2 = regs.ecx;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue