|
|
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:
1.1.1.2 root 18: #include <i386/ipl.h>
19: #include <i386/pic.h>
20: #include <i386/i386asm.h>
1.1 root 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)
1.1.1.2 root 30: pushl %eax /* save irq number */
31: movl %eax,%ecx /* copy irq number */
1.1 root 32: shll $2,%ecx /* irq * 4 */
33: movl EXT(intpri)(%ecx),%edx /* get new ipl */
34: call spl /* set ipl */
35: movl EXT(iunit)(%ecx),%edx /* get device unit number */
36: pushl %eax /* push previous ipl */
37: pushl %edx /* push unit number */
38: call *EXT(ivect)(%ecx) /* call interrupt handler */
39: addl $4,%esp /* pop unit number */
40: call splx_cli /* restore previous ipl */
41: addl $4,%esp /* pop previous ipl */
1.1.1.2 root 42: cli /* XXX no more nested interrupts */
43: popl %eax /* restore irq number */
44: movl %eax,%ecx /* copy irq number */
45: movb $(NON_SPEC_EOI),%al /* non-specific EOI */
46: outb %al,$(PIC_MASTER_ICW) /* ack interrupt to master */
47: cmpl $8,%ecx /* do we need to ack slave? */
48: jl 1f /* no, skip it */
49: outb %al,$(PIC_SLAVE_ICW)
50: 1:
1.1 root 51: ret /* return */
1.1.1.3 ! root 52: END(interrupt)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.