summaryrefslogtreecommitdiffstats
path: root/sys/sys/cpuctl.h
diff options
context:
space:
mode:
authorstas <stas@FreeBSD.org>2009-06-30 12:35:47 +0000
committerstas <stas@FreeBSD.org>2009-06-30 12:35:47 +0000
commit9a7ae64d553bf11e4648a25b3c383630165c81f8 (patch)
tree0c67a0c6d6ba2ea6cf40b29b3fd2cfa4a7071ba9 /sys/sys/cpuctl.h
parent19735eeae0f563e449b7002c86c2920fcc4012d4 (diff)
downloadFreeBSD-src-9a7ae64d553bf11e4648a25b3c383630165c81f8.zip
FreeBSD-src-9a7ae64d553bf11e4648a25b3c383630165c81f8.tar.gz
- Add support to atomically set/clear individual bits of a MSR register
via cpuctl(4) driver. Two new CPUCTL_MSRSBIT and CPUCTL_MSRCBIT ioctl(2) calls treat the data field of the argument struct passed as a mask and set/clear bits of the MSR register according to the mask value. - Allow user to perform atomic bitwise AND and OR operaions on MSR registers via cpucontrol(8) utility. Two new operations ("&=" and "|=") have been added. The first one applies bitwise AND operaion between the current contents of the MSR register and the mask, and the second performs bitwise OR. The argument can be optionally prefixed with "~" inversion operator. This allows one to mimic the "clear bit" behavior by using the command like this: cpucontrol -m 0x10&=~0x02 # clear the second bit of TSC MSR Inversion operator support in all modes (assignment, OR, AND). Approved by: re (kib) MFC after: 1 month
Diffstat (limited to 'sys/sys/cpuctl.h')
-rw-r--r--sys/sys/cpuctl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sys/cpuctl.h b/sys/sys/cpuctl.h
index 57b5acf..4bddb34 100644
--- a/sys/sys/cpuctl.h
+++ b/sys/sys/cpuctl.h
@@ -48,5 +48,7 @@ typedef struct {
#define CPUCTL_WRMSR _IOWR('c', 2, cpuctl_msr_args_t)
#define CPUCTL_CPUID _IOWR('c', 3, cpuctl_cpuid_args_t)
#define CPUCTL_UPDATE _IOWR('c', 4, cpuctl_update_args_t)
+#define CPUCTL_MSRSBIT _IOWR('c', 5, cpuctl_msr_args_t)
+#define CPUCTL_MSRCBIT _IOWR('c', 6, cpuctl_msr_args_t)
#endif /* _CPUCTL_H_ */
OpenPOWER on IntegriCloud