Print this page
3625 we only need one thread_create_intr
@@ -317,19 +317,12 @@
*
* If stk is NULL, the thread is created at the base of the stack
* and cannot be swapped.
*/
kthread_t *
-thread_create(
- caddr_t stk,
- size_t stksize,
- void (*proc)(),
- void *arg,
- size_t len,
- proc_t *pp,
- int state,
- pri_t pri)
+thread_create(caddr_t stk, size_t stksize, void (*proc)(), void *arg,
+ size_t len, proc_t *pp, int state, pri_t pri)
{
kthread_t *t;
extern struct classfuncs sys_classfuncs;
turnstile_t *ts;
@@ -889,11 +882,11 @@
/*
* cleanup zombie threads that are on deathrow.
*/
void
-thread_reaper()
+thread_reaper(void)
{
kthread_t *t, *l;
callb_cpr_t cprinfo;
/*
@@ -1026,18 +1019,13 @@
/*
* Install thread context ops for the current thread.
*/
void
-installctx(
- kthread_t *t,
- void *arg,
- void (*save)(void *),
- void (*restore)(void *),
- void (*fork)(void *, void *),
- void (*lwp_create)(void *, void *),
- void (*exit)(void *),
+installctx(kthread_t *t, void *arg, void (*save)(void *),
+ void (*restore)(void *), void (*fork)(void *, void *),
+ void (*lwp_create)(void *, void *), void (*exit)(void *),
void (*free)(void *, int))
{
struct ctxop *ctx;
ctx = kmem_alloc(sizeof (struct ctxop), KM_SLEEP);
@@ -1054,18 +1042,13 @@
/*
* Remove the thread context ops from a thread.
*/
int
-removectx(
- kthread_t *t,
- void *arg,
- void (*save)(void *),
- void (*restore)(void *),
- void (*fork)(void *, void *),
- void (*lwp_create)(void *, void *),
- void (*exit)(void *),
+removectx(kthread_t *t, void *arg, void (*save)(void *),
+ void (*restore)(void *), void (*fork)(void *, void *),
+ void (*lwp_create)(void *, void *), void (*exit)(void *),
void (*free)(void *, int))
{
struct ctxop *ctx, *prev_ctx;
/*
@@ -1298,11 +1281,11 @@
* thread pointer so it may be resumed.
*
* Called by swtch() only at high spl.
*/
kthread_t *
-thread_unpin()
+thread_unpin(void)
{
kthread_t *t = curthread; /* current thread */
kthread_t *itp; /* interrupted thread */
int i; /* interrupt level */
extern int intr_passivate();
@@ -1346,65 +1329,10 @@
return (itp);
}
/*
- * Create and initialize an interrupt thread.
- * Returns non-zero on error.
- * Called at spl7() or better.
- */
-void
-thread_create_intr(struct cpu *cp)
-{
- kthread_t *tp;
-
- tp = thread_create(NULL, 0,
- (void (*)())thread_create_intr, NULL, 0, &p0, TS_ONPROC, 0);
-
- /*
- * Set the thread in the TS_FREE state. The state will change
- * to TS_ONPROC only while the interrupt is active. Think of these
- * as being on a private free list for the CPU. Being TS_FREE keeps
- * inactive interrupt threads out of debugger thread lists.
- *
- * We cannot call thread_create with TS_FREE because of the current
- * checks there for ONPROC. Fix this when thread_create takes flags.
- */
- THREAD_FREEINTR(tp, cp);
-
- /*
- * Nobody should ever reference the credentials of an interrupt
- * thread so make it NULL to catch any such references.
- */
- tp->t_cred = NULL;
- tp->t_flag |= T_INTR_THREAD;
- tp->t_cpu = cp;
- tp->t_bound_cpu = cp;
- tp->t_disp_queue = cp->cpu_disp;
- tp->t_affinitycnt = 1;
- tp->t_preempt = 1;
-
- /*
- * Don't make a user-requested binding on this thread so that
- * the processor can be offlined.
- */
- tp->t_bind_cpu = PBIND_NONE; /* no USER-requested binding */
- tp->t_bind_pset = PS_NONE;
-
-#if defined(__i386) || defined(__amd64)
- tp->t_stk -= STACK_ALIGN;
- *(tp->t_stk) = 0; /* terminate intr thread stack */
-#endif
-
- /*
- * Link onto CPU's interrupt pool.
- */
- tp->t_link = cp->cpu_intr_thread;
- cp->cpu_intr_thread = tp;
-}
-
-/*
* TSD -- THREAD SPECIFIC DATA
*/
static kmutex_t tsd_mutex; /* linked list spin lock */
static uint_t tsd_nkeys; /* size of destructor array */
/* per-key destructor funcs */