FreeBSD/Linux Kernel Cross Reference
sys/i386/mp_desc.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26
27 /*
28 * HISTORY
29 * $Log: mp_desc.h,v $
30 * Revision 2.4 93/11/17 16:36:57 dbg
31 * Added ANSI function prototypes.
32 * [93/11/03 dbg]
33 *
34 * Revision 2.3 91/05/14 16:12:24 mrt
35 * Correcting copyright
36 *
37 * Revision 2.2 91/05/08 12:39:51 dbg
38 * Created.
39 * [91/03/21 dbg]
40 *
41 */
42
43 #ifndef _I386_MP_DESC_H_
44 #define _I386_MP_DESC_H_
45
46 #include <cpus.h>
47
48 /*
49 * Multiprocessor i386/i486 systems use a separate copy of the
50 * GDT, IDT, LDT, and kernel TSS per processor. The first three
51 * are separate to avoid lock contention: the i386 uses locked
52 * memory cycles to access the descriptor tables. The TSS is
53 * separate since each processor needs its own kernel stack,
54 * and since using a TSS marks it busy.
55 */
56
57 #include <i386/seg.h>
58 #include <i386/tss.h>
59
60 /*
61 * The descriptor tables are together in a structure
62 * allocated one per processor (except for the boot processor).
63 */
64 struct mp_desc_table {
65 struct fake_descriptor idt[IDTSZ]; /* IDT */
66 struct fake_descriptor gdt[GDTSZ]; /* GDT */
67 struct fake_descriptor ldt[LDTSZ]; /* LDT */
68 struct i386_tss ktss;
69 };
70
71 /*
72 * They are pointed to by a per-processor array.
73 */
74 extern struct mp_desc_table *mp_desc_table[NCPUS];
75
76 /*
77 * The kernel TSS gets its own pointer.
78 */
79 extern struct i386_tss *mp_ktss[NCPUS];
80
81 /*
82 * So does the GDT.
83 */
84 extern struct fake_descriptor *mp_gdt[NCPUS];
85
86
87 /*
88 * Each CPU calls this routine to set up its descriptor tables.
89 */
90 extern struct mp_desc_table * mp_desc_init(int cpu);
91
92 /*
93 * Allocate all of the interrupt stacks.
94 */
95 extern void interrupt_stack_alloc(void);
96
97 #endif /* _I386_MP_DESC_H_ */
Cache object: 6afaac6c0c5b3ee4e484cbaf48d1102c
|