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@
28 * cpu specific routines
31 #include <kern/machine.h>
32 #include <kern/misc_protos.h>
33 #include <kern/cpu_data.h>
34 #include <kern/cpu_number.h>
35 #include <kern/processor.h>
36 #include <mach/processor_info.h>
37 #include <i386/machine_cpu.h>
38 #include <i386/machine_routines.h>
39 #include <i386/mp_desc.h>
41 cpu_data_t cpu_data
[NCPUS
];
49 processor_info_t info
,
52 printf("cpu_control not implemented\n");
53 return (KERN_FAILURE
);
59 processor_flavor_t flavor
,
63 return (KERN_FAILURE
);
69 processor_flavor_t flavor
,
71 processor_info_t info
,
74 printf("cpu_info not implemented\n");
75 return (KERN_FAILURE
);
81 printf("cpu_sleep not implemented\n");
87 int my_cpu
= get_cpu_number();
89 machine_slot
[my_cpu
].is_cpu
= TRUE
;
90 machine_slot
[my_cpu
].running
= TRUE
;
93 machine_slot
[my_cpu
].cpu_type
= CPU_TYPE_I386
;
94 machine_slot
[my_cpu
].cpu_subtype
= CPU_SUBTYPE_PENTPRO
;
96 machine_slot
[my_cpu
].cpu_type
= cpuid_cputype(0);
97 machine_slot
[my_cpu
].cpu_subtype
= CPU_SUBTYPE_AT386
;
101 mp_desc_init(my_cpu
);
111 if (real_ncpus
== 0) {
113 * Special case for the boot processor,
114 * it has been pre-registered by cpu_init();
123 * - Run cpu_register() in exclusion mode
127 for(cpu
=0; cpu
< wncpu
; cpu
++) {
128 if(!machine_slot
[cpu
].is_cpu
) {
129 machine_slot
[cpu
].is_cpu
= TRUE
;
132 machine_slot
[cpu
].cpu_type
= CPU_TYPE_I386
;
133 machine_slot
[cpu
].cpu_subtype
= CPU_SUBTYPE_PENTPRO
;
135 machine_slot
[cpu
].cpu_type
= cpuid_cputype(0);
136 machine_slot
[cpu
].cpu_subtype
= CPU_SUBTYPE_AT386
;
143 if (*target_cpu
!= -1) {
156 if (cpu
== cpu_number()) {
157 PE_cpu_machine_init(cpu_data
[cpu
].cpu_id
, TRUE
);
159 cpu_data
[cpu
].cpu_status
= 1;
163 * Should call out through PE.
164 * But take the shortcut here.
166 ret
= intel_startCPU(cpu
);
177 cpu
= get_cpu_number();
178 PE_cpu_machine_init(cpu_data
[cpu
].cpu_id
, TRUE
);
180 cpu_data
[cpu
].cpu_status
= 1;