xref: /titanic_51/usr/src/uts/common/sys/prsystm.h (revision bc0e91320069f0bcaee43e80a7ea686d9efa2d08)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
507a48826SRoger A. Faulkner  * Common Development and Distribution License (the "License").
607a48826SRoger A. Faulkner  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
2107a48826SRoger A. Faulkner 
227c478bd9Sstevel@tonic-gate /*
2307a48826SRoger A. Faulkner  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
287c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
297c478bd9Sstevel@tonic-gate 
30f971a346SBryan Cantrill /*
31f971a346SBryan Cantrill  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
32f971a346SBryan Cantrill  */
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifndef _SYS_PRSYSTM_H
357c478bd9Sstevel@tonic-gate #define	_SYS_PRSYSTM_H
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #include <sys/isa_defs.h>
387c478bd9Sstevel@tonic-gate #include <sys/zone.h>
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
417c478bd9Sstevel@tonic-gate extern "C" {
427c478bd9Sstevel@tonic-gate #endif
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate extern kmutex_t pr_pidlock;
477c478bd9Sstevel@tonic-gate extern kcondvar_t *pr_pid_cv;
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate struct prfpregset;
507c478bd9Sstevel@tonic-gate struct pstatus;
517c478bd9Sstevel@tonic-gate struct lwpstatus;
527c478bd9Sstevel@tonic-gate struct psinfo;
537c478bd9Sstevel@tonic-gate struct lwpsinfo;
547c478bd9Sstevel@tonic-gate struct prcred;
557c478bd9Sstevel@tonic-gate struct prpriv;
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate struct seg;
587c478bd9Sstevel@tonic-gate struct regs;
597c478bd9Sstevel@tonic-gate struct watched_page;
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /*
627c478bd9Sstevel@tonic-gate  * These are functions in the procfs module that are
637c478bd9Sstevel@tonic-gate  * called from the kernel proper and from other modules.
647c478bd9Sstevel@tonic-gate  */
657c478bd9Sstevel@tonic-gate extern uint_t pr_getprot(struct seg *, int, void **,
667c478bd9Sstevel@tonic-gate 	caddr_t *, caddr_t *, caddr_t);
677c478bd9Sstevel@tonic-gate extern void pr_getprot_done(void **);
687c478bd9Sstevel@tonic-gate extern size_t pr_getsegsize(struct seg *, int);
697c478bd9Sstevel@tonic-gate extern int  pr_isobject(struct vnode *);
707c478bd9Sstevel@tonic-gate extern int  pr_isself(struct vnode *);
717c478bd9Sstevel@tonic-gate extern void prinvalidate(struct user *);
727c478bd9Sstevel@tonic-gate extern void prgetstatus(proc_t *, struct pstatus *, zone_t *);
737c478bd9Sstevel@tonic-gate extern void prgetlwpstatus(kthread_t *, struct lwpstatus *, zone_t *);
747c478bd9Sstevel@tonic-gate extern void prgetpsinfo(proc_t *, struct psinfo *);
757c478bd9Sstevel@tonic-gate extern void prgetlwpsinfo(kthread_t *, struct lwpsinfo *);
767c478bd9Sstevel@tonic-gate extern void prgetprfpregs(klwp_t *, struct prfpregset *);
777c478bd9Sstevel@tonic-gate extern void prgetprxregs(klwp_t *, caddr_t);
787c478bd9Sstevel@tonic-gate extern int  prgetprxregsize(proc_t *);
797c478bd9Sstevel@tonic-gate #if defined(__lint)
807c478bd9Sstevel@tonic-gate /* Work around lint confusion between old and new prcred definitions */
817c478bd9Sstevel@tonic-gate extern void prgetcred();
827c478bd9Sstevel@tonic-gate #else
837c478bd9Sstevel@tonic-gate extern void prgetcred(proc_t *, struct prcred *);
847c478bd9Sstevel@tonic-gate #endif
857c478bd9Sstevel@tonic-gate extern void prgetpriv(proc_t *, struct prpriv *);
867c478bd9Sstevel@tonic-gate extern size_t prgetprivsize(void);
877c478bd9Sstevel@tonic-gate extern int  prnsegs(struct as *, int);
887c478bd9Sstevel@tonic-gate extern void prexit(proc_t *);
897c478bd9Sstevel@tonic-gate extern void prfree(proc_t *);
907c478bd9Sstevel@tonic-gate extern void prlwpexit(kthread_t *);
917c478bd9Sstevel@tonic-gate extern void prlwpfree(proc_t *, lwpent_t *);
927c478bd9Sstevel@tonic-gate extern void prexecstart(void);
937c478bd9Sstevel@tonic-gate extern void prexecend(void);
947c478bd9Sstevel@tonic-gate extern void prrelvm(void);
957c478bd9Sstevel@tonic-gate extern void prbarrier(proc_t *);
967c478bd9Sstevel@tonic-gate extern void prstop(int, int);
9707a48826SRoger A. Faulkner extern void prunstop(void);
987c478bd9Sstevel@tonic-gate extern void prnotify(struct vnode *);
997c478bd9Sstevel@tonic-gate extern void prstep(klwp_t *, int);
1007c478bd9Sstevel@tonic-gate extern void prnostep(klwp_t *);
1017c478bd9Sstevel@tonic-gate extern void prdostep(void);
1027c478bd9Sstevel@tonic-gate extern int  prundostep(void);
1037c478bd9Sstevel@tonic-gate extern int  prhasfp(void);
1047c478bd9Sstevel@tonic-gate extern int  prhasx(proc_t *);
1057c478bd9Sstevel@tonic-gate extern caddr_t prmapin(struct as *, caddr_t, int);
1067c478bd9Sstevel@tonic-gate extern void prmapout(struct as *, caddr_t, caddr_t, int);
1077c478bd9Sstevel@tonic-gate extern int  pr_watch_emul(struct regs *, caddr_t, enum seg_rw);
1087c478bd9Sstevel@tonic-gate extern void pr_free_watched_pages(proc_t *);
1097c478bd9Sstevel@tonic-gate extern int  pr_allstopped(proc_t *, int);
1107c478bd9Sstevel@tonic-gate #if defined(__sparc)
111*bc0e9132SGordon Ross struct _gwindows;
1127c478bd9Sstevel@tonic-gate extern	int	prnwindows(klwp_t *);
113*bc0e9132SGordon Ross extern	void	prgetwindows(klwp_t *, struct _gwindows *);
1147c478bd9Sstevel@tonic-gate #if defined(__sparcv9) /* 32-bit adb macros should not see these defs */
1157c478bd9Sstevel@tonic-gate extern	void	prgetasregs(klwp_t *, asrset_t);
1167c478bd9Sstevel@tonic-gate extern	void	prsetasregs(klwp_t *, asrset_t);
1177c478bd9Sstevel@tonic-gate #endif /* __sparcv9 */
1187c478bd9Sstevel@tonic-gate #endif	/* __sparc */
1197c478bd9Sstevel@tonic-gate #if defined(__x86)
1207c478bd9Sstevel@tonic-gate struct	ssd;
1217c478bd9Sstevel@tonic-gate extern	int	prnldt(proc_t *);
1227c478bd9Sstevel@tonic-gate extern	void	prgetldt(proc_t *, struct ssd *);
1237c478bd9Sstevel@tonic-gate #endif	/* __x86 */
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL
1267c478bd9Sstevel@tonic-gate struct prfpregset32;
1277c478bd9Sstevel@tonic-gate struct pstatus32;
1287c478bd9Sstevel@tonic-gate struct lwpstatus32;
1297c478bd9Sstevel@tonic-gate struct psinfo32;
1307c478bd9Sstevel@tonic-gate struct lwpsinfo32;
1317c478bd9Sstevel@tonic-gate extern void prgetstatus32(proc_t *, struct pstatus32 *, zone_t *);
1327c478bd9Sstevel@tonic-gate extern void prgetlwpstatus32(kthread_t *, struct lwpstatus32 *, zone_t *);
1337c478bd9Sstevel@tonic-gate extern void prgetpsinfo32(proc_t *, struct psinfo32 *);
1347c478bd9Sstevel@tonic-gate extern void prgetlwpsinfo32(kthread_t *, struct lwpsinfo32 *);
135f971a346SBryan Cantrill extern void lwpsinfo_kto32(const struct lwpsinfo *src, struct lwpsinfo32 *dest);
136f971a346SBryan Cantrill extern void psinfo_kto32(const struct psinfo *src, struct psinfo32 *dest);
1377c478bd9Sstevel@tonic-gate extern void prgetprfpregs32(klwp_t *, struct prfpregset32 *);
1387c478bd9Sstevel@tonic-gate #if defined(__sparc)
1397c478bd9Sstevel@tonic-gate struct gwindows32;
1407c478bd9Sstevel@tonic-gate void		prgetwindows32(klwp_t *, struct gwindows32 *);
1417c478bd9Sstevel@tonic-gate #endif /* __sparc */
1427c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32_IMPL */
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate #endif	/* defined (_KERNEL) */
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1477c478bd9Sstevel@tonic-gate }
1487c478bd9Sstevel@tonic-gate #endif
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate #endif	/* _SYS_PRSYSTM_H */
151