2006-06-13 15:50:06 +00:00
|
|
|
#include "mmu.h"
|
|
|
|
|
2006-06-12 15:22:12 +00:00
|
|
|
.text
|
2006-06-13 15:50:06 +00:00
|
|
|
.globl alltraps
|
|
|
|
.globl trap
|
|
|
|
alltraps:
|
|
|
|
/* vectors.S sends all traps here */
|
|
|
|
pushl %ds # build
|
|
|
|
pushl %es # trap
|
|
|
|
pushal # frame
|
|
|
|
movl $16,%eax # SEG_KDATA << 3
|
|
|
|
movw %ax,%ds # kernel
|
|
|
|
movw %ax,%es # segments
|
|
|
|
pushl %esp # pass pointer to this trapframe
|
|
|
|
call trap # and call trap()
|
2006-06-15 16:02:20 +00:00
|
|
|
addl $4, %esp
|
2006-06-13 15:50:06 +00:00
|
|
|
# return falls through to trapret...
|
|
|
|
|
2006-06-12 15:22:12 +00:00
|
|
|
.globl trapret
|
|
|
|
/*
|
|
|
|
* a forked process RETs here
|
|
|
|
* expects ESP to point to a Trapframe
|
|
|
|
*/
|
|
|
|
trapret:
|
2006-06-22 20:47:23 +00:00
|
|
|
push $kernel_lock
|
|
|
|
call release_spinlock
|
2006-06-12 15:22:12 +00:00
|
|
|
popal
|
|
|
|
popl %es
|
|
|
|
popl %ds
|
|
|
|
addl $0x8, %esp /* trapno and errcode */
|
|
|
|
iret
|
2006-06-22 01:28:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
.globl acpu
|
|
|
|
acpu:
|
|
|
|
.long 0
|