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