root/arch/i386/include/mp.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


    1 /*      $OpenBSD: mp.h,v 1.2 2004/06/13 21:49:16 niklas Exp $   */
    2 
    3 /*-
    4  * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com>
    5  * Copyright (c) 2000 Niklas Hallqvist.
    6  * All rights reserved.
    7  *
    8  * Redistribution and use in source and binary forms, with or without
    9  * modification, are permitted provided that the following conditions
   10  * are met:
   11  * 1. Redistributions of source code must retain the above copyright
   12  *    notice, this list of conditions and the following disclaimer.
   13  * 2. Redistributions in binary form must reproduce the above copyright
   14  *    notice, this list of conditions and the following disclaimer in the
   15  *    documentation and/or other materials provided with the distribution.
   16  * 3. All advertising materials mentioning features or use of this software
   17  *    must display the following acknowledgement:
   18  *      This product includes software developed by SigmaSoft, Th.  Lockert.
   19  * 4. The name of the author may not be used to endorse or promote products
   20  *    derived from this software without specific prior written permission.
   21  *
   22  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
   23  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
   24  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
   25  * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   26  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   27  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
   28  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   29  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
   30  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
   31  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   32  */
   33 
   34 #ifndef _MACHINE_MP_H
   35 #define _MACHINE_MP_H
   36 
   37 /*
   38  * Configuration structures as defined in the Intel MP specification,
   39  * version 1.4
   40  */
   41 
   42 /*
   43  * MP Floating Pointer structure; must be located on 16-byte boundary
   44  */
   45 struct mp_float {
   46         u_int8_t        signature[4];
   47 #define MPF_SIGNATURE   "_MP_"
   48         u_int32_t       pointer;
   49         u_int8_t        length;
   50         u_int8_t        revision;
   51         u_int8_t        checksum;
   52         u_int8_t        feature1;
   53 #define MP_CONF_EXTENDED        0
   54 #define MP_CONF_2_ISA           1
   55 #define MP_CONF_2_EISA_NO_8     2
   56 #define MP_CONF_2_EISA          3
   57 #define MP_CONF_2_MCA           4
   58 #define MP_CONF_2_ISA_PCI       5
   59 #define MP_CONF_2_EISA_PCI      6
   60 #define MP_CONF_2_MCA_PCI       7
   61         u_int8_t        feature2;
   62 #define MP_IMCR         0x80
   63         u_int8_t        feature3;
   64         u_int8_t        feature4;
   65         u_int8_t        feature5;
   66 };
   67 
   68 /*
   69  * MP configuration table header
   70  */
   71 struct mp_conf {
   72         u_int8_t        signature[4];
   73 #define MPC_SIGNATURE   "PCMP"
   74         u_int16_t       length;
   75         u_int8_t        revision;
   76         u_int8_t        checksum;
   77         u_int8_t        oem[8];
   78         u_int8_t        product[12];
   79         u_int32_t       oem_pointer;
   80         u_int16_t       oem_length;
   81         u_int16_t       entry_count;
   82         u_int32_t       local_apic;
   83         u_int16_t       ext_length;
   84         u_int8_t        et_checksum;
   85         u_int8_t        reserved;
   86 };
   87 
   88 /*
   89  * Processor entry
   90  */
   91 struct mp_proc {
   92         u_int8_t        type;
   93 #define MP_PROCESSOR    0
   94         u_int8_t        local_apic;
   95         u_int8_t        apic_version;
   96         u_int8_t        flags;
   97 #define MP_ENABLE       0x01
   98 #define MP_BOOTCPU      0x02
   99         u_int32_t       cpu_signature;
  100 #define MP_STEPPING     0x0000000F
  101 #define MP_MODEL        0x000000F0
  102 #define MP_FAMILY       0x00000F00
  103         u_int32_t       feature_flags;
  104 #define MP_FP           0x00000001
  105 #define MP_MCE          0x00000080
  106 #define MP_CX8          0x00000100
  107 #define MP_APIC         0x00000200
  108         u_int32_t       reserved1;
  109         u_int32_t       reserved2;
  110 };
  111 
  112 /*
  113  * Bus entry
  114  */
  115 struct mp_bus {
  116         u_int8_t        type;
  117 #define MP_BUS          1
  118         u_int8_t        bus_id;
  119         u_int8_t        bustype[6]      __attribute((packed));
  120 #define MP_BUS_CBUS     "CBUS  "
  121 #define MP_BUS_CBUSII   "CBUSII"
  122 #define MP_BUS_EISA     "EISA  "
  123 #define MP_BUS_FUTURE   "FUTURE"
  124 #define MP_BUS_INTERN   "INTERN"
  125 #define MP_BUS_ISA      "ISA   "
  126 #define MP_BUS_MBI      "MBI   "
  127 #define MP_BUS_MBII     "MBII  "
  128 #define MP_BUS_MCA      "MCA   "
  129 #define MP_BUS_MPI      "MPI   "
  130 #define MP_BUS_MPSA     "MPSA  "
  131 #define MP_BUS_NUBUS    "NUBUS "
  132 #define MP_BUS_PCI      "PCI   "
  133 #define MP_BUS_PCCARD   "PCMCIA"
  134 #define MP_BUS_TC       "TC    "
  135 #define MP_BUS_VLB      "VL    "
  136 #define MP_BUS_VME      "VME   "
  137 #define MP_BUS_XPRESS   "XPRESS"
  138 };
  139 
  140 /*
  141  * I/O APIC entry
  142  */
  143 struct mp_apic {
  144         u_int8_t        type;
  145 #define MP_IOAPIC       2
  146         u_int8_t        apic_id;
  147         u_int8_t        apic_version;
  148         u_int8_t        apic_flags;
  149 #define MP_APIC_ENABLE  0x80
  150         u_int32_t       apic_address;
  151 };
  152 
  153 /*
  154  * I/O Interrupt Assignment entry
  155  * Local Interrupt Assignment entry
  156  */
  157 struct mp_irq {
  158         u_int8_t        type;
  159 #define MP_INTSRC       3
  160 #define MP_LOCINTSRC    4
  161         u_int8_t        irqtype;
  162 #define MP_INT_NORMAL   0
  163 #define MP_INT_NMI      1
  164 #define MP_INT_SMI      2
  165 #define MP_INT_EXT      3
  166         u_int16_t       irqflags;
  167         u_int8_t        bus_id;
  168         u_int8_t        source_irq;
  169         u_int8_t        destination_apic;
  170 #define MP_ALL_APIC     0xFF
  171         u_int8_t        apic_intr;
  172 };
  173 
  174 /*
  175  * System Address Space Mapping entry
  176  */
  177 struct mp_map {
  178         u_int8_t        type;
  179 #define MP_SYSMAP       128
  180         u_int8_t        length;
  181         u_int8_t        bus;
  182         u_int8_t        address_type;
  183 #define MP_ADDR_IO      0
  184 #define MP_ADDR_MEM     1
  185 #define MP_ADDR_PRE     2
  186         u_int64_t       address_base;
  187         u_int64_t       address_length;
  188 };
  189 
  190 /*
  191  * Bus Hierarchy Descriptor entry
  192  */
  193 struct mp_bushier {
  194         u_int8_t        type;
  195 #define MP_BUSHIER      129
  196         u_int8_t        length;
  197         u_int8_t        bus_id;
  198         u_int8_t        bus_info;
  199 #define MP_BUS_SUB      0x01
  200         u_int8_t        parent;
  201         u_int8_t        reserved1;
  202         u_int16_t       reserved2;
  203 };
  204 
  205 /*
  206  * Compatibility Bus Address Space Modifier entry
  207  */
  208 struct mp_buscompat {
  209         u_int8_t        type;
  210 #define MP_BUSCOMPAT    130
  211         u_int8_t        length;
  212         u_int8_t        bus_id;
  213         u_int8_t        modifier;
  214 #define MP_COMPAT_SUB   0x01
  215         u_int32_t       range;
  216 };
  217 
  218 #ifdef _KERNEL
  219 extern int napics;
  220 #endif /* _KERNEL */
  221 
  222 #endif /* _MACHINE_MP_H */

/* [<][>][^][v][top][bottom][index][help] */