LegacyPlatform.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /** @file
  2. Legacy BIOS Platform support
  3. Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef LEGACY_BIOS_PLATFORM_H_
  7. #define LEGACY_BIOS_PLATFORM_H_
  8. #include <FrameworkDxe.h>
  9. #include <Protocol/PciIo.h>
  10. #include <Protocol/PciRootBridgeIo.h>
  11. #include <Protocol/DevicePath.h>
  12. #include <Protocol/LegacyInterrupt.h>
  13. #include <Protocol/LegacyRegion2.h>
  14. #include <Protocol/LegacyBiosPlatform.h>
  15. #include <Protocol/FirmwareVolume.h>
  16. #include <Protocol/DiskInfo.h>
  17. #include <Library/UefiDriverEntryPoint.h>
  18. #include <Library/UefiBootServicesTableLib.h>
  19. #include <Library/UefiRuntimeServicesTableLib.h>
  20. #include <Library/DebugLib.h>
  21. #include <Library/BaseMemoryLib.h>
  22. #include <Library/MemoryAllocationLib.h>
  23. #include <Library/IoLib.h>
  24. #include <Library/PciLib.h>
  25. #include <Library/PcdLib.h>
  26. #include <Library/DxeServicesLib.h>
  27. #include <Library/DevicePathLib.h>
  28. #include <IndustryStandard/Pci.h>
  29. //
  30. // PIRQ information constants.
  31. //
  32. #define MAX_IRQ_ROUTING_ENTRIES 6
  33. #define MAX_IRQ_PRIORITY_ENTRIES 7
  34. #define V_INTEL_VENDOR_ID 0x8086
  35. #define V_PIIX4_IDE_DEVICE_ID 0x7010
  36. //
  37. // Type declarations
  38. //
  39. typedef struct {
  40. UINT8 SetupValue;
  41. UINT16 DeviceType;
  42. UINT8 Class;
  43. UINT8 SubClass;
  44. } EFI_SETUP_BBS_MAP;
  45. typedef struct {
  46. UINT8 Class;
  47. UINT8 SubClass;
  48. } PCI_CLASS_RECORD;
  49. typedef struct {
  50. EFI_LEGACY_PIRQ_TABLE_HEADER PirqTable;
  51. EFI_LEGACY_IRQ_ROUTING_ENTRY IrqRoutingEntry[MAX_IRQ_ROUTING_ENTRIES];
  52. } EFI_LEGACY_PIRQ_TABLE;
  53. typedef struct {
  54. EFI_HANDLE Handle;
  55. UINT16 Vid;
  56. UINT16 Did;
  57. UINT16 SvId;
  58. UINT16 SysId;
  59. } DEVICE_STRUCTURE;
  60. typedef struct {
  61. EFI_GUID FileName;
  62. UINTN Valid;
  63. } SYSTEM_ROM_TABLE;
  64. typedef struct {
  65. UINT32 Signature;
  66. EFI_HANDLE Handle;
  67. EFI_LEGACY_BIOS_PLATFORM_PROTOCOL LegacyBiosPlatform;
  68. EFI_HANDLE ImageHandle;
  69. EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
  70. } LEGACY_BIOS_PLATFORM_INSTANCE;
  71. #define LEGACY_BIOS_PLATFORM_INSTANCE_SIGNATURE SIGNATURE_32('P','B','I','O')
  72. #define LEGACY_BIOS_PLATFORM_INSTANCE_FROM_THIS(this) \
  73. CR (this, \
  74. LEGACY_BIOS_PLATFORM_INSTANCE, \
  75. LegacyBiosPlatform, \
  76. LEGACY_BIOS_PLATFORM_INSTANCE_SIGNATURE \
  77. )
  78. #endif