klwp.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_KLWP_H
#define _SYS_KLWP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/ucontext.h>
#include <sys/contract.h>
#include <sys/machparam.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* The light-weight process object and the methods by which it
* is accessed.
*/
/* lwp_eosys values */
#define NORMALRETURN 0 /* normal return; adjusts PC, registers */
/*
* Resource usage, per-lwp plus per-process (sum over defunct lwps).
*/
struct lrusage {
};
typedef struct _klwp {
/*
* user-mode context
*/
/*
* system-call interface
*/
long *lwp_ap; /* pointer to arglist */
int lwp_errno; /* error for current syscall (private) */
/*
* support for I/O
*/
char lwp_error; /* return error code */
char lwp_eosys; /* special action on end of syscall */
char lwp_argsaved; /* are all args in lwp_arg */
char lwp_watchtrap; /* lwp undergoing watchpoint single-step */
void *lwp_regs; /* pointer to saved regs on stack */
void *lwp_fpu; /* pointer to fpu regs */
/*
* signal handling and debugger (/proc) interface
*/
struct lwp_watch { /* used in watchpoint single-stepping */
int wpcode;
int wpmapped;
/*
* Microstate accounting. Timestamps are made at the start and the
* and the corresponding accounting info is updated. The current
* microstate is kept in the thread struct, since there are cases
* when one thread must update another thread's state (a no-no
* microstate stuff is kept here to avoid wasting space on things
* like kernel threads that don't have an associated lwp.
*/
struct mstate {
int ms_prev; /* previous running mstate */
} lwp_mstate;
/*
* Per-lwp resource usage.
*/
/*
* Things to keep for real-time (SIGPROF) profiling.
*/
int lwp_lastfault;
/*
* timers. Protected by lwp->procp->p_lock
*/
/*
*/
char lwp_unused;
/*
* Last failed privilege.
*/
short lwp_badpriv;
/*
* linkage
*/
struct _kthread *lwp_thread;
/*
* Contracts
*/
} klwp_t;
/* lwp states */
#if defined(_KERNEL)
extern int lwp_default_stksize;
extern int lwp_reapcnt;
extern struct _kthread *lwp_deathrow;
extern struct kmem_cache *lwp_cache;
extern void *segkp_lwp;
/* where newly-created lwps normally start */
extern void lwp_rtt(void);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_KLWP_H */