forked from LLNL/msr-safe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsr_safe.h
64 lines (57 loc) · 2.26 KB
/
msr_safe.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright (c) 2011-2017 by Lawrence Livermore National Security, LLC.
* LLNL-CODE-645430
*
* Produced at Lawrence Livermore National Laboratory.
* Written by Marty McFadden, [email protected]
* Kathleen Shoga, [email protected]
* Barry Rountree [email protected]
*
* All rights reserved.
*
* This file is part of msr-safe.
*
* msr-safe is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* msr-safe 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 Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with msr-safe. If not, see <http://www.gnu.org/licenses/>.
*
* This material is based upon work supported by the U.S. Department of
* Energy's Lawrence Livermore National Laboratory. Office of Science, under
* Award number DE-AC52-07NA27344.
*/
/*
* This file defines the ioctl interface for submitting a batch of MSR
* requests. This file should be distributed to a place where kernel
* module interface header files are kept for a distribution running this
* module so that user-space applications and libraries that wish to use
* the batch interface may #include this file to get the interface.
*/
#ifndef MSR_SAFE_HEADER_INCLUDE
#define MSR_SAFE_HEADER_INCLUDE
#include <linux/ioctl.h>
#include <linux/types.h>
struct msr_batch_op
{
__u16 cpu; // In: CPU to execute {rd/wr}msr instruction
__u16 isrdmsr; // In: 0=wrmsr, non-zero=rdmsr
__s32 err; // Out: set if error occurred with this operation
__u32 msr; // In: MSR Address to perform operation
__u64 msrdata; // In/Out: Input/Result to/from operation
__u64 wmask; // Out: Write mask applied to wrmsr
};
struct msr_batch_array
{
__u32 numops; // In: # of operations in operations array
struct msr_batch_op *ops; // In: Array[numops] of operations
};
#define X86_IOC_MSR_BATCH _IOWR('c', 0xA2, struct msr_batch_array)
#endif