1 /* $OpenBSD: mpbiosreg.h,v 1.3 2005/11/23 09:24:52 mickey Exp $ */
2 /* $NetBSD: mpbiosreg.h,v 1.1.2.3 2000/02/29 13:17:51 sommerfeld Exp $ */
3
4 /*-
5 * Copyright (c) 2000 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by RedBack Networks Inc.
10 *
11 * Author: Bill Sommerfeld
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgement:
23 * This product includes software developed by the NetBSD
24 * Foundation, Inc. and its contributors.
25 * 4. Neither the name of The NetBSD Foundation nor the names of its
26 * contributors may be used to endorse or promote products derived
27 * from this software without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
30 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
31 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
32 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
33 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE.
40 */
41
42 #ifndef _I386_MPBIOSREG_H_
43 #define _I386_MPBIOSREG_H_
44
45 #define BIOS_BASE (0xf0000)
46 #define BIOS_SIZE (0x10000)
47 #define BIOS_COUNT (BIOS_SIZE)
48
49 /*
50 * Multiprocessor config table entry types.
51 */
52
53 #define MPS_MCT_CPU 0
54 #define MPS_MCT_BUS 1
55 #define MPS_MCT_IOAPIC 2
56 #define MPS_MCT_IOINT 3
57 #define MPS_MCT_LINT 4
58
59 #define MPS_MCT_NTYPES 5
60
61 /*
62 * Interrupt typess
63 */
64
65 #define MPS_INTTYPE_INT 0
66 #define MPS_INTTYPE_NMI 1
67 #define MPS_INTTYPE_SMI 2
68 #define MPS_INTTYPE_ExtINT 3
69
70 #define MPS_INTPO_DEF 0
71 #define MPS_INTPO_ACTHI 1
72 #define MPS_INTPO_ACTLO 3
73 #define MPS_INTPO_SHIFT 0
74 #define MPS_INTPO_MASK 3
75
76 #define MPS_INTTR_DEF 0
77 #define MPS_INTTR_EDGE 1
78 #define MPS_INTTR_LEVEL 3
79 #define MPS_INTTR_SHIFT 2
80 #define MPS_INTTR_MASK 3
81
82 #define MPS_INT(p,t) \
83 ((((p) & MPS_INTPO_MASK) << MPS_INTPO_SHIFT) | \
84 (((t) & MPS_INTTR_MASK) << MPS_INTTR_SHIFT))
85
86 /* MP Floating Pointer Structure */
87 struct mpbios_fps {
88 u_int32_t signature;
89 /* string defined by the Intel MP Spec as identifying the MP table */
90 #define MP_FP_SIG 0x5f504d5f /* _MP_ */
91
92 u_int32_t pap;
93 u_int8_t length;
94 u_int8_t spec_rev;
95 u_int8_t checksum;
96 u_int8_t mpfb1; /* system configuration */
97 u_int8_t mpfb2; /* flags */
98 #define MPFPS_FLAG_IMCR 0x80 /* IMCR present */
99 u_int8_t mpfb3; /* unused */
100 u_int8_t mpfb4; /* unused */
101 u_int8_t mpfb5; /* unused */
102 };
103
104 /* MP Configuration Table Header */
105 struct mpbios_cth {
106 u_int32_t signature;
107 #define MP_CT_SIG 0x504d4350 /* PCMP */
108
109 u_int16_t base_len;
110 u_int8_t spec_rev;
111 u_int8_t checksum;
112 u_int8_t oem_id[8];
113 u_int8_t product_id[12];
114 u_int32_t oem_table_pointer;
115 u_int16_t oem_table_size;
116 u_int16_t entry_count;
117 u_int32_t apic_address;
118 u_int16_t ext_len;
119 u_int8_t ext_cksum;
120 u_int8_t reserved;
121 };
122
123 struct mpbios_proc {
124 u_int8_t type;
125 u_int8_t apic_id;
126 u_int8_t apic_version;
127 u_int8_t cpu_flags;
128 #define PROCENTRY_FLAG_EN 0x01
129 #define PROCENTRY_FLAG_BP 0x02
130 u_long cpu_signature;
131 u_long feature_flags;
132 u_long reserved1;
133 u_long reserved2;
134 };
135
136 struct mpbios_bus {
137 u_int8_t type;
138 u_int8_t bus_id;
139 char bus_type[6];
140 };
141
142 struct mpbios_ioapic {
143 u_int8_t type;
144 u_int8_t apic_id;
145 u_int8_t apic_version;
146 u_int8_t apic_flags;
147 #define IOAPICENTRY_FLAG_EN 0x01
148 void *apic_address;
149 };
150
151 struct mpbios_int {
152 u_int8_t type;
153 u_int8_t int_type;
154 u_int16_t int_flags;
155 u_int8_t src_bus_id;
156 u_int8_t src_bus_irq;
157 u_int8_t dst_apic_id;
158 #define MPS_ALL_APICS 0xff
159 u_int8_t dst_apic_int;
160 };
161
162 #endif /* !_I386_MPBIOSREG_H_ */