mpbiosreg.h revision 1.2
1/* $NetBSD: mpbiosreg.h,v 1.2 2002/10/01 12:57:07 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 _I386_MPBIOSREG_H_ 42#define _I386_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/* 61 * Interrupt typess 62 */ 63 64#define MPS_INTTYPE_INT 0 65#define MPS_INTTYPE_NMI 1 66#define MPS_INTTYPE_SMI 2 67#define MPS_INTTYPE_ExtINT 3 68 69#define MPS_INTPO_DEF 0 70#define MPS_INTPO_ACTHI 1 71#define MPS_INTPO_ACTLO 3 72 73#define MPS_INTTR_DEF 0 74#define MPS_INTTR_EDGE 1 75#define MPS_INTTR_LEVEL 3 76 77 78/* MP Floating Pointer Structure */ 79struct mpbios_fps { 80 u_int32_t signature; 81/* string defined by the Intel MP Spec as identifying the MP table */ 82#define MP_FP_SIG 0x5f504d5f /* _MP_ */ 83 84 u_int32_t pap; 85 u_int8_t length; 86 u_int8_t spec_rev; 87 u_int8_t checksum; 88 u_int8_t mpfb1; /* system configuration */ 89 u_int8_t mpfb2; /* flags */ 90#define MPFPS_FLAG_IMCR 0x80 /* IMCR present */ 91 u_int8_t mpfb3; /* unused */ 92 u_int8_t mpfb4; /* unused */ 93 u_int8_t mpfb5; /* unused */ 94}; 95 96/* MP Configuration Table Header */ 97struct mpbios_cth { 98 u_int32_t signature; 99#define MP_CT_SIG 0x504d4350 /* PCMP */ 100 101 u_int16_t base_len; 102 u_int8_t spec_rev; 103 u_int8_t checksum; 104 u_int8_t oem_id[8]; 105 u_int8_t product_id[12]; 106 u_int32_t oem_table_pointer; 107 u_int16_t oem_table_size; 108 u_int16_t entry_count; 109 u_int32_t apic_address; 110 u_int16_t ext_len; 111 u_int8_t ext_cksum; 112 u_int8_t reserved; 113}; 114 115struct mpbios_proc { 116 u_int8_t type; 117 u_int8_t apic_id; 118 u_int8_t apic_version; 119 u_int8_t cpu_flags; 120#define PROCENTRY_FLAG_EN 0x01 121#define PROCENTRY_FLAG_BP 0x02 122 u_long cpu_signature; 123 u_long feature_flags; 124 u_long reserved1; 125 u_long reserved2; 126}; 127 128struct mpbios_bus { 129 u_int8_t type; 130 u_int8_t bus_id; 131 char bus_type[6]; 132}; 133 134struct mpbios_ioapic { 135 u_int8_t type; 136 u_int8_t apic_id; 137 u_int8_t apic_version; 138 u_int8_t apic_flags; 139#define IOAPICENTRY_FLAG_EN 0x01 140 void *apic_address; 141}; 142 143struct mpbios_int { 144 u_int8_t type; 145 u_int8_t int_type; 146 u_int16_t int_flags; 147 u_int8_t src_bus_id; 148 u_int8_t src_bus_irq; 149 u_int8_t dst_apic_id; 150#define MPS_ALL_APICS 0xff 151 u_int8_t dst_apic_int; 152}; 153 154 155#endif /* !_I386_MPBIOSREG_H_ */ 156