diff options
author | bsd <bsd@FreeBSD.org> | 2001-06-28 02:08:13 +0000 |
---|---|---|
committer | bsd <bsd@FreeBSD.org> | 2001-06-28 02:08:13 +0000 |
commit | 47d3082050d220c6f4d161234ff7a3c4bc03b629 (patch) | |
tree | 5be0ec8cce68f03e921e4e1d2e96c1d0d9b6b38d /sys/amd64/include/cpufunc.h | |
parent | 057bf882e3678d2a8cb0feeaf6c89af57e5074e9 (diff) | |
download | FreeBSD-src-47d3082050d220c6f4d161234ff7a3c4bc03b629.zip FreeBSD-src-47d3082050d220c6f4d161234ff7a3c4bc03b629.tar.gz |
Provide access to the IA32 hardware debug registers from the ddb
kernel debugger. Proper use of these registers allows setting
hardware watchpoints for use in kernel debugging.
MFC after: 2 weeks
Diffstat (limited to 'sys/amd64/include/cpufunc.h')
-rw-r--r-- | sys/amd64/include/cpufunc.h | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 40f5bb7..4a9300a 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -443,6 +443,12 @@ rdr0(void) return (data); } +static __inline void +load_dr0(u_int sel) +{ + __asm __volatile("movl %0,%%dr0" : : "r" (sel)); +} + static __inline u_int rdr1(void) { @@ -451,6 +457,12 @@ rdr1(void) return (data); } +static __inline void +load_dr1(u_int sel) +{ + __asm __volatile("movl %0,%%dr1" : : "r" (sel)); +} + static __inline u_int rdr2(void) { @@ -459,6 +471,12 @@ rdr2(void) return (data); } +static __inline void +load_dr2(u_int sel) +{ + __asm __volatile("movl %0,%%dr2" : : "r" (sel)); +} + static __inline u_int rdr3(void) { @@ -467,6 +485,40 @@ rdr3(void) return (data); } +static __inline void +load_dr3(u_int sel) +{ + __asm __volatile("movl %0,%%dr3" : : "r" (sel)); +} + +static __inline u_int +rdr4(void) +{ + u_int data; + __asm __volatile("movl %%dr4,%0" : "=r" (data)); + return (data); +} + +static __inline void +load_dr4(u_int sel) +{ + __asm __volatile("movl %0,%%dr4" : : "r" (sel)); +} + +static __inline u_int +rdr5(void) +{ + u_int data; + __asm __volatile("movl %%dr5,%0" : "=r" (data)); + return (data); +} + +static __inline void +load_dr5(u_int sel) +{ + __asm __volatile("movl %0,%%dr5" : : "r" (sel)); +} + static __inline u_int rdr6(void) { @@ -475,6 +527,12 @@ rdr6(void) return (data); } +static __inline void +load_dr6(u_int sel) +{ + __asm __volatile("movl %0,%%dr6" : : "r" (sel)); +} + static __inline u_int rdr7(void) { @@ -483,6 +541,12 @@ rdr7(void) return (data); } +static __inline void +load_dr7(u_int sel) +{ + __asm __volatile("movl %0,%%dr7" : : "r" (sel)); +} + static __inline critical_t critical_enter(void) { @@ -545,7 +609,6 @@ 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)); __END_DECLS |