aboutsummaryrefslogtreecommitdiff
path: root/sys/x86/include
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-08-02 19:52:26 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-08-05 15:46:37 +0000
commitd0bc4b466683d17b84f9acafe4c3cc746f860dbf (patch)
tree0d524368fde72f934c4751c5b9194896b15b1ae4 /sys/x86/include
parent245ec7651e4221043d1032fb3f82f335dc65fc7f (diff)
downloadsrc-d0bc4b466683d17b84f9acafe4c3cc746f860dbf.tar.gz
src-d0bc4b466683d17b84f9acafe4c3cc746f860dbf.zip
x86_msr_op: extend the KPI to allow MSR read and single-CPU operations
Reivewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31386
Diffstat (limited to 'sys/x86/include')
-rw-r--r--sys/x86/include/x86_var.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h
index 983c353327fd..0fdff68638cf 100644
--- a/sys/x86/include/x86_var.h
+++ b/sys/x86/include/x86_var.h
@@ -154,12 +154,24 @@ int user_dbreg_trap(register_t dr6);
int minidumpsys(struct dumperinfo *);
struct pcb *get_pcb_td(struct thread *td);
+/*
+ * MSR ops for x86_msr_op()
+ */
#define MSR_OP_ANDNOT 0x00000001
#define MSR_OP_OR 0x00000002
#define MSR_OP_WRITE 0x00000003
+#define MSR_OP_READ 0x00000004
+
+/*
+ * Where and which execution mode
+ */
#define MSR_OP_LOCAL 0x10000000
-#define MSR_OP_SCHED 0x20000000
-#define MSR_OP_RENDEZVOUS 0x30000000
-void x86_msr_op(u_int msr, u_int op, uint64_t arg1);
+#define MSR_OP_SCHED_ALL 0x20000000
+#define MSR_OP_SCHED_ONE 0x30000000
+#define MSR_OP_RENDEZVOUS_ALL 0x40000000
+#define MSR_OP_RENDEZVOUS_ONE 0x50000000
+#define MSR_OP_CPUID(id) ((id) << 8)
+
+void x86_msr_op(u_int msr, u_int op, uint64_t arg1, uint64_t *res);
#endif