• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   Legacy BIOS Platform support
3 
4   Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 
6   This program and the accompanying materials are
7   licensed and made available under the terms and conditions of the BSD License
8   which accompanies this distribution.  The full text of the license may be found at
9   http://opensource.org/licenses/bsd-license.php
10 
11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 
14 **/
15 
16 #ifndef LEGACY_BIOS_PLATFORM_H_
17 #define LEGACY_BIOS_PLATFORM_H_
18 
19 #include <FrameworkDxe.h>
20 
21 #include <Protocol/PciIo.h>
22 #include <Protocol/PciRootBridgeIo.h>
23 #include <Protocol/DevicePath.h>
24 #include <Protocol/LegacyInterrupt.h>
25 #include <Protocol/LegacyRegion2.h>
26 #include <Protocol/LegacyBiosPlatform.h>
27 #include <Protocol/FirmwareVolume.h>
28 #include <Protocol/DiskInfo.h>
29 
30 #include <Library/UefiDriverEntryPoint.h>
31 #include <Library/UefiBootServicesTableLib.h>
32 #include <Library/UefiRuntimeServicesTableLib.h>
33 #include <Library/DebugLib.h>
34 #include <Library/BaseMemoryLib.h>
35 #include <Library/MemoryAllocationLib.h>
36 #include <Library/IoLib.h>
37 #include <Library/PciLib.h>
38 #include <Library/PcdLib.h>
39 #include <Library/DxeServicesLib.h>
40 #include <Library/DevicePathLib.h>
41 
42 #include <IndustryStandard/Pci.h>
43 
44 //
45 // PIRQ information constants.
46 //
47 #define MAX_IRQ_ROUTING_ENTRIES     6
48 #define MAX_IRQ_PRIORITY_ENTRIES    7
49 
50 #define V_INTEL_VENDOR_ID         0x8086
51 #define V_PIIX4_IDE_DEVICE_ID     0x7010
52 
53 //
54 // Type declarations
55 //
56 typedef struct {
57   UINT8   SetupValue;
58   UINT16  DeviceType;
59   UINT8   Class;
60   UINT8   SubClass;
61 } EFI_SETUP_BBS_MAP;
62 
63 typedef struct {
64   UINT8          Class;
65   UINT8          SubClass;
66 } PCI_CLASS_RECORD;
67 
68 typedef struct {
69   EFI_LEGACY_PIRQ_TABLE_HEADER  PirqTable;
70   EFI_LEGACY_IRQ_ROUTING_ENTRY  IrqRoutingEntry[MAX_IRQ_ROUTING_ENTRIES];
71 } EFI_LEGACY_PIRQ_TABLE;
72 
73 typedef struct {
74   EFI_HANDLE  Handle;
75   UINT16      Vid;
76   UINT16      Did;
77   UINT16      SvId;
78   UINT16      SysId;
79 } DEVICE_STRUCTURE;
80 
81 typedef struct {
82   EFI_GUID  FileName;
83   UINTN     Valid;
84 } SYSTEM_ROM_TABLE;
85 
86 typedef struct {
87   UINT32                            Signature;
88   EFI_HANDLE                        Handle;
89   EFI_LEGACY_BIOS_PLATFORM_PROTOCOL LegacyBiosPlatform;
90   EFI_HANDLE                        ImageHandle;
91   EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL   *PciRootBridgeIo;
92 } LEGACY_BIOS_PLATFORM_INSTANCE;
93 
94 #define LEGACY_BIOS_PLATFORM_INSTANCE_SIGNATURE   SIGNATURE_32('P','B','I','O')
95 
96 #define LEGACY_BIOS_PLATFORM_INSTANCE_FROM_THIS(this) \
97   CR (this, \
98       LEGACY_BIOS_PLATFORM_INSTANCE, \
99       LegacyBiosPlatform, \
100       LEGACY_BIOS_PLATFORM_INSTANCE_SIGNATURE \
101       )
102 
103 #endif
104 
105