|
|
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 "i386asm.h"
20:
21: #include <oskit/x86/pc/pic.h>
22:
23: #define READ_ISR (OCW_TEMPLATE|READ_NEXT_RD|READ_IS_ONRD)
24:
25: /*
26: * Generic interrupt handler.
27: *
28: * On entry, %eax contains the irq number.
29: */
30: ENTRY(interrupt)
31: movl %eax,%ecx /* save irq number */
32: movb $(NON_SPEC_EOI),%al /* non-specific EOI */
33: outb %al,$(MASTER_ICW) /* ack interrupt to master */
34: cmpl $8,%ecx /* do we need to ack slave? */
35: jl 1f /* no, skip it */
36: outb %al,$(SLAVES_ICW)
37: 1:
38: shll $2,%ecx /* irq * 4 */
39: movl EXT(intpri)(%ecx),%edx /* get new ipl */
40: call spl /* set ipl */
41: movl EXT(iunit)(%ecx),%edx /* get device unit number */
42: pushl %eax /* push previous ipl */
43: pushl %edx /* push unit number */
44: call *EXT(ivect)(%ecx) /* call interrupt handler */
45: addl $4,%esp /* pop unit number */
46: call splx_cli /* restore previous ipl */
47: cli /* XXX no more nested interrupts */
48: addl $4,%esp /* pop previous ipl */
49: ret /* return */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.