summaryrefslogtreecommitdiff
path: root/Nt32Pkg/MiscSubClassPlatformDxe
diff options
context:
space:
mode:
Diffstat (limited to 'Nt32Pkg/MiscSubClassPlatformDxe')
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.unibin2896 -> 0 bytes
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendor.unibin2260 -> 0 bytes
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.unibin2460 -> 0 bytes
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscOemString.unibin1996 -> 0 bytes
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.unibin9426 -> 0 bytes
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf18
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h1
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c310
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.unibin2014 -> 0 bytes
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.unibin2456 -> 0 bytes
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionString.unibin2004 -> 0 bytes
-rw-r--r--Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.unibin2030 -> 0 bytes
12 files changed, 78 insertions, 251 deletions
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni
deleted file mode 100644
index 14a68936ef..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni
+++ /dev/null
Binary files differ
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni
deleted file mode 100644
index b1e7e520fc..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni
+++ /dev/null
Binary files differ
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni
deleted file mode 100644
index 67bee85037..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni
+++ /dev/null
Binary files differ
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemString.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemString.uni
deleted file mode 100644
index fb79bdbde1..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscOemString.uni
+++ /dev/null
Binary files differ
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni
deleted file mode 100644
index b6a617b75e..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni
+++ /dev/null
Binary files differ
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf
index b9d441078f..081dff4fa8 100644
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf
+++ b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf
@@ -54,15 +54,6 @@
MiscSubclassDriver.h
MiscDevicePath.h
MiscSubclassDriver.uni
- MiscSystemSlotDesignation.uni
- MiscSystemOptionString.uni
- MiscSystemManufacturer.uni
- MiscSystemLanguageString.uni
- MiscPortInternalConnectorDesignator.uni
- MiscOemString.uni
- MiscChassisManufacturer.uni
- MiscBiosVendor.uni
- MiscBaseBoardManufacturer.uni
CommonHeader.h
[Packages]
@@ -81,20 +72,23 @@
HiiLibFramework
DebugLib
BaseLib
+ PcdLib
[Guids]
- gEfiWinNtMemoryGuid # SOMETIMES_CONSUMED
gEfiProcessorSubClassGuid # SOMETIMES_CONSUMED
gEfiMiscSubClassGuid # SOMETIMES_CONSUMED
gEfiMemoryProducerGuid # SOMETIMES_CONSUMED
gEfiMemorySubClassGuid # SOMETIMES_CONSUMED
- gEfiWinNtMemoryGuid # SOMETIMES_CONSUMED
[Protocols]
gEfiWinNtIoProtocolGuid # PROTOCOL_NOTIFY SOMETIMES_CONSUMED
gEfiHiiProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDataHubProtocolGuid # PROTOCOL ALWAYS_CONSUMED
+[PcdsDynamic.common]
+ PcdWinNtMemorySize|gEfiNt32PkgTokenSpaceGuid
+
[Depex]
- gEfiDataHubProtocolGuid AND gEfiHiiProtocolGuid \ No newline at end of file
+ gEfiDataHubProtocolGuid AND gEfiHiiProtocolGuid
+ \ No newline at end of file
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
index 1374d7b135..e17f8358de 100644
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
+++ b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
@@ -36,6 +36,7 @@ Abstract:
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DevicePathLib.h>
+#include <Library/PcdLib.h>
#include <MiscDevicePath.h>
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
index 03eb74f9f9..138ed7f439 100644
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
+++ b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
@@ -25,12 +25,6 @@ Abstract:
extern UINT8 MiscSubclassStrings[];
-VOID
-EFIAPI
-WinNtIoProtocolNotifyFunction (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
//
//
@@ -70,7 +64,7 @@ Returns:
--*/
{
EFI_MISC_SUBCLASS_DRIVER_DATA MiscSubclass;
- EFI_STATUS EfiStatus;
+ EFI_STATUS Status;
//
// Do nothing if data parameters are not valid.
@@ -103,7 +97,7 @@ Returns:
//
// Log Data Hub record.
//
- EfiStatus = DataHub->LogData (
+ Status = DataHub->LogData (
DataHub,
&gEfiMiscSubClassGuid,
&gEfiMiscSubClassGuid,
@@ -112,16 +106,16 @@ Returns:
sizeof (EFI_SUBCLASS_TYPE1_HEADER) + RecordLen
);
- if (EFI_ERROR (EfiStatus)) {
+ if (EFI_ERROR (Status)) {
DEBUG (
(EFI_D_ERROR,
"LogData(%d bytes) == %r\n",
sizeof (EFI_SUBCLASS_TYPE1_HEADER) + RecordLen,
- EfiStatus)
+ Status)
);
}
- return EfiStatus;
+ return Status;
}
@@ -152,16 +146,17 @@ Returns:
--*/
{
- EFI_MISC_SUBCLASS_DRIVER_DATA RecordData;
- EFI_DATA_HUB_PROTOCOL *DataHub;
- EFI_HII_PROTOCOL *Hii;
- EFI_HII_PACKAGES *PackageList;
- EFI_HII_HANDLE HiiHandle;
- EFI_STATUS EfiStatus;
- UINTN Index;
- BOOLEAN LogRecordData;
- EFI_EVENT Event;
- VOID *Registration;
+ EFI_MISC_SUBCLASS_DRIVER_DATA RecordData;
+ EFI_DATA_HUB_PROTOCOL *DataHub;
+ EFI_HII_PROTOCOL *Hii;
+ EFI_HII_PACKAGES *PackageList;
+ EFI_HII_HANDLE HiiHandle;
+ EFI_STATUS Status;
+ UINTN Index;
+ BOOLEAN LogRecordData;
+ EFI_MEMORY_SUBCLASS_DRIVER_DATA MemorySubClassData;
+ UINT64 TotalMemorySize;
+ CHAR16 *Nt32MemString;
//
@@ -175,11 +170,11 @@ Returns:
//
// Locate data hub protocol.
//
- EfiStatus = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, &DataHub);
+ Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, &DataHub);
- if (EFI_ERROR (EfiStatus)) {
- DEBUG ((EFI_D_ERROR, "Could not locate DataHub protocol. %r\n", EfiStatus));
- return EfiStatus;
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "Could not locate DataHub protocol. %r\n", Status));
+ return Status;
} else if (DataHub == NULL) {
DEBUG ((EFI_D_ERROR, "LocateProtocol(DataHub) returned NULL pointer!\n"));
return EFI_DEVICE_ERROR;
@@ -187,11 +182,11 @@ Returns:
//
// Locate hii protocol.
//
- EfiStatus = gBS->LocateProtocol (&gEfiHiiProtocolGuid, NULL, &Hii);
+ Status = gBS->LocateProtocol (&gEfiHiiProtocolGuid, NULL, &Hii);
- if (EFI_ERROR (EfiStatus)) {
- DEBUG ((EFI_D_ERROR, "Could not locate Hii protocol. %r\n", EfiStatus));
- return EfiStatus;
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "Could not locate Hii protocol. %r\n", Status));
+ return Status;
} else if (Hii == NULL) {
DEBUG ((EFI_D_ERROR, "LocateProtocol(Hii) returned NULL pointer!\n"));
return EFI_DEVICE_ERROR;
@@ -200,12 +195,12 @@ Returns:
// Add our default strings to the HII database. They will be modified later.
//
PackageList = PreparePackages (1, &gEfiMiscSubClassGuid, MiscSubclassStrings);
- EfiStatus = Hii->NewPack (Hii, PackageList, &HiiHandle);
+ Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
FreePool (PackageList);
- if (EFI_ERROR (EfiStatus)) {
- DEBUG ((EFI_D_ERROR, "Could not log default strings to Hii. %r\n", EfiStatus));
- return EfiStatus;
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "Could not log default strings to Hii. %r\n", Status));
+ return Status;
}
//
//
@@ -250,7 +245,7 @@ Returns:
//
// Log RecordData to Data Hub.
//
- EfiStatus = DataHub->LogData (
+ Status = DataHub->LogData (
DataHub,
&gEfiMiscSubClassGuid,
&gEfiMiscSubClassGuid,
@@ -259,12 +254,12 @@ Returns:
sizeof (EFI_SUBCLASS_TYPE1_HEADER) + mMiscSubclassDataTable[Index].RecordLen
);
- if (EFI_ERROR (EfiStatus)) {
+ if (EFI_ERROR (Status)) {
DEBUG (
(EFI_D_ERROR,
"LogData(%d bytes) == %r\n",
sizeof (EFI_SUBCLASS_TYPE1_HEADER) + mMiscSubclassDataTable[Index].RecordLen,
- EfiStatus)
+ Status)
);
}
@@ -276,29 +271,16 @@ Returns:
// is no more data to log.
//
for (;;) {
- //
- //
- //
- EfiStatus = (*mMiscSubclassDataTable[Index].Function)
- (
- mMiscSubclassDataTable[Index].RecordType, &mMiscSubclassDataTable[Index].RecordLen, &RecordData.Record, &
- LogRecordData
- );
-
- //
- //
- //
- if (EFI_ERROR (EfiStatus)) {
+ Status = (*mMiscSubclassDataTable[Index].Function)(mMiscSubclassDataTable[Index].RecordType, &mMiscSubclassDataTable[Index].RecordLen, &RecordData.Record, &LogRecordData);
+ if (EFI_ERROR (Status)) {
break;
}
if (!LogRecordData) {
break;
}
- //
- //
- //
- EfiStatus = DataHub->LogData (
+
+ Status = DataHub->LogData (
DataHub,
&gEfiMiscSubClassGuid,
&gEfiMiscSubClassGuid,
@@ -307,212 +289,62 @@ Returns:
sizeof (EFI_SUBCLASS_TYPE1_HEADER) + mMiscSubclassDataTable[Index].RecordLen
);
- if (EFI_ERROR (EfiStatus)) {
+ if (EFI_ERROR (Status)) {
DEBUG (
(EFI_D_ERROR,
"LogData(%d bytes) == %r\n",
sizeof (EFI_SUBCLASS_TYPE1_HEADER) + mMiscSubclassDataTable[Index].RecordLen,
- EfiStatus)
+ Status)
);
}
}
}
- //
- // Install notify function to fetch memory data through WinNtIo protocol and store to data hub.
- //
- EfiStatus = gBS->CreateEvent (
- EVT_NOTIFY_SIGNAL,
- TPL_CALLBACK,
- WinNtIoProtocolNotifyFunction,
- ImageHandle,
- &Event
- );
- ASSERT (!EFI_ERROR (EfiStatus));
-
- EfiStatus = gBS->RegisterProtocolNotify (
- &gEfiWinNtIoProtocolGuid,
- Event,
- &Registration
- );
- ASSERT (!EFI_ERROR (EfiStatus));
-
- return EFI_SUCCESS;
-}
-
-UINTN
-Atoi (
- CHAR16 *String
- )
-/*++
-
-Routine Description:
- Convert a unicode string to a UINTN
-
-Arguments:
- String - Unicode string.
-
-Returns:
- UINTN of the number represented by String.
-
---*/
-{
- UINTN Number;
- CHAR16 *Str;
+
//
- // skip preceeding white space
+ // Log Memory Size info based on PCD setting.
//
- Str = String;
- while ((*Str) && (*Str == ' ' || *Str == '"')) {
- Str++;
- }
+ MemorySubClassData.Header.Instance = 1;
+ MemorySubClassData.Header.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE;
+ MemorySubClassData.Header.RecordType = EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER;
+
//
- // Convert ot a Number
+ // Process Memory String in form size!size ...
+ // So 64!64 is 128 MB
//
- Number = 0;
- while (*Str != '\0') {
- if ((*Str >= '0') && (*Str <= '9')) {
- Number = (Number * 10) +*Str - '0';
- } else {
- break;
+ Nt32MemString = PcdGetPtr (PcdWinNtMemorySize);
+ for (TotalMemorySize = 0; *Nt32MemString != '\0';) {
+ TotalMemorySize += StrDecimalToUint64 (Nt32MemString);
+ while (*Nt32MemString != '\0') {
+ if (*Nt32MemString == '!') {
+ Nt32MemString++;
+ break;
+ }
+ Nt32MemString++;
}
-
- Str++;
}
- return Number;
-}
-
-VOID
-EFIAPI
-WinNtIoProtocolNotifyFunction (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
- This function will log memory size data to data hub.
-
-Arguments:
-Event - Event whose notification function is being invoked.
-Context - Pointer to the notification function's context.
-
-Returns:
- EFI_STATUS.
+ MemorySubClassData.Record.ArrayStartAddress.MemoryArrayStartAddress = 0;
+ MemorySubClassData.Record.ArrayStartAddress.MemoryArrayEndAddress = LShiftU64 (TotalMemorySize, 20) - 1;
+ MemorySubClassData.Record.ArrayStartAddress.PhysicalMemoryArrayLink.ProducerName = gEfiMemoryProducerGuid;
+ MemorySubClassData.Record.ArrayStartAddress.PhysicalMemoryArrayLink.Instance = 1;
+ MemorySubClassData.Record.ArrayStartAddress.PhysicalMemoryArrayLink.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE;
+ MemorySubClassData.Record.ArrayStartAddress.MemoryArrayPartitionWidth = 0;
---*/
-{
- EFI_STATUS Status;
- EFI_MEMORY_SUBCLASS_DRIVER_DATA MemorySubClassData;
- EFI_DATA_RECORD_HEADER *Record;
- EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
- UINTN HandleCount;
- UINTN HandleIndex;
- UINT64 MonotonicCount;
- BOOLEAN RecordFound;
- EFI_HANDLE *HandleBuffer;
- EFI_WIN_NT_IO_PROTOCOL *WinNtIo;
- EFI_DATA_HUB_PROTOCOL *DataHub;
- UINT64 TotalMemorySize;
-
- DataHub = NULL;
- MonotonicCount = 0;
- RecordFound = FALSE;
-
- //
- // Retrieve the list of all handles from the handle database.
- //
- Status = gBS->LocateHandleBuffer (
- AllHandles,
- &gEfiWinNtIoProtocolGuid,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (EFI_ERROR (Status)) {
- return ;
- }
//
- // Locate DataHub protocol.
+ // Store memory size data record to data hub.
//
- Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, &DataHub);
- if (EFI_ERROR (Status)) {
- return ;
- }
- //
- // Search the Handle array to find the meory size information.
- //
- for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
- Status = gBS->OpenProtocol (
- HandleBuffer[HandleIndex],
- &gEfiWinNtIoProtocolGuid,
- &WinNtIo,
- Context,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- if ((WinNtIo->WinNtThunk->Signature == EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE) &&
- CompareGuid (WinNtIo->TypeGuid, &gEfiWinNtMemoryGuid)
- ) {
- //
- // Check if this record has been stored in data hub.
- //
- do {
- Status = DataHub->GetNextRecord (DataHub, &MonotonicCount, NULL, &Record);
- if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) {
- DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *) (Record + 1);
- if (CompareGuid (&Record->DataRecordGuid, &gEfiProcessorSubClassGuid) &&
- (DataHeader->RecordType == EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER)
- ) {
- RecordFound = TRUE;
- }
- }
- } while (MonotonicCount != 0);
-
- if (RecordFound) {
- RecordFound = FALSE;
- continue;
- }
- //
- // Initialize data record.
- //
- MemorySubClassData.Header.Instance = 1;
- MemorySubClassData.Header.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE;
- MemorySubClassData.Header.RecordType = EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER;
+ Status = DataHub->LogData (
+ DataHub,
+ &gEfiMemorySubClassGuid,
+ &gEfiMemoryProducerGuid,
+ EFI_DATA_RECORD_CLASS_DATA,
+ &MemorySubClassData,
+ sizeof (EFI_SUBCLASS_TYPE1_HEADER) + sizeof (EFI_MEMORY_ARRAY_START_ADDRESS_DATA)
+ );
- TotalMemorySize = (UINT64) Atoi (WinNtIo->EnvString);
- MemorySubClassData.Record.ArrayStartAddress.MemoryArrayStartAddress = 0;
- MemorySubClassData.Record.ArrayStartAddress.MemoryArrayEndAddress = LShiftU64 (TotalMemorySize, 20) - 1;
- MemorySubClassData.Record.ArrayStartAddress.PhysicalMemoryArrayLink.ProducerName = gEfiMemoryProducerGuid;
- MemorySubClassData.Record.ArrayStartAddress.PhysicalMemoryArrayLink.Instance = 1;
- MemorySubClassData.Record.ArrayStartAddress.PhysicalMemoryArrayLink.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE;
- MemorySubClassData.Record.ArrayStartAddress.MemoryArrayPartitionWidth = 0;
-
- //
- // Store memory size data record to data hub.
- //
- Status = DataHub->LogData (
- DataHub,
- &gEfiMemorySubClassGuid,
- &gEfiMemoryProducerGuid,
- EFI_DATA_RECORD_CLASS_DATA,
- &MemorySubClassData,
- sizeof (EFI_SUBCLASS_TYPE1_HEADER) + sizeof (EFI_MEMORY_ARRAY_START_ADDRESS_DATA)
- );
- }
-
- gBS->CloseProtocol (
- HandleBuffer[HandleIndex],
- &gEfiWinNtIoProtocolGuid,
- Context,
- NULL
- );
- }
+ return EFI_SUCCESS;
}
+
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni
deleted file mode 100644
index 36dacf066a..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni
+++ /dev/null
Binary files differ
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni
deleted file mode 100644
index 204588ef8c..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni
+++ /dev/null
Binary files differ
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni
deleted file mode 100644
index 617578d6a3..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni
+++ /dev/null
Binary files differ
diff --git a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni b/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni
deleted file mode 100644
index f279ff960d..0000000000
--- a/Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni
+++ /dev/null
Binary files differ