CeDOS - kernel/syscall.s

kernel/syscall.s (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.global syscall_interrupt
/*!
 * Prehandles scheduler interrupts by switching from process- to scheduler-stack
 */
syscall_interrupt:
  // push arguments on stack
  push %edx
  push %ecx
  push %ebx

  mov $SYSCALL_TABLE, %ecx
  mov (%ecx, %eax, 4), %eax

  call *%eax

  // restore stack
  add $12, %esp
  iret