mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Pass CPU state as a pointer
Previously CPU statue was passed on the stack, but the compiler is allowed to clobber values passed to it on the stack in the SysV x86 ABI. So now leave the state on the stack but pass a pointer to it into the ISR functions.
This commit is contained in:
@@ -10,7 +10,7 @@ class lapic;
|
||||
struct page_table;
|
||||
struct cpu_state;
|
||||
|
||||
extern "C" uintptr_t isr_handler(uintptr_t, cpu_state);
|
||||
extern "C" uintptr_t isr_handler(uintptr_t, cpu_state*);
|
||||
|
||||
|
||||
/// The task scheduler
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
static scheduler & get() { return s_instance; }
|
||||
|
||||
private:
|
||||
friend uintptr_t syscall_dispatch(uintptr_t, const cpu_state &);
|
||||
friend uintptr_t isr_handler(uintptr_t, cpu_state);
|
||||
friend uintptr_t syscall_dispatch(uintptr_t, cpu_state &);
|
||||
friend uintptr_t isr_handler(uintptr_t, cpu_state*);
|
||||
|
||||
/// Handle a timer tick
|
||||
/// \arg rsp0 The stack pointer of the current interrupt handler
|
||||
|
||||
Reference in New Issue
Block a user