57 /*
58 * The list of watched areas maps into a list of pages with modified
59 * protections. The list is kept sorted by user-level virtual address.
60 */
61 typedef struct watched_page {
62 avl_node_t wp_link; /* Link in AVL tree */
63 struct watched_page *wp_list; /* link in p_wprot */
64 caddr_t wp_vaddr; /* virtual address of this page */
65 uchar_t wp_prot; /* modified protection bits */
66 uchar_t wp_oprot; /* original protection bits */
67 uchar_t wp_umap[3]; /* reference counts of user pr_mappage()s */
68 uchar_t wp_kmap[3]; /* reference counts of kernel pr_mappage()s */
69 ushort_t wp_flags; /* see below */
70 short wp_read; /* number of WA_READ areas in this page */
71 short wp_write; /* number of WA_WRITE areas in this page */
72 short wp_exec; /* number of WA_EXEC areas in this page */
73 } watched_page_t;
74
75 /* wp_flags */
76 #define WP_NOWATCH 0x01 /* protections temporarily restored */
77 #define WP_SETPROT 0x02 /* SEGOP_SETPROT() needed on this page */
78
79 #ifdef _KERNEL
80
81 /*
82 * These functions handle the necessary logic to perform the copy operation
83 * while ignoring watchpoints.
84 */
85 extern int copyin_nowatch(const void *, void *, size_t);
86 extern int copyout_nowatch(const void *, void *, size_t);
87 extern int fuword32_nowatch(const void *, uint32_t *);
88 extern int suword32_nowatch(void *, uint32_t);
89 #ifdef _LP64
90 extern int suword64_nowatch(void *, uint64_t);
91 extern int fuword64_nowatch(const void *, uint64_t *);
92 #endif
93
94 /*
95 * Disable watchpoints for a given region of memory. When bracketed by these
96 * calls, functions can use copyops and ignore watchpoints.
97 */
|
57 /*
58 * The list of watched areas maps into a list of pages with modified
59 * protections. The list is kept sorted by user-level virtual address.
60 */
61 typedef struct watched_page {
62 avl_node_t wp_link; /* Link in AVL tree */
63 struct watched_page *wp_list; /* link in p_wprot */
64 caddr_t wp_vaddr; /* virtual address of this page */
65 uchar_t wp_prot; /* modified protection bits */
66 uchar_t wp_oprot; /* original protection bits */
67 uchar_t wp_umap[3]; /* reference counts of user pr_mappage()s */
68 uchar_t wp_kmap[3]; /* reference counts of kernel pr_mappage()s */
69 ushort_t wp_flags; /* see below */
70 short wp_read; /* number of WA_READ areas in this page */
71 short wp_write; /* number of WA_WRITE areas in this page */
72 short wp_exec; /* number of WA_EXEC areas in this page */
73 } watched_page_t;
74
75 /* wp_flags */
76 #define WP_NOWATCH 0x01 /* protections temporarily restored */
77 #define WP_SETPROT 0x02 /* segop_setprot() needed on this page */
78
79 #ifdef _KERNEL
80
81 /*
82 * These functions handle the necessary logic to perform the copy operation
83 * while ignoring watchpoints.
84 */
85 extern int copyin_nowatch(const void *, void *, size_t);
86 extern int copyout_nowatch(const void *, void *, size_t);
87 extern int fuword32_nowatch(const void *, uint32_t *);
88 extern int suword32_nowatch(void *, uint32_t);
89 #ifdef _LP64
90 extern int suword64_nowatch(void *, uint64_t);
91 extern int fuword64_nowatch(const void *, uint64_t *);
92 #endif
93
94 /*
95 * Disable watchpoints for a given region of memory. When bracketed by these
96 * calls, functions can use copyops and ignore watchpoints.
97 */
|