|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1995 Shantanu Goel ! 3: * All Rights Reserved. ! 4: * ! 5: * Permission to use, copy, modify and distribute this software and its ! 6: * documentation is hereby granted, provided that both the copyright ! 7: * notice and this permission notice appear in all copies of the ! 8: * software, derivative works or modified versions, and any portions ! 9: * thereof, and that both notices appear in supporting documentation. ! 10: * ! 11: * THE AUTHOR ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" ! 12: * CONDITION. THE AUTHOR DISCLAIMS ANY LIABILITY OF ANY KIND FOR ! 13: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 14: */ ! 15: ! 16: #include <mach/machine/asm.h> ! 17: ! 18: #include "ipl.h" ! 19: #include "pic.h" ! 20: #include "i386asm.h" ! 21: ! 22: #define READ_ISR (OCW_TEMPLATE|READ_NEXT_RD|READ_IS_ONRD) ! 23: ! 24: /* ! 25: * Generic interrupt handler. ! 26: * ! 27: * On entry, %eax contains the irq number. ! 28: */ ! 29: ENTRY(interrupt) ! 30: movl %eax,%ecx /* save irq number */ ! 31: movb $(NON_SPEC_EOI),%al /* non-specific EOI */ ! 32: outb %al,$(PIC_MASTER_ICW) /* ack interrupt to master */ ! 33: cmpl $8,%ecx /* do we need to ack slave? */ ! 34: jl 1f /* no, skip it */ ! 35: outb %al,$(PIC_SLAVE_ICW) ! 36: 1: ! 37: shll $2,%ecx /* irq * 4 */ ! 38: movl EXT(intpri)(%ecx),%edx /* get new ipl */ ! 39: call spl /* set ipl */ ! 40: movl EXT(iunit)(%ecx),%edx /* get device unit number */ ! 41: pushl %eax /* push previous ipl */ ! 42: pushl %edx /* push unit number */ ! 43: call *EXT(ivect)(%ecx) /* call interrupt handler */ ! 44: addl $4,%esp /* pop unit number */ ! 45: call splx_cli /* restore previous ipl */ ! 46: cli /* XXX no more nested interrupts */ ! 47: addl $4,%esp /* pop previous ipl */ ! 48: ret /* return */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.