summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-29 08:24:21 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-29 08:24:21 +0000
commit5b84091f3bd33ef0ec0e9c365e6a7cd516d4c2c9 (patch)
tree13c9339d5008941ce91fede0bea8726dfea20ccf /MdeModulePkg
parente35b53179454119ba0d8591ccdfee9f0efe5fd77 (diff)
downloadedk2-5b84091f3bd33ef0ec0e9c365e6a7cd516d4c2c9.zip
edk2-5b84091f3bd33ef0ec0e9c365e6a7cd516d4c2c9.tar.gz
edk2-5b84091f3bd33ef0ec0e9c365e6a7cd516d4c2c9.tar.bz2
Add DevicePathFromText support for ACPI _ADR node.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11445 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
index 162b0e9..00f44f8 100644
--- a/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
+++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
@@ -1,7 +1,7 @@
/** @file
DevicePathFromText protocol as defined in the UEFI 2.0 specification.
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+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
@@ -1138,6 +1138,51 @@ DevPathFromTextAcpiExp (
}
/**
+ Converts a text device path node to ACPI _ADR device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to the newly-created ACPI _ADR device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextAcpiAdr (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ CHAR16 *DisplayDeviceStr;
+ ACPI_ADR_DEVICE_PATH *AcpiAdr;
+ UINTN Index;
+
+ AcpiAdr = (ACPI_ADR_DEVICE_PATH *) CreateDeviceNode (
+ ACPI_DEVICE_PATH,
+ ACPI_ADR_DP,
+ sizeof (ACPI_ADR_DEVICE_PATH)
+ );
+ ASSERT (AcpiAdr != NULL);
+
+ for (Index = 0; ; Index++) {
+ DisplayDeviceStr = GetNextParamStr (&TextDeviceNode);
+ if (IS_NULL (*DisplayDeviceStr)) {
+ break;
+ }
+ if (Index > 0) {
+ AcpiAdr = ReallocatePool (
+ DevicePathNodeLength (AcpiAdr),
+ DevicePathNodeLength (AcpiAdr) + sizeof (UINT32),
+ AcpiAdr
+ );
+ ASSERT (AcpiAdr != NULL);
+ SetDevicePathNodeLength (AcpiAdr, DevicePathNodeLength (AcpiAdr) + sizeof (UINT32));
+ }
+
+ (&AcpiAdr->ADR)[Index] = (UINT32) Strtoi (DisplayDeviceStr);
+ }
+
+ return (EFI_DEVICE_PATH_PROTOCOL *) AcpiAdr;
+}
+
+/**
Converts a text device path node to Parallel Port device path structure.
@param TextDeviceNode The input Text device path node.
@@ -2769,6 +2814,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE DevPathFromTextTable[]
{L"ParallelPort", DevPathFromTextParallelPort},
{L"AcpiEx", DevPathFromTextAcpiEx},
{L"AcpiExp", DevPathFromTextAcpiExp},
+ {L"AcpiAdr", DevPathFromTextAcpiAdr},
{L"Ata", DevPathFromTextAta},
{L"Scsi", DevPathFromTextScsi},
{L"Fibre", DevPathFromTextFibre},