Refine code to make code follow the coding style.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11419 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10 2011-03-25 05:36:54 +00:00
parent 9531873c8d
commit a47c681fc0
1 changed files with 74 additions and 65 deletions

View File

@ -1,4 +1,4 @@
/*++ /** @file
Defives data structures per MultiProcessor Specification Ver 1.4. Defives data structures per MultiProcessor Specification Ver 1.4.
The MultiProcessor Specification defines an enhancement to the standard The MultiProcessor Specification defines an enhancement to the standard
@ -13,7 +13,7 @@ http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
--*/ **/
#ifndef _LEGACY_BIOS_MPTABLE_H_ #ifndef _LEGACY_BIOS_MPTABLE_H_
#define _LEGACY_BIOS_MPTABLE_H_ #define _LEGACY_BIOS_MPTABLE_H_
@ -26,6 +26,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#pragma pack(1) #pragma pack(1)
#define EFI_LEGACY_MP_TABLE_FLOATING_POINTER_SIGNATURE SIGNATURE_32 ('_', 'M', 'P', '_') #define EFI_LEGACY_MP_TABLE_FLOATING_POINTER_SIGNATURE SIGNATURE_32 ('_', 'M', 'P', '_')
typedef struct {
UINT32 Reserved1 : 6;
UINT32 MutipleClk : 1;
UINT32 Imcr : 1;
UINT32 Reserved2 : 24;
} FRATUREBYTE2_5;
typedef struct { typedef struct {
UINT32 Signature; UINT32 Signature;
UINT32 PhysicalAddress; UINT32 PhysicalAddress;
@ -33,12 +40,7 @@ typedef struct {
UINT8 SpecRev; UINT8 SpecRev;
UINT8 Checksum; UINT8 Checksum;
UINT8 FeatureByte1; UINT8 FeatureByte1;
struct { FRATUREBYTE2_5 FeatureByte2_5;
UINT32 Reserved1 : 6;
UINT32 MutipleClk : 1;
UINT32 Imcr : 1;
UINT32 Reserved2 : 24;
} FeatureByte2_5;
} EFI_LEGACY_MP_TABLE_FLOATING_POINTER; } EFI_LEGACY_MP_TABLE_FLOATING_POINTER;
#define EFI_LEGACY_MP_TABLE_HEADER_SIGNATURE SIGNATURE_32 ('P', 'C', 'M', 'P') #define EFI_LEGACY_MP_TABLE_HEADER_SIGNATURE SIGNATURE_32 ('P', 'C', 'M', 'P')
@ -66,29 +68,35 @@ typedef struct {
// Entry Type 0: Processor. // Entry Type 0: Processor.
// //
#define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_PROCESSOR 0x00 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_PROCESSOR 0x00
typedef struct {
UINT8 Enabled : 1;
UINT8 Bsp : 1;
UINT8 Reserved : 6;
} EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_FLAGS;
typedef struct {
UINT32 Stepping : 4;
UINT32 Model : 4;
UINT32 Family : 4;
UINT32 Reserved : 20;
} EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_SIGNATURE;
typedef struct {
UINT32 Fpu : 1;
UINT32 Reserved1 : 6;
UINT32 Mce : 1;
UINT32 Cx8 : 1;
UINT32 Apic : 1;
UINT32 Reserved2 : 22;
} EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_FEATURES;
typedef struct { typedef struct {
UINT8 EntryType; UINT8 EntryType;
UINT8 Id; UINT8 Id;
UINT8 Ver; UINT8 Ver;
struct { EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_FLAGS Flags;
UINT8 Enabled : 1; EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_SIGNATURE Signature;
UINT8 Bsp : 1; EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_FEATURES Features;
UINT8 Reserved : 6;
} Flags;
struct {
UINT32 Stepping : 4;
UINT32 Model : 4;
UINT32 Family : 4;
UINT32 Reserved : 20;
} Signature;
struct {
UINT32 Fpu : 1;
UINT32 Reserved1 : 6;
UINT32 Mce : 1;
UINT32 Cx8 : 1;
UINT32 Apic : 1;
UINT32 Reserved2 : 22;
} Features;
UINT32 Reserved1; UINT32 Reserved1;
UINT32 Reserved2; UINT32 Reserved2;
} EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR; } EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR;
@ -125,14 +133,16 @@ typedef struct {
// Entry Type 2: I/O APIC. // Entry Type 2: I/O APIC.
// //
#define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IOAPIC 0x02 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IOAPIC 0x02
typedef struct {
UINT8 Enabled : 1;
UINT8 Reserved : 7;
} EFI_LEGACY_MP_TABLE_ENTRY_IOAPIC_FLAGS;
typedef struct { typedef struct {
UINT8 EntryType; UINT8 EntryType;
UINT8 Id; UINT8 Id;
UINT8 Ver; UINT8 Ver;
struct { EFI_LEGACY_MP_TABLE_ENTRY_IOAPIC_FLAGS Flags;
UINT8 Enabled : 1;
UINT8 Reserved : 7;
} Flags;
UINT32 Address; UINT32 Address;
} EFI_LEGACY_MP_TABLE_ENTRY_IOAPIC; } EFI_LEGACY_MP_TABLE_ENTRY_IOAPIC;
@ -140,23 +150,29 @@ typedef struct {
// Entry Type 3: I/O Interrupt Assignment. // Entry Type 3: I/O Interrupt Assignment.
// //
#define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IO_INT 0x03 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IO_INT 0x03
typedef struct {
UINT16 Polarity : 2;
UINT16 Trigger : 2;
UINT16 Reserved : 12;
} EFI_LEGACY_MP_TABLE_ENTRY_INT_FLAGS;
typedef struct {
UINT8 IntNo : 2;
UINT8 Dev : 5;
UINT8 Reserved : 1;
} EFI_LEGACY_MP_TABLE_ENTRY_INT_FIELDS;
typedef union {
EFI_LEGACY_MP_TABLE_ENTRY_INT_FIELDS fields;
UINT8 byte;
} EFI_LEGACY_MP_TABLE_ENTRY_INT_SOURCE_BUS_IRQ;
typedef struct { typedef struct {
UINT8 EntryType; UINT8 EntryType;
UINT8 IntType; UINT8 IntType;
struct { EFI_LEGACY_MP_TABLE_ENTRY_INT_FLAGS Flags;
UINT16 Polarity : 2;
UINT16 Trigger : 2;
UINT16 Reserved : 12;
} Flags;
UINT8 SourceBusId; UINT8 SourceBusId;
union { EFI_LEGACY_MP_TABLE_ENTRY_INT_SOURCE_BUS_IRQ SourceBusIrq;
struct {
UINT8 IntNo : 2;
UINT8 Dev : 5;
UINT8 Reserved : 1;
} fields;
UINT8 byte;
} SourceBusIrq;
UINT8 DestApicId; UINT8 DestApicId;
UINT8 DestApicIntIn; UINT8 DestApicIntIn;
} EFI_LEGACY_MP_TABLE_ENTRY_IO_INT; } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT;
@ -189,20 +205,9 @@ typedef enum {
typedef struct { typedef struct {
UINT8 EntryType; UINT8 EntryType;
UINT8 IntType; UINT8 IntType;
struct { EFI_LEGACY_MP_TABLE_ENTRY_INT_FLAGS Flags;
UINT16 Polarity : 2;
UINT16 Trigger : 2;
UINT16 Reserved : 12;
} Flags;
UINT8 SourceBusId; UINT8 SourceBusId;
union { EFI_LEGACY_MP_TABLE_ENTRY_INT_SOURCE_BUS_IRQ SourceBusIrq;
struct {
UINT8 IntNo : 2;
UINT8 Dev : 5;
UINT8 Reserved : 1;
} fields;
UINT8 byte;
} SourceBusIrq;
UINT8 DestApicId; UINT8 DestApicId;
UINT8 DestApicIntIn; UINT8 DestApicIntIn;
} EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT; } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT;
@ -251,14 +256,16 @@ typedef enum {
// Entry Type 129: Bus Hierarchy. // Entry Type 129: Bus Hierarchy.
// //
#define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_BUS_HIERARCHY 0x81 #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_BUS_HIERARCHY 0x81
typedef struct {
UINT8 SubtractiveDecode : 1;
UINT8 Reserved : 7;
} EFI_LEGACY_MP_TABLE_ENTRY_EXT_BUS_HIERARCHY_BUSINFO;
typedef struct { typedef struct {
UINT8 EntryType; UINT8 EntryType;
UINT8 Length; UINT8 Length;
UINT8 BusId; UINT8 BusId;
struct { EFI_LEGACY_MP_TABLE_ENTRY_EXT_BUS_HIERARCHY_BUSINFO BusInfo;
UINT8 SubtractiveDecode : 1;
UINT8 Reserved : 7;
} BusInfo;
UINT8 ParentBus; UINT8 ParentBus;
UINT8 Reserved1; UINT8 Reserved1;
UINT8 Reserved2; UINT8 Reserved2;
@ -269,14 +276,16 @@ typedef struct {
// Entry Type 130: Compatibility Bus Address Space Modifier. // Entry Type 130: Compatibility Bus Address Space Modifier.
// //
#define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_COMPAT_BUS_ADDR_SPACE_MODIFIER 0x82 #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_COMPAT_BUS_ADDR_SPACE_MODIFIER 0x82
typedef struct {
UINT8 RangeMode : 1;
UINT8 Reserved : 7;
} EFI_LEGACY_MP_TABLE_ENTRY_EXT_COMPAT_BUS_ADDR_SPACE_MODIFIER_ADDR_MODE;
typedef struct { typedef struct {
UINT8 EntryType; UINT8 EntryType;
UINT8 Length; UINT8 Length;
UINT8 BusId; UINT8 BusId;
struct { EFI_LEGACY_MP_TABLE_ENTRY_EXT_COMPAT_BUS_ADDR_SPACE_MODIFIER_ADDR_MODE AddrMode;
UINT8 RangeMode : 1;
UINT8 Reserved : 7;
} AddrMode;
UINT32 PredefinedRangeList; UINT32 PredefinedRangeList;
} EFI_LEGACY_MP_TABLE_ENTRY_EXT_COMPAT_BUS_ADDR_SPACE_MODIFIER; } EFI_LEGACY_MP_TABLE_ENTRY_EXT_COMPAT_BUS_ADDR_SPACE_MODIFIER;