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@
26 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
36 #include <machine/machine_routines.h>
37 #include <pexpert/pexpert.h>
40 #include <IOKit/IOService.h>
41 #include <IOKit/IOInterruptController.h>
44 kIOCPUStateUnregistered
= 0,
45 kIOCPUStateUninitalized
,
51 class IOCPUInterruptController
;
53 extern IOCPUInterruptController
*gIOCPUInterruptController
;
55 class IOCPU
: public IOService
57 OSDeclareAbstractStructors(IOCPU
);
66 processor_t machProcessor
;
67 ipi_handler_t ipi_handler
;
69 struct ExpansionData
{ };
70 ExpansionData
*reserved
;
72 virtual void setCPUNumber(UInt32 cpuNumber
);
73 virtual void setCPUState(UInt32 cpuState
);
76 static void initCPUs(void);
78 virtual bool start(IOService
*provider
);
79 virtual IOReturn
setProperties(OSObject
*properties
);
80 virtual void initCPU(bool boot
) = 0;
81 virtual void quiesceCPU(void) = 0;
82 virtual kern_return_t
startCPU(vm_offset_t start_paddr
,
83 vm_offset_t arg_paddr
) = 0;
84 virtual void haltCPU(void) = 0;
85 virtual void signalCPU(IOCPU
*target
);
86 virtual void enableCPUTimeBase(bool enable
);
88 virtual UInt32
getCPUNumber(void);
89 virtual UInt32
getCPUState(void);
90 virtual OSArray
*getCPUGroup(void);
91 virtual UInt32
getCPUGroupSize(void);
92 virtual processor_t
getMachProcessor(void);
94 virtual const OSSymbol
*getCPUName(void) = 0;
96 OSMetaClassDeclareReservedUnused(IOCPU
, 0);
97 OSMetaClassDeclareReservedUnused(IOCPU
, 1);
98 OSMetaClassDeclareReservedUnused(IOCPU
, 2);
99 OSMetaClassDeclareReservedUnused(IOCPU
, 3);
100 OSMetaClassDeclareReservedUnused(IOCPU
, 4);
101 OSMetaClassDeclareReservedUnused(IOCPU
, 5);
102 OSMetaClassDeclareReservedUnused(IOCPU
, 6);
103 OSMetaClassDeclareReservedUnused(IOCPU
, 7);
106 void IOCPUSleepKernel(void);
109 class IOCPUInterruptController
: public IOInterruptController
111 OSDeclareDefaultStructors(IOCPUInterruptController
);
120 struct ExpansionData
{ };
121 ExpansionData
*reserved
;
124 virtual IOReturn
initCPUInterruptController(int sources
);
125 virtual void registerCPUInterruptController(void);
126 virtual void setCPUInterruptProperties(IOService
*service
);
127 virtual void enableCPUInterrupt(IOCPU
*cpu
);
129 virtual IOReturn
registerInterrupt(IOService
*nub
, int source
,
131 IOInterruptHandler handler
,
134 virtual IOReturn
getInterruptType(IOService
*nub
, int source
,
137 virtual IOReturn
enableInterrupt(IOService
*nub
, int source
);
138 virtual IOReturn
disableInterrupt(IOService
*nub
, int source
);
139 virtual IOReturn
causeInterrupt(IOService
*nub
, int source
);
141 virtual IOReturn
handleInterrupt(void *refCon
, IOService
*nub
,
144 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 0);
145 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 1);
146 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 2);
147 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 3);
148 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 4);
149 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 5);
152 #endif /* ! _IOKIT_CPU_H */