/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_PROC_PRDATA_H
#define _SYS_PROC_PRDATA_H
#include <sys/isa_defs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Test for thread being stopped, not on an event of interest,
* but with a directed stop in effect.
*/
#define DSTOPPED(t) \
((t)->t_state == TS_STOPPED && \
((t)->t_proc_flag & TP_PRSTOP))
/*
* Common file object to which all /proc vnodes for a specific process
* or lwp refer. One for the process, one for each lwp.
*/
typedef struct prcommon {
} prcommon_t;
/* prc_flags */
/*
* Macros for mapping between i-numbers and pids.
*/
(nodetype) + 2)
/* for old /proc interface */
/*
* Node types for /proc files (directories and files contained therein).
*/
typedef enum prnodetype {
#endif
#if defined(__sparc)
#endif
} prnodetype_t;
typedef struct prnode {
} prnode_t;
/*
* Values for pr_flags.
*/
/*
* Conversion macros.
*/
/*
* Flags to prlock().
*/
/*
* Assign one set to another (possible different sizes).
*
* Assigning to a smaller set causes members to be lost.
* Assigning to a larger set causes extra members to be cleared.
*/
{ \
while (--_i_ >= 0) \
}
/*
* Determine whether or not a set (of arbitrary size) is empty.
*/
/*
* Resource usage with times as hrtime_t rather than timestruc_t.
* Each member exactly matches the corresponding member in prusage_t.
* This is for convenience of internal computation.
*/
typedef struct prhusage {
} prhusage_t;
#if defined(_KERNEL)
/* Exclude system processes from this test */
#define PROCESS_NOT_32BIT(p) \
(p)->p_model != DATAMODEL_ILP32)
extern int prnwatch; /* number of supported watchpoints */
extern int nproc_highbit; /* highbit(v.v_nproc) */
extern struct vnodeops *prvnodeops;
/*
* Generic chained copyout buffers for procfs use.
* In order to prevent procfs from making huge oversize kmem_alloc calls,
* a list of smaller buffers can be concatenated and copied to userspace in
* sequence.
*
* The implementation is opaque.
*
* A user of this will perform the following steps:
*
* list_t listhead;
* struct my *mp;
*
* pr_iol_initlist(&listhead, sizeof (*mp), n);
* while (whatever) {
* mp = pr_iol_newbuf(&listhead, sizeof (*mp);
* ...
* error = ...
* }
*
* When done, depending on whether copyout() or uiomove() is supposed to
* be used for transferring the buffered data to userspace, call either:
*
* error = pr_iol_copyout_and_free(&listhead, &cmaddr, error);
*
* or else:
*
* error = pr_iol_uiomove_and_free(&listhead, uiop, error);
*
* These two functions will in any case kmem_free() all list items, but
* are updated. The error returned will either be the one passed in, or
*/
#if defined(_SYSCALL32_IMPL)
#endif /* _SYSCALL32_IMPL */
/* kludge to support old /proc interface */
#if !defined(_SYS_OLD_PROCFS_H)
#if defined(_SYSCALL32_IMPL)
#endif /* _SYSCALL32_IMPL */
#endif /* !_SYS_OLD_PROCFS_H */
extern void pr_wait_die(prnode_t *);
extern void prscaleusage(prhusage_t *);
extern void prfreenode(prnode_t *);
extern void pr_free_watchpoints(proc_t *);
/*
* Machine-dependent routines (defined in prmachdep.c).
*/
#if defined(_SYSCALL32_IMPL)
#endif /* _SYSCALL32_IMPL */
extern void prpokethread(kthread_t *t);
extern int prgetrvals(klwp_t *, long *, long *);
extern int prgetprxregsize(proc_t *);
extern int prhasfp(void);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PROC_PRDATA_H */