summaryrefslogtreecommitdiffstats
path: root/src/hardware/dmidecode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hardware/dmidecode.h')
-rw-r--r--src/hardware/dmidecode.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/hardware/dmidecode.h b/src/hardware/dmidecode.h
index 9a8c6c8..1b4eca8 100644
--- a/src/hardware/dmidecode.h
+++ b/src/hardware/dmidecode.h
@@ -45,8 +45,23 @@ typedef struct _DmiProcessor {
char *upgrade; /* CPU upgrade method - socket */
unsigned charact_nb; /* Number of CPU Characteristics */
char **characteristics; /* CPU Characteristics */
+ char *l1_cache_handle; /* Level 1 Cache Handle */
+ char *l2_cache_handle; /* Level 2 Cache Handle */
+ char *l3_cache_handle; /* Level 3 Cache Handle */
} DmiProcessor;
+/* Processor cache from dmidecode. */
+typedef struct _DmiCpuCache {
+ char *id; /* ID */
+ unsigned size; /* Cache Size */
+ char *name; /* Cache Name */
+ char *status; /* Cache Status (Enabled or Disabled) */
+ unsigned level; /* Cache Level */
+ char *op_mode; /* Cache Operational Mode (Write Back, ..) */
+ char *type; /* Cache Type (Data, Instruction, Unified..) */
+ char *associativity; /* Cache Associativity */
+} DmiCpuCache;
+
/*
* Get array of processors according to the dmidecode program.
@@ -64,5 +79,21 @@ short dmi_get_processors(DmiProcessor **cpus, unsigned *cpus_nb);
*/
void dmi_free_processors(DmiProcessor **cpus, unsigned *cpus_nb);
+/*
+ * Get array of processor caches according to the dmidecode program.
+ * @param caches array of cpu caches, this function will allocate necessary
+ * memory, but caller is responsible for freeing it
+ * @param caches_nb number of caches in caches
+ * @return 0 if success, negative value otherwise
+ */
+short dmi_get_cpu_caches(DmiCpuCache **caches, unsigned *caches_nb);
+
+/*
+ * Free array of cpu cache structures.
+ * @param caches array of caches
+ * @param caches_nb number of caches
+ */
+void dmi_free_cpu_caches(DmiCpuCache **caches, unsigned *caches_nb);
+
#endif /* DMIDECODE_H_ */