diff options
author | Erwan Velu <erwanaliasr1@gmail.com> | 2011-03-29 21:50:10 +0200 |
---|---|---|
committer | Erwan Velu <erwanaliasr1@gmail.com> | 2011-03-29 21:50:10 +0200 |
commit | 33f974322130bb122d6d82ce9da9209e175f8341 (patch) | |
tree | 30faceece7955c9198d9457b6c23e6c89471ee2d /com32/hdt | |
parent | 3c7edc827704b44886a6d2a74e690513f44f24d0 (diff) | |
download | syslinux-33f974322130bb122d6d82ce9da9209e175f8341.tar.gz |
hdt: Dumping cache information
Diffstat (limited to 'com32/hdt')
-rw-r--r-- | com32/hdt/hdt-dump-dmi.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/com32/hdt/hdt-dump-dmi.c b/com32/hdt/hdt-dump-dmi.c index f348b9b9..4a574b95 100644 --- a/com32/hdt/hdt-dump-dmi.c +++ b/com32/hdt/hdt-dump-dmi.c @@ -29,6 +29,33 @@ #include "hdt-common.h" #include "hdt-dump.h" +void dump_cache(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) { + + if (hardware->dmi.cache_count == 0) { + APPEND_ARRAY + add_as("dmi.warning","No cache structure found") + END_OF_APPEND; + return; + } + + for (int cache=0; cache<hardware->dmi.cache_count;cache++) { + APPEND_ARRAY + add_ai("Cache", cache) + add_as("dmi.cache.socket_designation", hardware->dmi.cache[cache].socket_designation) + add_as("dmi.cache.configuration", hardware->dmi.cache[cache].configuration) + add_as("dmi.cache.mode", hardware->dmi.cache[cache].mode) + add_as("dmi.cache.location", hardware->dmi.cache[cache].location) + add_ai("dmi.cache.installed_size (KB)", hardware->dmi.cache[cache].installed_size) + add_ai("dmi.cache.max_size (KB)", hardware->dmi.cache[cache].max_size) + add_as("dmi.cache.supported_sram_types", hardware->dmi.cache[cache].supported_sram_types) + add_as("dmi.cache.installed_sram_types", hardware->dmi.cache[cache].installed_sram_types) + add_ai("dmi.cache.speed (ns)", hardware->dmi.cache[cache].speed) + add_as("dmi.cache.error_correction_type", hardware->dmi.cache[cache].error_correction_type) + add_as("dmi.cache.system_type", hardware->dmi.cache[cache].system_type) + add_as("dmi.cache.associativity", hardware->dmi.cache[cache].associativity) + END_OF_APPEND; + } +} void dump_memory_banks(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) { if (hardware->dmi.memory_count == 0) { @@ -348,6 +375,7 @@ void dump_dmi(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) dump_battery(hardware,config,item); dump_processor(hardware,config,item); dump_memory_banks(hardware,config,item); + dump_cache(hardware,config,item); exit: flush("dmi",config,item); } |