1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28*7c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate 31*7c478bd9Sstevel@tonic-gate #ifndef _SYS_PRSYSTM_H 32*7c478bd9Sstevel@tonic-gate #define _SYS_PRSYSTM_H 33*7c478bd9Sstevel@tonic-gate 34*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate #include <sys/isa_defs.h> 37*7c478bd9Sstevel@tonic-gate #include <sys/zone.h> 38*7c478bd9Sstevel@tonic-gate 39*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 40*7c478bd9Sstevel@tonic-gate extern "C" { 41*7c478bd9Sstevel@tonic-gate #endif 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gate #if defined(_KERNEL) 44*7c478bd9Sstevel@tonic-gate 45*7c478bd9Sstevel@tonic-gate extern kmutex_t pr_pidlock; 46*7c478bd9Sstevel@tonic-gate extern kcondvar_t *pr_pid_cv; 47*7c478bd9Sstevel@tonic-gate 48*7c478bd9Sstevel@tonic-gate struct prfpregset; 49*7c478bd9Sstevel@tonic-gate struct pstatus; 50*7c478bd9Sstevel@tonic-gate struct lwpstatus; 51*7c478bd9Sstevel@tonic-gate struct psinfo; 52*7c478bd9Sstevel@tonic-gate struct lwpsinfo; 53*7c478bd9Sstevel@tonic-gate struct prcred; 54*7c478bd9Sstevel@tonic-gate struct prpriv; 55*7c478bd9Sstevel@tonic-gate 56*7c478bd9Sstevel@tonic-gate struct seg; 57*7c478bd9Sstevel@tonic-gate struct regs; 58*7c478bd9Sstevel@tonic-gate struct watched_page; 59*7c478bd9Sstevel@tonic-gate 60*7c478bd9Sstevel@tonic-gate /* 61*7c478bd9Sstevel@tonic-gate * These are functions in the procfs module that are 62*7c478bd9Sstevel@tonic-gate * called from the kernel proper and from other modules. 63*7c478bd9Sstevel@tonic-gate */ 64*7c478bd9Sstevel@tonic-gate extern uint_t pr_getprot(struct seg *, int, void **, 65*7c478bd9Sstevel@tonic-gate caddr_t *, caddr_t *, caddr_t); 66*7c478bd9Sstevel@tonic-gate extern void pr_getprot_done(void **); 67*7c478bd9Sstevel@tonic-gate extern size_t pr_getsegsize(struct seg *, int); 68*7c478bd9Sstevel@tonic-gate extern int pr_isobject(struct vnode *); 69*7c478bd9Sstevel@tonic-gate extern int pr_isself(struct vnode *); 70*7c478bd9Sstevel@tonic-gate extern void prinvalidate(struct user *); 71*7c478bd9Sstevel@tonic-gate extern void prgetstatus(proc_t *, struct pstatus *, zone_t *); 72*7c478bd9Sstevel@tonic-gate extern void prgetlwpstatus(kthread_t *, struct lwpstatus *, zone_t *); 73*7c478bd9Sstevel@tonic-gate extern void prgetpsinfo(proc_t *, struct psinfo *); 74*7c478bd9Sstevel@tonic-gate extern void prgetlwpsinfo(kthread_t *, struct lwpsinfo *); 75*7c478bd9Sstevel@tonic-gate extern void prgetprfpregs(klwp_t *, struct prfpregset *); 76*7c478bd9Sstevel@tonic-gate extern void prgetprxregs(klwp_t *, caddr_t); 77*7c478bd9Sstevel@tonic-gate extern int prgetprxregsize(proc_t *); 78*7c478bd9Sstevel@tonic-gate #if defined(__lint) 79*7c478bd9Sstevel@tonic-gate /* Work around lint confusion between old and new prcred definitions */ 80*7c478bd9Sstevel@tonic-gate extern void prgetcred(); 81*7c478bd9Sstevel@tonic-gate #else 82*7c478bd9Sstevel@tonic-gate extern void prgetcred(proc_t *, struct prcred *); 83*7c478bd9Sstevel@tonic-gate #endif 84*7c478bd9Sstevel@tonic-gate extern void prgetpriv(proc_t *, struct prpriv *); 85*7c478bd9Sstevel@tonic-gate extern size_t prgetprivsize(void); 86*7c478bd9Sstevel@tonic-gate extern int prnsegs(struct as *, int); 87*7c478bd9Sstevel@tonic-gate extern void prexit(proc_t *); 88*7c478bd9Sstevel@tonic-gate extern void prfree(proc_t *); 89*7c478bd9Sstevel@tonic-gate extern void prlwpexit(kthread_t *); 90*7c478bd9Sstevel@tonic-gate extern void prlwpfree(proc_t *, lwpent_t *); 91*7c478bd9Sstevel@tonic-gate extern void prexecstart(void); 92*7c478bd9Sstevel@tonic-gate extern void prexecend(void); 93*7c478bd9Sstevel@tonic-gate extern void prrelvm(void); 94*7c478bd9Sstevel@tonic-gate extern void prbarrier(proc_t *); 95*7c478bd9Sstevel@tonic-gate extern void prstop(int, int); 96*7c478bd9Sstevel@tonic-gate extern void prnotify(struct vnode *); 97*7c478bd9Sstevel@tonic-gate extern void prstep(klwp_t *, int); 98*7c478bd9Sstevel@tonic-gate extern void prnostep(klwp_t *); 99*7c478bd9Sstevel@tonic-gate extern void prdostep(void); 100*7c478bd9Sstevel@tonic-gate extern int prundostep(void); 101*7c478bd9Sstevel@tonic-gate extern int prhasfp(void); 102*7c478bd9Sstevel@tonic-gate extern int prhasx(proc_t *); 103*7c478bd9Sstevel@tonic-gate extern caddr_t prmapin(struct as *, caddr_t, int); 104*7c478bd9Sstevel@tonic-gate extern void prmapout(struct as *, caddr_t, caddr_t, int); 105*7c478bd9Sstevel@tonic-gate extern int pr_watch_emul(struct regs *, caddr_t, enum seg_rw); 106*7c478bd9Sstevel@tonic-gate extern void pr_free_watched_pages(proc_t *); 107*7c478bd9Sstevel@tonic-gate extern int pr_allstopped(proc_t *, int); 108*7c478bd9Sstevel@tonic-gate #if defined(__sparc) 109*7c478bd9Sstevel@tonic-gate struct gwindows; 110*7c478bd9Sstevel@tonic-gate extern int prnwindows(klwp_t *); 111*7c478bd9Sstevel@tonic-gate extern void prgetwindows(klwp_t *, struct gwindows *); 112*7c478bd9Sstevel@tonic-gate #if defined(__sparcv9) /* 32-bit adb macros should not see these defs */ 113*7c478bd9Sstevel@tonic-gate extern void prgetasregs(klwp_t *, asrset_t); 114*7c478bd9Sstevel@tonic-gate extern void prsetasregs(klwp_t *, asrset_t); 115*7c478bd9Sstevel@tonic-gate #endif /* __sparcv9 */ 116*7c478bd9Sstevel@tonic-gate #endif /* __sparc */ 117*7c478bd9Sstevel@tonic-gate #if defined(__x86) 118*7c478bd9Sstevel@tonic-gate struct ssd; 119*7c478bd9Sstevel@tonic-gate extern int prnldt(proc_t *); 120*7c478bd9Sstevel@tonic-gate extern void prgetldt(proc_t *, struct ssd *); 121*7c478bd9Sstevel@tonic-gate #endif /* __x86 */ 122*7c478bd9Sstevel@tonic-gate 123*7c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL 124*7c478bd9Sstevel@tonic-gate struct prfpregset32; 125*7c478bd9Sstevel@tonic-gate struct pstatus32; 126*7c478bd9Sstevel@tonic-gate struct lwpstatus32; 127*7c478bd9Sstevel@tonic-gate struct psinfo32; 128*7c478bd9Sstevel@tonic-gate struct lwpsinfo32; 129*7c478bd9Sstevel@tonic-gate extern void prgetstatus32(proc_t *, struct pstatus32 *, zone_t *); 130*7c478bd9Sstevel@tonic-gate extern void prgetlwpstatus32(kthread_t *, struct lwpstatus32 *, zone_t *); 131*7c478bd9Sstevel@tonic-gate extern void prgetpsinfo32(proc_t *, struct psinfo32 *); 132*7c478bd9Sstevel@tonic-gate extern void prgetlwpsinfo32(kthread_t *, struct lwpsinfo32 *); 133*7c478bd9Sstevel@tonic-gate extern void prgetprfpregs32(klwp_t *, struct prfpregset32 *); 134*7c478bd9Sstevel@tonic-gate #if defined(__sparc) 135*7c478bd9Sstevel@tonic-gate struct gwindows32; 136*7c478bd9Sstevel@tonic-gate void prgetwindows32(klwp_t *, struct gwindows32 *); 137*7c478bd9Sstevel@tonic-gate #endif /* __sparc */ 138*7c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32_IMPL */ 139*7c478bd9Sstevel@tonic-gate 140*7c478bd9Sstevel@tonic-gate #endif /* defined (_KERNEL) */ 141*7c478bd9Sstevel@tonic-gate 142*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 143*7c478bd9Sstevel@tonic-gate } 144*7c478bd9Sstevel@tonic-gate #endif 145*7c478bd9Sstevel@tonic-gate 146*7c478bd9Sstevel@tonic-gate #endif /* _SYS_PRSYSTM_H */ 147