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