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.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/hardware/dmidecode.h b/src/hardware/dmidecode.h
index 9190ea4..91eda85 100644
--- a/src/hardware/dmidecode.h
+++ b/src/hardware/dmidecode.h
@@ -65,6 +65,20 @@ typedef struct _DmiCpuCache {
char *associativity; /* Cache Associativity */
} DmiCpuCache;
+/* Memory module from dmidecode. */
+typedef struct _DmiMemoryModule {
+ unsigned long size; /* Memory Module Size in Bytes */
+} DmiMemoryModule;
+
+/* Memory from dmidecode. */
+typedef struct _DmiMemory {
+ unsigned long physical_size; /* Physical Memory Size in Bytes */
+ unsigned long available_size; /* Available Memory Size in Bytes */
+ unsigned long start_addr; /* Starting Address of Memory Array in KB */
+ unsigned long end_addr; /* Ending Address of Memory Array in KB */
+ DmiMemoryModule *modules; /* Memory Modules */
+ unsigned modules_nb; /* Number of Memory Modules */
+} DmiMemory;
/*
* Get array of processors according to the dmidecode program.
@@ -98,5 +112,19 @@ short dmi_get_cpu_caches(DmiCpuCache **caches, unsigned *caches_nb);
*/
void dmi_free_cpu_caches(DmiCpuCache **caches, unsigned *caches_nb);
+/*
+ * Get memory structure according to the dmidecode program.
+ * @param memory structure, this function will allocate
+ * necessary memory, but caller is responsible for freeing it
+ * @return 0 if success, negative value otherwise
+ */
+short dmi_get_memory(DmiMemory *memory);
+
+/*
+ * Free memory structure.
+ * @param memory structure
+ */
+void dmi_free_memory(DmiMemory *memory);
+
#endif /* DMIDECODE_H_ */