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 5*07a48826SRoger A. Faulkner * Common Development and Distribution License (the "License"). 6*07a48826SRoger 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 */ 21*07a48826SRoger A. Faulkner 227c478bd9Sstevel@tonic-gate /* 23*07a48826SRoger 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 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #ifndef _SYS_PRSYSTM_H 327c478bd9Sstevel@tonic-gate #define _SYS_PRSYSTM_H 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate #include <sys/isa_defs.h> 357c478bd9Sstevel@tonic-gate #include <sys/zone.h> 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate #ifdef __cplusplus 387c478bd9Sstevel@tonic-gate extern "C" { 397c478bd9Sstevel@tonic-gate #endif 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate #if defined(_KERNEL) 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate extern kmutex_t pr_pidlock; 447c478bd9Sstevel@tonic-gate extern kcondvar_t *pr_pid_cv; 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate struct prfpregset; 477c478bd9Sstevel@tonic-gate struct pstatus; 487c478bd9Sstevel@tonic-gate struct lwpstatus; 497c478bd9Sstevel@tonic-gate struct psinfo; 507c478bd9Sstevel@tonic-gate struct lwpsinfo; 517c478bd9Sstevel@tonic-gate struct prcred; 527c478bd9Sstevel@tonic-gate struct prpriv; 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate struct seg; 557c478bd9Sstevel@tonic-gate struct regs; 567c478bd9Sstevel@tonic-gate struct watched_page; 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate /* 597c478bd9Sstevel@tonic-gate * These are functions in the procfs module that are 607c478bd9Sstevel@tonic-gate * called from the kernel proper and from other modules. 617c478bd9Sstevel@tonic-gate */ 627c478bd9Sstevel@tonic-gate extern uint_t pr_getprot(struct seg *, int, void **, 637c478bd9Sstevel@tonic-gate caddr_t *, caddr_t *, caddr_t); 647c478bd9Sstevel@tonic-gate extern void pr_getprot_done(void **); 657c478bd9Sstevel@tonic-gate extern size_t pr_getsegsize(struct seg *, int); 667c478bd9Sstevel@tonic-gate extern int pr_isobject(struct vnode *); 677c478bd9Sstevel@tonic-gate extern int pr_isself(struct vnode *); 687c478bd9Sstevel@tonic-gate extern void prinvalidate(struct user *); 697c478bd9Sstevel@tonic-gate extern void prgetstatus(proc_t *, struct pstatus *, zone_t *); 707c478bd9Sstevel@tonic-gate extern void prgetlwpstatus(kthread_t *, struct lwpstatus *, zone_t *); 717c478bd9Sstevel@tonic-gate extern void prgetpsinfo(proc_t *, struct psinfo *); 727c478bd9Sstevel@tonic-gate extern void prgetlwpsinfo(kthread_t *, struct lwpsinfo *); 737c478bd9Sstevel@tonic-gate extern void prgetprfpregs(klwp_t *, struct prfpregset *); 747c478bd9Sstevel@tonic-gate extern void prgetprxregs(klwp_t *, caddr_t); 757c478bd9Sstevel@tonic-gate extern int prgetprxregsize(proc_t *); 767c478bd9Sstevel@tonic-gate #if defined(__lint) 777c478bd9Sstevel@tonic-gate /* Work around lint confusion between old and new prcred definitions */ 787c478bd9Sstevel@tonic-gate extern void prgetcred(); 797c478bd9Sstevel@tonic-gate #else 807c478bd9Sstevel@tonic-gate extern void prgetcred(proc_t *, struct prcred *); 817c478bd9Sstevel@tonic-gate #endif 827c478bd9Sstevel@tonic-gate extern void prgetpriv(proc_t *, struct prpriv *); 837c478bd9Sstevel@tonic-gate extern size_t prgetprivsize(void); 847c478bd9Sstevel@tonic-gate extern int prnsegs(struct as *, int); 857c478bd9Sstevel@tonic-gate extern void prexit(proc_t *); 867c478bd9Sstevel@tonic-gate extern void prfree(proc_t *); 877c478bd9Sstevel@tonic-gate extern void prlwpexit(kthread_t *); 887c478bd9Sstevel@tonic-gate extern void prlwpfree(proc_t *, lwpent_t *); 897c478bd9Sstevel@tonic-gate extern void prexecstart(void); 907c478bd9Sstevel@tonic-gate extern void prexecend(void); 917c478bd9Sstevel@tonic-gate extern void prrelvm(void); 927c478bd9Sstevel@tonic-gate extern void prbarrier(proc_t *); 937c478bd9Sstevel@tonic-gate extern void prstop(int, int); 94*07a48826SRoger A. Faulkner extern void prunstop(void); 957c478bd9Sstevel@tonic-gate extern void prnotify(struct vnode *); 967c478bd9Sstevel@tonic-gate extern void prstep(klwp_t *, int); 977c478bd9Sstevel@tonic-gate extern void prnostep(klwp_t *); 987c478bd9Sstevel@tonic-gate extern void prdostep(void); 997c478bd9Sstevel@tonic-gate extern int prundostep(void); 1007c478bd9Sstevel@tonic-gate extern int prhasfp(void); 1017c478bd9Sstevel@tonic-gate extern int prhasx(proc_t *); 1027c478bd9Sstevel@tonic-gate extern caddr_t prmapin(struct as *, caddr_t, int); 1037c478bd9Sstevel@tonic-gate extern void prmapout(struct as *, caddr_t, caddr_t, int); 1047c478bd9Sstevel@tonic-gate extern int pr_watch_emul(struct regs *, caddr_t, enum seg_rw); 1057c478bd9Sstevel@tonic-gate extern void pr_free_watched_pages(proc_t *); 1067c478bd9Sstevel@tonic-gate extern int pr_allstopped(proc_t *, int); 1077c478bd9Sstevel@tonic-gate #if defined(__sparc) 1087c478bd9Sstevel@tonic-gate struct gwindows; 1097c478bd9Sstevel@tonic-gate extern int prnwindows(klwp_t *); 1107c478bd9Sstevel@tonic-gate extern void prgetwindows(klwp_t *, struct gwindows *); 1117c478bd9Sstevel@tonic-gate #if defined(__sparcv9) /* 32-bit adb macros should not see these defs */ 1127c478bd9Sstevel@tonic-gate extern void prgetasregs(klwp_t *, asrset_t); 1137c478bd9Sstevel@tonic-gate extern void prsetasregs(klwp_t *, asrset_t); 1147c478bd9Sstevel@tonic-gate #endif /* __sparcv9 */ 1157c478bd9Sstevel@tonic-gate #endif /* __sparc */ 1167c478bd9Sstevel@tonic-gate #if defined(__x86) 1177c478bd9Sstevel@tonic-gate struct ssd; 1187c478bd9Sstevel@tonic-gate extern int prnldt(proc_t *); 1197c478bd9Sstevel@tonic-gate extern void prgetldt(proc_t *, struct ssd *); 1207c478bd9Sstevel@tonic-gate #endif /* __x86 */ 1217c478bd9Sstevel@tonic-gate 1227c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL 1237c478bd9Sstevel@tonic-gate struct prfpregset32; 1247c478bd9Sstevel@tonic-gate struct pstatus32; 1257c478bd9Sstevel@tonic-gate struct lwpstatus32; 1267c478bd9Sstevel@tonic-gate struct psinfo32; 1277c478bd9Sstevel@tonic-gate struct lwpsinfo32; 1287c478bd9Sstevel@tonic-gate extern void prgetstatus32(proc_t *, struct pstatus32 *, zone_t *); 1297c478bd9Sstevel@tonic-gate extern void prgetlwpstatus32(kthread_t *, struct lwpstatus32 *, zone_t *); 1307c478bd9Sstevel@tonic-gate extern void prgetpsinfo32(proc_t *, struct psinfo32 *); 1317c478bd9Sstevel@tonic-gate extern void prgetlwpsinfo32(kthread_t *, struct lwpsinfo32 *); 1327c478bd9Sstevel@tonic-gate extern void prgetprfpregs32(klwp_t *, struct prfpregset32 *); 1337c478bd9Sstevel@tonic-gate #if defined(__sparc) 1347c478bd9Sstevel@tonic-gate struct gwindows32; 1357c478bd9Sstevel@tonic-gate void prgetwindows32(klwp_t *, struct gwindows32 *); 1367c478bd9Sstevel@tonic-gate #endif /* __sparc */ 1377c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32_IMPL */ 1387c478bd9Sstevel@tonic-gate 1397c478bd9Sstevel@tonic-gate #endif /* defined (_KERNEL) */ 1407c478bd9Sstevel@tonic-gate 1417c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1427c478bd9Sstevel@tonic-gate } 1437c478bd9Sstevel@tonic-gate #endif 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gate #endif /* _SYS_PRSYSTM_H */ 146