summaryrefslogtreecommitdiff
path: root/trapasm.S
diff options
context:
space:
mode:
Diffstat (limited to 'trapasm.S')
-rw-r--r--trapasm.S16
1 files changed, 16 insertions, 0 deletions
diff --git a/trapasm.S b/trapasm.S
index 69649ff..c75ab39 100644
--- a/trapasm.S
+++ b/trapasm.S
@@ -1,4 +1,20 @@
+#include "mmu.h"
+
.text
+ .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...
+
.globl trapret
/*
* a forked process RETs here