Improve syscalls for new task switching

There are a lot of under the hood changes here:
- Move syscalls to be a dispatch table, defined by syscalls.inc
- Don't need a full process state (push_all) in syscalls now
- In push_all, define REGS instead of using offsets
- Save TWO stack pointers as well as current saved stack pointer in TCB:
  - rsp0 is the base of the kernel stack for interrupts
  - rsp3 is the saved user stack from cpu_data
- Update syscall numbers in nulldrv
- Some asm-debugging enhancements to the gdb script
- fork() still not working
This commit is contained in:
Justin C. Miller
2019-04-02 00:25:36 -07:00
parent ca2362f858
commit 11a53e792f
17 changed files with 284 additions and 215 deletions

View File

@@ -20,7 +20,6 @@ extern "C" {
void isr_handler(cpu_state*);
void irq_handler(cpu_state*);
void syscall_handler(cpu_state*);
#define ISR(i, name) extern void name ();
#define EISR(i, name) extern void name ();
@@ -219,9 +218,11 @@ isr_handler(cpu_state *regs)
_halt();
break;
/*
case isr::isrSyscall:
syscall_dispatch(regs);
break;
*/
case isr::isrSpurious:
// No EOI for the spurious interrupt
@@ -284,9 +285,3 @@ irq_handler(cpu_state *regs)
*reinterpret_cast<uint32_t *>(0xffffff80fee000b0) = 0;
}
void
syscall_handler(cpu_state *regs)
{
syscall_dispatch(regs);
}