-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathseabios-smbios-allow-vendor-manufacturer-version-product-nam.patch
105 lines (85 loc) · 3.74 KB
/
seabios-smbios-allow-vendor-manufacturer-version-product-nam.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
From 79ac7cf2b727e6a797382b7f713d111699158878 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <[email protected]>
Date: Fri, 18 Jun 2010 16:11:37 -0300
Subject: [PATCH 1/4] smbios: allow vendor/manufacturer/version/product names be set on config.h
RH-Author: Eduardo Habkost <[email protected]>
Message-id: <[email protected]>
Patchwork-id: 10001
O-Subject: [RHEL6 seabios PATCH 2/7] smbios: allow
vendor/manufacturer/version/product names be set on config.h
Bugzilla: 593317
RH-Acked-by: Alex Williamson <[email protected]>
RH-Acked-by: Gleb Natapov <[email protected]>
RH-Acked-by: Jes Sorensen <[email protected]>
Bugzilla: 593317
Upstream status: will be submitted today
Instead of using the same string for every field, let those fields to be set
individually on config.h
Signed-off-by: Eduardo Habkost <[email protected]>
---
src/config.h | 8 ++++++++
src/smbios.c | 16 ++++++++--------
2 files changed, 16 insertions(+), 8 deletions(-)
Signed-off-by: Eduardo Habkost <[email protected]>
---
src/config.h | 8 ++++++++
src/smbios.c | 16 ++++++++--------
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/config.h b/src/config.h
index 1f6a563..22b0f21 100644
--- a/src/config.h
+++ b/src/config.h
@@ -12,6 +12,14 @@
#define CONFIG_APPNAME6 "BOCHS "
#define CONFIG_APPNAME4 "BXPC"
+/* SMBIOS fields */
+#define CONFIG_SMBIOS_VENDOR CONFIG_APPNAME
+#define CONFIG_SMBIOS_VERSION CONFIG_APPNAME
+#define CONFIG_SMBIOS_MANUFACTURER CONFIG_APPNAME
+#define CONFIG_SMBIOS_PROD_NAME CONFIG_APPNAME
+#define CONFIG_SMBIOS_TYPE3_NAME CONFIG_APPNAME
+#define CONFIG_SMBIOS_CPU_NAME CONFIG_APPNAME
+
// Configure as a coreboot payload.
#define CONFIG_COREBOOT 0
diff --git a/src/smbios.c b/src/smbios.c
index ef2b330..597fb37 100644
--- a/src/smbios.c
+++ b/src/smbios.c
@@ -88,8 +88,8 @@ smbios_init_type_0(void *start)
p->header.length = sizeof(struct smbios_type_0);
p->header.handle = 0;
- load_str_field_with_default(0, vendor_str, CONFIG_APPNAME);
- load_str_field_with_default(0, bios_version_str, CONFIG_APPNAME);
+ load_str_field_with_default(0, vendor_str, CONFIG_SMBIOS_VENDOR);
+ load_str_field_with_default(0, bios_version_str, CONFIG_SMBIOS_VERSION);
p->bios_starting_address_segment = 0xe800;
@@ -135,8 +135,8 @@ smbios_init_type_1(void *start)
p->header.length = sizeof(struct smbios_type_1);
p->header.handle = 0x100;
- load_str_field_with_default(1, manufacturer_str, CONFIG_APPNAME);
- load_str_field_with_default(1, product_name_str, CONFIG_APPNAME);
+ load_str_field_with_default(1, manufacturer_str, CONFIG_SMBIOS_MANUFACTURER);
+ load_str_field_with_default(1, product_name_str, CONFIG_SMBIOS_PROD_NAME);
load_str_field_or_skip(1, version_str);
load_str_field_or_skip(1, serial_number_str);
@@ -185,9 +185,9 @@ smbios_init_type_3(void *start)
p->contained_element_count = 0;
start += sizeof(struct smbios_type_3);
- memcpy((char *)start, CONFIG_APPNAME"\0\0", sizeof(CONFIG_APPNAME) + 1);
+ memcpy((char *)start, CONFIG_SMBIOS_TYPE3_NAME"\0\0", sizeof(CONFIG_SMBIOS_TYPE3_NAME) + 1);
- return start + sizeof(CONFIG_APPNAME) + 1;
+ return start + sizeof(CONFIG_SMBIOS_TYPE3_NAME) + 1;
}
/* Type 4 -- Processor Information */
@@ -228,9 +228,9 @@ smbios_init_type_4(void *start, unsigned int cpu_number)
snprintf((char*)start, 6, "CPU%2x", cpu_number);
start += 6;
- memcpy((char *)start, CONFIG_APPNAME"\0\0", sizeof(CONFIG_APPNAME) + 1);
+ memcpy((char *)start, CONFIG_SMBIOS_CPU_NAME"\0\0", sizeof(CONFIG_SMBIOS_CPU_NAME) + 1);
- return start + sizeof(CONFIG_APPNAME) + 1;
+ return start + sizeof(CONFIG_SMBIOS_CPU_NAME) + 1;
}
/* Type 16 -- Physical Memory Array */
--
1.7.0.3