BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[mirror_edk2.git] / DuetPkg / PciRootBridgeNoEnumerationDxe / PcatPciRootBridgeDevicePath.c
CommitLineData
c69dd9df 1/*++\r
2\r
b1f700a8
HT
3Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
c69dd9df 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13 PcatPciRootBridgeDevicePath.c\r
14 \r
15Abstract:\r
16\r
17 EFI PCAT PCI Root Bridge Device Path Protocol\r
18\r
19Revision History\r
20\r
21--*/\r
22\r
23#include "PcatPciRootBridge.h"\r
24\r
25//\r
26// Static device path declarations for this driver.\r
27//\r
28\r
29typedef struct {\r
30 ACPI_HID_DEVICE_PATH AcpiDevicePath;\r
31 EFI_DEVICE_PATH_PROTOCOL EndDevicePath;\r
32} EFI_PCI_ROOT_BRIDGE_DEVICE_PATH;\r
33\r
e56dd2ce 34EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeDevicePath = {\r
c69dd9df 35 {\r
abae655f 36 {\r
37 ACPI_DEVICE_PATH,\r
38 ACPI_DP,\r
39 {\r
40 (UINT8) (sizeof(ACPI_HID_DEVICE_PATH)),\r
41 (UINT8) ((sizeof(ACPI_HID_DEVICE_PATH)) >> 8),\r
42 }\r
43 },\r
c69dd9df 44 EISA_PNP_ID(0x0A03),\r
45 0\r
46 },\r
47 {\r
48 END_DEVICE_PATH_TYPE,\r
49 END_ENTIRE_DEVICE_PATH_SUBTYPE,\r
abae655f 50 {\r
51 END_DEVICE_PATH_LENGTH,\r
52 0\r
53 }\r
c69dd9df 54 }\r
55};\r
56\r
57EFI_STATUS\r
58PcatRootBridgeDevicePathConstructor (\r
59 IN EFI_DEVICE_PATH_PROTOCOL **Protocol,\r
60 IN UINTN RootBridgeNumber,\r
61 IN BOOLEAN IsPciExpress\r
62 )\r
63/*++\r
64\r
65Routine Description:\r
66\r
67 Construct the device path protocol\r
68\r
69Arguments:\r
70\r
71 Protocol - protocol to initialize\r
72 \r
73Returns:\r
74\r
75 None\r
76\r
77--*/\r
78{\r
79 ACPI_HID_DEVICE_PATH *AcpiDevicePath;\r
80 \r
81 *Protocol = DuplicateDevicePath((EFI_DEVICE_PATH_PROTOCOL *)(&mEfiPciRootBridgeDevicePath));\r
82\r
83 AcpiDevicePath = (ACPI_HID_DEVICE_PATH *)(*Protocol);\r
84 \r
85 AcpiDevicePath->UID = (UINT32)RootBridgeNumber;\r
86\r
87 if (IsPciExpress) {\r
88 AcpiDevicePath->HID = EISA_PNP_ID(0x0A08);\r
89 }\r
90\r
91 return EFI_SUCCESS;\r
92}\r
93\r