]> git.saurik.com Git - apple/xnu.git/blame - osfmk/i386/AT386/mp/mp_v1_1.c
xnu-344.49.tar.gz
[apple/xnu.git] / osfmk / i386 / AT386 / mp / mp_v1_1.c
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
43866e37 6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
1c79356b 7 *
43866e37
A
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
1c79356b
A
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
43866e37
A
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.
1c79356b
A
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
55vm_offset_t bios_start;
56#endif /* MP_DEBUG */
57
58unsigned int lapic_id_initdata = 0;
59int lapic_id = (int)&lapic_id_initdata;
60vm_offset_t lapic_start;
61
62void lapic_init(void);
63int get_ncpus(void);
64void validate_cpus(int ncpus);
65void cpu_interrupt(int cpu);
66void slave_boot(int cpu);
67
68boolean_t mp_v1_1_initialized = FALSE;
69
70void
71mp_v1_1_init(void)
72{
73 /*WILL BE REMOVED IN FUTURE REVISION!!! !*/
74 /* SIMPLY COMMENTED OUT FOR THE MOMENT */
75 return;
76}
77
78void
79lapic_init(void)
80{
81}
82
83void
84cpu_interrupt(
85 int cpu)
86{
87}
88
89#if NCPUS > 1
90void
91slave_boot(
92 int cpu)
93{
94}
95
96void
97start_other_cpus(void)
98{
99}
100
101void
102validate_cpus(int ncpus)
103{
104 int i;
9bccf70c 105 for(i=0;i<ncpus;i++)
1c79356b
A
106 machine_slot[i].is_cpu = TRUE;
107}
108
109int
110get_ncpus(void)
111{
112 return 1;
113}
114
115void
116slave_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
130struct 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
136void 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
152void
153db_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
169void db_lapic(int cpu);
170unsigned int db_remote_read(int cpu, int reg);
171void db_ioapic(unsigned int);
172void kdb_console(void);
173
174void
175kdb_console(void)
176{
177}
178
179#define BOOLP(a) ((a)?' ':'!')
180
181static char *DM[8] = {
182 "Fixed",
183 "Lowest Priority",
184 "Invalid",
185 "Invalid",
186 "NMI",
187 "Reset",
188 "Invalid",
189 "ExtINT"};
190
191unsigned int
192db_remote_read(int cpu, int reg)
193{
194 return -1;
195}
196
197void
198db_lapic(int cpu)
199{
200}
201
202void
203db_ioapic(unsigned int ind)
204{
205}
206
207#endif /* MACH_KDB */