summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRegia König2021-06-07 19:23:46 +0200
committerRegia König2021-06-07 19:23:46 +0200
commit1587ced7394f9bce0f457f682667f906677d1261 (patch)
tree4d4de98f12c844edac332ed2a509f1e3c40f12cf
parentMove dmi.c into /bios and /efi dir. The whole open_dmit() function must be re... (diff)
downloadmemtest86-1587ced7394f9bce0f457f682667f906677d1261.tar.gz
memtest86-1587ced7394f9bce0f457f682667f906677d1261.tar.xz
memtest86-1587ced7394f9bce0f457f682667f906677d1261.zip
Add SMBIOS and SMBIOS3 Guid
-rw-r--r--efi_memtest/memtest86+/efi/Include/Efi_Defs.c2
-rw-r--r--efi_memtest/memtest86+/efi/Include/Efi_Defs_GUID.h11
-rw-r--r--efi_memtest/memtest86+/efi/dmi.c60
3 files changed, 67 insertions, 6 deletions
diff --git a/efi_memtest/memtest86+/efi/Include/Efi_Defs.c b/efi_memtest/memtest86+/efi/Include/Efi_Defs.c
index 16f6e6d..acaebcc 100644
--- a/efi_memtest/memtest86+/efi/Include/Efi_Defs.c
+++ b/efi_memtest/memtest86+/efi/Include/Efi_Defs.c
@@ -23,6 +23,8 @@ EFI_GUID gEfiVT100PlusGuid = EFI_VT_100_PLUS_GUID;
EFI_GUID gEfiVTUTF8Guid = EFI_VT_UTF8_GUID;
EFI_GUID gEfiUartDevicePathGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;
EFI_GUID gEfiSasDevicePathGuid = EFI_SAS_DEVICE_PATH_GUID;
+EFI_GUID gEfiSmbiosGuid = SMBIOS_TABLE_GUID;
+EFI_GUID gEfiSmbios3Guid = SMBIOS3_TABLE_GUID;
// Protocols
EFI_GUID gEfiSimpleFileSystemProtocolGuid = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
diff --git a/efi_memtest/memtest86+/efi/Include/Efi_Defs_GUID.h b/efi_memtest/memtest86+/efi/Include/Efi_Defs_GUID.h
index 7f2cc3b..4fbc049 100644
--- a/efi_memtest/memtest86+/efi/Include/Efi_Defs_GUID.h
+++ b/efi_memtest/memtest86+/efi/Include/Efi_Defs_GUID.h
@@ -1,14 +1,13 @@
#ifndef __EFI_DEFS_GUID_H__
#define __EFI_DEFS_GUID_H__
-
/*
* Guids
*/
-#define ACPI_TABLE_GUID { 0xEB9D2D30, 0x2D88, 0x11D3, { 0x9A, 0x16, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }}
+#define ACPI_TABLE_GUID {0xEB9D2D30, 0x2D88, 0x11D3, { 0x9A, 0x16, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}}
extern EFI_GUID gEfiAcpiTableGuid;
-#define EFI_ACPI_TABLE_GUID { 0x8868E871, 0xE4F1, 0x11D3, { 0xBC, 0x22, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}
+#define EFI_ACPI_TABLE_GUID {0x8868E871, 0xE4F1, 0x11D3, { 0xBC, 0x22, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81}}
#define EFI_ACPI_10_TABLE_GUID ACPI_TABLE_GUID
extern EFI_GUID gEfiAcpi10TableGuid;
@@ -47,6 +46,12 @@ extern EFI_GUID gEfiUartDevicePathGuid;
#define EFI_SAS_DEVICE_PATH_GUID { 0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d }}
extern EFI_GUID gEfiSasDevicePathGuid;
+#define SMBIOS_TABLE_GUID {0xeb9d2d31,0x2d88,0x11d3, {0x9a,0x16,0x0,0x90,0x27,0x3f,0xc1,0x4d}};
+extern EFI_GUID gEfiSmbiosGuid;
+
+#define SMBIOS3_TABLE_GUID {0xf2fd1544, 0x9794, 0x4a2c, {0x99,0x2e,0xe5,0xbb,0xcf,0x20,0xe3,0x94}}
+extern EFI_GUID gEfiSmbios3Guid;
+
/*
* Protocols
*/
diff --git a/efi_memtest/memtest86+/efi/dmi.c b/efi_memtest/memtest86+/efi/dmi.c
index df1eade..e16e482 100644
--- a/efi_memtest/memtest86+/efi/dmi.c
+++ b/efi_memtest/memtest86+/efi/dmi.c
@@ -11,11 +11,11 @@
#include "Uefi.h"
#include "Library/UefiLib.h"
-extern EFI_SYSTEM_TABLE *gST;
-
#include "test.h"
#include "stdint.h"
+#include "efi/Include/Efi_Defs_GUID.h"
+
#include "logger.h"
#define round_up(x,y) (((x) + (y) - 1) & ~((y)-1))
@@ -173,8 +173,62 @@ char * get_tstruct_string(struct tstruct_header *header, int n){
return 0;
}
+BOOLEAN abc(EFI_GUID* sfspGuid, EFI_GUID* guid) {
+ if (guid->Data1 == sfspGuid->Data1 && guid->Data2 == sfspGuid->Data2 && guid->Data3 == sfspGuid->Data3
+ && guid->Data4[0] == sfspGuid->Data4[0] && guid->Data4[1] == sfspGuid->Data4[1]
+ && guid->Data4[2] == sfspGuid->Data4[2] && guid->Data4[3] == sfspGuid->Data4[3]
+ && guid->Data4[4] == sfspGuid->Data4[4] && guid->Data4[5] == sfspGuid->Data4[5]
+ && guid->Data4[6] == sfspGuid->Data4[6] && guid->Data4[7] == sfspGuid->Data4[7]) {
+
+ return TRUE;
+ }
+ return FALSE;
+}
+
int open_dmi(void) {
- return 0;
+
+ if (logflag) print_log("open_dmi() started.", 19);
+
+ extern EFI_SYSTEM_TABLE *gST;
+ EFI_CONFIGURATION_TABLE *ct = gST->ConfigurationTable;
+ UINTN NumberOfTableEntries = gST->NumberOfTableEntries;
+
+ if (logflag && log_mem_ctrl) {
+ char log[46] = "print_log(): NumberOfTableEntries = ";
+ int length = 36;
+ int_to_charr(NumberOfTableEntries, log, &length);
+ print_log(log, length);
+ }
+
+ EFI_GUID acpi_20 = gEfiAcpi20TableGuid;
+ EFI_GUID acpi_10 = gEfiAcpi10TableGuid;
+ EFI_GUID smbios = gEfiSmbiosGuid;
+ EFI_GUID smbios3 = gEfiSmbios3Guid;
+
+ for (int i = 0; i < NumberOfTableEntries; i++) {
+
+ EFI_GUID guid = ct->VendorGuid;
+
+ Print(L"GUID: %x-%x-%x-%x-%x-%x-%x-%x-%x-%x-%x",
+ guid.Data1, guid.Data2, guid.Data3,
+ guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
+ guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
+
+ if (abc(&guid, &acpi_20)) {
+ Print(L" EFI_ACPI_20_TABLE_GUID");
+ } else if (abc(&guid, &smbios)) {
+ Print(L" SMBIOS_TABLE_GUID");
+ } else if (abc(&guid, &acpi_10)) {
+ Print(L" ACPI_10_TABLE_GUID");
+ } else {
+ print_log("Unknown table-GUID.", 19);
+ }
+
+ Print(L"\n");
+ ct++;
+ }
+
+ return 0;
}
/*int open_dmi(void){