summaryrefslogtreecommitdiff
path: root/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.h
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-10 22:04:19 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-10 22:04:19 +0000
commit8016da21b56d5ab1da855037cd0f0e034e2404bf (patch)
treeca1007851ca05a7f3fbd6936f6f10edffd6f2e3b /OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.h
parent09bb585cb2a9d182e4f15cdd0ab020b3b82ead8a (diff)
downloadedk2-platforms-8016da21b56d5ab1da855037cd0f0e034e2404bf.tar.xz
OvmfPkg: Add CsmSupportLib
This library installs the legacy interrupt, region and platform support required for CSM support drivers. Signed-off-by: jljusten Reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12681 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.h')
-rw-r--r--OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.h104
1 files changed, 104 insertions, 0 deletions
diff --git a/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.h b/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.h
new file mode 100644
index 0000000000..a4654a446b
--- /dev/null
+++ b/OvmfPkg/Csm/CsmSupportLib/LegacyPlatform.h
@@ -0,0 +1,104 @@
+/** @file
+ Legacy BIOS Platform support
+
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials are
+ licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef LEGACY_BIOS_PLATFORM_H_
+#define LEGACY_BIOS_PLATFORM_H_
+
+#include <FrameworkDxe.h>
+
+#include <Protocol/PciIo.h>
+#include <Protocol/PciRootBridgeIo.h>
+#include <Protocol/DevicePath.h>
+#include <Protocol/LegacyInterrupt.h>
+#include <Protocol/LegacyRegion2.h>
+#include <Protocol/LegacyBiosPlatform.h>
+#include <Protocol/FirmwareVolume.h>
+#include <Protocol/DiskInfo.h>
+
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/DebugLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/IoLib.h>
+#include <Library/PciLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DxeServicesLib.h>
+#include <Library/DevicePathLib.h>
+
+#include <IndustryStandard/Pci.h>
+
+//
+// PIRQ information constants.
+//
+#define MAX_IRQ_ROUTING_ENTRIES 6
+#define MAX_IRQ_PRIORITY_ENTRIES 7
+
+#define V_INTEL_VENDOR_ID 0x8086
+#define V_PIIX4_IDE_DEVICE_ID 0x7010
+
+//
+// Type declarations
+//
+typedef struct {
+ UINT8 SetupValue;
+ UINT16 DeviceType;
+ UINT8 Class;
+ UINT8 SubClass;
+} EFI_SETUP_BBS_MAP;
+
+typedef struct {
+ UINT8 Class;
+ UINT8 SubClass;
+} PCI_CLASS_RECORD;
+
+typedef struct {
+ EFI_LEGACY_PIRQ_TABLE_HEADER PirqTable;
+ EFI_LEGACY_IRQ_ROUTING_ENTRY IrqRoutingEntry[MAX_IRQ_ROUTING_ENTRIES];
+} EFI_LEGACY_PIRQ_TABLE;
+
+typedef struct {
+ EFI_HANDLE Handle;
+ UINT16 Vid;
+ UINT16 Did;
+ UINT16 SvId;
+ UINT16 SysId;
+} DEVICE_STRUCTURE;
+
+typedef struct {
+ EFI_GUID FileName;
+ UINTN Valid;
+} SYSTEM_ROM_TABLE;
+
+typedef struct {
+ UINT32 Signature;
+ EFI_HANDLE Handle;
+ EFI_LEGACY_BIOS_PLATFORM_PROTOCOL LegacyBiosPlatform;
+ EFI_HANDLE ImageHandle;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
+} LEGACY_BIOS_PLATFORM_INSTANCE;
+
+#define LEGACY_BIOS_PLATFORM_INSTANCE_SIGNATURE SIGNATURE_32('P','B','I','O')
+
+#define LEGACY_BIOS_PLATFORM_INSTANCE_FROM_THIS(this) \
+ CR (this, \
+ LEGACY_BIOS_PLATFORM_INSTANCE, \
+ LegacyBiosPlatform, \
+ LEGACY_BIOS_PLATFORM_INSTANCE_SIGNATURE \
+ )
+
+#endif
+