2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 #include <pexpert/pexpert.h>
26 #include <pexpert/protos.h>
27 #include <machine/machine_routines.h>
28 #include <i386/machine_cpu.h>
30 #include <sys/kdebug.h>
32 struct i386_interrupt_handler
{
33 IOInterruptHandler handler
;
39 typedef struct i386_interrupt_handler i386_interrupt_handler_t
;
41 i386_interrupt_handler_t PE_interrupt_handler
;
43 void PE_platform_interrupt_initialize(void)
50 PE_incoming_interrupt(int interrupt
, void *state
)
52 i386_interrupt_handler_t
*vector
;
54 KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_EXCP_INTR
, 0) | DBG_FUNC_START
,
55 0, ((unsigned int *)state
)[5], 0, 0, 0);
57 vector
= &PE_interrupt_handler
;
60 case APIC_ERROR_INTERRUPT
:
61 case SPURIOUS_INTERRUPT
:
62 case INTERPROCESS_INTERRUPT
:
63 lapic_interrupt(interrupt
, state
);
66 vector
->handler(vector
->target
, state
, vector
->nub
, interrupt
);
69 KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_EXCP_INTR
, 0) | DBG_FUNC_END
,
73 void PE_install_interrupt_handler(void *nub
, int source
,
75 IOInterruptHandler handler
,
78 i386_interrupt_handler_t
*vector
;
80 vector
= &PE_interrupt_handler
;
82 /*vector->source = source; IGNORED */
83 vector
->handler
= handler
;
85 vector
->target
= target
;
86 vector
->refCon
= refCon
;