diff options
author | peter <peter@FreeBSD.org> | 2004-01-28 23:54:31 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2004-01-28 23:54:31 +0000 |
commit | 5e45c69f41132d5a819ecab326491bcbd30b567d (patch) | |
tree | 1115639665e30511d19194342ed44ec6f676c7ed /sys/amd64 | |
parent | 9ba1ee132deb530c3e9886e6482d14e12f89e8be (diff) | |
download | FreeBSD-src-5e45c69f41132d5a819ecab326491bcbd30b567d.zip FreeBSD-src-5e45c69f41132d5a819ecab326491bcbd30b567d.tar.gz |
Add dbreg struct definitions for /proc/*/dbregs and a place to store the
registers in the pcb
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/include/pcb.h | 11 | ||||
-rw-r--r-- | sys/amd64/include/reg.h | 15 |
2 files changed, 23 insertions, 3 deletions
diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h index 1d909cd..311c473 100644 --- a/sys/amd64/include/pcb.h +++ b/sys/amd64/include/pcb.h @@ -64,11 +64,18 @@ struct pcb { u_int32_t pcb_es; u_int32_t pcb_fs; u_int32_t pcb_gs; + u_int64_t pcb_dr0; + u_int64_t pcb_dr1; + u_int64_t pcb_dr2; + u_int64_t pcb_dr3; + u_int64_t pcb_dr6; + u_int64_t pcb_dr7; struct savefpu pcb_save; u_long pcb_flags; -#define PCB_FPUINITDONE 0x01 /* fpu state is initialized */ -#define PCB_FULLCTX 0x02 /* full context restore on sysret */ +#define PCB_DBREGS 0x02 /* process using debug registers */ +#define PCB_FPUINITDONE 0x08 /* fpu state is initialized */ +#define PCB_FULLCTX 0x80 /* full context restore on sysret */ caddr_t pcb_onfault; /* copyin/out fault recovery */ }; diff --git a/sys/amd64/include/reg.h b/sys/amd64/include/reg.h index 73b52d7..0bbf808 100644 --- a/sys/amd64/include/reg.h +++ b/sys/amd64/include/reg.h @@ -84,10 +84,23 @@ struct fpreg { unsigned long fpr_spare[12]; }; +/* + * Register set accessible via /proc/$pid/dbregs. + */ struct dbreg { - unsigned long grrr; + unsigned long dr[16]; /* debug registers */ + /* Index 0-3: debug address registers */ + /* Index 4-5: reserved */ + /* Index 6: debug status */ + /* Index 7: debug control */ + /* Index 8-15: reserved */ }; +#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)->dr[(x)]) /* reference dr0 - dr15 by + register number */ #ifdef _KERNEL /* * XXX these interfaces are MI, so they should be declared in a MI place. |