xv6-cs450/mp.h

55 lines
2.1 KiB
C
Raw Normal View History

// See MultiProcessor Specification Version 1.[14]
2006-09-06 19:50:20 +02:00
struct mp { // floating pointer
uchar signature[4]; // "_MP_"
2006-09-06 21:08:14 +02:00
void *physaddr; // phys addr of MP config table
2006-09-06 19:50:20 +02:00
uchar length; // 1
uchar specrev; // [14]
uchar checksum; // all bytes must add up to 0
2006-09-06 21:08:14 +02:00
uchar type; // MP system config type
2006-07-20 11:07:53 +02:00
uchar imcrp;
uchar reserved[3];
2006-06-21 03:53:07 +02:00
};
struct mpconf { // configuration table header
2006-09-06 19:50:20 +02:00
uchar signature[4]; // "PCMP"
ushort length; // total table length
uchar version; // [14]
uchar checksum; // all bytes must add up to 0
uchar product[20]; // product id
2006-09-06 21:08:14 +02:00
uint *oemtable; // OEM table pointer
2006-09-06 19:50:20 +02:00
ushort oemlength; // OEM table length
ushort entry; // entry count
2006-09-06 21:08:14 +02:00
uint *lapicaddr; // address of local APIC
2006-09-06 19:50:20 +02:00
ushort xlength; // extended table length
uchar xchecksum; // extended table checksum
2006-07-20 11:07:53 +02:00
uchar reserved;
2006-06-21 03:53:07 +02:00
};
struct mpproc { // processor table entry
2006-09-06 19:50:20 +02:00
uchar type; // entry type (0)
uchar apicid; // local APIC id
uchar version; // local APIC verison
uchar flags; // CPU flags
#define MPBOOT 0x02 // This proc is the bootstrap processor.
2006-09-06 19:50:20 +02:00
uchar signature[4]; // CPU signature
uint feature; // feature flags from CPUID instruction
2006-07-20 11:07:53 +02:00
uchar reserved[8];
2006-06-21 03:53:07 +02:00
};
2006-09-06 19:50:20 +02:00
struct mpioapic { // I/O APIC table entry
uchar type; // entry type (2)
uchar apicno; // I/O APIC id
uchar version; // I/O APIC version
uchar flags; // I/O APIC flags
uint *addr; // I/O APIC address
2006-06-21 03:53:07 +02:00
};
// Table entry types
#define MPPROC 0x00 // One per processor
#define MPBUS 0x01 // One per bus
#define MPIOAPIC 0x02 // One per I/O APIC
#define MPIOINTR 0x03 // One per bus interrupt source
#define MPLINTR 0x04 // One per system interrupt source