xref: /minix3/minix/kernel/arch/i386/debugreg.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #ifndef __DEBUGREG_H__
2*433d6423SLionel Sambuc #define __DEBUGREG_H__
3*433d6423SLionel Sambuc 
4*433d6423SLionel Sambuc /* DR6: status flags */
5*433d6423SLionel Sambuc #define DR6_B(bp)	(1 << (bp))	/* breakpoint was triggered */
6*433d6423SLionel Sambuc #define DR6_BD		(1 << 13)	/* debug register access detected */
7*433d6423SLionel Sambuc #define DR6_BS		(1 << 14)	/* single step */
8*433d6423SLionel Sambuc #define DR6_BT		(1 << 15)	/* task switch */
9*433d6423SLionel Sambuc 
10*433d6423SLionel Sambuc /* DR7: control flags */
11*433d6423SLionel Sambuc #define	DR7_L(bp)	(1 << (2*(bp)))		/* breakpoint armed locally */
12*433d6423SLionel Sambuc #define	DR7_G(bp)	(1 << (1+2*(bp)))	/* breakpoint armed globally */
13*433d6423SLionel Sambuc #define	DR7_LE		(1 << 8)		/* exact local breakpoints */
14*433d6423SLionel Sambuc #define	DR7_GE		(1 << 9)		/* exact global breakpoints */
15*433d6423SLionel Sambuc #define	DR7_GD		(1 << 13)		/* detect debug reg movs */
16*433d6423SLionel Sambuc 
17*433d6423SLionel Sambuc #define	DR7_RW_MASK(bp)		(3 << (16+4*(bp)))
18*433d6423SLionel Sambuc #define	DR7_RW_EXEC(bp)		(0 << (16+4*(bp)))	/* execute */
19*433d6423SLionel Sambuc #define	DR7_RW_WRITE(bp)	(1 << (16+4*(bp)))	/* write */
20*433d6423SLionel Sambuc #define	DR7_RW_IO(bp)		(2 << (16+4*(bp)))	/* IO */
21*433d6423SLionel Sambuc #define	DR7_RW_RW(bp)		(3 << (16+4*(bp)))	/* read or write */
22*433d6423SLionel Sambuc 
23*433d6423SLionel Sambuc #define	DR7_LN_MASK(bp)	(3 << (18+4*(bp)))
24*433d6423SLionel Sambuc #define	DR7_LN_1(bp)	(0 << (18+4*(bp)))	/* 1 byte */
25*433d6423SLionel Sambuc #define	DR7_LN_2(bp)	(1 << (18+4*(bp)))	/* 2 bytes */
26*433d6423SLionel Sambuc #define	DR7_LN_8(bp)	(2 << (18+4*(bp)))	/* 8 bytes */
27*433d6423SLionel Sambuc #define	DR7_LN_4(bp)	(3 << (18+4*(bp)))	/* 4 bytes */
28*433d6423SLionel Sambuc 
29*433d6423SLionel Sambuc /* debugreg.S */
30*433d6423SLionel Sambuc void ld_dr0(phys_bytes value);
31*433d6423SLionel Sambuc void ld_dr1(phys_bytes value);
32*433d6423SLionel Sambuc void ld_dr2(phys_bytes value);
33*433d6423SLionel Sambuc void ld_dr3(phys_bytes value);
34*433d6423SLionel Sambuc void ld_dr6(unsigned long value);
35*433d6423SLionel Sambuc void ld_dr7(unsigned long value);
36*433d6423SLionel Sambuc phys_bytes st_dr0(void);
37*433d6423SLionel Sambuc phys_bytes st_dr1(void);
38*433d6423SLionel Sambuc phys_bytes st_dr2(void);
39*433d6423SLionel Sambuc phys_bytes st_dr3(void);
40*433d6423SLionel Sambuc unsigned long st_dr6(void);
41*433d6423SLionel Sambuc unsigned long st_dr7(void);
42*433d6423SLionel Sambuc 
43*433d6423SLionel Sambuc #endif /* __DEBUGREG_H__ */
44*433d6423SLionel Sambuc 
45