[coreboot-gerrit] New patch to review for coreboot: 19f13e4 SMBIOS: Allow creating the DMI type 11 table "OEM Strings"
Peter Stuge (peter@stuge.se)
gerrit at coreboot.org
Sat Jul 6 20:28:18 CEST 2013
Peter Stuge (peter at stuge.se) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3618
-gerrit
commit 19f13e4170391cfef377a0c9d96beec28fb8e9c1
Author: Peter Stuge <peter at stuge.se>
Date: Sat Jul 6 19:51:12 2013 +0200
SMBIOS: Allow creating the DMI type 11 table "OEM Strings"
Change-Id: Id338968429435bac26595c4843b07cdbb91dd64d
Signed-off-by: Peter Stuge <peter at stuge.se>
---
src/arch/x86/boot/smbios.c | 18 ++++++++++++++++++
src/include/smbios.h | 10 ++++++++++
2 files changed, 28 insertions(+)
diff --git a/src/arch/x86/boot/smbios.c b/src/arch/x86/boot/smbios.c
index 308336a..709d4f5 100644
--- a/src/arch/x86/boot/smbios.c
+++ b/src/arch/x86/boot/smbios.c
@@ -256,6 +256,24 @@ static int smbios_write_type4(unsigned long *current, int handle)
return len;
}
+int smbios_write_type11(unsigned long *current, int handle, const char **oem_strings, int count)
+{
+ struct smbios_type11 *t = (struct smbios_type11 *)*current;
+ int i, len;
+
+ memset(t, 0, sizeof *t);
+ t->type = SMBIOS_OEM_STRINGS;
+ t->handle = handle;
+ t->length = len = sizeof *t - 2;
+
+ for (i = 0; i < count; i++)
+ t->count = smbios_add_string(t->eos, oem_strings[i]);
+
+ len += smbios_string_table_len(t->eos);
+ *current += len;
+ return len;
+}
+
static int smbios_write_type32(unsigned long *current, int handle)
{
struct smbios_type32 *t = (struct smbios_type32 *)*current;
diff --git a/src/include/smbios.h b/src/include/smbios.h
index 50bce2a..9051a69 100644
--- a/src/include/smbios.h
+++ b/src/include/smbios.h
@@ -3,6 +3,7 @@
#include <types.h>
+int smbios_write_type11(unsigned long *current, int handle, const char **oem_strings, int count);
unsigned long smbios_write_tables(unsigned long start);
int smbios_add_string(char *start, const char *str);
int smbios_string_table_len(char *start);
@@ -31,6 +32,7 @@ typedef enum {
SMBIOS_PROCESSOR_INFORMATION=4,
SMBIOS_CACHE_INFORMATION=7,
SMBIOS_SYSTEM_SLOTS=9,
+ SMBIOS_OEM_STRINGS=11,
SMBIOS_EVENT_LOG=15,
SMBIOS_PHYS_MEMORY_ARRAY=16,
SMBIOS_MEMORY_DEVICE=17,
@@ -142,6 +144,14 @@ struct smbios_type4 {
char eos[2];
} __attribute__((packed));
+struct smbios_type11 {
+ u8 type;
+ u8 length;
+ u16 handle;
+ u8 count;
+ char eos[2];
+} __attribute__((packed));
+
struct smbios_type15 {
u8 type;
u8 length;
More information about the coreboot-gerrit
mailing list