summaryrefslogtreecommitdiffstats
path: root/src/hardware/dmidecode.h
diff options
context:
space:
mode:
authorPeter Schiffer <pschiffe@redhat.com>2013-04-15 18:57:02 +0200
committerPeter Schiffer <pschiffe@redhat.com>2013-04-15 18:57:02 +0200
commita8b751d7c530e103910885c757a2e36abefe625d (patch)
tree97ea17eed124ad46195fab21a8e37751be2d90f2 /src/hardware/dmidecode.h
parentd65c216cb9d8bcce65f19d4e0b1a06b298c8d654 (diff)
downloadopenlmi-providers-a8b751d7c530e103910885c757a2e36abefe625d.tar.gz
openlmi-providers-a8b751d7c530e103910885c757a2e36abefe625d.tar.xz
openlmi-providers-a8b751d7c530e103910885c757a2e36abefe625d.zip
Hardware: Added System Memory Provider
Added new provider: * LMI_MemoryProvider
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_ */