diff options
author | Peter Schiffer <pschiffe@redhat.com> | 2013-04-04 19:02:29 +0200 |
---|---|---|
committer | Peter Schiffer <pschiffe@redhat.com> | 2013-04-04 19:02:29 +0200 |
commit | 381f0c0a5cd98a48dc6d5a5e0b98443707d8ea81 (patch) | |
tree | bdad2e739aac00eb02e71dfe7d4074268c6f69a4 /src/hardware/dmidecode.h | |
parent | c47c5c19c5857439db30e40d4a691f5b700adf5f (diff) | |
download | openlmi-providers-381f0c0a5cd98a48dc6d5a5e0b98443707d8ea81.tar.gz openlmi-providers-381f0c0a5cd98a48dc6d5a5e0b98443707d8ea81.tar.xz openlmi-providers-381f0c0a5cd98a48dc6d5a5e0b98443707d8ea81.zip |
Hardware: Added Processor Cache Memory Provider
New Providers:
* LMI_ProcessorCacheMemoryProvider
* LMI_AssociatedProcessorCacheMemoryProvider
Other Changes:
* Optimized usage of string constats
* Fixed wrong usage of pointers in dmidecode.c
* Filled unknown mandatory fields in providers with "Unknown" value
* Replaced hard coded numbers with LMI constants
* Minor optimization - don't gather data which won't be used
Diffstat (limited to 'src/hardware/dmidecode.h')
-rw-r--r-- | src/hardware/dmidecode.h | 31 |
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_ */ |