source: trunk/lib_ir/AgnerTestP/PMCTest/MSRDriver.h @ 4221

Last change on this file since 4221 was 4221, checked in by linmengl, 5 years ago

initial checkin of Agner Fog's performance script

File size: 1.7 KB
Line 
1//                       msrdriver.h                     2012-03-02 Agner Fog
2
3// Device driver for access to Model-specific registers and control registers
4// in Windows 2000 and later and Linux (32 and 64 bit x86 platform)
5
6// (c) Copyright 2005-2012 by Agner Fog. GNU General Public License www.gnu.org/licences
7
8#pragma once
9
10// list of input/output data structures for MSR driver
11#define MAX_QUE_ENTRIES 32                  // maximum number of entries in queue
12
13// commands for MSR driver. Shared with application program
14enum EMSR_COMMAND {
15    MSR_IGNORE = 0,                // do nothing
16    MSR_STOP   = 1,                // skip rest of list
17    MSR_READ   = 2,                // read model specific register
18    MSR_WRITE  = 3,                // write model specific register
19    CR_READ    = 4,                // read control register
20    CR_WRITE   = 5,                // write control register
21    PMC_ENABLE = 6,                // Enable RDPMC and RDTSC instructions
22    PMC_DISABLE= 7,                // Disable RDPMC instruction (RDTSC remains enabled)
23    PROC_GET   = 8,                // Get processor number (In multiprocessor systems. 0-based)
24    PROC_SET   = 9,                // Set processor number (In multiprocessor systems. 0-based)
25    UNUSED1    = 0x7fffffff        // make sure this enum takes 32 bits
26};
27
28
29// input/output data structure for MSR driver
30struct SMSRInOut {
31    enum EMSR_COMMAND msr_command;      // command for read or write register
32    unsigned int register_number;  // register number
33    union {
34        long long value;            // 64 bit value to read or write
35        unsigned int val[2];        // lower and upper 32 bits
36    };
37};
Note: See TracBrowser for help on using the repository browser.