Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/fs/proc/prdata.h
+++ new/usr/src/uts/common/fs/proc/prdata.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 (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
|
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 */
21 21 /*
22 22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
27 27 /* All Rights Reserved */
28 28
29 29 /*
30 - * Copyright 2018 Joyent, Inc.
30 + * Copyright 2019 Joyent, Inc.
31 31 * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
32 32 * Copyright 2023 Oxide Computer Company
33 33 */
34 34
35 35 #ifndef _SYS_PROC_PRDATA_H
36 36 #define _SYS_PROC_PRDATA_H
37 37
38 38 #include <sys/isa_defs.h>
39 39 #include <sys/proc.h>
40 40 #include <sys/vnode.h>
41 41 #include <sys/prsystm.h>
42 42 #include <sys/model.h>
43 43 #include <sys/poll.h>
44 44 #include <sys/list.h>
45 45
46 46 #ifdef __cplusplus
47 47 extern "C" {
48 48 #endif
49 49
50 50 /*
51 51 * Test for thread being stopped, not on an event of interest,
52 52 * but with a directed stop in effect.
53 53 */
54 54 #define DSTOPPED(t) \
55 55 ((t)->t_state == TS_STOPPED && \
56 56 ((t)->t_proc_flag & TP_PRSTOP))
57 57
58 58 #define round4(r) (((r) + 3) & (~3))
59 59 #define round8(r) (((r) + 7) & (~7))
60 60 #define round16(r) (((r) + 15) & (~15))
61 61 #define roundlong(r) (((r) + sizeof (long) - 1) & (~(sizeof (long) - 1)))
62 62
63 63 #define PNSIZ 10 /* max size of /proc name entries */
64 64 #define PLNSIZ 10 /* max size of /proc lwp name entries */
65 65
66 66 /*
67 67 * Common file object to which all /proc vnodes for a specific process
68 68 * or lwp refer. One for the process, one for each lwp.
69 69 */
70 70 typedef struct prcommon {
71 71 kmutex_t prc_mutex; /* to wait for the proc/lwp to stop */
72 72 kcondvar_t prc_wait; /* to wait for the proc/lwp to stop */
73 73 ushort_t prc_flags; /* flags */
74 74 uint_t prc_writers; /* number of write opens of prnodes */
75 75 uint_t prc_selfopens; /* number of write opens by self */
76 76 pid_t prc_pid; /* process id */
77 77 model_t prc_datamodel; /* data model of the process */
78 78 proc_t *prc_proc; /* process being traced */
79 79 kthread_t *prc_thread; /* thread (lwp) being traced */
80 80 int prc_slot; /* procdir slot number */
81 81 id_t prc_tid; /* thread (lwp) id */
82 82 int prc_tslot; /* lwpdir slot number, -1 if reaped */
83 83 int prc_refcnt; /* this structure's reference count */
84 84 struct pollhead prc_pollhead; /* list of all pollers */
85 85 } prcommon_t;
86 86
87 87 /* prc_flags */
88 88 #define PRC_DESTROY 0x01 /* process or lwp is being destroyed */
89 89 #define PRC_LWP 0x02 /* structure refers to an lwp */
90 90 #define PRC_SYS 0x04 /* process is a system process */
91 91 #define PRC_POLL 0x08 /* poll() in progress on this process/lwp */
92 92 #define PRC_EXCL 0x10 /* exclusive access granted (old /proc) */
93 93
94 94 /*
95 95 * Macros for mapping between i-numbers and pids.
96 96 */
97 97 #define pmkino(tslot, pslot, nodetype) \
98 98 (((((ino_t)(tslot) << nproc_highbit) | \
99 99 (ino_t)(pslot)) << 6) | \
100 100 (nodetype) + 2)
101 101
102 102 /* for old /proc interface */
103 103 #define PRBIAS 64
104 104 #define ptoi(n) ((int)(((n) + PRBIAS))) /* pid to i-number */
105 105
106 106 /*
107 107 * Node types for /proc files (directories and files contained therein).
108 108 */
109 109 typedef enum prnodetype {
110 110 PR_PROCDIR, /* /proc */
111 111 PR_SELF, /* /proc/self */
112 112 PR_PIDDIR, /* /proc/<pid> */
113 113 PR_AS, /* /proc/<pid>/as */
114 114 PR_CTL, /* /proc/<pid>/ctl */
115 115 PR_STATUS, /* /proc/<pid>/status */
116 116 PR_LSTATUS, /* /proc/<pid>/lstatus */
117 117 PR_PSINFO, /* /proc/<pid>/psinfo */
|
↓ open down ↓ |
77 lines elided |
↑ open up ↑ |
118 118 PR_LPSINFO, /* /proc/<pid>/lpsinfo */
119 119 PR_MAP, /* /proc/<pid>/map */
120 120 PR_RMAP, /* /proc/<pid>/rmap */
121 121 PR_XMAP, /* /proc/<pid>/xmap */
122 122 PR_CRED, /* /proc/<pid>/cred */
123 123 PR_SIGACT, /* /proc/<pid>/sigact */
124 124 PR_AUXV, /* /proc/<pid>/auxv */
125 125 #if defined(__i386) || defined(__amd64)
126 126 PR_LDT, /* /proc/<pid>/ldt */
127 127 #endif
128 + PR_ARGV, /* /proc/<pid>/argv */
129 + PR_CMDLINE, /* /proc/<pid>/cmdline */
128 130 PR_USAGE, /* /proc/<pid>/usage */
129 131 PR_LUSAGE, /* /proc/<pid>/lusage */
130 132 PR_PAGEDATA, /* /proc/<pid>/pagedata */
131 133 PR_WATCH, /* /proc/<pid>/watch */
132 134 PR_CURDIR, /* /proc/<pid>/cwd */
133 135 PR_ROOTDIR, /* /proc/<pid>/root */
134 136 PR_FDDIR, /* /proc/<pid>/fd */
135 137 PR_FD, /* /proc/<pid>/fd/nn */
136 138 PR_FDINFODIR, /* /proc/<pid>/fdinfo */
137 139 PR_FDINFO, /* /proc/<pid>/fdinfo/nn */
138 140 PR_OBJECTDIR, /* /proc/<pid>/object */
139 141 PR_OBJECT, /* /proc/<pid>/object/xxx */
140 142 PR_LWPDIR, /* /proc/<pid>/lwp */
141 143 PR_LWPIDDIR, /* /proc/<pid>/lwp/<lwpid> */
142 144 PR_LWPCTL, /* /proc/<pid>/lwp/<lwpid>/lwpctl */
143 145 PR_LWPNAME, /* /proc/<pid>/lwp/<lwpid>/lwpname */
144 146 PR_LWPSTATUS, /* /proc/<pid>/lwp/<lwpid>/lwpstatus */
145 147 PR_LWPSINFO, /* /proc/<pid>/lwp/<lwpid>/lwpsinfo */
146 148 PR_LWPUSAGE, /* /proc/<pid>/lwp/<lwpid>/lwpusage */
147 149 PR_XREGS, /* /proc/<pid>/lwp/<lwpid>/xregs */
148 150 PR_TMPLDIR, /* /proc/<pid>/lwp/<lwpid>/templates */
149 151 PR_TMPL, /* /proc/<pid>/lwp/<lwpid>/templates/<id> */
150 152 PR_SPYMASTER, /* /proc/<pid>/lwp/<lwpid>/spymaster */
151 153 #if defined(__sparc)
152 154 PR_GWINDOWS, /* /proc/<pid>/lwp/<lwpid>/gwindows */
153 155 PR_ASRS, /* /proc/<pid>/lwp/<lwpid>/asrs */
154 156 #endif
155 157 PR_PRIV, /* /proc/<pid>/priv */
156 158 PR_PATHDIR, /* /proc/<pid>/path */
157 159 PR_PATH, /* /proc/<pid>/path/xxx */
158 160 PR_CTDIR, /* /proc/<pid>/contracts */
159 161 PR_CT, /* /proc/<pid>/contracts/<ctid> */
160 162 PR_SECFLAGS, /* /proc/<pid>/secflags */
161 163 PR_PIDFILE, /* old process file */
162 164 PR_LWPIDFILE, /* old lwp file */
163 165 PR_OPAGEDATA, /* old page data file */
164 166 PR_NFILES /* number of /proc node types */
165 167 } prnodetype_t;
166 168
167 169 typedef struct prnode {
168 170 vnode_t *pr_next; /* list of all vnodes for process */
169 171 uint_t pr_flags; /* private flags */
170 172 kmutex_t pr_mutex; /* locks pr_files and child pr_flags */
171 173 prnodetype_t pr_type; /* node type */
172 174 mode_t pr_mode; /* file mode */
173 175 ino_t pr_ino; /* node id (for stat(2)) */
174 176 uint_t pr_hatid; /* hat layer id for page data files */
175 177 prcommon_t *pr_common; /* common data structure */
176 178 prcommon_t *pr_pcommon; /* process common data structure */
177 179 vnode_t *pr_parent; /* parent directory */
178 180 vnode_t **pr_files; /* contained files array (directory) */
179 181 uint_t pr_index; /* position within parent */
180 182 vnode_t *pr_pidfile; /* substitute vnode for old /proc */
181 183 vnode_t *pr_realvp; /* real vnode, file in object,fd dirs */
182 184 proc_t *pr_owner; /* the process that created this node */
183 185 vnode_t *pr_vnode; /* pointer to vnode */
184 186 struct contract *pr_contract; /* contract pointer */
185 187 int pr_cttype; /* active template type */
186 188 } prnode_t;
187 189
188 190 /*
189 191 * Values for pr_flags.
190 192 */
191 193 #define PR_INVAL 0x01 /* vnode is invalidated */
192 194 #define PR_ISSELF 0x02 /* vnode is a self-open */
193 195 #define PR_AOUT 0x04 /* vnode is for an a.out path */
194 196 #define PR_OFFMAX 0x08 /* vnode is a large file open */
195 197
196 198 /*
197 199 * Conversion macros.
198 200 */
199 201 #define VTOP(vp) ((struct prnode *)(vp)->v_data)
200 202 #define PTOV(pnp) ((pnp)->pr_vnode)
201 203
202 204 /*
203 205 * Flags to prlock().
204 206 */
205 207 #define ZNO 0 /* Fail on encountering a zombie process. */
206 208 #define ZYES 1 /* Allow zombies. */
207 209
208 210 /*
209 211 * Assign one set to another (possible different sizes).
210 212 *
211 213 * Assigning to a smaller set causes members to be lost.
212 214 * Assigning to a larger set causes extra members to be cleared.
213 215 */
214 216 #define prassignset(ap, sp) \
215 217 { \
216 218 register int _i_ = sizeof (*(ap))/sizeof (uint32_t); \
217 219 while (--_i_ >= 0) \
218 220 ((uint32_t *)(ap))[_i_] = \
219 221 (_i_ >= sizeof (*(sp))/sizeof (uint32_t)) ? \
220 222 0 : ((uint32_t *)(sp))[_i_]; \
221 223 }
222 224
223 225 /*
224 226 * Determine whether or not a set (of arbitrary size) is empty.
225 227 */
226 228 #define prisempty(sp) \
227 229 setisempty((uint32_t *)(sp), \
228 230 (uint_t)(sizeof (*(sp)) / sizeof (uint32_t)))
229 231
230 232 /*
231 233 * Resource usage with times as hrtime_t rather than timestruc_t.
232 234 * Each member exactly matches the corresponding member in prusage_t.
233 235 * This is for convenience of internal computation.
234 236 */
235 237 typedef struct prhusage {
236 238 id_t pr_lwpid; /* lwp id. 0: process or defunct */
237 239 int pr_count; /* number of contributing lwps */
238 240 hrtime_t pr_tstamp; /* current time stamp */
239 241 hrtime_t pr_create; /* process/lwp creation time stamp */
240 242 hrtime_t pr_term; /* process/lwp termination time stamp */
241 243 hrtime_t pr_rtime; /* total lwp real (elapsed) time */
242 244 hrtime_t pr_utime; /* user level CPU time */
243 245 hrtime_t pr_stime; /* system call CPU time */
244 246 hrtime_t pr_ttime; /* other system trap CPU time */
245 247 hrtime_t pr_tftime; /* text page fault sleep time */
246 248 hrtime_t pr_dftime; /* data page fault sleep time */
247 249 hrtime_t pr_kftime; /* kernel page fault sleep time */
248 250 hrtime_t pr_ltime; /* user lock wait sleep time */
249 251 hrtime_t pr_slptime; /* all other sleep time */
250 252 hrtime_t pr_wtime; /* wait-cpu (latency) time */
251 253 hrtime_t pr_stoptime; /* stopped time */
252 254 hrtime_t filltime[6]; /* filler for future expansion */
253 255 uint64_t pr_minf; /* minor page faults */
254 256 uint64_t pr_majf; /* major page faults */
255 257 uint64_t pr_nswap; /* swaps */
256 258 uint64_t pr_inblk; /* input blocks */
257 259 uint64_t pr_oublk; /* output blocks */
258 260 uint64_t pr_msnd; /* messages sent */
259 261 uint64_t pr_mrcv; /* messages received */
260 262 uint64_t pr_sigs; /* signals received */
261 263 uint64_t pr_vctx; /* voluntary context switches */
262 264 uint64_t pr_ictx; /* involuntary context switches */
263 265 uint64_t pr_sysc; /* system calls */
264 266 uint64_t pr_ioch; /* chars read and written */
265 267 uint64_t filler[10]; /* filler for future expansion */
266 268 } prhusage_t;
267 269
268 270 #if defined(_KERNEL)
269 271
270 272 /* Exclude system processes from this test */
271 273 #define PROCESS_NOT_32BIT(p) \
272 274 (!((p)->p_flag & SSYS) && (p)->p_as != &kas && \
273 275 (p)->p_model != DATAMODEL_ILP32)
274 276
275 277 extern int prnwatch; /* number of supported watchpoints */
276 278 extern int nproc_highbit; /* highbit(v.v_nproc) */
277 279
278 280 extern struct vnodeops *prvnodeops;
279 281
280 282 /*
281 283 * Generic chained copyout buffers for procfs use.
282 284 * In order to prevent procfs from making huge oversize kmem_alloc calls,
283 285 * a list of smaller buffers can be concatenated and copied to userspace in
284 286 * sequence.
285 287 *
286 288 * The implementation is opaque.
287 289 *
288 290 * A user of this will perform the following steps:
289 291 *
290 292 * list_t listhead;
291 293 * struct my *mp;
292 294 *
293 295 * pr_iol_initlist(&listhead, sizeof (*mp), n);
294 296 * while (whatever) {
295 297 * mp = pr_iol_newbuf(&listhead, sizeof (*mp));
296 298 * ...
297 299 * error = ...
298 300 * }
299 301 *
300 302 * When done, depending on whether copyout() or uiomove() is supposed to
301 303 * be used for transferring the buffered data to userspace, call either:
302 304 *
303 305 * error = pr_iol_copyout_and_free(&listhead, &cmaddr, error);
304 306 *
305 307 * or else:
306 308 *
307 309 * error = pr_iol_uiomove_and_free(&listhead, uiop, error);
308 310 *
309 311 * These two functions will in any case kmem_free() all list items, but
310 312 * if an error occurred before they will not perform the copyout/uiomove.
311 313 * If copyout/uiomove are done, the passed target address / uio_t
312 314 * are updated. The error returned will either be the one passed in, or
313 315 * the error that occurred during copyout/uiomove.
314 316 */
315 317
316 318 extern void pr_iol_initlist(list_t *head, size_t itemsize, int nitems);
317 319 extern void * pr_iol_newbuf(list_t *head, size_t itemsize);
318 320 extern int pr_iol_copyout_and_free(list_t *head, caddr_t *tgt, int errin);
319 321 extern int pr_iol_uiomove_and_free(list_t *head, uio_t *uiop, int errin);
320 322 extern void pr_iol_freelist(list_t *);
321 323
322 324 #if defined(_SYSCALL32_IMPL)
323 325
324 326 extern int prwritectl32(vnode_t *, struct uio *, cred_t *);
325 327 extern void prgetaction32(proc_t *, user_t *, uint_t, struct sigaction32 *);
326 328 extern void prcvtusage32(struct prhusage *, prusage32_t *);
327 329
328 330 #endif /* _SYSCALL32_IMPL */
329 331
330 332 /* kludge to support old /proc interface */
331 333 #if !defined(_SYS_OLD_PROCFS_H)
332 334 extern int prgetmap(proc_t *, int, list_t *);
333 335 extern int prgetxmap(proc_t *, list_t *);
334 336 #if defined(_SYSCALL32_IMPL)
335 337 extern int prgetmap32(proc_t *, int, list_t *);
336 338 extern int prgetxmap32(proc_t *, list_t *);
337 339 #endif /* _SYSCALL32_IMPL */
338 340 #endif /* !_SYS_OLD_PROCFS_H */
339 341
340 342 extern proc_t *pr_p_lock(prnode_t *);
341 343 extern kthread_t *pr_thread(prnode_t *);
342 344 extern void pr_stop(prnode_t *);
343 345 extern int pr_wait_stop(prnode_t *, time_t);
344 346 extern int pr_setrun(prnode_t *, ulong_t);
345 347 extern int pr_wait(prcommon_t *, timestruc_t *, int);
346 348 extern void pr_wait_die(prnode_t *);
347 349 extern int pr_setsig(prnode_t *, siginfo_t *);
348 350 extern int pr_kill(prnode_t *, int, cred_t *);
|
↓ open down ↓ |
211 lines elided |
↑ open up ↑ |
349 351 extern int pr_unkill(prnode_t *, int);
350 352 extern int pr_nice(proc_t *, int, cred_t *);
351 353 extern void pr_setentryexit(proc_t *, sysset_t *, int);
352 354 extern int pr_set(proc_t *, long);
353 355 extern int pr_unset(proc_t *, long);
354 356 extern void pr_sethold(prnode_t *, sigset_t *);
355 357 extern file_t *pr_getf(proc_t *, uint_t, short *);
356 358 extern void pr_releasef(file_t *);
357 359 extern void pr_setfault(proc_t *, fltset_t *);
358 360 extern int prusrio(proc_t *, enum uio_rw, struct uio *, int);
361 +extern int prreadargv(proc_t *, char *, size_t, size_t *);
362 +extern int prreadcmdline(proc_t *, char *, size_t, size_t *);
363 +extern int prreadenvv(proc_t *, char *, size_t, size_t *);
359 364 extern int prwritectl(vnode_t *, struct uio *, cred_t *);
360 365 extern int prlock(prnode_t *, int);
361 366 extern void prunmark(proc_t *);
362 367 extern void prunlock(prnode_t *);
363 368 extern size_t prpdsize(struct as *);
364 369 extern int prpdread(proc_t *, uint_t, struct uio *);
365 370 extern size_t oprpdsize(struct as *);
366 371 extern int oprpdread(struct as *, uint_t, struct uio *);
367 372 extern void prgetaction(proc_t *, user_t *, uint_t, struct sigaction *);
368 373 extern void prgetusage(kthread_t *, struct prhusage *);
369 374 extern void praddusage(kthread_t *, struct prhusage *);
370 375 extern void prcvtusage(struct prhusage *, prusage_t *);
371 376 extern void prscaleusage(prhusage_t *);
372 377 extern kthread_t *prchoose(proc_t *);
373 378 extern void allsetrun(proc_t *);
374 379 extern int setisempty(uint32_t *, uint_t);
375 380 extern int pr_u32tos(uint32_t, char *, int);
376 381 extern vnode_t *prlwpnode(prnode_t *, uint_t);
377 382 extern prnode_t *prgetnode(vnode_t *, prnodetype_t);
378 383 extern void prfreenode(prnode_t *);
379 384 extern void pr_object_name(char *, vnode_t *, struct vattr *);
380 385 extern int set_watched_area(proc_t *, struct watched_area *);
381 386 extern int clear_watched_area(proc_t *, struct watched_area *);
382 387 extern void pr_free_watchpoints(proc_t *);
383 388 extern proc_t *pr_cancel_watch(prnode_t *);
384 389 extern struct seg *break_seg(proc_t *);
385 390 extern void prgethold(kthread_t *, sigset_t *);
386 391
387 392 /*
388 393 * Machine-dependent routines (defined in prmachdep.c).
389 394 */
390 395 extern void prgetprregs(klwp_t *, prgregset_t);
391 396 extern void prsetprregs(klwp_t *, prgregset_t, int);
392 397
393 398 #if defined(_SYSCALL32_IMPL)
394 399 extern void prgetprregs32(klwp_t *, prgregset32_t);
395 400 extern void prgregset_32ton(klwp_t *, prgregset32_t, prgregset_t);
396 401 extern void prgetprfpregs32(klwp_t *, prfpregset32_t *);
397 402 extern void prsetprfpregs32(klwp_t *, prfpregset32_t *);
398 403 extern size_t prpdsize32(struct as *);
399 404 extern int prpdread32(proc_t *, uint_t, struct uio *);
400 405 extern size_t oprpdsize32(struct as *);
401 406 extern int oprpdread32(struct as *, uint_t, struct uio *);
402 407 #endif /* _SYSCALL32_IMPL */
403 408
404 409 extern void prpokethread(kthread_t *t);
405 410 extern int prgetrvals(klwp_t *, long *, long *);
406 411 extern void prgetprfpregs(klwp_t *, prfpregset_t *);
407 412 extern void prsetprfpregs(klwp_t *, prfpregset_t *);
408 413 extern int prhasfp(void);
409 414 extern caddr_t prgetstackbase(proc_t *);
410 415 extern caddr_t prgetpsaddr(proc_t *);
411 416 extern int prisstep(klwp_t *);
412 417 extern void prsvaddr(klwp_t *, caddr_t);
413 418 extern int prfetchinstr(klwp_t *, ulong_t *);
414 419 extern ushort_t prgetpctcpu(uint64_t);
415 420
416 421 /*
417 422 * This set of routines is used by platforms to implement support for the
418 423 * 'xregs' or extended registers in /proc. Unlike other registers which
419 424 * generally have a well-defined value determined by the ABI that never changes,
420 425 * we expect these to change.
421 426 *
422 427 * An important thing to note is that you'll see we have moved away from a
423 428 * traditional version of a fixed size, non-opaque definition of the
424 429 * prxregset_t. This is because the size varies and we don't want applications
425 430 * to incorrectly bake a real definition in and cause problems where extending
426 431 * it becomes very hard to do (ala the prgregset_t and prfregset_t). This is a
427 432 * little more work for everyone implementing it, but it does ensure that we are
428 433 * generally in better shape.
429 434 *
430 435 * Here are the semantics of what these are required * to do and how the fit
431 436 * together:
432 437 *
433 438 * o prhasx Determine if the process in question supports the
434 439 * extended register sets. Note, this is may be a
435 440 * process-specific setting due to things like whether or
436 441 * not the FPU is enabled or other things.
437 442 *
438 443 * o prgetxregsize This returns the size of the actual xregs file for a
439 444 * given process. This may change between processes because
440 445 * not every process may have the same set of extended
441 446 * features enabled (e.g. AMX on x86).
442 447 *
443 448 * o prwriteminxreg This is used by the prwritectl() and related worlds to
444 449 * determine the minimum amount of data that much be
445 450 * present to determine if the actual size of a write is
446 451 * valid. If xregs is not supported, then this should
447 452 * return B_FALSE.
448 453 *
449 454 * o prwritesizexreg This is meant to indicate how much data is required to
450 455 * be copied in for a given xregs write. The base data will
451 456 * already be present from having called prwriteminxreg
452 457 * previously. If xregs are not supported this should
453 458 * return B_FALSE.
454 459 *
455 460 * There is a wrinkle in this which is not true of other
456 461 * callers. The data that we are given is not guaranteed to
457 462 * be aligned in the slightest due to the need to support
458 463 * both ILP32 and LP64!
459 464 *
460 465 * o prgetprxregs This is a request to fill in the xregs data. Right now
461 466 * the system guarantees that the buffer size is at least
462 467 * the result of the prgetprxregs() call for this process.
463 468 * Callers may assume that the process remains locked
464 469 * between the two so that the size doesn't change.
465 470 *
466 471 * o prsetprxregs This is a request to set the xregs data. The only
467 472 * assumption that should be made is that the validation of
468 473 * the size has been done in prvalidpcsxreg() as been
469 474 * performed. Users can and will potentially try to trick
470 475 * us with invalid values. Do not blindly apply this unless
471 476 * there is something that is impossible about that, but
472 477 * given that our recommendations for this are variable
473 478 * width data, that should not happen.
474 479 *
475 480 * If xregs are not supported this should return EINVAL.
476 481 * While yes other errnos may make more sense, that is what
477 482 * we have always returned in /proc for this case.
478 483 */
479 484 extern int prhasx(proc_t *);
480 485 extern size_t prgetprxregsize(proc_t *);
481 486 extern void prgetprxregs(klwp_t *, prxregset_t *);
482 487 extern boolean_t prwriteminxreg(size_t *);
483 488 extern boolean_t prwritesizexreg(const void *, size_t *);
484 489 extern int prsetprxregs(klwp_t *, prxregset_t *);
485 490
486 491 #endif /* _KERNEL */
487 492
488 493 #ifdef __cplusplus
489 494 }
490 495 #endif
491 496
492 497 #endif /* _SYS_PROC_PRDATA_H */
|
↓ open down ↓ |
124 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX