]> git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/AT386/mp/mp_v1_1.c
bc5a1c4d94e34d2537c3b7ba023bd7a7096a25ee
[apple/xnu.git] / osfmk / i386 / AT386 / mp / mp_v1_1.c
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
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
13 * file.
14 *
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.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * @OSF_COPYRIGHT@
27 */
28
29 #include <cpus.h>
30 #include <mach_rt.h>
31 #include <mach_kdb.h>
32 #include <mach_ldebug.h>
33
34 #include <i386/AT386/misc_protos.h>
35 #include <i386/AT386/mp/mp_v1_1.h>
36 #include <i386/AT386/mp/mp.h>
37 #include <i386/AT386/mp/boot.h>
38 #include <i386/apic.h>
39 #include <i386/ipl.h>
40 #include <i386/fpu.h>
41 #include <i386/pio.h>
42 #include <i386/cpuid.h>
43 #include <i386/proc_reg.h>
44 #include <i386/misc_protos.h>
45 #include <mach/mach_types.h>
46 #include <mach/kern_return.h>
47 #include <vm/vm_kern.h>
48 #include <kern/startup.h>
49 #include <kern/cpu_number.h>
50 #include <kern/cpu_data.h>
51
52 #define MP_DEBUG 1
53
54 #if MP_DEBUG
55 vm_offset_t bios_start;
56 #endif /* MP_DEBUG */
57
58 unsigned int lapic_id_initdata = 0;
59 int lapic_id = (int)&lapic_id_initdata;
60 vm_offset_t lapic_start;
61
62 void lapic_init(void);
63 int get_ncpus(void);
64 void validate_cpus(int ncpus);
65 void cpu_interrupt(int cpu);
66 void slave_boot(int cpu);
67
68 boolean_t mp_v1_1_initialized = FALSE;
69
70 void
71 mp_v1_1_init(void)
72 {
73 /*WILL BE REMOVED IN FUTURE REVISION!!! !*/
74 /* SIMPLY COMMENTED OUT FOR THE MOMENT */
75 return;
76 }
77
78 void
79 lapic_init(void)
80 {
81 }
82
83 void
84 cpu_interrupt(
85 int cpu)
86 {
87 }
88
89 #if NCPUS > 1
90 void
91 slave_boot(
92 int cpu)
93 {
94 }
95
96 void
97 start_other_cpus(void)
98 {
99 }
100
101 void
102 validate_cpus(int ncpus)
103 {
104 int i;
105 for(i=0;i<ncpus;i++)
106 machine_slot[i].is_cpu = TRUE;
107 }
108
109 int
110 get_ncpus(void)
111 {
112 return 1;
113 }
114
115 void
116 slave_machine_init(void)
117 {
118 }
119
120 #endif /* NCPUS > 1 */
121
122 #if MACH_KDB
123 #include <ddb/db_output.h>
124
125 #define TRAP_DEBUG 0 /* Must match interrupt.s and spl.s */
126
127
128 #if TRAP_DEBUG
129 #define MTRAPS 100
130 struct mp_trap_hist_struct {
131 unsigned char type;
132 unsigned char data[5];
133 } trap_hist[MTRAPS], *cur_trap_hist = trap_hist,
134 *max_trap_hist = &trap_hist[MTRAPS];
135
136 void db_trap_hist(void);
137
138 /*
139 * SPL:
140 * 1: new spl
141 * 2: old spl
142 * 3: new tpr
143 * 4: old tpr
144 * INT:
145 * 1: int vec
146 * 2: old spl
147 * 3: new spl
148 * 4: post eoi tpr
149 * 5: exit tpr
150 */
151
152 void
153 db_trap_hist(void)
154 {
155 int i,j;
156 for(i=0;i<MTRAPS;i++)
157 if (trap_hist[i].type == 1 || trap_hist[i].type == 2) {
158 db_printf("%s%s",
159 (&trap_hist[i]>=cur_trap_hist)?"*":" ",
160 (trap_hist[i].type == 1)?"SPL":"INT");
161 for(j=0;j<5;j++)
162 db_printf(" %02x", trap_hist[i].data[j]);
163 db_printf("\n");
164 }
165
166 }
167 #endif /* TRAP_DEBUG */
168
169 void db_lapic(int cpu);
170 unsigned int db_remote_read(int cpu, int reg);
171 void db_ioapic(unsigned int);
172 void kdb_console(void);
173
174 void
175 kdb_console(void)
176 {
177 }
178
179 #define BOOLP(a) ((a)?' ':'!')
180
181 static char *DM[8] = {
182 "Fixed",
183 "Lowest Priority",
184 "Invalid",
185 "Invalid",
186 "NMI",
187 "Reset",
188 "Invalid",
189 "ExtINT"};
190
191 unsigned int
192 db_remote_read(int cpu, int reg)
193 {
194 return -1;
195 }
196
197 void
198 db_lapic(int cpu)
199 {
200 }
201
202 void
203 db_ioapic(unsigned int ind)
204 {
205 }
206
207 #endif /* MACH_KDB */