/** @file\r
\r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2009, 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
#define EFI_SET_SUPPORTS 0\r
#define EFI_SET_ATTRIBUTES 1\r
\r
-typedef struct _PCI_IO_DEVICE {\r
+typedef struct _PCI_IO_DEVICE PCI_IO_DEVICE;\r
+\r
+struct _PCI_IO_DEVICE {\r
UINT32 Signature;\r
EFI_HANDLE Handle;\r
EFI_PCI_IO_PROTOCOL PciIo;\r
//\r
// The bridge device this pci device is subject to\r
//\r
- struct _PCI_IO_DEVICE *Parent;\r
+ PCI_IO_DEVICE *Parent;\r
\r
//\r
// A linked list for children Pci Device if it is bridge device\r
\r
BOOLEAN IsPciExp;\r
\r
-} PCI_IO_DEVICE;\r
+};\r
\r
\r
#define PCI_IO_DEVICE_FROM_PCI_IO_THIS(a) \\r
gEfiPciRootBridgeIoProtocolGuid # PROTOCOL TO_START\r
gEfiDevicePathProtocolGuid # PROTOCOL TO_START\r
gEfiIncompatiblePciDeviceSupportProtocolGuid # PROTOCOL TO_START\r
- gEfiUgaIoProtocolGuid # ALWAYS_CONSUMED System Table\r
- gEfiLoadFile2ProtocolGuid # SOMETIMES_CONSUMED\r
+ gEfiLoadFile2ProtocolGuid # SOMETIMES_CONSUMED\r
\r
[FeaturePcd.common]\r
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPciVgaEnable\r
/** @file\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation \r
+Copyright (c) 2006 - 2009, 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
@param PMem32Node Pointer to instance of 32-bit Pmemory resource node\r
@param Mem64Node Pointer to instance of 64-bit memory resource node\r
@param PMem64Node Pointer to instance of 64-bit Pmemory resource node\r
- @param pConfig outof buffer holding new constructed APCI resource requestor\r
+ @param Config Output buffer holding new constructed APCI resource requestor\r
**/\r
EFI_STATUS\r
ConstructAcpiResourceRequestor (\r
IN PCI_RESOURCE_NODE *PMem32Node,\r
IN PCI_RESOURCE_NODE *Mem64Node,\r
IN PCI_RESOURCE_NODE *PMem64Node,\r
- OUT VOID **pConfig\r
+ OUT VOID **Config\r
)\r
{\r
UINT8 NumConfig;\r
NumConfig = 0;\r
Aperture = 0;\r
\r
- *pConfig = NULL;\r
+ *Config = NULL;\r
\r
//\r
// if there is io request, add to the io aperture\r
PtrEnd->Checksum = 0;\r
}\r
\r
- *pConfig = Configuration;\r
+ *Config = Configuration;\r
\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
- Get resource base from a acpi configuration descriptor.\r
+ Get resource base from an acpi configuration descriptor.\r
\r
- @param pConfig an acpi configuration descriptor.\r
+ @param Config an acpi configuration descriptor.\r
@param IoBase output of I/O resource base address.\r
@param Mem32Base output of 32-bit memory base address.\r
@param PMem32Base output of 32-bit pmemory base address.\r
@param Mem64Base output of 64-bit memory base address.\r
@param PMem64Base output of 64-bit pmemory base address.\r
\r
- @return EFI_SUCCESS Success operation.\r
+ @return EFI_SUCCESS Get resource base address successfully.\r
+\r
**/\r
EFI_STATUS\r
GetResourceBase (\r
- IN VOID *pConfig,\r
+ IN VOID *Config,\r
OUT UINT64 *IoBase,\r
OUT UINT64 *Mem32Base,\r
OUT UINT64 *PMem32Base,\r
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr;\r
UINT64 ResStatus;\r
\r
+ ASSERT (Config != NULL);\r
+\r
*IoBase = 0xFFFFFFFFFFFFFFFFULL;\r
*Mem32Base = 0xFFFFFFFFFFFFFFFFULL;\r
*PMem32Base = 0xFFFFFFFFFFFFFFFFULL;\r
*Mem64Base = 0xFFFFFFFFFFFFFFFFULL;\r
*PMem64Base = 0xFFFFFFFFFFFFFFFFULL;\r
\r
- Temp = (UINT8 *) pConfig;\r
+ Temp = (UINT8 *) Config;\r
\r
while (*Temp == ACPI_ADDRESS_SPACE_DESCRIPTOR) {\r
\r
@param PMem32Node Pointer to instance of 32-bit Pmemory resource node.\r
@param Mem64Node Pointer to instance of 64-bit memory resource node.\r
@param PMem64Node Pointer to instance of 64-bit Pmemory resource node.\r
- @param pConfig outof buffer holding new constructed APCI resource requestor.\r
+ @param Config Output buffer holding new constructed APCI resource requestor.\r
**/\r
EFI_STATUS\r
ConstructAcpiResourceRequestor (\r
IN PCI_RESOURCE_NODE *PMem32Node,\r
IN PCI_RESOURCE_NODE *Mem64Node,\r
IN PCI_RESOURCE_NODE *PMem64Node,\r
- OUT VOID **pConfig\r
+ OUT VOID **Config\r
);\r
\r
/**\r
- Get resource base from a acpi configuration descriptor.\r
+ Get resource base from an acpi configuration descriptor.\r
\r
- @param pConfig an acpi configuration descriptor.\r
+ @param Config an acpi configuration descriptor.\r
@param IoBase output of I/O resource base address.\r
@param Mem32Base output of 32-bit memory base address.\r
@param PMem32Base output of 32-bit pmemory base address.\r
@param Mem64Base output of 64-bit memory base address.\r
@param PMem64Base output of 64-bit pmemory base address.\r
\r
- @return EFI_SUCCESS Success operation.\r
+ @return EFI_SUCCESS Get resource base address successfully.\r
+\r
**/\r
EFI_STATUS\r
GetResourceBase (\r
- IN VOID *pConfig,\r
+ IN VOID *Config,\r
OUT UINT64 *IoBase,\r
OUT UINT64 *Mem32Base,\r
OUT UINT64 *PMem32Base,\r
//\r
// Start to parse the bars\r
//\r
- for (Offset = 0x10, BarIndex = 0; Offset <= 0x24; BarIndex++) {\r
+ for (Offset = 0x10, BarIndex = 0; Offset <= 0x24 && BarIndex < PCI_MAX_BAR; BarIndex++) {\r
Offset = PciParseBar (PciIoDevice, Offset, BarIndex);\r
}\r
\r
}\r
}\r
\r
- if (EFI_ERROR (Status)) {\r
+ if (EFI_ERROR (Status) || Configuration == NULL ) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
RootBridgeDev->Handle,\r
&AcpiConfig\r
);\r
-\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
PMem64Bridge\r
);\r
\r
- if (AcpiConfig != NULL) {\r
- FreePool (AcpiConfig);\r
- }\r
+ FreePool (AcpiConfig);\r
}\r
\r
//\r
PMem64Bridge\r
);\r
\r
- if (AcpiConfig != NULL) {\r
- gBS->FreePool (AcpiConfig);\r
- }\r
+ FreePool (AcpiConfig);\r
}\r
\r
//\r
/** @file\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+Copyright (c) 2006 - 2009, 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
}\r
\r
/**\r
- Initialize a PCI LoadFile2 instance\r
+ Initialize a PCI LoadFile2 instance.\r
\r
- @param PciIoDevice - PCI IO Device\r
+ @param PciIoDevice PCI IO Device.\r
\r
**/\r
VOID\r
/** @file\r
\r
-Copyright (c) 2006, Intel Corporation \r
+Copyright (c) 2006 - 2009, 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
#include <Protocol/LoadFile2.h>\r
\r
/**\r
- Initialize a PCI LoadFile2 instance\r
+ Initialize a PCI LoadFile2 instance.\r
\r
- @param PciIoDevice - PCI IO Device\r
+ @param PciIoDevice PCI IO Device.\r
\r
**/\r
VOID\r
On output with a return code of EFI_BUFFER_TOO_SMALL, \r
the size of Buffer required to retrieve the requested file. \r
@param Buffer The memory buffer to transfer the file to. If Buffer is NULL, \r
- then no the size of the requested file is returned in BufferSize.\r
+ then no the size of the requested file is returned in BufferSize.\r
\r
@retval EFI_SUCCESS The file was loaded. \r
@retval EFI_UNSUPPORTED BootPolicy is TRUE.\r
/** @file\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+Copyright (c) 2006 - 2009, 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
UINT64 ResNodeAlignRest;\r
UINT64 TempAlignRest;\r
\r
+ ASSERT (Bridge != NULL);\r
+ ASSERT (ResNode != NULL);\r
+\r
InsertHeadList (&Bridge->ChildList, &ResNode->Link);\r
\r
CurrentLink = Bridge->ChildList.ForwardLink->ForwardLink;\r
LIST_ENTRY *CurrentLink;\r
PCI_RESOURCE_NODE *Temp;\r
\r
+ ASSERT (Dst != NULL);\r
+ ASSERT (Res != NULL);\r
+\r
while (!IsListEmpty (&Res->ChildList)) {\r
CurrentLink = Res->ChildList.ForwardLink;\r
\r
//\r
Node->PciDev->Allocated = TRUE;\r
\r
+ ASSERT (Node->Bar < PCI_MAX_BAR);\r
switch ((Node->PciDev->PciBar[Node->Bar]).BarType) {\r
\r
case PciBarTypeIo16:\r