How to read and write CPU cache?
-
Please let me know How we can get the size of CPU cache? and how can er read and write CPU cache using MFC?
Surendra Vishwkarma
-
Please let me know How we can get the size of CPU cache? and how can er read and write CPU cache using MFC?
Surendra Vishwkarma
// Camel - CPU Identifying Tool // Copyright (C) 2002, Iain Chesworth // // 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; either version 2 of the License, or // any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" #include "cpu_info.h" // -------------------------------------------------------- // // Constructor Functions - CPUInfo Class // // -------------------------------------------------------- CPUInfo::CPUInfo () { // Check to see if this processor supports CPUID. if (DoesCPUSupportCPUID ()) { // Retrieve the CPU details. RetrieveCPUIdentity (); RetrieveCPUFeatures (); if (!RetrieveCPUClockSpeed ()) RetrieveClassicalCPUClockSpeed (); // Attempt to retrieve cache information. if (!RetrieveCPUCacheDetails ()) RetrieveClassicalCPUCacheDetails (); // Retrieve the extended CPU details. if (!RetrieveExtendedCPUIdentity ()) RetrieveClassicalCPUIdentity (); RetrieveExtendedCPUFeatures (); // Now attempt to retrieve the serial number (if possible). RetrieveProcessorSerialNumber (); } } CPUInfo::~CPUInfo () { } // -------------------------------------------------------- // // Public Functions - CPUInfo Class // // -------------------------------------------------------- char * CPUInfo::GetVendorString () { // Return the vendor string. return ChipID.Vendor; } char * CPUInfo::GetVendorID () { // Return the vendor ID. switch (ChipManufacturer) { case Intel: return "Intel Corporation"; case AMD: return "Advanced Micro Devices"; case NSC: return "National Semiconductor"; case Cyrix: return "Cyrix Corp., VIA Inc."; case NexGen: return "NexGen Inc., Advanced Micro Devices"; case IDT: return "IDT\\Centaur, Via Inc."; case UMC: return "United Microelectronics Corp."; case Rise: return "Rise"; case Transmeta: return "Transmeta"; default: return "Unknown Manufacturer"; } } ch
-
// Camel - CPU Identifying Tool // Copyright (C) 2002, Iain Chesworth // // 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; either version 2 of the License, or // any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "stdafx.h" #include "cpu_info.h" // -------------------------------------------------------- // // Constructor Functions - CPUInfo Class // // -------------------------------------------------------- CPUInfo::CPUInfo () { // Check to see if this processor supports CPUID. if (DoesCPUSupportCPUID ()) { // Retrieve the CPU details. RetrieveCPUIdentity (); RetrieveCPUFeatures (); if (!RetrieveCPUClockSpeed ()) RetrieveClassicalCPUClockSpeed (); // Attempt to retrieve cache information. if (!RetrieveCPUCacheDetails ()) RetrieveClassicalCPUCacheDetails (); // Retrieve the extended CPU details. if (!RetrieveExtendedCPUIdentity ()) RetrieveClassicalCPUIdentity (); RetrieveExtendedCPUFeatures (); // Now attempt to retrieve the serial number (if possible). RetrieveProcessorSerialNumber (); } } CPUInfo::~CPUInfo () { } // -------------------------------------------------------- // // Public Functions - CPUInfo Class // // -------------------------------------------------------- char * CPUInfo::GetVendorString () { // Return the vendor string. return ChipID.Vendor; } char * CPUInfo::GetVendorID () { // Return the vendor ID. switch (ChipManufacturer) { case Intel: return "Intel Corporation"; case AMD: return "Advanced Micro Devices"; case NSC: return "National Semiconductor"; case Cyrix: return "Cyrix Corp., VIA Inc."; case NexGen: return "NexGen Inc., Advanced Micro Devices"; case IDT: return "IDT\\Centaur, Via Inc."; case UMC: return "United Microelectronics Corp."; case Rise: return "Rise"; case Transmeta: return "Transmeta"; default: return "Unknown Manufacturer"; } } ch
Thanks a lot hameduser :-D, I will check this ,hope this will solve my problem
Surendra Vishwkarma