xv6-65oo2/trapasm.S

39 lines
704 B
ArmAsm
Raw Normal View History

.text
.globl trap
.globl trapret1
.globl alltraps
2006-06-13 15:50:06 +00:00
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()
addl $4, %esp
# return falls through to trapret...
2006-09-06 17:27:19 +00:00
/*
* a forked process RETs here
* expects ESP to point to a Trapframe
*/
.globl trapret
2006-06-12 15:22:12 +00:00
trapret:
popal
popl %es
popl %ds
addl $0x8, %esp /* trapno and errcode */
iret
.globl forkret1
forkret1:
movl 4(%esp), %esp
jmp trapret
2006-09-06 17:27:19 +00:00
.globl acpu
acpu:
.long 0