xv6-cs450/trapasm.S

29 lines
750 B
ArmAsm
Raw Normal View History

2006-06-13 17:50:06 +02:00
#include "mmu.h"
2006-06-12 17:22:12 +02:00
.text
2006-06-13 17:50:06 +02: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()
# return falls through to trapret...
2006-06-12 17:22:12 +02:00
.globl trapret
/*
* a forked process RETs here
* expects ESP to point to a Trapframe
*/
trapret:
popal
popl %es
popl %ds
addl $0x8, %esp /* trapno and errcode */
iret