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