aboutsummaryrefslogtreecommitdiffstats
path: root/com32/gplinclude/dmi
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-05-14 21:58:54 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-05-14 21:58:54 -0700
commit6bb4566204d84145d3f870e57099e428cce9c6db (patch)
tree5cd1eae92493fc1d61aa2f5bf09dba9f213d41c0 /com32/gplinclude/dmi
parent57fb5d68193716a6aaeb84759ce50689c3118cad (diff)
downloadsyslinux-6bb4566204d84145d3f870e57099e428cce9c6db.tar.gz
syslinux-6bb4566204d84145d3f870e57099e428cce9c6db.tar.xz
syslinux-6bb4566204d84145d3f870e57099e428cce9c6db.zip
gpllib: Add support for Cache Information (Type 7) (dmi)
From the SMBIOS spec (v2.6.1): 3.3.8 Cache Information (Type 7): The information in this structure defines the attributes of CPU cache device in the system. One structure is specified for each such device, whether the device is internal to or external to the CPU module. Cache modules can be associated with a processor structure in one or two ways depending on the SMBIOS version, see 3.3.5 Processor Information (Type 4) on page 25 and 3.3.15 Group Associations (Type 14) on page 46 for more information. Implementation mostly borrowed from the dmidecode project. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/gplinclude/dmi')
-rw-r--r--com32/gplinclude/dmi/dmi.h4
-rw-r--r--com32/gplinclude/dmi/dmi_cache.h47
2 files changed, 51 insertions, 0 deletions
diff --git a/com32/gplinclude/dmi/dmi.h b/com32/gplinclude/dmi/dmi.h
index 89782a97..50cd4cac 100644
--- a/com32/gplinclude/dmi/dmi.h
+++ b/com32/gplinclude/dmi/dmi.h
@@ -14,6 +14,7 @@
#define DMI_H
#include <inttypes.h>
#define MAX_DMI_MEMORY_ITEMS 32
+#define MAX_DMI_CACHE_ITEMS 32
#define PAGE_SIZE 4096
@@ -34,6 +35,7 @@ enum {DMI_TABLE_PRESENT = 100, ENODMITABLE};
#include "dmi_memory.h"
#include "dmi_battery.h"
#include "dmi_ipmi.h"
+#include "dmi_cache.h"
extern char display_line;
#define moreprintf(...) do { display_line++; if (display_line == 24) { char tempbuf[10]; display_line=0; printf("Press enter to continue"); fgets(tempbuf, sizeof tempbuf, stdin);} printf ( __VA_ARGS__); } while (0);
@@ -66,7 +68,9 @@ typedef struct {
s_battery battery;
s_memory memory[MAX_DMI_MEMORY_ITEMS];
s_ipmi ipmi;
+ s_cache cache[MAX_DMI_CACHE_ITEMS];
int memory_count;
+ int cache_count;
dmi_table dmitable;
} s_dmi;
diff --git a/com32/gplinclude/dmi/dmi_cache.h b/com32/gplinclude/dmi/dmi_cache.h
new file mode 100644
index 00000000..50f93afd
--- /dev/null
+++ b/com32/gplinclude/dmi/dmi_cache.h
@@ -0,0 +1,47 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009 Pierre-Alexandre Meyer - All Rights Reserved
+ *
+ * Some part borrowed from DMI Decode:
+ *
+ * (C) 2000-2002 Alan Cox <alan@redhat.com>
+ * (C) 2002-2007 Jean Delvare <khali@linux-fr.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef DMI_CACHE_H
+#define DMI_CACHE_H
+
+#include <stdint.h>
+
+#include "stdbool.h"
+
+typedef struct {
+ char socket_designation[32];
+ char configuration[32];
+ char mode[32];
+ char location[8];
+ uint16_t installed_size;
+ uint16_t max_size;
+ char supported_sram_types[32];
+ char installed_sram_types[32];
+ uint16_t speed;
+ char error_correction_type[32];
+ char system_type[16];
+ char associativity[32];
+} __attribute__((__packed__)) s_cache;
+
+const char *dmi_cache_mode(uint8_t code);
+const char *dmi_cache_location(uint8_t code);
+uint16_t dmi_cache_size(uint16_t code);
+void dmi_cache_types(uint16_t code, const char *sep, char* array);
+const char *dmi_cache_ec_type(uint8_t code);
+const char *dmi_cache_type(uint8_t code);
+const char *dmi_cache_associativity(uint8_t code);
+#endif /* DMI_CACHE_H */