/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_KLWP_H
#define _SYS_KLWP_H
#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 */
/*
* Resource usage, per-lwp plus per-process (sum over defunct lwps).
*/
struct lrusage {
};
typedef struct _klwp {
/*
* user-mode context
*/
/*
* system-call interface
*/
/*
* support for I/O
*/
/*
* signal handling and debugger (/proc) interface
*/
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 {
} 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
*/
/*
* 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 */