summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/msr.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-09-01 01:16:57 +0400
committerH. Peter Anvin <hpa@zytor.com>2009-09-01 03:16:04 +0400
commitff55df53dfdd338906c8ba9d1f4a759b86b869d5 (patch)
tree80ccb646dfd40beeb839d4c70624ba34dbcd5795 /arch/x86/include/asm/msr.h
parent8b956bf1f0f2b552ed93cf6cafe823edff298b3b (diff)
downloadlinux-ff55df53dfdd338906c8ba9d1f4a759b86b869d5.tar.xz
x86, msr: Export the register-setting MSR functions via /dev/*/msr
Make it possible to access the all-register-setting/getting MSR functions via the MSR driver. This is implemented as an ioctl() on the standard MSR device node. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Borislav Petkov <petkovbb@gmail.com>
Diffstat (limited to 'arch/x86/include/asm/msr.h')
-rw-r--r--arch/x86/include/asm/msr.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 8e56712aa176..7e2b6ba962ff 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -3,10 +3,16 @@
#include <asm/msr-index.h>
-#ifdef __KERNEL__
#ifndef __ASSEMBLY__
#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define X86_IOC_RDMSR_REGS _IOWR('c', 0xA0, __u32[8])
+#define X86_IOC_WRMSR_REGS _IOWR('c', 0xA1, __u32[8])
+
+#ifdef __KERNEL__
+
#include <asm/asm.h>
#include <asm/errno.h>
#include <asm/cpumask.h>
@@ -286,6 +292,6 @@ static inline int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8])
return wrmsr_safe_regs(regs);
}
#endif /* CONFIG_SMP */
-#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
+#endif /* __ASSEMBLY__ */
#endif /* _ASM_X86_MSR_H */