1 1.6 jym /* $NetBSD: mpbiosreg.h,v 1.6 2010/04/18 23:47:51 jym 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 * 21 1.1 fvdl * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 22 1.1 fvdl * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 23 1.1 fvdl * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 24 1.1 fvdl * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 25 1.1 fvdl * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 1.1 fvdl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 1.1 fvdl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 1.1 fvdl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 1.1 fvdl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 1.1 fvdl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 1.1 fvdl * POSSIBILITY OF SUCH DAMAGE. 32 1.1 fvdl */ 33 1.1 fvdl 34 1.1 fvdl #ifndef _X86_MPBIOSREG_H_ 35 1.1 fvdl #define _X86_MPBIOSREG_H_ 36 1.1 fvdl 37 1.1 fvdl #define BIOS_BASE (0xf0000) 38 1.1 fvdl #define BIOS_SIZE (0x10000) 39 1.1 fvdl #define BIOS_COUNT (BIOS_SIZE) 40 1.1 fvdl 41 1.1 fvdl /* 42 1.1 fvdl * Multiprocessor config table entry types. 43 1.1 fvdl */ 44 1.1 fvdl 45 1.1 fvdl #define MPS_MCT_CPU 0 46 1.1 fvdl #define MPS_MCT_BUS 1 47 1.1 fvdl #define MPS_MCT_IOAPIC 2 48 1.1 fvdl #define MPS_MCT_IOINT 3 49 1.1 fvdl #define MPS_MCT_LINT 4 50 1.1 fvdl 51 1.1 fvdl #define MPS_MCT_NTYPES 5 52 1.1 fvdl 53 1.1 fvdl /* MP Floating Pointer Structure */ 54 1.1 fvdl struct mpbios_fps { 55 1.4 cegger uint32_t signature; 56 1.1 fvdl /* string defined by the Intel MP Spec as identifying the MP table */ 57 1.1 fvdl #define MP_FP_SIG 0x5f504d5f /* _MP_ */ 58 1.1 fvdl 59 1.4 cegger uint32_t pap; 60 1.4 cegger uint8_t length; 61 1.4 cegger uint8_t spec_rev; 62 1.4 cegger uint8_t checksum; 63 1.4 cegger uint8_t mpfb1; /* system configuration */ 64 1.4 cegger uint8_t mpfb2; /* flags */ 65 1.1 fvdl #define MPFPS_FLAG_IMCR 0x80 /* IMCR present */ 66 1.4 cegger uint8_t mpfb3; /* unused */ 67 1.4 cegger uint8_t mpfb4; /* unused */ 68 1.4 cegger uint8_t mpfb5; /* unused */ 69 1.1 fvdl }; 70 1.1 fvdl 71 1.1 fvdl /* MP Configuration Table Header */ 72 1.1 fvdl struct mpbios_cth { 73 1.4 cegger uint32_t signature; 74 1.1 fvdl #define MP_CT_SIG 0x504d4350 /* PCMP */ 75 1.1 fvdl 76 1.4 cegger uint16_t base_len; 77 1.4 cegger uint8_t spec_rev; 78 1.4 cegger uint8_t checksum; 79 1.4 cegger uint8_t oem_id[8]; 80 1.4 cegger uint8_t product_id[12]; 81 1.4 cegger uint32_t oem_table_pointer; 82 1.4 cegger uint16_t oem_table_size; 83 1.4 cegger uint16_t entry_count; 84 1.4 cegger uint32_t apic_address; 85 1.4 cegger uint16_t ext_len; 86 1.4 cegger uint8_t ext_cksum; 87 1.4 cegger uint8_t reserved; 88 1.1 fvdl }; 89 1.1 fvdl 90 1.1 fvdl struct mpbios_proc { 91 1.4 cegger uint8_t type; 92 1.4 cegger uint8_t apic_id; 93 1.4 cegger uint8_t apic_version; 94 1.4 cegger uint8_t cpu_flags; 95 1.1 fvdl #define PROCENTRY_FLAG_EN 0x01 96 1.1 fvdl #define PROCENTRY_FLAG_BP 0x02 97 1.4 cegger uint32_t reserved1; 98 1.4 cegger uint32_t reserved2; 99 1.1 fvdl }; 100 1.1 fvdl 101 1.1 fvdl struct mpbios_bus { 102 1.4 cegger uint8_t type; 103 1.4 cegger uint8_t bus_id; 104 1.1 fvdl char bus_type[6]; 105 1.1 fvdl }; 106 1.1 fvdl 107 1.1 fvdl struct mpbios_ioapic { 108 1.4 cegger uint8_t type; 109 1.4 cegger uint8_t apic_id; 110 1.4 cegger uint8_t apic_version; 111 1.4 cegger uint8_t apic_flags; 112 1.1 fvdl #define IOAPICENTRY_FLAG_EN 0x01 113 1.4 cegger uint32_t apic_address; 114 1.1 fvdl }; 115 1.1 fvdl 116 1.1 fvdl struct mpbios_int { 117 1.4 cegger uint8_t type; 118 1.4 cegger uint8_t int_type; 119 1.4 cegger uint16_t int_flags; 120 1.4 cegger uint8_t src_bus_id; 121 1.4 cegger uint8_t src_bus_irq; 122 1.4 cegger uint8_t dst_apic_id; 123 1.1 fvdl #define MPS_ALL_APICS 0xff 124 1.4 cegger uint8_t dst_apic_int; 125 1.1 fvdl }; 126 1.1 fvdl 127 1.1 fvdl 128 1.1 fvdl #endif /* !_X86_MPBIOSREG_H_ */ 129