Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to read and write CPU cache?

How to read and write CPU cache?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Surendra Vishwkarma
    wrote on last edited by
    #1

    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

    H 1 Reply Last reply
    0
    • S 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

      H Offline
      H Offline
      hameduser
      wrote on last edited by
      #2

      // 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

      S 1 Reply Last reply
      0
      • H hameduser

        // 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

        S Offline
        S Offline
        Surendra Vishwkarma
        wrote on last edited by
        #3

        Thanks a lot hameduser :-D, I will check this ,hope this will solve my problem

        Surendra Vishwkarma

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups