Forward port bochs smp changes; rename smpdetect.c to smp.c.
[seabios.git] / src / mptable.h
1 #ifndef __MPTABLE_H
2 #define __MPTABLE_H
3
4 #include "types.h" // u32
5
6 #define MPTABLE_SIGNATURE 0x5f504d5f  // "_MP_"
7
8 struct mptable_floating_s {
9     u32 signature;
10     u32 physaddr;
11     u8 length;
12     u8 spec_rev;
13     u8 checksum;
14     u8 feature1;
15     u8 feature2;
16     u8 reserved[3];
17 };
18
19 #define MPCONFIG_SIGNATURE 0x504d4350  // "PCMP"
20
21 struct mptable_config_s {
22     u32 signature;
23     u16 length;
24     u8 spec;
25     u8 checksum;
26     char oemid[8];
27     char productid[12];
28     u32 oemptr;
29     u16 oemsize;
30     u16 entrycount;
31     u32 lapic;
32     u16 exttable_length;
33     u8 exttable_checksum;
34     u8 reserved;
35 } PACKED;
36
37 #define MPT_TYPE_CPU 0
38 #define MPT_TYPE_BUS 1
39 #define MPT_TYPE_IOAPIC 2
40 #define MPT_TYPE_INTSRC 3
41
42 struct mpt_cpu {
43     u8 type;
44     u8 apicid;
45     u8 apicver;
46     u8 cpuflag;
47     u32 cpusignature;
48     u32 featureflag;
49     u32 reserved[2];
50 } PACKED;
51
52 struct mpt_bus {
53     u8 type;
54     u8 busid;
55     char bustype[6];
56 } PACKED;
57
58 struct mpt_ioapic {
59     u8 type;
60     u8 apicid;
61     u8 apicver;
62     u8 flags;
63     u32 apicaddr;
64 } PACKED;
65
66 struct mpt_intsrc {
67     u8 type;
68     u8 irqtype;
69     u16 irqflag;
70     u8 srcbus;
71     u8 srcbusirq;
72     u8 dstapic;
73     u8 dstirq;
74 } PACKED;
75
76 // mptable.c
77 void mptable_init(void);
78
79 #endif // mptable.h