]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. PEI core needs to check image machine type
authorxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 31 Jan 2007 07:18:41 +0000 (07:18 +0000)
committerxgu3 <xgu3@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 31 Jan 2007 07:18:41 +0000 (07:18 +0000)
2. In BDS, Legacy free may make BdsLibConnectAllDefaultConsoles fail.
3. Pci22.h, we need to add more definition in that
4. EBC: EBC Exception Subclass should add EFI_SUBCLASS_SPECIFIC
5. PciEnumeratorSupport Null Pointer Error

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

EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h
EdkModulePkg/Bus/Pci/PciBus/Dxe/PciEnumeratorSupport.c
EdkModulePkg/Core/Pei/Image/Image.c
EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConsole.c
EdkNt32Pkg/Library/EdkNt32PeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
EdkUnixPkg/Library/EdkGenericBdsLib/BdsConsole.c
EdkUnixPkg/Library/EdkUnixPeiPeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
MdePkg/Include/Common/StatusCode.h
MdePkg/Include/IndustryStandard/pci22.h

index dcf3e561077dd4d284ef95dec924662df16dd427..7ac5d2867694256be5e682602d3c21126ba16856 100644 (file)
@@ -1,11 +1,11 @@
 /*++\r
 \r
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
-\r
+                                                                                          \r
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
@@ -189,7 +189,7 @@ extern EFI_COMPONENT_NAME_PROTOCOL  gEhciComponentName;
 //\r
 // USB Base Class Code,Sub-Class Code and Programming Interface\r
 //\r
 //\r
 // USB Base Class Code,Sub-Class Code and Programming Interface\r
 //\r
-#define PCI_CLASSC_PI_EHCI      0x20\r
+#define PCI_CLASSC_PI_EHCI      PCI_IF_EHCI\r
 \r
 #define SETUP_PACKET_ID         0x2D\r
 #define INPUT_PACKET_ID         0x69\r
 \r
 #define SETUP_PACKET_ID         0x2D\r
 #define INPUT_PACKET_ID         0x69\r
index 3b796a6b42822364e2f2a0e39effba14e4802fa5..0403402ddd62181ad96ebb753912a8ff46ded4c7 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -255,8 +255,8 @@ Returns:
                       Device,\r
                       Func\r
                       );\r
                       Device,\r
                       Func\r
                       );\r
-      if (gFullEnumeration) {\r
-        InitializeP2C (PciIoDevice);\r
+      if ((PciIoDevice != NULL) && gFullEnumeration) {\r
+        InitializeP2C (PciIoDevice);      \r
       }\r
     } else {\r
 \r
       }\r
     } else {\r
 \r
@@ -289,7 +289,7 @@ Returns:
     //\r
     // Special initialization for PPB including making the PPB quiet\r
     //\r
     //\r
     // Special initialization for PPB including making the PPB quiet\r
     //\r
-    if (gFullEnumeration) {\r
+    if ((PciIoDevice != NULL) && gFullEnumeration) {\r
       InitializePpb (PciIoDevice);\r
     }\r
   }\r
       InitializePpb (PciIoDevice);\r
     }\r
   }\r
index dfe4668c1b5ec6fa5e6d677f2f31a1b488bd3412..202936869b62eb4b2f9417f4b5dc6562d76f934c 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 All rights reserved. This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -56,6 +56,7 @@ Returns:
   UINT64                      ImageSize;\r
   EFI_PHYSICAL_ADDRESS        ImageEntryPoint;\r
   EFI_TE_IMAGE_HEADER         *TEImageHeader;\r
   UINT64                      ImageSize;\r
   EFI_PHYSICAL_ADDRESS        ImageEntryPoint;\r
   EFI_TE_IMAGE_HEADER         *TEImageHeader;\r
+  UINT16                      Machine;\r
 \r
   *EntryPoint   = NULL;\r
   TEImageHeader = NULL;\r
 \r
   *EntryPoint   = NULL;\r
   TEImageHeader = NULL;\r
@@ -114,7 +115,7 @@ Returns:
       // Retrieve the entry point from the TE image header\r
       //\r
       ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) TEImageHeader;\r
       // Retrieve the entry point from the TE image header\r
       //\r
       ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) TEImageHeader;\r
-      *EntryPoint = (VOID *)((UINTN) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) +\r
+      *EntryPoint  = (VOID *)((UINTN) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) +\r
                     TEImageHeader->AddressOfEntryPoint - TEImageHeader->StrippedSize);\r
     }\r
   } else {\r
                     TEImageHeader->AddressOfEntryPoint - TEImageHeader->StrippedSize);\r
     }\r
   } else {\r
@@ -128,6 +129,17 @@ Returns:
     }\r
   }\r
 \r
     }\r
   }\r
 \r
+  if (((EFI_TE_IMAGE_HEADER *) (UINTN) ImageAddress)->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {\r
+    TEImageHeader = (EFI_TE_IMAGE_HEADER *) (UINTN) ImageAddress;\r
+    Machine = TEImageHeader->Machine;\r
+  } else {\r
+    Machine = PeCoffLoaderGetMachineType (Pe32Data);\r
+  } \r
+  \r
+  if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Machine)) {\r
+    return EFI_UNSUPPORTED;  \r
+  }\r
+\r
   //\r
   // Print debug message: Loading PEIM at 0x12345678 EntryPoint=0x12345688 Driver.efi\r
   //\r
   //\r
   // Print debug message: Loading PEIM at 0x12345678 EntryPoint=0x12345688 Driver.efi\r
   //\r
index 6c9097f142eb963ee2e1df3b763822f6157b2090..47a79ff34e068b692853bee72847e4369352b203 100644 (file)
@@ -367,11 +367,18 @@ Returns:
   //\r
   // Connect all default console variables\r
   //\r
   //\r
   // Connect all default console variables\r
   //\r
-  Status = BdsLibConnectConsoleVariable (L"ConIn");\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
 \r
 \r
+  //\r
+  // Because possibly the platform is legacy free, in such case,\r
+  // ConIn devices (Serial Port and PS2 Keyboard ) does not exist, \r
+  // so we need not check the status.\r
+  //  \r
+  BdsLibConnectConsoleVariable (L"ConIn");\r
+\r
+  // \r
+  // It seems impossible not to have any ConOut device on platform,\r
+  // so we check the status here.\r
+  //\r
   Status = BdsLibConnectConsoleVariable (L"ConOut");\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   Status = BdsLibConnectConsoleVariable (L"ConOut");\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
index e2cfd352b2d03af186f43a5cc5e8642f48f3f32b..da2f8e94eb222c1624d7421c85fe406ad2de381a 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -32,7 +32,9 @@ PeCoffLoaderGetEntryPoint (
 \r
 Routine Description:\r
 \r
 \r
 Routine Description:\r
 \r
-  Loads a PE/COFF image into memory\r
+  Loads a PE/COFF image into memory, this is not follow the original purpose of \r
+  PeCoffGetEntryPoint library class.  But it's ok that Unix package not run on a real \r
+  platform and this is for source level debug.\r
 \r
 Arguments:\r
 \r
 \r
 Arguments:\r
 \r
@@ -72,4 +74,40 @@ Returns:
                            );\r
   *EntryPoint = (VOID*)(UINTN)ImageEntryPoint;\r
   return Status;\r
                            );\r
   *EntryPoint = (VOID*)(UINTN)ImageEntryPoint;\r
   return Status;\r
-}
\ No newline at end of file
+}\r
+\r
+/**\r
+  Returns the machine type of PE/COFF image. \r
+  This is copied from MDE BasePeCoffGetEntryPointLib, the code should be sync with it.\r
+  The reason is NT32 package needs to load the image to memory to support source\r
+  level debug.\r
+   \r
+\r
+  @param  Image   Pointer to a PE/COFF header\r
+\r
+  @return         Machine type or zero if not a valid iamge\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+PeCoffLoaderGetMachineType (\r
+  IN  VOID  *Pe32Data\r
+  )\r
+{  \r
+  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  Hdr;\r
+  EFI_IMAGE_DOS_HEADER                 *DosHdr;\r
+\r
+  DosHdr = (EFI_IMAGE_DOS_HEADER  *)Pe32Data;\r
+  if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
+    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data + DosHdr->e_lfanew);\r
+  } else {\r
+    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data);\r
+  }\r
+\r
+  if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)  {\r
+    return Hdr.Pe32->FileHeader.Machine;\r
+  }\r
+\r
+  return 0x0000;\r
+}\r
+\r
index 6c9097f142eb963ee2e1df3b763822f6157b2090..47a79ff34e068b692853bee72847e4369352b203 100644 (file)
@@ -367,11 +367,18 @@ Returns:
   //\r
   // Connect all default console variables\r
   //\r
   //\r
   // Connect all default console variables\r
   //\r
-  Status = BdsLibConnectConsoleVariable (L"ConIn");\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
 \r
 \r
+  //\r
+  // Because possibly the platform is legacy free, in such case,\r
+  // ConIn devices (Serial Port and PS2 Keyboard ) does not exist, \r
+  // so we need not check the status.\r
+  //  \r
+  BdsLibConnectConsoleVariable (L"ConIn");\r
+\r
+  // \r
+  // It seems impossible not to have any ConOut device on platform,\r
+  // so we check the status here.\r
+  //\r
   Status = BdsLibConnectConsoleVariable (L"ConOut");\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   Status = BdsLibConnectConsoleVariable (L"ConOut");\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
index c0d0a01d3ef532a893a6b67fbe6e2d634b485afb..c5f2453b3d77091caecd9ff0dcb900dbeb48cd3f 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -32,7 +32,9 @@ PeCoffLoaderGetEntryPoint (
 \r
 Routine Description:\r
 \r
 \r
 Routine Description:\r
 \r
-  Loads a PE/COFF image into memory\r
+  Loads a PE/COFF image into memory, this is not follow the original purpose of \r
+  PeCoffGetEntryPoint library class.  But it's ok that Unix package not run on a real \r
+  platform and this is for source level debug.\r
 \r
 Arguments:\r
 \r
 \r
 Arguments:\r
 \r
@@ -72,4 +74,40 @@ Returns:
                            );\r
   *EntryPoint = (VOID*)(UINTN)ImageEntryPoint;\r
   return Status;\r
                            );\r
   *EntryPoint = (VOID*)(UINTN)ImageEntryPoint;\r
   return Status;\r
-}
+}\r
+\r
+/**\r
+  Returns the machine type of PE/COFF image. \r
+  This is copied from MDE BasePeCoffGetEntryPointLib, the code should be sync with it.\r
+  The reason is Unix package needs to load the image to memory to support source\r
+  level debug.\r
+   \r
+\r
+  @param  Image   Pointer to a PE/COFF header\r
+\r
+  @return         Machine type or zero if not a valid iamge\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+PeCoffLoaderGetMachineType (\r
+  IN  VOID  *Pe32Data\r
+  )\r
+{  \r
+  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  Hdr;\r
+  EFI_IMAGE_DOS_HEADER                 *DosHdr;\r
+\r
+  DosHdr = (EFI_IMAGE_DOS_HEADER  *)Pe32Data;\r
+  if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
+    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data + DosHdr->e_lfanew);\r
+  } else {\r
+    Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data);\r
+  }\r
+\r
+  if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)  {\r
+    return Hdr.Pe32->FileHeader.Machine;\r
+  }\r
+\r
+  return 0x0000;\r
+}\r
+\r
index 03b0cfcc3d77db9015960c197732045a16002aeb..6e2b71a218efb92265a4bb58020be229cb18a195 100644 (file)
@@ -15,7 +15,7 @@
   7           Debug Codes\r
 </pre>\r
 \r
   7           Debug Codes\r
 </pre>\r
 \r
-  Copyright (c) 2006, Intel Corporation                                                         \r
+  Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
   All rights reserved. This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -560,6 +560,7 @@ typedef struct {
 #define EFI_SOFTWARE_EFI_BOOT_SERVICE     (EFI_SOFTWARE | 0x00100000)\r
 #define EFI_SOFTWARE_EFI_RUNTIME_SERVICE  (EFI_SOFTWARE | 0x00110000)\r
 #define EFI_SOFTWARE_EFI_DXE_SERVICE      (EFI_SOFTWARE | 0x00120000)\r
 #define EFI_SOFTWARE_EFI_BOOT_SERVICE     (EFI_SOFTWARE | 0x00100000)\r
 #define EFI_SOFTWARE_EFI_RUNTIME_SERVICE  (EFI_SOFTWARE | 0x00110000)\r
 #define EFI_SOFTWARE_EFI_DXE_SERVICE      (EFI_SOFTWARE | 0x00120000)\r
+#define EFI_SOFTWARE_X64_EXCEPTION        (EFI_SOFTWARE | 0x00130000)\r
 \r
 //\r
 // Software Class Progress Code definitions.\r
 \r
 //\r
 // Software Class Progress Code definitions.\r
@@ -657,6 +658,9 @@ typedef struct {
 // Software Class IA32 Exception Subclass Progress Code definitions.\r
 //\r
 //\r
 // Software Class IA32 Exception Subclass Progress Code definitions.\r
 //\r
 //\r
+// Software Class X64 Exception Subclass Progress Code definitions.\r
+//\r
+//\r
 // Software Class IPF Exception Subclass Progress Code definitions.\r
 //\r
 //\r
 // Software Class IPF Exception Subclass Progress Code definitions.\r
 //\r
 //\r
@@ -833,58 +837,82 @@ typedef struct {
 // These exceptions are derived from the debug protocol definitions in the EFI\r
 // specification.\r
 //\r
 // These exceptions are derived from the debug protocol definitions in the EFI\r
 // specification.\r
 //\r
-#define EFI_SW_EC_EBC_UNDEFINED             0x00000000\r
-#define EFI_SW_EC_EBC_DIVIDE_ERROR          EXCEPT_EBC_DIVIDE_ERROR\r
-#define EFI_SW_EC_EBC_DEBUG                 EXCEPT_EBC_DEBUG\r
-#define EFI_SW_EC_EBC_BREAKPOINT            EXCEPT_EBC_BREAKPOINT\r
-#define EFI_SW_EC_EBC_OVERFLOW              EXCEPT_EBC_OVERFLOW\r
-#define EFI_SW_EC_EBC_INVALID_OPCODE        EXCEPT_EBC_INVALID_OPCODE\r
-#define EFI_SW_EC_EBC_STACK_FAULT           EXCEPT_EBC_STACK_FAULT\r
-#define EFI_SW_EC_EBC_ALIGNMENT_CHECK       EXCEPT_EBC_ALIGNMENT_CHECK\r
-#define EFI_SW_EC_EBC_INSTRUCTION_ENCODING  EXCEPT_EBC_INSTRUCTION_ENCODING\r
-#define EFI_SW_EC_EBC_BAD_BREAK             EXCEPT_EBC_BAD_BREAK\r
-#define EFI_SW_EC_EBC_STEP                  EXCEPT_EBC_STEP\r
+#define EFI_SW_EC_EBC_UNDEFINED             (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_UNDEFINED)\r
+#define EFI_SW_EC_EBC_DIVIDE_ERROR          (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_DIVIDE_ERROR)\r
+#define EFI_SW_EC_EBC_DEBUG                 (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_DEBUG)\r
+#define EFI_SW_EC_EBC_BREAKPOINT            (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_BREAKPOINT)\r
+#define EFI_SW_EC_EBC_OVERFLOW              (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_OVERFLOW)\r
+#define EFI_SW_EC_EBC_INVALID_OPCODE        (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_INVALID_OPCODE)\r
+#define EFI_SW_EC_EBC_STACK_FAULT           (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_STACK_FAULT)\r
+#define EFI_SW_EC_EBC_ALIGNMENT_CHECK       (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_ALIGNMENT_CHECK)\r
+#define EFI_SW_EC_EBC_INSTRUCTION_ENCODING  (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_INSTRUCTION_ENCODING)\r
+#define EFI_SW_EC_EBC_BAD_BREAK             (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_BAD_BREAK)\r
+#define EFI_SW_EC_EBC_STEP                  (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_STEP)\r
 \r
 //\r
 // Software Class IA32 Exception Subclass Error Code definitions.\r
 // These exceptions are derived from the debug protocol definitions in the EFI\r
 // specification.\r
 //\r
 \r
 //\r
 // Software Class IA32 Exception Subclass Error Code definitions.\r
 // These exceptions are derived from the debug protocol definitions in the EFI\r
 // specification.\r
 //\r
-#define EFI_SW_EC_IA32_DIVIDE_ERROR     EXCEPT_IA32_DIVIDE_ERROR\r
-#define EFI_SW_EC_IA32_DEBUG            EXCEPT_IA32_DEBUG\r
-#define EFI_SW_EC_IA32_NMI              EXCEPT_IA32_NMI\r
-#define EFI_SW_EC_IA32_BREAKPOINT       EXCEPT_IA32_BREAKPOINT\r
-#define EFI_SW_EC_IA32_OVERFLOW         EXCEPT_IA32_OVERFLOW\r
-#define EFI_SW_EC_IA32_BOUND            EXCEPT_IA32_BOUND\r
-#define EFI_SW_EC_IA32_INVALID_OPCODE   EXCEPT_IA32_INVALID_OPCODE\r
-#define EFI_SW_EC_IA32_DOUBLE_FAULT     EXCEPT_IA32_DOUBLE_FAULT\r
-#define EFI_SW_EC_IA32_INVALID_TSS      EXCEPT_IA32_INVALID_TSS\r
-#define EFI_SW_EC_IA32_SEG_NOT_PRESENT  EXCEPT_IA32_SEG_NOT_PRESENT\r
-#define EFI_SW_EC_IA32_STACK_FAULT      EXCEPT_IA32_STACK_FAULT\r
-#define EFI_SW_EC_IA32_GP_FAULT         EXCEPT_IA32_GP_FAULT\r
-#define EFI_SW_EC_IA32_PAGE_FAULT       EXCEPT_IA32_PAGE_FAULT\r
-#define EFI_SW_EC_IA32_FP_ERROR         EXCEPT_IA32_FP_ERROR\r
-#define EFI_SW_EC_IA32_ALIGNMENT_CHECK  EXCEPT_IA32_ALIGNMENT_CHECK\r
-#define EFI_SW_EC_IA32_MACHINE_CHECK    EXCEPT_IA32_MACHINE_CHECK\r
-#define EFI_SW_EC_IA32_SIMD             EXCEPT_IA32_SIMD\r
+#define EFI_SW_EC_IA32_DIVIDE_ERROR     (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_DIVIDE_ERROR)\r
+#define EFI_SW_EC_IA32_DEBUG            (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_DEBUG)\r
+#define EFI_SW_EC_IA32_NMI              (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_NMI)\r
+#define EFI_SW_EC_IA32_BREAKPOINT       (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_BREAKPOINT)\r
+#define EFI_SW_EC_IA32_OVERFLOW         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_OVERFLOW)\r
+#define EFI_SW_EC_IA32_BOUND            (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_BOUND)\r
+#define EFI_SW_EC_IA32_INVALID_OPCODE   (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_INVALID_OPCODE)\r
+#define EFI_SW_EC_IA32_DOUBLE_FAULT     (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_DOUBLE_FAULT)\r
+#define EFI_SW_EC_IA32_INVALID_TSS      (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_INVALID_TSS)\r
+#define EFI_SW_EC_IA32_SEG_NOT_PRESENT  (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_SEG_NOT_PRESENT)\r
+#define EFI_SW_EC_IA32_STACK_FAULT      (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_STACK_FAULT)\r
+#define EFI_SW_EC_IA32_GP_FAULT         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_GP_FAULT)\r
+#define EFI_SW_EC_IA32_PAGE_FAULT       (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_PAGE_FAULT)\r
+#define EFI_SW_EC_IA32_FP_ERROR         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_FP_ERROR)\r
+#define EFI_SW_EC_IA32_ALIGNMENT_CHECK  (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_ALIGNMENT_CHECK)\r
+#define EFI_SW_EC_IA32_MACHINE_CHECK    (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_MACHINE_CHECK)\r
+#define EFI_SW_EC_IA32_SIMD             (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_SIMD)\r
+\r
+//\r
+// Software Class X64 Exception Subclass Error Code definitions.\r
+// These exceptions are derived from the debug protocol definitions in the EFI\r
+// specification.\r
+//\r
+#define EFI_SW_EC_X64_DIVIDE_ERROR      (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_DIVIDE_ERROR)\r
+#define EFI_SW_EC_X64_DEBUG             (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_DEBUG)\r
+#define EFI_SW_EC_X64_NMI               (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_NMI)\r
+#define EFI_SW_EC_X64_BREAKPOINT        (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_BREAKPOINT)\r
+#define EFI_SW_EC_X64_OVERFLOW          (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_OVERFLOW)\r
+#define EFI_SW_EC_X64_BOUND             (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_BOUND)\r
+#define EFI_SW_EC_X64_INVALID_OPCODE    (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_INVALID_OPCODE)\r
+#define EFI_SW_EC_X64_DOUBLE_FAULT      (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_DOUBLE_FAULT)\r
+#define EFI_SW_EC_X64_INVALID_TSS       (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_INVALID_TSS)\r
+#define EFI_SW_EC_X64_SEG_NOT_PRESENT   (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_SEG_NOT_PRESENT)\r
+#define EFI_SW_EC_X64_STACK_FAULT       (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_STACK_FAULT)\r
+#define EFI_SW_EC_X64_GP_FAULT          (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_GP_FAULT)\r
+#define EFI_SW_EC_X64_PAGE_FAULT        (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_PAGE_FAULT)\r
+#define EFI_SW_EC_X64_FP_ERROR          (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_FP_ERROR)\r
+#define EFI_SW_EC_X64_ALIGNMENT_CHECK   (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_ALIGNMENT_CHECK)\r
+#define EFI_SW_EC_X64_MACHINE_CHECK     (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_MACHINE_CHECK)\r
+#define EFI_SW_EC_X64_SIMD              (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_SIMD)\r
 \r
 //\r
 // Software Class IPF Exception Subclass Error Code definitions.\r
 // These exceptions are derived from the debug protocol definitions in the EFI\r
 // specification.\r
 //\r
 \r
 //\r
 // Software Class IPF Exception Subclass Error Code definitions.\r
 // These exceptions are derived from the debug protocol definitions in the EFI\r
 // specification.\r
 //\r
-#define EFI_SW_EC_IPF_ALT_DTLB            EXCEPT_IPF_ALT_DTLB\r
-#define EFI_SW_EC_IPF_DNESTED_TLB         EXCEPT_IPF_DNESTED_TLB\r
-#define EFI_SW_EC_IPF_BREAKPOINT          EXCEPT_IPF_BREAKPOINT\r
-#define EFI_SW_EC_IPF_EXTERNAL_INTERRUPT  EXCEPT_IPF_EXTERNAL_INTERRUPT\r
-#define EFI_SW_EC_IPF_GEN_EXCEPT          EXCEPT_IPF_GEN_EXCEPT\r
-#define EFI_SW_EC_IPF_NAT_CONSUMPTION     EXCEPT_IPF_NAT_CONSUMPTION\r
-#define EFI_SW_EC_IPF_DEBUG_EXCEPT        EXCEPT_IPF_DEBUG_EXCEPT\r
-#define EFI_SW_EC_IPF_UNALIGNED_ACCESS    EXCEPT_IPF_UNALIGNED_ACCESS\r
-#define EFI_SW_EC_IPF_FP_FAULT            EXCEPT_IPF_FP_FAULT\r
-#define EFI_SW_EC_IPF_FP_TRAP             EXCEPT_IPF_FP_TRAP\r
-#define EFI_SW_EC_IPF_TAKEN_BRANCH        EXCEPT_IPF_TAKEN_BRANCH\r
-#define EFI_SW_EC_IPF_SINGLE_STEP         EXCEPT_IPF_SINGLE_STEP\r
+#define EFI_SW_EC_IPF_ALT_DTLB            (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_ALT_DTLB)\r
+#define EFI_SW_EC_IPF_DNESTED_TLB         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_DNESTED_TLB)\r
+#define EFI_SW_EC_IPF_BREAKPOINT          (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_BREAKPOINT)\r
+#define EFI_SW_EC_IPF_EXTERNAL_INTERRUPT  (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_EXTERNAL_INTERRUPT)\r
+#define EFI_SW_EC_IPF_GEN_EXCEPT          (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_GEN_EXCEPT)\r
+#define EFI_SW_EC_IPF_NAT_CONSUMPTION     (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_NAT_CONSUMPTION)\r
+#define EFI_SW_EC_IPF_DEBUG_EXCEPT        (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_DEBUG_EXCEPT)\r
+#define EFI_SW_EC_IPF_UNALIGNED_ACCESS    (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_UNALIGNED_ACCESS)\r
+#define EFI_SW_EC_IPF_FP_FAULT            (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_FP_FAULT)\r
+#define EFI_SW_EC_IPF_FP_TRAP             (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_FP_TRAP)\r
+#define EFI_SW_EC_IPF_TAKEN_BRANCH        (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_TAKEN_BRANCH)\r
+#define EFI_SW_EC_IPF_SINGLE_STEP         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_SINGLE_STEP)\r
+\r
 \r
 //\r
 // Software Class PEI Service Subclass Error Code definitions.\r
 \r
 //\r
 // Software Class PEI Service Subclass Error Code definitions.\r
index 581744ff5599c1775112139e7f2c4c2e9e7af45d..b0ec149b502dddcc7388493640d9c05b2dbf2e89 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support for PCI 2.2 standard.\r
 \r
 /** @file\r
   Support for PCI 2.2 standard.\r
 \r
-  Copyright (c) 2006, Intel Corporation                                                         \r
+  Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
   All rights reserved. This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -232,6 +232,7 @@ typedef struct {
 #define PCI_CLASS_SERIAL_ACCESS_BUS   0x01\r
 #define PCI_CLASS_SERIAL_SSA          0x02\r
 #define PCI_CLASS_SERIAL_USB          0x03\r
 #define PCI_CLASS_SERIAL_ACCESS_BUS   0x01\r
 #define PCI_CLASS_SERIAL_SSA          0x02\r
 #define PCI_CLASS_SERIAL_USB          0x03\r
+#define PCI_IF_EHCI                   0x20\r
 #define PCI_CLASS_SERIAL_FIBRECHANNEL 0x04\r
 #define PCI_CLASS_SERIAL_SMB          0x05\r
 \r
 #define PCI_CLASS_SERIAL_FIBRECHANNEL 0x04\r
 #define PCI_CLASS_SERIAL_SMB          0x05\r
 \r
@@ -270,6 +271,7 @@ typedef struct {
 #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
 #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
+#define IS_PCI_16550_SERIAL(_p)       IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)\r
 #define IS_PCI_USB(_p)                IS_CLASS2 (_p, PCI_CLASS_SERIAL, PCI_CLASS_SERIAL_USB)\r
 \r
 #define HEADER_TYPE_DEVICE            0x00\r
 #define IS_PCI_USB(_p)                IS_CLASS2 (_p, PCI_CLASS_SERIAL, PCI_CLASS_SERIAL_USB)\r
 \r
 #define HEADER_TYPE_DEVICE            0x00\r