Print this page
XXX AVX procfs
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libproc/common/llib-lproc
+++ new/usr/src/lib/libproc/common/llib-lproc
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
20 20 */
21 21 /* LINTLIBRARY */
22 22 /* PROTOLIB1 */
23 23
24 24 /*
25 25 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
26 26 * Use is subject to license terms.
27 27 */
28 28 #include "libproc.h"
29 29
30 30 /*
31 31 * usr/src/lib/libproc
32 32 */
33 33
34 34 /* Pcontrol.c */
35 35 int _libproc_debug;
36 36 struct ps_prochandle *Pcreate(const char *file, char *const *argv,
37 37 int *perr, char *path, size_t len);
38 38 const char *Pcreate_error(int error);
39 39 void Pcreate_callback(struct ps_prochandle *Pr);
40 40 struct ps_prochandle *Pgrab(pid_t pid, int gflag, int *perr);
41 41 const char *Pgrab_error(int error);
42 42 void Pfree(struct ps_prochandle *Pr);
43 43 int Pstate(struct ps_prochandle *Pr);
44 44 int Pasfd(struct ps_prochandle *Pr);
45 45 int Pctlfd(struct ps_prochandle *Pr);
46 46 const psinfo_t *Ppsinfo(struct ps_prochandle *Pr);
47 47 const pstatus_t *Pstatus(struct ps_prochandle *Pr);
48 48 int Pcred(struct ps_prochandle *Pr, prcred_t *pcrp, int ngroups);
49 49 ssize_t Ppriv(struct ps_prochandle *Pr, prpriv_t *pprivp, size_t);
50 50 void Psync(struct ps_prochandle *Pr);
51 51 int Pcreate_agent(struct ps_prochandle *Pr);
52 52 void Pdestroy_agent(struct ps_prochandle *Pr);
53 53 int Preopen(struct ps_prochandle *Pr);
54 54 void Prelease(struct ps_prochandle *Pr, int flags);
55 55 int Pstopstatus(struct ps_prochandle *Pr, long cmd, uint_t msec);
56 56 int Pwait(struct ps_prochandle *Pr, uint_t msec);
57 57 int Pstop(struct ps_prochandle *Pr, uint_t msec);
58 58 int Pdstop(struct ps_prochandle *Pr);
59 59 int Pgetareg(struct ps_prochandle *Pr, int regno, prgreg_t *preg);
60 60 int Pputareg(struct ps_prochandle *Pr, int regno, prgreg_t reg);
61 61 int Psetrun(struct ps_prochandle *Pr, int sig, int flags);
62 62 ssize_t Pread(struct ps_prochandle *Pr,
63 63 void *buf, size_t nbyte, uintptr_t address);
64 64 ssize_t Pread_string(struct ps_prochandle *Pr,
65 65 char *buf, size_t nbyte, uintptr_t address);
66 66 ssize_t Pwrite(struct ps_prochandle *Pr,
67 67 const void *buf, size_t nbyte, uintptr_t address);
68 68 int Pclearsig(struct ps_prochandle *Pr);
69 69 int Pclearfault(struct ps_prochandle *Pr);
70 70 int Psetbkpt(struct ps_prochandle *Pr, uintptr_t address, ulong_t *saved);
71 71 int Pdelbkpt(struct ps_prochandle *Pr, uintptr_t address, ulong_t saved);
72 72 int Pxecbkpt(struct ps_prochandle *Pr, ulong_t saved);
73 73 int Psetwapt(struct ps_prochandle *Pr, const prwatch_t *wp);
74 74 int Pdelwapt(struct ps_prochandle *Pr, const prwatch_t *wp);
75 75 int Pxecwapt(struct ps_prochandle *Pr, const prwatch_t *wp);
76 76 int Psetflags(struct ps_prochandle *Pr, long flags);
77 77 int Punsetflags(struct ps_prochandle *Pr, long flags);
78 78 int Psignal(struct ps_prochandle *Pr, int which, int stop);
79 79 void Psetsignal(struct ps_prochandle *Pr, const sigset_t *set);
80 80 int Pfault(struct ps_prochandle *Pr, int which, int stop);
81 81 void Psetfault(struct ps_prochandle *Pr, const fltset_t *set);
82 82 int Psysentry(struct ps_prochandle *Pr, int which, int stop);
83 83 void Psetsysentry(struct ps_prochandle *Pr, const sysset_t *set);
84 84 int Psysexit(struct ps_prochandle *Pr, int which, int stop);
85 85 void Psetsysexit(struct ps_prochandle *Pr, const sysset_t *set);
86 86 int Plwp_iter(struct ps_prochandle *Pr, proc_lwp_f *func, void *cd);
87 87 int Psyscall(struct ps_prochandle *Pr, sysret_t *,
88 88 int sysindex, uint_t nargs, argdes_t *argp);
89 89
90 90 struct ps_lwphandle *Lgrab(struct ps_prochandle *P, lwpid_t lwpid, int *perr);
91 91 const char *Lgrab_error(int error);
92 92 struct ps_prochandle *Lprochandle(struct ps_lwphandle *Lwp);
93 93 void Lfree(struct ps_lwphandle *Lwp);
94 94 int Lctlfd(struct ps_lwphandle *Lwp);
95 95 int Lwait(struct ps_lwphandle *Lwp, uint_t msec);
96 96 int Lstop(struct ps_lwphandle *Lwp, uint_t msec);
97 97 int Ldstop(struct ps_lwphandle *Lwp);
98 98 int Lstate(struct ps_lwphandle *Lwp);
99 99 const lwpsinfo_t *Lpsinfo(struct ps_lwphandle *Lwp);
100 100 const lwpstatus_t *Lstatus(struct ps_lwphandle *Lwp);
101 101 int Lgetareg(struct ps_lwphandle *Lwp, int regno, prgreg_t *preg);
102 102 int Lputareg(struct ps_lwphandle *Lwp, int regno, prgreg_t reg);
103 103 int Lsetrun(struct ps_lwphandle *Lwp, int sig, int flags);
104 104 int Lclearsig(struct ps_lwphandle *Lwp);
↓ open down ↓ |
104 lines elided |
↑ open up ↑ |
105 105 int Lclearfault(struct ps_lwphandle *Lwp);
106 106 int Lxecbkpt(struct ps_lwphandle *Lwp, ulong_t saved);
107 107 int Lxecwapt(struct ps_lwphandle *Lwp, const prwatch_t *wp);
108 108 void Lsync(struct ps_lwphandle *Lwp);
109 109
110 110 /* Plwpregs.c */
111 111 int Plwp_getregs(struct ps_prochandle *Pr, lwpid_t i, prgregset_t gr);
112 112 int Plwp_setregs(struct ps_prochandle *Pr, lwpid_t i, const prgregset_t gr);
113 113 int Plwp_getfpregs(struct ps_prochandle *Pr, lwpid_t i, prfpregset_t *fp);
114 114 int Plwp_setfpregs(struct ps_prochandle *Pr, lwpid_t i, const prfpregset_t *fp);
115 -#if defined(sparc) || defined(__sparc)
116 115 int Plwp_getxregs(struct ps_prochandle *Pr, lwpid_t i, prxregset_t *xr);
117 116 int Plwp_setxregs(struct ps_prochandle *Pr, lwpid_t i, const prxregset_t *xr);
118 117 #if defined(__sparcv9)
119 118 int Plwp_getasrs(struct ps_prochandle *Pr, lwpid_t i, asrset_t asrs);
120 119 int Plwp_setasrs(struct ps_prochandle *Pr, lwpid_t i, const asrset_t asrs);
121 120 #endif /* __sparcv9 */
122 -#endif /* __sparc */
123 121 int Plwp_getpsinfo(struct ps_prochandle *Pr, lwpid_t i, lwpsinfo_t *lps);
124 122
125 123 /* Pcore.c */
126 124 struct ps_prochandle *Pfgrab_core(int fd, const char *aout, int *perr);
127 125 struct ps_prochandle *Pgrab_core(const char *core, const char *aout,
128 126 int gflag, int *perr);
129 127
130 128 /* Pisprocdir.c */
131 129 int Pisprocdir(struct ps_prochandle *Pr, const char *dir);
132 130
133 131 /* Pservice.c */
134 132 ps_err_e ps_pdmodel(struct ps_prochandle *Pr, int *modelp);
135 133 ps_err_e ps_pread(struct ps_prochandle *Pr,
136 134 psaddr_t addr, void *buf, size_t size);
137 135 ps_err_e ps_pwrite(struct ps_prochandle *Pr,
138 136 psaddr_t addr, const void *buf, size_t size);
139 137 ps_err_e ps_pdread(struct ps_prochandle *Pr,
140 138 psaddr_t addr, void *buf, size_t size);
141 139 ps_err_e ps_pdwrite(struct ps_prochandle *Pr,
142 140 psaddr_t addr, const void *buf, size_t size);
143 141 ps_err_e ps_ptread(struct ps_prochandle *Pr,
144 142 psaddr_t addr, void *buf, size_t size);
145 143 ps_err_e ps_ptwrite(struct ps_prochandle *Pr,
146 144 psaddr_t addr, const void *buf, size_t size);
147 145 ps_err_e ps_pstop(struct ps_prochandle *Pr);
148 146 ps_err_e ps_pcontinue(struct ps_prochandle *Pr);
149 147 ps_err_e ps_lstop(struct ps_prochandle *Pr, lwpid_t lwpid);
150 148 ps_err_e ps_lcontinue(struct ps_prochandle *Pr, lwpid_t lwpid);
151 149 ps_err_e ps_lgetregs(struct ps_prochandle *Pr,
152 150 lwpid_t lwpid, prgregset_t regs);
153 151 ps_err_e ps_lsetregs(struct ps_prochandle *Pr,
154 152 lwpid_t lwpid, const prgregset_t regs);
155 153 ps_err_e ps_lgetfpregs(struct ps_prochandle *Pr,
156 154 lwpid_t lwpid, prfpregset_t *regs);
157 155 ps_err_e ps_lsetfpregs(struct ps_prochandle *Pr,
158 156 lwpid_t lwpid, const prfpregset_t *regs);
159 157 #if defined(sparc) || defined(__sparc)
160 158 ps_err_e ps_lgetxregsize(struct ps_prochandle *Pr,
161 159 lwpid_t lwpid, int *xrsize);
162 160 ps_err_e ps_lgetxregs(struct ps_prochandle *Pr,
163 161 lwpid_t lwpid, caddr_t xregs);
164 162 ps_err_e ps_lsetxregs(struct ps_prochandle *Pr,
165 163 lwpid_t lwpid, caddr_t xregs);
166 164 #endif /* sparc */
167 165 #if defined(__i386) || defined(__amd64)
168 166 ps_err_e ps_lgetLDT(struct ps_prochandle *Pr,
169 167 lwpid_t lwpid, struct ssd *ldt);
170 168 #endif /* __i386 || __amd6464 */
171 169 void ps_plog(const char *fmt, ...);
172 170
173 171 /* Psymtab.c */
174 172 void Pupdate_maps(struct ps_prochandle *Pr);
175 173 void Pupdate_syms(struct ps_prochandle *Pr);
176 174 rd_agent_t *Prd_agent(struct ps_prochandle *Pr);
177 175 const prmap_t *Paddr_to_map(struct ps_prochandle *Pr, uintptr_t addr);
178 176 const prmap_t *Paddr_to_text_map(struct ps_prochandle *Pr, uintptr_t addr);
179 177 const prmap_t *Pname_to_map(struct ps_prochandle *Pr, const char *name);
180 178 const prmap_t *Plmid_to_map(struct ps_prochandle *Pr, Lmid_t lmid,
181 179 const char *name);
182 180 int Plookup_by_addr(struct ps_prochandle *Pr, uintptr_t addr,
183 181 char *sym_name_buffer, size_t bufsize, GElf_Sym *symbolp);
184 182 int Plookup_by_name(struct ps_prochandle *Pr,
185 183 const char *object_name, const char *symbol_name,
186 184 GElf_Sym *sym);
187 185 int Plookup_by_lmid(struct ps_prochandle *Pr,
188 186 Lmid_t lmid, const char *object_name, const char *symbol_name,
189 187 GElf_Sym *sym);
190 188 const rd_loadobj_t *Paddr_to_loadobj(struct ps_prochandle *, uintptr_t);
191 189 const rd_loadobj_t *Pname_to_loadobj(struct ps_prochandle *, const char *);
192 190 const rd_loadobj_t *Plmid_to_loadobj(struct ps_prochandle *, Lmid_t,
193 191 const char *);
194 192 int Pmapping_iter(struct ps_prochandle *Pr, proc_map_f *func, void *cd);
195 193 int Pmapping_iter_resolved(struct ps_prochandle *Pr, proc_map_f *func,
196 194 void *cd);
197 195 int Pobject_iter(struct ps_prochandle *Pr, proc_map_f *func, void *cd);
198 196 int Pobject_iter_resolved(struct ps_prochandle *Pr, proc_map_f *func,
199 197 void *cd);
200 198 char *Pobjname(struct ps_prochandle *Pr, uintptr_t addr,
201 199 char *buffer, size_t bufsize);
202 200 char *Pobjname_resolved(struct ps_prochandle *Pr, uintptr_t addr,
203 201 char *buffer, size_t bufsize);
204 202 int Plmid(struct ps_prochandle *Pr, uintptr_t addr, Lmid_t *lmidp);
205 203 int Psymbol_iter(struct ps_prochandle *Pr, const char *object_name,
206 204 int which, int type, proc_sym_f *func, void *cd);
207 205 int Psymbol_iter_by_lmid(struct ps_prochandle *Pr, Lmid_t lmid,
208 206 const char *object_name, int which, int type,
209 207 proc_sym_f *func, void *cd);
210 208 char *Pgetenv(struct ps_prochandle *Pr, const char *name,
211 209 char *buffer, size_t bufsize);
212 210 char *Pplatform(struct ps_prochandle *Pr, char *s, size_t n);
213 211 int Puname(struct ps_prochandle *Pr, struct utsname *u);
214 212 char *Pzonename(struct ps_prochandle *Pr, char *s, size_t n);
215 213 char *Pfindobj(struct ps_prochandle *Pr, const char *path,
216 214 char *s, size_t n);
217 215 char *Pexecname(struct ps_prochandle *Pr, char *buffer, size_t bufsize);
218 216 void Preset_maps(struct ps_prochandle *Pr);
219 217
220 218 ps_err_e ps_pglobal_lookup(struct ps_prochandle *Pr,
221 219 const char *object_name, const char *sym_name,
222 220 psaddr_t *sym_addr);
223 221
224 222 ps_err_e ps_pglobal_sym(struct ps_prochandle *Pr,
225 223 const char *object_name, const char *sym_name,
226 224 ps_sym_t *symp);
227 225
228 226 long Pgetauxval(struct ps_prochandle *Pr, int type);
229 227 const auxv_t *Pgetauxvec(struct ps_prochandle *Pr);
230 228 ps_err_e ps_pauxv(struct ps_prochandle *Pr, const auxv_t **aux);
231 229
232 230 /* Putil.c */
233 231 void Perror_printf(struct ps_prochandle *Pr, const char *format, ...);
234 232
235 233 /* pr_door.c */
236 234 int pr_door_info(struct ps_prochandle *Pr, int did, door_info_t *di);
237 235
238 236 /* pr_exit.c */
239 237 int pr_exit(struct ps_prochandle *Pr, int status);
240 238 int pr_lwp_exit(struct ps_prochandle *Pr);
241 239
242 240 /* pr_fcntl.c */
243 241 int pr_fcntl(struct ps_prochandle *Pr, int fd, int cmd, void *argp);
244 242
245 243 /* pr_getitimer.c */
246 244 int pr_getitimer(struct ps_prochandle *Pr,
247 245 int which, struct itimerval *itv);
248 246 int pr_setitimer(struct ps_prochandle *Pr,
249 247 int which, const struct itimerval *itv, struct itimerval *oitv);
250 248
251 249 /* pr_getrctl.c */
252 250 int pr_getrctl(struct ps_prochandle *Pr, const char *rname,
253 251 rctlblk_t *old_blk, rctlblk_t *new_blk, int rflag);
254 252 int pr_setrctl(struct ps_prochandle *Pr, const char *rname,
255 253 rctlblk_t *old_blk, rctlblk_t *new_blk, int rflag);
256 254 int pr_setprojrctl(struct ps_prochandle *Pr, const char *rname,
257 255 rctlblk_t *new_blk, size_t size, int rflag);
258 256
259 257 /* pr_getrlimit.c */
260 258 int pr_getrlimit(struct ps_prochandle *Pr,
261 259 int resource, struct rlimit *rlp);
262 260 int pr_setrlimit(struct ps_prochandle *Pr,
263 261 int resource, const struct rlimit *rlp);
264 262 int pr_getrlimit64(struct ps_prochandle *Pr,
265 263 int resource, struct rlimit64 *rlp);
266 264 int pr_setrlimit64(struct ps_prochandle *Pr,
267 265 int resource, const struct rlimit64 *rlp);
268 266
269 267 /* pr_getsockname.c */
270 268 int pr_getsockname(struct ps_prochandle *Pr,
271 269 int sock, struct sockaddr *name, socklen_t *namelen);
272 270 int pr_getpeername(struct ps_prochandle *Pr,
273 271 int sock, struct sockaddr *name, socklen_t *namelen);
274 272
275 273 /* pr_ioctl.c */
276 274 int pr_ioctl(struct ps_prochandle *Pr,
277 275 int fd, int code, void *buf, size_t size);
278 276
279 277 /* pr_lseek.c */
280 278 off_t pr_lseek(struct ps_prochandle *Pr,
281 279 int filedes, off_t offset, int whence);
282 280 offset_t pr_llseek(struct ps_prochandle *Pr,
283 281 int filedes, offset_t offset, int whence);
284 282
285 283 /* pr_memcntl.c */
286 284 int pr_memcntl(struct ps_prochandle *Pr,
287 285 caddr_t addr, size_t len, int cmd, caddr_t arg, int attr, int mask);
288 286
289 287 /* pr_mmap.c */
290 288 void *pr_mmap(struct ps_prochandle *Pr,
291 289 void *addr, size_t len, int prot, int flags, int fd, off_t off);
292 290 int pr_munmap(struct ps_prochandle *Pr,
293 291 void *addr, size_t len);
294 292 void *pr_zmap(struct ps_prochandle *Pr,
295 293 void *addr, size_t len, int prot, int flags);
296 294
297 295 /* pr_open.c */
298 296 int pr_open(struct ps_prochandle *Pr,
299 297 const char *filename, int flags, mode_t mode);
300 298 int pr_creat(struct ps_prochandle *Pr,
301 299 const char *filename, mode_t mode);
302 300 int pr_close(struct ps_prochandle *Pr, int fd);
303 301 int pr_access(struct ps_prochandle *Pr, const char *path, int amode);
304 302
305 303 /* pr_pbind.c */
306 304 int pr_processor_bind(struct ps_prochandle *Pr, idtype_t, id_t, int, int *);
307 305
308 306 /* pr_rename.c */
309 307 int pr_rename(struct ps_prochandle *Pr, const char *old, const char *new);
310 308 int pr_link(struct ps_prochandle *Pr, const char *exist, const char *new);
311 309 int pr_unlink(struct ps_prochandle *Pr, const char *);
312 310
313 311 /* pr_sigaction.c */
314 312 int pr_sigaction(struct ps_prochandle *Pr,
315 313 int sig, const struct sigaction *act, struct sigaction *oact);
316 314
317 315 /* pr_stat.c */
318 316 int pr_stat(struct ps_prochandle *Pr, const char *path, struct stat *buf);
319 317 int pr_lstat(struct ps_prochandle *Pr, const char *path, struct stat *buf);
320 318 int pr_fstat(struct ps_prochandle *Pr, int fd, struct stat *buf);
321 319 int pr_stat64(struct ps_prochandle *Pr, const char *path,
322 320 struct stat64 *buf);
323 321 int pr_lstat64(struct ps_prochandle *Pr, const char *path,
324 322 struct stat64 *buf);
325 323 int pr_fstat64(struct ps_prochandle *Pr, int fd, struct stat64 *buf);
326 324
327 325 /* pr_statvfs.c */
328 326 int pr_statvfs(struct ps_prochandle *Pr, const char *path, statvfs_t *buf);
329 327 int pr_fstatvfs(struct ps_prochandle *Pr, int fd, statvfs_t *buf);
330 328
331 329 /* pr_tasksys.c */
332 330 projid_t pr_getprojid(struct ps_prochandle *Pr);
333 331 taskid_t pr_gettaskid(struct ps_prochandle *Pr);
334 332 taskid_t pr_settaskid(struct ps_prochandle *Pr, projid_t project, int flags);
335 333
336 334 /* pr_waitid.c */
337 335 int pr_waitid(struct ps_prochandle *Pr,
338 336 idtype_t idtype, id_t id, siginfo_t *infop, int options);
339 337
340 338 /* proc_get_info.c */
341 339 int proc_get_cred(pid_t pid, prcred_t *credp, int ngroups);
342 340 prpriv_t *proc_get_priv(pid_t pid);
343 341 int proc_get_psinfo(pid_t pid, psinfo_t *psp);
344 342 int proc_get_status(pid_t pid, pstatus_t *psp);
345 343 int proc_get_auxv(pid_t pid, auxv_t *pauxv, int naux);
346 344
347 345 /* proc_names.c */
348 346 char *proc_fltname(int flt, char *buf, size_t bufsz);
349 347 char *proc_signame(int sig, char *buf, size_t bufsz);
350 348 char *proc_sysname(int sys, char *buf, size_t bufsz);
351 349
352 350 int proc_str2flt(const char *str, int *fltnum);
353 351 int proc_str2sig(const char *str, int *signum);
354 352 int proc_str2sys(const char *str, int *sysnum);
355 353
356 354 char *proc_fltset2str(const fltset_t *set, const char *delim, int members,
357 355 char *buf, size_t nbytes);
358 356 char *proc_sigset2str(const sigset_t *set, const char *delim, int members,
359 357 char *buf, size_t nbytes);
360 358 char *proc_sysset2str(const sysset_t *set, const char *delim, int members,
361 359 char *buf, size_t nbytes);
362 360
363 361 char *proc_str2fltset(const char *str, const char *delim, int members,
364 362 fltset_t *set);
365 363 char *proc_str2sigset(const char *str, const char *delim, int members,
366 364 sigset_t *set);
367 365 char *proc_str2sysset(const char *str, const char *delim, int members,
368 366 sysset_t *set);
369 367
370 368 int proc_walk(proc_walk_f *func, void *arg, int flags);
371 369
372 370 /* proc_arg.c */
373 371 struct ps_prochandle *proc_arg_grab(const char *arg,
374 372 int oflag, int gflag, int *perr);
375 373
376 374 pid_t proc_arg_psinfo(const char *arg, int oflag, psinfo_t *psp, int *perr);
377 375 void proc_unctrl_psinfo(psinfo_t *psp);
378 376
379 377 /* proc_set.c */
380 378 int Psetcred(struct ps_prochandle *Pr, const prcred_t *pcred);
381 379
382 380 /* Pstack.c */
383 381 int Pstack_iter(struct ps_prochandle *Pr,
384 382 const prgregset_t regs, proc_stack_f *func, void *arg);
385 383
386 384 /* Pisadep.c */
387 385 const char *Ppltdest(struct ps_prochandle *Pr, uintptr_t addr);
↓ open down ↓ |
255 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX