]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. added functions header for MACROS in PCI22.h.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 9 Dec 2008 06:40:02 +0000 (06:40 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 9 Dec 2008 06:40:02 +0000 (06:40 +0000)
2. move IS_PCI_GFX to modules, since it not defined in PCI spec.
3. added comments for some structure in ElTorito.h.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6928 6f19259b-4bc3-4df7-8a09-765794883524

DuetPkg/PciBusNoEnumerationDxe/PciBus.h
IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBus.h
MdePkg/Include/IndustryStandard/ElTorito.h
MdePkg/Include/IndustryStandard/Pci22.h

index 420c868bbea527adf4220a5b153a16c3238f1bd8..039967a98e77473c56f5c71e07a68f456efa3632 100644 (file)
@@ -220,5 +220,6 @@ extern UINT64                      gAllZero;
 \r
 #define IS_ISA_BRIDGE(_p)       IS_CLASS2 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA)  \r
 #define IS_INTEL_ISA_BRIDGE(_p) (IS_CLASS2 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA_PDECODE) && ((_p)->Hdr.VendorId == 0x8086) && ((_p)->Hdr.DeviceId == 0x7110))\r
+#define IS_PCI_GFX(_p)     IS_CLASS2 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_OTHER)\r
 \r
 #endif\r
index e594ae0fdb43cda42b759bf1b78b79c6caa1f9e7..6fa32424e37cd422e0877eb0fe27df51767cd6f7 100644 (file)
@@ -291,4 +291,6 @@ PciBusDriverBindingStop (
   IN  EFI_HANDLE                    *ChildHandleBuffer\r
   );\r
 \r
+#define IS_PCI_GFX(_p)     IS_CLASS2 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_OTHER)\r
+\r
 #endif\r
index a8deb461d0ae9e64bab2c89cba6bdd7574861fff..d8b1c27dfbe42e61911d5095419acac87a56243e 100644 (file)
@@ -67,6 +67,9 @@ typedef union {
     CHAR8   Reserved[82];\r
   } Unknown;\r
 \r
+  ///\r
+  /// Boot Record Volume Descriptor, defined in "El Torito" Specification.\r
+  ///\r
   struct {\r
     UINT8   Type;            ///< Must be 0\r
     CHAR8   Id[5];           ///< "CD001" \r
@@ -76,7 +79,10 @@ typedef union {
     UINT8   EltCatalog[4];   ///< Absolute pointer to first sector of Boot Catalog\r
     CHAR8   Unused2[13];     ///< Must be 0\r
   } BootRecordVolume;\r
-\r
\r
+  ///\r
+  /// Primary Volumn Descriptor, defined in ISO 9660.\r
+  ///\r
   struct {\r
     UINT8   Type; \r
     CHAR8   Id[5];           ///< "CD001"\r
@@ -102,7 +108,7 @@ typedef union {
   /// Catalog validation entry (Catalog header)\r
   ///\r
   struct {\r
-    UINT8   Indicator;\r
+    UINT8   Indicator;       ///< Must be 01\r
     UINT8   PlatformId;\r
     UINT16  Reserved;\r
     CHAR8   ManufacId[24];\r
@@ -114,12 +120,12 @@ typedef union {
   /// Initial/Default Entry or Section Entry\r
   ///\r
   struct {\r
-    UINT8   Indicator;\r
+    UINT8   Indicator;       ///< 88 = Bootable, 00 = Not Bootable\r
     UINT8   MediaType : 4;\r
-    UINT8   Reserved1 : 4;\r
+    UINT8   Reserved1 : 4;   ///< Must be 0\r
     UINT16  LoadSegment;\r
     UINT8   SystemType;\r
-    UINT8   Reserved2;\r
+    UINT8   Reserved2;       ///< Must be 0\r
     UINT16  SectorCount;\r
     UINT32  Lba;\r
   } Boot;\r
@@ -128,9 +134,9 @@ typedef union {
   /// Section Header Entry\r
   ///\r
   struct {\r
-    UINT8   Indicator;\r
+    UINT8   Indicator;       ///< 90 - Header, more header follw, 91 - Final Header\r
     UINT8   PlatformId;\r
-    UINT16  SectionEntries;\r
+    UINT16  SectionEntries;  ///< Number of section entries following this header\r
     CHAR8   Id[28];\r
   } Section;\r
 \r
index 8802b2b4bb5099ce4ca1424e59ec72587aefa1cd..846b702da6b70060f52a84d74d8623e35c9dd36a 100644 (file)
@@ -171,7 +171,6 @@ typedef struct {
 #define   PCI_CLASS_DISPLAY_XGA         0x01\r
 #define   PCI_CLASS_DISPLAY_3D          0x02\r
 #define   PCI_CLASS_DISPLAY_OTHER       0x80  \r
-#define   PCI_CLASS_DISPLAY_GFX         0x80\r
 \r
 #define PCI_CLASS_MEDIA               0x04\r
 #define   PCI_CLASS_MEDIA_VIDEO         0x00\r
@@ -302,23 +301,172 @@ typedef struct {
 #define   PCI_SUBCLASS_DPIO             0x00\r
 #define   PCI_SUBCLASS_DPIO_OTHER       0x80\r
 \r
+/**  \r
+  Macro that checks whether the Base Class code of device matched.\r
+\r
+  @param  _p      Specified device.\r
+  @param  c       Base Class code needs matching.\r
+\r
+  @retval TRUE    Base Class code matches the specified device.\r
+  @retval FALSE   Base Class code doesn't match the specified device.         \r
+\r
+**/\r
 #define IS_CLASS1(_p, c)              ((_p)->Hdr.ClassCode[2] == (c))\r
+/**  \r
+  Macro that checks whether the Base Class code and Sub-Class code of device matched.\r
+\r
+  @param  _p      Specified device.\r
+  @param  c       Base Class code needs matching.\r
+  @param  s       Sub-Class code needs matching.\r
+\r
+  @retval TRUE    Base Class code and Sub-Class code match the specified device.\r
+  @retval FALSE   Base Class code and Sub-Class code don't match the specified device.         \r
+\r
+**/\r
 #define IS_CLASS2(_p, c, s)           (IS_CLASS1 (_p, c) && ((_p)->Hdr.ClassCode[1] == (s)))\r
+/**  \r
+  Macro that checks whether the Base Class code, Sub-Class code and Interface code of device matched.\r
+\r
+  @param  _p      Specified device.\r
+  @param  c       Base Class code needs matching.\r
+  @param  s       Sub-Class code needs matching.\r
+  @param  p       Interface code needs matching.\r
+\r
+  @retval TRUE    Base Class code, Sub-Class code and Interface code match the specified device.\r
+  @retval FALSE   Base Class code, Sub-Class code and Interface code don't match the specified device.         \r
+\r
+**/\r
 #define IS_CLASS3(_p, c, s, p)        (IS_CLASS2 (_p, c, s) && ((_p)->Hdr.ClassCode[0] == (p)))\r
 \r
+/**  \r
+  Macro that checks whether device is a display controller.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a display controller.\r
+  @retval FALSE   Device is not a display controller.\r
+\r
+**/\r
 #define IS_PCI_DISPLAY(_p)            IS_CLASS1 (_p, PCI_CLASS_DISPLAY)\r
-#define IS_PCI_VGA(_p)                IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 0)\r
-#define IS_PCI_8514(_p)               IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 1)\r
-#define IS_PCI_GFX(_p)                IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_GFX, 0)\r
+/**  \r
+  Macro that checks whether device is a VGA-compatible controller.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a VGA-compatible controller.\r
+  @retval FALSE   Device is not a VGA-compatible controller.\r
+\r
+**/\r
+#define IS_PCI_VGA(_p)                IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, PCI_IF_VGA_VGA)\r
+/**  \r
+  Macro that checks whether device is an 8514-compatible controller.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is an 8514-compatible controller.\r
+  @retval FALSE   Device is not an 8514-compatible controller.\r
+\r
+**/\r
+#define IS_PCI_8514(_p)               IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, PCI_IF_VGA_8514)\r
+/**  \r
+  Macro that checks whether device is built before the Class Code field was defined.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is an old device.\r
+  @retval FALSE   Device is not an old device.\r
+\r
+**/\r
 #define IS_PCI_OLD(_p)                IS_CLASS1 (_p, PCI_CLASS_OLD)\r
+/**  \r
+  Macro that checks whether device is a VGA-compatible device built before the Class Code field was defined.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is an old VGA-compatible device.\r
+  @retval FALSE   Device is not an old VGA-compatible device.\r
+\r
+**/\r
 #define IS_PCI_OLD_VGA(_p)            IS_CLASS2 (_p, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA)\r
+/**  \r
+  Macro that checks whether device is an IDE controller.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is an IDE controller.\r
+  @retval FALSE   Device is not an IDE controller.\r
+\r
+**/\r
 #define IS_PCI_IDE(_p)                IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_IDE)\r
-#define IS_PCI_SCSI(_p)               IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI, 0)\r
-#define IS_PCI_RAID(_p)               IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID, 0)\r
-#define IS_PCI_LPC(_p)                IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA, 0)\r
-#define IS_PCI_P2P(_p)                IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 0)\r
-#define IS_PCI_P2P_SUB(_p)            IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 1)\r
+/**  \r
+  Macro that checks whether device is a SCSI bus controller.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a SCSI bus controller.\r
+  @retval FALSE   Device is not a SCSI bus controller.\r
+\r
+**/\r
+#define IS_PCI_SCSI(_p)               IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI)\r
+/**  \r
+  Macro that checks whether device is a RAID controller.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a RAID controller.\r
+  @retval FALSE   Device is not a RAID controller.\r
+\r
+**/\r
+#define IS_PCI_RAID(_p)               IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID)\r
+/**  \r
+  Macro that checks whether device is an ISA bridge.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is an ISA bridge.\r
+  @retval FALSE   Device is not an ISA bridge.\r
+\r
+**/\r
+#define IS_PCI_LPC(_p)                IS_CLASS2 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA)\r
+/**  \r
+  Macro that checks whether device is a PCI-to-PCI bridge.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a PCI-to-PCI bridge.\r
+  @retval FALSE   Device is not a PCI-to-PCI bridge.\r
+\r
+**/\r
+#define IS_PCI_P2P(_p)                IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, PCI_IF_BRIDGE_P2P)\r
+/**  \r
+  Macro that checks whether device is a Subtractive Decode PCI-to-PCI bridge.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a Subtractive Decode PCI-to-PCI bridge.\r
+  @retval FALSE   Device is not a Subtractive Decode PCI-to-PCI bridge.\r
+\r
+**/\r
+#define IS_PCI_P2P_SUB(_p)            IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, PCI_IF_BRIDGE_P2P_SUBTRACTIVE)\r
+/**  \r
+  Macro that checks whether device is a 16550-compatible serial controller.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a 16550-compatible serial controller.\r
+  @retval FALSE   Device is not a 16550-compatible serial controller.\r
+\r
+**/\r
 #define IS_PCI_16550_SERIAL(_p)       IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)\r
+/**  \r
+  Macro that checks whether device is a Universal Serial Bus controller.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a Universal Serial Bus controller.\r
+  @retval FALSE   Device is not a Universal Serial Bus controller.\r
+\r
+**/\r
 #define IS_PCI_USB(_p)                IS_CLASS2 (_p, PCI_CLASS_SERIAL, PCI_CLASS_SERIAL_USB)\r
 \r
 //\r
@@ -332,9 +480,35 @@ typedef struct {
 // Mask of Header type\r
 //\r
 #define HEADER_LAYOUT_CODE            0x7f\r
+/**  \r
+  Macro that checks whether device is a PCI-PCI bridge.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a PCI-PCI bridge.\r
+  @retval FALSE   Device is not a PCI-PCI bridge.\r
 \r
+**/\r
 #define IS_PCI_BRIDGE(_p)             (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_PCI_TO_PCI_BRIDGE))\r
+/**  \r
+  Macro that checks whether device is a CardBus bridge.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a CardBus bridge.\r
+  @retval FALSE   Device is not a CardBus bridge.\r
+\r
+**/\r
 #define IS_CARDBUS_BRIDGE(_p)         (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_CARDBUS_BRIDGE))\r
+/**  \r
+  Macro that checks whether device is a multiple functions device.\r
+\r
+  @param  _p      Specified device.\r
+\r
+  @retval TRUE    Device is a multiple functions device.\r
+  @retval FALSE   Device is not a multiple functions device.\r
+\r
+**/\r
 #define IS_PCI_MULTI_FUNC(_p)         ((_p)->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION)\r
 \r
 ///\r
@@ -382,6 +556,9 @@ typedef struct {
 ///\r
 #define PCI_INT_LINE_UNKNOWN                        0xFF               \r
 \r
+///\r
+/// PCI Access Data Format\r
+///\r
 typedef union {\r
   struct {\r
     UINT32  Reg : 8;\r