2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
34 #include <machine/machine_routines.h>
35 #include <pexpert/pexpert.h>
38 #include <IOKit/IOService.h>
39 #include <IOKit/IOInterruptController.h>
42 kIOCPUStateUnregistered
= 0,
43 kIOCPUStateUninitalized
,
49 class IOCPUInterruptController
;
51 extern IOCPUInterruptController
*gIOCPUInterruptController
;
53 class IOCPU
: public IOService
55 OSDeclareAbstractStructors(IOCPU
);
64 processor_t machProcessor
;
65 ipi_handler_t ipi_handler
;
67 struct ExpansionData
{ };
68 ExpansionData
*reserved
;
70 virtual void setCPUNumber(UInt32 cpuNumber
);
71 virtual void setCPUState(UInt32 cpuState
);
74 static void initCPUs(void);
76 virtual bool start(IOService
*provider
);
77 virtual OSObject
*getProperty(const OSSymbol
*aKey
) const;
78 virtual bool setProperty(const OSSymbol
*aKey
, OSObject
*anObject
);
79 virtual bool serializeProperties(OSSerialize
*serialize
) const;
80 virtual IOReturn
setProperties(OSObject
*properties
);
81 virtual void initCPU(bool boot
) = 0;
82 virtual void quiesceCPU(void) = 0;
83 virtual kern_return_t
startCPU(vm_offset_t start_paddr
,
84 vm_offset_t arg_paddr
) = 0;
85 virtual void haltCPU(void) = 0;
86 virtual void signalCPU(IOCPU
*target
);
87 virtual void enableCPUTimeBase(bool enable
);
89 virtual UInt32
getCPUNumber(void);
90 virtual UInt32
getCPUState(void);
91 virtual OSArray
*getCPUGroup(void);
92 virtual UInt32
getCPUGroupSize(void);
93 virtual processor_t
getMachProcessor(void);
95 virtual const OSSymbol
*getCPUName(void) = 0;
97 OSMetaClassDeclareReservedUnused(IOCPU
, 0);
98 OSMetaClassDeclareReservedUnused(IOCPU
, 1);
99 OSMetaClassDeclareReservedUnused(IOCPU
, 2);
100 OSMetaClassDeclareReservedUnused(IOCPU
, 3);
101 OSMetaClassDeclareReservedUnused(IOCPU
, 4);
102 OSMetaClassDeclareReservedUnused(IOCPU
, 5);
103 OSMetaClassDeclareReservedUnused(IOCPU
, 6);
104 OSMetaClassDeclareReservedUnused(IOCPU
, 7);
107 void IOCPUSleepKernel(void);
110 class IOCPUInterruptController
: public IOInterruptController
112 OSDeclareDefaultStructors(IOCPUInterruptController
);
121 struct ExpansionData
{ };
122 ExpansionData
*reserved
;
125 virtual IOReturn
initCPUInterruptController(int sources
);
126 virtual void registerCPUInterruptController(void);
127 virtual void setCPUInterruptProperties(IOService
*service
);
128 virtual void enableCPUInterrupt(IOCPU
*cpu
);
130 virtual IOReturn
registerInterrupt(IOService
*nub
, int source
,
132 IOInterruptHandler handler
,
135 virtual IOReturn
getInterruptType(IOService
*nub
, int source
,
138 virtual IOReturn
enableInterrupt(IOService
*nub
, int source
);
139 virtual IOReturn
disableInterrupt(IOService
*nub
, int source
);
140 virtual IOReturn
causeInterrupt(IOService
*nub
, int source
);
142 virtual IOReturn
handleInterrupt(void *refCon
, IOService
*nub
,
145 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 0);
146 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 1);
147 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 2);
148 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 3);
149 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 4);
150 OSMetaClassDeclareReservedUnused(IOCPUInterruptController
, 5);
153 #endif /* ! _IOKIT_CPU_H */