diff options
author | Hao Wu <hao.a.wu@intel.com> | 2016-07-12 20:10:42 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-07-20 15:07:19 +0800 |
commit | 6558fd73117c0df2285a4e16d562115386f5b46b (patch) | |
tree | 1d5a1986966e21298ecb6ca9c61e2eedbcf080e2 /MdeModulePkg | |
parent | 65960189249ec2ee40864e670056faa3831453f8 (diff) | |
download | edk2-platforms-6558fd73117c0df2285a4e16d562115386f5b46b.tar.xz |
MdeModulePkg RamDiskDxe: Not use hardcode 'SectionInstance' to locate SSDT
This commit will scan all the EFI raw section instances within the
module's FV to make sure the NVDIMM root device SSDT can be properly
located.
Cc: Feng Tian <feng.tian@intel.com>
Cc: Zhang Chao B <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c | 58 |
1 files changed, 36 insertions, 22 deletions
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c index 9383de496f..6784e2b2f1 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c @@ -75,35 +75,49 @@ RamDiskPublishSsdt ( {
EFI_STATUS Status;
EFI_ACPI_DESCRIPTION_HEADER *Table;
+ UINTN SectionInstance;
UINTN TableSize;
- Status = GetSectionFromFv (
- &gEfiCallerIdGuid,
- EFI_SECTION_RAW,
- 1,
- (VOID **) &Table,
- &TableSize
- );
- ASSERT_EFI_ERROR (Status);
+ Status = EFI_SUCCESS;
+ SectionInstance = 0;
- ASSERT (Table->OemTableId == SIGNATURE_64 ('R', 'a', 'm', 'D', 'i', 's', 'k', ' '));
+ //
+ // Scan all the EFI raw section instances in FV to find the NVDIMM root
+ // device SSDT.
+ //
+ while (TRUE) {
+ Status = GetSectionFromFv (
+ &gEfiCallerIdGuid,
+ EFI_SECTION_RAW,
+ SectionInstance,
+ (VOID **) &Table,
+ &TableSize
+ );
+ if (EFI_ERROR (Status)) {
+ break;
+ }
- Status = mAcpiTableProtocol->InstallAcpiTable (
- mAcpiTableProtocol,
- Table,
- TableSize,
- &mRamDiskSsdtTableKey
- );
- ASSERT_EFI_ERROR (Status);
+ if (Table->OemTableId == SIGNATURE_64 ('R', 'a', 'm', 'D', 'i', 's', 'k', ' ')) {
+ Status = mAcpiTableProtocol->InstallAcpiTable (
+ mAcpiTableProtocol,
+ Table,
+ TableSize,
+ &mRamDiskSsdtTableKey
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ if (!EFI_ERROR (Status)) {
+ mRamDiskSsdtTableKeyValid = TRUE;
+ }
- if (!EFI_ERROR (Status)) {
- mRamDiskSsdtTableKeyValid = TRUE;
- } else {
- mRamDiskSsdtTableKeyValid = FALSE;
+ FreePool (Table);
+ return Status;
+ } else {
+ FreePool (Table);
+ SectionInstance++;
+ }
}
- FreePool (Table);
-
return Status;
}
|