]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/AT386/mp/mp.c
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@
26 * Mach Operating System
27 * Copyright (c) 1991,1990 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
60 #include <mach/machine.h>
61 #include <kern/lock.h>
62 #include <kern/cpu_data.h>
63 #include <kern/processor.h>
64 #include <kern/misc_protos.h>
65 #include <kern/machine.h>
66 #include <i386/db_machdep.h>
67 #include <ddb/db_run.h>
68 #include <i386/AT386/mp/mp.h>
69 #include <i386/setjmp.h>
70 #include <i386/misc_protos.h>
72 int cpu_int_word
[NCPUS
];
74 extern void cpu_interrupt(int cpu
);
75 extern int get_ncpus(void);
78 * Generate a clock interrupt on next running cpu
80 * Instead of having the master processor interrupt
81 * all active processors, each processor in turn interrupts
82 * the next active one. This avoids all slave processors
83 * accessing the same R/W data simultaneously.
92 i386_signal_cpus(int event
)
99 processor_t processor
)
105 processor_t processor
)
114 printf("cpu_start not implemented\n");
115 return (KERN_FAILURE
);
123 * Find out how many cpus will run
132 * get real number of cpus
135 real_ncpus
= get_ncpus();
141 * Ignore real number of cpus it if number of requested cpus
143 * Keep it if number of requested cpu is null or larger.
146 if (real_ncpus
< wncpu
)
150 extern void validate_cpus(int);
153 * We do NOT have CPUS numbered contiguously.
156 validate_cpus(wncpu
);
159 for (i
=0; i
< wncpu
; i
++)
160 machine_slot
[i
].is_cpu
= TRUE
;
165 * invoke kdb on slave processors
174 * Clear kdb interrupt
181 #else /* NCPUS > 1 */
182 int cpu_int_word
[NCPUS
];
183 #endif /* NCPUS > 1 */