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@
25 * cpu specific routines
28 #include <kern/machine.h>
29 #include <kern/misc_protos.h>
30 #include <kern/cpu_data.h>
31 #include <kern/cpu_number.h>
32 #include <kern/processor.h>
33 #include <mach/processor_info.h>
34 #include <i386/machine_cpu.h>
35 #include <i386/machine_routines.h>
36 #include <i386/mp_desc.h>
38 cpu_data_t cpu_data
[NCPUS
];
46 processor_info_t info
,
49 printf("cpu_control not implemented\n");
50 return (KERN_FAILURE
);
56 processor_flavor_t flavor
,
60 return (KERN_FAILURE
);
66 processor_flavor_t flavor
,
68 processor_info_t info
,
71 printf("cpu_info not implemented\n");
72 return (KERN_FAILURE
);
78 printf("cpu_sleep not implemented\n");
84 int my_cpu
= get_cpu_number();
86 machine_slot
[my_cpu
].is_cpu
= TRUE
;
87 machine_slot
[my_cpu
].running
= TRUE
;
90 machine_slot
[my_cpu
].cpu_type
= CPU_TYPE_I386
;
91 machine_slot
[my_cpu
].cpu_subtype
= CPU_SUBTYPE_PENTPRO
;
93 machine_slot
[my_cpu
].cpu_type
= cpuid_cputype(0);
94 machine_slot
[my_cpu
].cpu_subtype
= CPU_SUBTYPE_AT386
;
108 if (real_ncpus
== 0) {
110 * Special case for the boot processor,
111 * it has been pre-registered by cpu_init();
120 * - Run cpu_register() in exclusion mode
124 for(cpu
=0; cpu
< wncpu
; cpu
++) {
125 if(!machine_slot
[cpu
].is_cpu
) {
126 machine_slot
[cpu
].is_cpu
= TRUE
;
129 machine_slot
[cpu
].cpu_type
= CPU_TYPE_I386
;
130 machine_slot
[cpu
].cpu_subtype
= CPU_SUBTYPE_PENTPRO
;
132 machine_slot
[cpu
].cpu_type
= cpuid_cputype(0);
133 machine_slot
[cpu
].cpu_subtype
= CPU_SUBTYPE_AT386
;
140 if (*target_cpu
!= -1) {
153 if (cpu
== cpu_number()) {
154 PE_cpu_machine_init(cpu_data
[cpu
].cpu_id
, TRUE
);
156 cpu_data
[cpu
].cpu_status
= 1;
160 * Should call out through PE.
161 * But take the shortcut here.
163 ret
= intel_startCPU(cpu
);
174 cpu
= get_cpu_number();
175 PE_cpu_machine_init(cpu_data
[cpu
].cpu_id
, TRUE
);
177 cpu_data
[cpu
].cpu_status
= 1;