2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
33 #include <machine/machine_routines.h>
34 #include <pexpert/pexpert.h>
37 #include <IOKit/IOService.h>
38 #include <IOKit/IOInterruptController.h>
41 kIOCPUStateUnregistered
= 0,
42 kIOCPUStateUninitalized
,
48 class IOCPUInterruptController
;
50 extern IOCPUInterruptController
*gIOCPUInterruptController
;
52 class IOCPU
: public IOService
54 OSDeclareAbstractStructors(IOCPU
);
63 processor_t machProcessor
;
64 ipi_handler_t ipi_handler
;
66 struct ExpansionData
{ };
67 ExpansionData
*reserved
;
69 virtual void setCPUNumber(UInt32 cpuNumber
);
70 virtual void setCPUState(UInt32 cpuState
);
73 static void initCPUs(void);
75 virtual bool start(IOService
*provider
);
76 virtual IOReturn
setProperties(OSObject
*properties
);
77 virtual void initCPU(bool boot
) = 0;
78 virtual void quiesceCPU(void) = 0;
79 virtual kern_return_t
startCPU(vm_offset_t start_paddr
,
80 vm_offset_t arg_paddr
) = 0;
81 virtual void haltCPU(void) = 0;
82 virtual void signalCPU(IOCPU
*target
);
83 virtual void enableCPUTimeBase(bool enable
);
85 virtual UInt32
getCPUNumber(void);
86 virtual UInt32
getCPUState(void);
87 virtual OSArray
*getCPUGroup(void);
88 virtual UInt32
getCPUGroupSize(void);
89 virtual processor_t
getMachProcessor(void);
91 virtual const OSSymbol
*getCPUName(void) = 0;
93 OSMetaClassDeclareReservedUnused(IOCPU
, 0);
94 OSMetaClassDeclareReservedUnused(IOCPU
, 1);
95 OSMetaClassDeclareReservedUnused(IOCPU
, 2);
96 OSMetaClassDeclareReservedUnused(IOCPU
, 3);
97 OSMetaClassDeclareReservedUnused(IOCPU
, 4);
98 OSMetaClassDeclareReservedUnused(IOCPU
, 5);
99 OSMetaClassDeclareReservedUnused(IOCPU
, 6);
100 OSMetaClassDeclareReservedUnused(IOCPU
, 7);
103 void IOCPUSleepKernel(void);
106 class IOCPUInterruptController
: public IOInterruptController
108 OSDeclareDefaultStructors(IOCPUInterruptController
);
117 struct ExpansionData
{ };
118 ExpansionData
*reserved
;
121 virtual IOReturn
initCPUInterruptController(int sources
);
122 virtual void registerCPUInterruptController(void);
123 virtual void setCPUInterruptProperties(IOService
*service
);
124 virtual void enableCPUInterrupt(IOCPU
*cpu
);
126 virtual IOReturn
registerInterrupt(IOService
*nub
, int source
,
128 IOInterruptHandler handler
,
131 virtual IOReturn
getInterruptType(IOService
*nub
, int source
,
134 virtual IOReturn
enableInterrupt(IOService
*nub
, int source
);
135 virtual IOReturn
disableInterrupt(IOService
*nub
, int source
);
136 virtual IOReturn
causeInterrupt(IOService
*nub
, int source
);
138 virtual IOReturn
handleInterrupt(void *refCon
, IOService
*nub
,
141 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 0);
142 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 1);
143 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 2);
144 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 3);
145 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 4);
146 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 5);
149 #endif /* ! _IOKIT_CPU_H */