108 kmutex_t a_contents; /* protect certain fields in the structure */
109 uchar_t a_flags; /* as attributes */
110 uchar_t a_vbits; /* used for collecting statistics */
111 kcondvar_t a_cv; /* used by as_rangelock */
112 struct hat *a_hat; /* hat structure */
113 struct hrmstat *a_hrm; /* ref and mod bits */
114 caddr_t a_userlimit; /* highest allowable address in this as */
115 struct seg *a_seglast; /* last segment hit on the addr space */
116 krwlock_t a_lock; /* protects segment related fields */
117 size_t a_size; /* total size of address space */
118 struct seg *a_lastgap; /* last seg found by as_gap() w/ AS_HI (mmap) */
119 struct seg *a_lastgaphl; /* last seg saved in as_gap() either for */
120 /* AS_HI or AS_LO used in as_addseg() */
121 avl_tree_t a_segtree; /* segments in this address space. (AVL tree) */
122 avl_tree_t a_wpage; /* watched pages (procfs) */
123 uchar_t a_updatedir; /* mappings changed, rebuild a_objectdir */
124 timespec_t a_updatetime; /* time when mappings last changed */
125 vnode_t **a_objectdir; /* object directory (procfs) */
126 size_t a_sizedir; /* size of object directory */
127 struct as_callback *a_callbacks; /* callback list */
128 void *a_xhat; /* list of xhat providers */
129 proc_t *a_proc; /* back pointer to proc */
130 size_t a_resvsize; /* size of reserved part of address space */
131 };
132
133 #define AS_PAGLCK 0x80
134 #define AS_CLAIMGAP 0x40
135 #define AS_UNMAPWAIT 0x20
136 #define AS_NEEDSPURGE 0x10 /* mostly for seg_nf, see as_purge() */
137 #define AS_NOUNMAPWAIT 0x02
138 #define AS_BUSY 0x01 /* needed by XHAT framework */
139
140 #define AS_ISPGLCK(as) ((as)->a_flags & AS_PAGLCK)
141 #define AS_ISCLAIMGAP(as) ((as)->a_flags & AS_CLAIMGAP)
142 #define AS_ISUNMAPWAIT(as) ((as)->a_flags & AS_UNMAPWAIT)
143 #define AS_ISBUSY(as) ((as)->a_flags & AS_BUSY)
144 #define AS_ISNOUNMAPWAIT(as) ((as)->a_flags & AS_NOUNMAPWAIT)
145
146 #define AS_SETPGLCK(as) ((as)->a_flags |= AS_PAGLCK)
147 #define AS_SETCLAIMGAP(as) ((as)->a_flags |= AS_CLAIMGAP)
148 #define AS_SETUNMAPWAIT(as) ((as)->a_flags |= AS_UNMAPWAIT)
149 #define AS_SETBUSY(as) ((as)->a_flags |= AS_BUSY)
150 #define AS_SETNOUNMAPWAIT(as) ((as)->a_flags |= AS_NOUNMAPWAIT)
151
152 #define AS_CLRPGLCK(as) ((as)->a_flags &= ~AS_PAGLCK)
153 #define AS_CLRCLAIMGAP(as) ((as)->a_flags &= ~AS_CLAIMGAP)
154 #define AS_CLRUNMAPWAIT(as) ((as)->a_flags &= ~AS_UNMAPWAIT)
155 #define AS_CLRBUSY(as) ((as)->a_flags &= ~AS_BUSY)
156 #define AS_CLRNOUNMAPWAIT(as) ((as)->a_flags &= ~AS_NOUNMAPWAIT)
157
158 #define AS_TYPE_64BIT(as) \
159 (((as)->a_userlimit > (caddr_t)UINT32_MAX) ? 1 : 0)
160
161 /*
162 * Flags for as_map/as_map_ansegs
163 */
164 #define AS_MAP_NO_LPOOB ((uint_t)-1)
165 #define AS_MAP_HEAP ((uint_t)-2)
166 #define AS_MAP_STACK ((uint_t)-3)
167
168 /*
169 * The as_callback is the basic structure which supports the ability to
170 * inform clients of specific events pertaining to address space management.
171 * A user calls as_add_callback to register an address space callback
172 * for a range of pages, specifying the events that need to occur.
173 * When as_do_callbacks is called and finds a 'matching' entry, the
174 * callback is called once, and the callback function MUST call
175 * as_delete_callback when all callback activities are complete.
|
108 kmutex_t a_contents; /* protect certain fields in the structure */
109 uchar_t a_flags; /* as attributes */
110 uchar_t a_vbits; /* used for collecting statistics */
111 kcondvar_t a_cv; /* used by as_rangelock */
112 struct hat *a_hat; /* hat structure */
113 struct hrmstat *a_hrm; /* ref and mod bits */
114 caddr_t a_userlimit; /* highest allowable address in this as */
115 struct seg *a_seglast; /* last segment hit on the addr space */
116 krwlock_t a_lock; /* protects segment related fields */
117 size_t a_size; /* total size of address space */
118 struct seg *a_lastgap; /* last seg found by as_gap() w/ AS_HI (mmap) */
119 struct seg *a_lastgaphl; /* last seg saved in as_gap() either for */
120 /* AS_HI or AS_LO used in as_addseg() */
121 avl_tree_t a_segtree; /* segments in this address space. (AVL tree) */
122 avl_tree_t a_wpage; /* watched pages (procfs) */
123 uchar_t a_updatedir; /* mappings changed, rebuild a_objectdir */
124 timespec_t a_updatetime; /* time when mappings last changed */
125 vnode_t **a_objectdir; /* object directory (procfs) */
126 size_t a_sizedir; /* size of object directory */
127 struct as_callback *a_callbacks; /* callback list */
128 proc_t *a_proc; /* back pointer to proc */
129 size_t a_resvsize; /* size of reserved part of address space */
130 };
131
132 #define AS_PAGLCK 0x80
133 #define AS_CLAIMGAP 0x40
134 #define AS_UNMAPWAIT 0x20
135 #define AS_NEEDSPURGE 0x10 /* mostly for seg_nf, see as_purge() */
136 #define AS_NOUNMAPWAIT 0x02
137
138 #define AS_ISPGLCK(as) ((as)->a_flags & AS_PAGLCK)
139 #define AS_ISCLAIMGAP(as) ((as)->a_flags & AS_CLAIMGAP)
140 #define AS_ISUNMAPWAIT(as) ((as)->a_flags & AS_UNMAPWAIT)
141 #define AS_ISNOUNMAPWAIT(as) ((as)->a_flags & AS_NOUNMAPWAIT)
142
143 #define AS_SETPGLCK(as) ((as)->a_flags |= AS_PAGLCK)
144 #define AS_SETCLAIMGAP(as) ((as)->a_flags |= AS_CLAIMGAP)
145 #define AS_SETUNMAPWAIT(as) ((as)->a_flags |= AS_UNMAPWAIT)
146 #define AS_SETNOUNMAPWAIT(as) ((as)->a_flags |= AS_NOUNMAPWAIT)
147
148 #define AS_CLRPGLCK(as) ((as)->a_flags &= ~AS_PAGLCK)
149 #define AS_CLRCLAIMGAP(as) ((as)->a_flags &= ~AS_CLAIMGAP)
150 #define AS_CLRUNMAPWAIT(as) ((as)->a_flags &= ~AS_UNMAPWAIT)
151 #define AS_CLRNOUNMAPWAIT(as) ((as)->a_flags &= ~AS_NOUNMAPWAIT)
152
153 #define AS_TYPE_64BIT(as) \
154 (((as)->a_userlimit > (caddr_t)UINT32_MAX) ? 1 : 0)
155
156 /*
157 * Flags for as_map/as_map_ansegs
158 */
159 #define AS_MAP_NO_LPOOB ((uint_t)-1)
160 #define AS_MAP_HEAP ((uint_t)-2)
161 #define AS_MAP_STACK ((uint_t)-3)
162
163 /*
164 * The as_callback is the basic structure which supports the ability to
165 * inform clients of specific events pertaining to address space management.
166 * A user calls as_add_callback to register an address space callback
167 * for a range of pages, specifying the events that need to occur.
168 * When as_do_callbacks is called and finds a 'matching' entry, the
169 * callback is called once, and the callback function MUST call
170 * as_delete_callback when all callback activities are complete.
|