xv6/trapasm.S

39 lines
650 B
ArmAsm
Raw Normal View History

.text
2007-08-27 13:11:13 +00:00
2007-08-27 13:34:35 +00:00
.set SEG_KDATA_SEL, 0x10 # selector for SEG_KDATA
2007-08-27 13:11:13 +00:00
# vectors.S sends all traps here.
2007-08-28 18:23:48 +00:00
.globl alltraps
2006-06-13 15:50:06 +00:00
alltraps:
2007-08-27 13:11:13 +00:00
# Build trap frame.
pushl %ds
pushl %es
pushal
# Set up data segments.
movl $SEG_KDATA_SEL, %eax
movw %ax,%ds
movw %ax,%es
# Call trap(tf), where tf=%esp
pushl %esp
call trap
addl $4, %esp
2006-09-06 17:27:19 +00:00
2007-08-27 13:11:13 +00:00
# Return falls through to trapret...
.globl trapret
2006-06-12 15:22:12 +00:00
trapret:
popal
popl %es
popl %ds
2007-08-27 13:11:13 +00:00
addl $0x8, %esp # trapno and errcode
iret
2007-08-27 13:11:13 +00:00
# A forked process switches to user mode by calling
# forkret1(tf), where tf is the trap frame to use.
.globl forkret1
forkret1:
movl 4(%esp), %esp
jmp trapret
2006-09-06 17:27:19 +00:00