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.
34 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
39 OSDefineMetaClassAndStructors(AppleCPU
, IOCPU
);
41 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
43 bool AppleCPU::start(IOService
*provider
)
46 ml_processor_info_t processor_info
;
48 if (!super::start(provider
)) return false;
50 cpuIC
= new IOCPUInterruptController
;
51 if (cpuIC
== 0) return false;
53 if (cpuIC
->initCPUInterruptController(1) != kIOReturnSuccess
) return false;
56 cpuIC
->registerCPUInterruptController();
58 processor_info
.cpu_id
= (cpu_id_t
)this;
59 processor_info
.boot_cpu
= true;
60 processor_info
.start_paddr
= 0;
61 processor_info
.supports_nap
= false;
62 processor_info
.l2cr_value
= 0;
63 processor_info
.time_base_enable
= 0;
65 // Register this CPU with mach.
66 result
= ml_processor_register(&processor_info
, &machProcessor
,
68 if (result
== KERN_FAILURE
) return false;
70 setCPUState(kIOCPUStateUninitalized
);
72 processor_start(machProcessor
);
79 void AppleCPU::initCPU(bool boot
)
82 cpuIC
->enableCPUInterrupt(this);
85 setCPUState(kIOCPUStateRunning
);
88 void AppleCPU::quiesceCPU(void)
93 kern_return_t
AppleCPU::startCPU(vm_offset_t
/*start_paddr*/,
94 vm_offset_t
/*arg_paddr*/)
99 void AppleCPU::haltCPU(void)
104 const OSSymbol
*AppleCPU::getCPUName(void)
106 return OSSymbol::withCStringNoCopy("Primary0");
109 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */