/* ----------------------------------------------------------------------- * * * Copyright 2009 Pierre-Alexandre Meyer - All Rights Reserved * * Some part borrowed from DMI Decode: * * (C) 2000-2002 Alan Cox * (C) 2002-2007 Jean Delvare * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, Inc., 53 Temple Place Ste 330, * Boston MA 02111-1307, USA; either version 2 of the License, or * (at your option) any later version; incorporated herein by reference. * * ----------------------------------------------------------------------- */ #include #include #include /* * 3.3.8 Cache Information (Type 7) */ const char *dmi_cache_mode(uint8_t code) { static const char *mode[] = { "Write Through", /* 0x00 */ "Write Back", "Varies With Memory Address", "Unknown" /* 0x03 */ }; return mode[code]; } const char *dmi_cache_location(uint8_t code) { static const char *location[4] = { "Internal", /* 0x00 */ "External", "= 0x01 && code <= 0x06) return type[code - 0x01]; return out_of_spec; } const char *dmi_cache_type(uint8_t code) { /* 3.3.8.4 */ static const char *type[] = { "Other", /* 0x01 */ "Unknown", "Instruction", "Data", "Unified" /* 0x05 */ }; if (code >= 0x01 && code <= 0x05) return type[code - 0x01]; return out_of_spec; } const char *dmi_cache_associativity(uint8_t code) { /* 3.3.8.5 */ static const char *type[] = { "Other", /* 0x01 */ "Unknown", "Direct Mapped", "2-way Set-associative", "4-way Set-associative", "Fully Associative", "8-way Set-associative", "16-way Set-associative" /* 0x08 */ }; if (code >= 0x01 && code <= 0x08) return type[code - 0x01]; return out_of_spec; }