Print this page
patch lower-case-segops
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/watchpoint.h
+++ new/usr/src/uts/common/sys/watchpoint.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 #ifndef _SYS_WATCHPOINT_H
28 28 #define _SYS_WATCHPOINT_H
29 29
30 30 #pragma ident "%Z%%M% %I% %E% SMI"
31 31
32 32 #include <sys/types.h>
33 33 #include <vm/seg_enum.h>
34 34 #include <sys/copyops.h>
35 35 #include <sys/avl.h>
36 36
37 37 #ifdef __cplusplus
38 38 extern "C" {
39 39 #endif
40 40
41 41 /*
42 42 * Definitions for the VM implementation of watchpoints.
43 43 * See proc(4) and <sys/procfs.h> for definitions of the user interface.
44 44 */
45 45
46 46 /*
47 47 * Each process with watchpoints has a linked list of watched areas.
48 48 * The list is kept sorted by user-level virtual address.
49 49 */
50 50 typedef struct watched_area {
51 51 avl_node_t wa_link; /* link in AVL tree */
52 52 caddr_t wa_vaddr; /* virtual address of watched area */
53 53 caddr_t wa_eaddr; /* virtual address plus size */
54 54 ulong_t wa_flags; /* watch type flags (see <sys/procfs.h>) */
55 55 } watched_area_t;
56 56
57 57 /*
58 58 * The list of watched areas maps into a list of pages with modified
59 59 * protections. The list is kept sorted by user-level virtual address.
60 60 */
61 61 typedef struct watched_page {
62 62 avl_node_t wp_link; /* Link in AVL tree */
63 63 struct watched_page *wp_list; /* link in p_wprot */
64 64 caddr_t wp_vaddr; /* virtual address of this page */
65 65 uchar_t wp_prot; /* modified protection bits */
66 66 uchar_t wp_oprot; /* original protection bits */
↓ open down ↓ |
66 lines elided |
↑ open up ↑ |
67 67 uchar_t wp_umap[3]; /* reference counts of user pr_mappage()s */
68 68 uchar_t wp_kmap[3]; /* reference counts of kernel pr_mappage()s */
69 69 ushort_t wp_flags; /* see below */
70 70 short wp_read; /* number of WA_READ areas in this page */
71 71 short wp_write; /* number of WA_WRITE areas in this page */
72 72 short wp_exec; /* number of WA_EXEC areas in this page */
73 73 } watched_page_t;
74 74
75 75 /* wp_flags */
76 76 #define WP_NOWATCH 0x01 /* protections temporarily restored */
77 -#define WP_SETPROT 0x02 /* SEGOP_SETPROT() needed on this page */
77 +#define WP_SETPROT 0x02 /* segop_setprot() needed on this page */
78 78
79 79 #ifdef _KERNEL
80 80
81 81 /*
82 82 * These functions handle the necessary logic to perform the copy operation
83 83 * while ignoring watchpoints.
84 84 */
85 85 extern int copyin_nowatch(const void *, void *, size_t);
86 86 extern int copyout_nowatch(const void *, void *, size_t);
87 87 extern int fuword32_nowatch(const void *, uint32_t *);
88 88 extern int suword32_nowatch(void *, uint32_t);
89 89 #ifdef _LP64
90 90 extern int suword64_nowatch(void *, uint64_t);
91 91 extern int fuword64_nowatch(const void *, uint64_t *);
92 92 #endif
93 93
94 94 /*
95 95 * Disable watchpoints for a given region of memory. When bracketed by these
96 96 * calls, functions can use copyops and ignore watchpoints.
97 97 */
98 98 extern int watch_disable_addr(const void *, size_t, enum seg_rw);
99 99 extern void watch_enable_addr(const void *, size_t, enum seg_rw);
100 100
101 101 /*
102 102 * Enable/Disable watchpoints for an entire thread.
103 103 */
104 104 extern void watch_enable(kthread_id_t);
105 105 extern void watch_disable(kthread_id_t);
106 106
107 107 struct as;
108 108 struct proc;
109 109 struct k_siginfo;
110 110 extern void setallwatch(void);
111 111 extern int pr_is_watchpage(caddr_t, enum seg_rw);
112 112 extern int pr_is_watchpage_as(caddr_t, enum seg_rw, struct as *);
113 113 extern int pr_is_watchpoint(caddr_t *, int *, size_t, size_t *,
114 114 enum seg_rw);
115 115 extern void do_watch_step(caddr_t, size_t, enum seg_rw, int, greg_t);
116 116 extern int undo_watch_step(struct k_siginfo *);
117 117 extern int wp_compare(const void *, const void *);
118 118 extern int wa_compare(const void *, const void *);
119 119
120 120 extern struct copyops watch_copyops;
121 121
122 122 extern watched_area_t *pr_find_watched_area(struct proc *, watched_area_t *,
123 123 avl_index_t *);
124 124
125 125 #endif
126 126
127 127 #ifdef __cplusplus
128 128 }
129 129 #endif
130 130
131 131 #endif /* _SYS_WATCHPOINT_H */
↓ open down ↓ |
44 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX