From 878d7f2499e7a2f9817e11c882877596b0ef8ec5 Mon Sep 17 00:00:00 2001 From: bsd Date: Thu, 21 Sep 2000 17:07:27 +0000 Subject: Add a couple of debug register helper functions to assist in setting and clearing watchpoints. Reviewed by: jwd@FreeBSD.org, -hackers@ --- sys/amd64/include/reg.h | 6 ++++++ sys/amd64/include/sysarch.h | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'sys/amd64/include') diff --git a/sys/amd64/include/reg.h b/sys/amd64/include/reg.h index 6effd1a..47856a3 100644 --- a/sys/amd64/include/reg.h +++ b/sys/amd64/include/reg.h @@ -132,6 +132,12 @@ struct dbreg { unsigned int dr7; /* debug control register */ }; +#define DBREG_DR7_EXEC 0x00 /* break on execute */ +#define DBREG_DR7_WRONLY 0x01 /* break on write */ +#define DBREG_DR7_RDWR 0x03 /* break on read or write */ +#define DBREG_DRX(d,x) ((&d->dr0)[x]) /* reference dr0 - dr7 by + register number */ + #ifdef _KERNEL /* diff --git a/sys/amd64/include/sysarch.h b/sys/amd64/include/sysarch.h index 01e63c5..7e355af 100644 --- a/sys/amd64/include/sysarch.h +++ b/sys/amd64/include/sysarch.h @@ -68,6 +68,7 @@ struct i386_vm86_args { #include union descriptor; +struct dbreg; __BEGIN_DECLS int i386_get_ldt __P((int, union descriptor *, int)); @@ -75,6 +76,9 @@ int i386_set_ldt __P((int, union descriptor *, int)); int i386_get_ioperm __P((unsigned int, unsigned int *, int *)); int i386_set_ioperm __P((unsigned int, unsigned int, int)); int i386_vm86 __P((int, void *)); +int i386_set_watch __P((int watchnum, unsigned int watchaddr, int size, + int access, struct dbreg * d)); +int i386_clr_watch __P((int watchnum, struct dbreg * d)); __END_DECLS #endif -- cgit v1.1