10a70d042Srtm#include "mmu.h" 20a70d042Srtm 355e95b16Srtm .text 40a70d042Srtm.globl trap 5*65bd8e13Srsc.globl trapret1 6*65bd8e13Srsc 7*65bd8e13Srsc.globl alltraps 80a70d042Srtmalltraps: 90a70d042Srtm /* vectors.S sends all traps here */ 100a70d042Srtm pushl %ds # build 110a70d042Srtm pushl %es # trap 120a70d042Srtm pushal # frame 130a70d042Srtm movl $16,%eax # SEG_KDATA << 3 140a70d042Srtm movw %ax,%ds # kernel 150a70d042Srtm movw %ax,%es # segments 160a70d042Srtm pushl %esp # pass pointer to this trapframe 170a70d042Srtm call trap # and call trap() 18a4c03deaSrtm addl $4, %esp 190a70d042Srtm # return falls through to trapret... 200a70d042Srtm 2155e95b16Srtm /* 2255e95b16Srtm * a forked process RETs here 2355e95b16Srtm * expects ESP to point to a Trapframe 2455e95b16Srtm */ 25*65bd8e13Srsc.globl trapret 2655e95b16Srtmtrapret: 2755e95b16Srtm popal 2855e95b16Srtm popl %es 2955e95b16Srtm popl %ds 3055e95b16Srtm addl $0x8, %esp /* trapno and errcode */ 3155e95b16Srtm iret 3221a88fd4Skaashoek 33*65bd8e13Srsc.globl forkret 34*65bd8e13Srscforkret: 35*65bd8e13Srsc call forkret1 36*65bd8e13Srsc jmp trapret 3721a88fd4Skaashoek 3821a88fd4Skaashoek.globl acpu 3921a88fd4Skaashoekacpu: 4021a88fd4Skaashoek .long 0 41