summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/cpufunc.h
diff options
context:
space:
mode:
authorbsd <bsd@FreeBSD.org>2000-02-20 20:51:23 +0000
committerbsd <bsd@FreeBSD.org>2000-02-20 20:51:23 +0000
commit85f1c223b39c92c49e8b7c6c7ad39d3e42a27574 (patch)
tree24b3d3119a30ef55034eb6483b006f39f272b986 /sys/amd64/include/cpufunc.h
parent5e5e3ebba622666325b5191546c69ed7f00a5781 (diff)
downloadFreeBSD-src-85f1c223b39c92c49e8b7c6c7ad39d3e42a27574.zip
FreeBSD-src-85f1c223b39c92c49e8b7c6c7ad39d3e42a27574.tar.gz
Don't forget to reset the hardware debug registers when a process that
was using them exits. Don't allow a user process to cause the kernel to take a TRCTRAP on a user space address. Reviewed by: jlemon, sef Approved by: jkh
Diffstat (limited to 'sys/amd64/include/cpufunc.h')
-rw-r--r--sys/amd64/include/cpufunc.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 92e74ca..e1968f0 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -452,6 +452,54 @@ load_gs(u_int sel)
__asm __volatile("movl %0,%%gs" : : "rm" (sel));
}
+static __inline u_int
+rdr0(void)
+{
+ u_int data;
+ __asm __volatile("movl %%dr0,%0" : "=rm" (data));
+ return (data);
+}
+
+static __inline u_int
+rdr1(void)
+{
+ u_int data;
+ __asm __volatile("movl %%dr1,%0" : "=rm" (data));
+ return (data);
+}
+
+static __inline u_int
+rdr2(void)
+{
+ u_int data;
+ __asm __volatile("movl %%dr2,%0" : "=rm" (data));
+ return (data);
+}
+
+static __inline u_int
+rdr3(void)
+{
+ u_int data;
+ __asm __volatile("movl %%dr3,%0" : "=rm" (data));
+ return (data);
+}
+
+static __inline u_int
+rdr6(void)
+{
+ u_int data;
+ __asm __volatile("movl %%dr6,%0" : "=rm" (data));
+ return (data);
+}
+
+static __inline u_int
+rdr7(void)
+{
+ u_int data;
+ __asm __volatile("movl %%dr7,%0" : "=rm" (data));
+ return (data);
+}
+
#else /* !__GNUC__ */
int breakpoint __P((void));
@@ -497,5 +545,7 @@ void ltr __P((u_short sel));
u_int rcr0 __P((void));
u_int rcr3 __P((void));
u_int rcr4 __P((void));
+void load_dr6 __P((u_int dr6));
+void reset_dbregs __P((void));
#endif /* !_MACHINE_CPUFUNC_H_ */
OpenPOWER on IntegriCloud