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