From 0baeff3d96eae184e775c1064f1836090446a7bf Mon Sep 17 00:00:00 2001 From: rab Date: Fri, 6 Jan 2006 10:19:31 -0800 Subject: 6219276 need per-process equivalent of device context 6244042 x86 kernels do not need default LDTs 6308413 sysi86(SI86DSCR) rejects the first valid custom descriptor #6 with errno 6308413 contributed by Juergen Keil --- usr/src/uts/common/os/lwp.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'usr/src/uts/common/os/lwp.c') diff --git a/usr/src/uts/common/os/lwp.c b/usr/src/uts/common/os/lwp.c index df3f6767e8..dbccf77b9e 100644 --- a/usr/src/uts/common/os/lwp.c +++ b/usr/src/uts/common/os/lwp.c @@ -21,7 +21,7 @@ */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -785,6 +785,12 @@ lwp_exit(void) * death-row by resume(). Avoid preemption after resetting t->t_procp. */ t->t_preempt++; + + if (t->t_ctx != NULL) + exitctx(t); + if (p->p_pctx != NULL) + exitpctx(p); + t->t_procp = &p0; /* @@ -817,9 +823,6 @@ lwp_exit(void) lwp_pcb_exit(); - if (t->t_ctx != NULL) - exitctx(t); - t->t_state = TS_ZOMB; swtch_from_zombie(); /* never returns */ @@ -1617,12 +1620,7 @@ forklwp(klwp_t *lwp, proc_t *cp, id_t lwpid) lwp_forkregs(lwp, clwp); /* - * fork device context, if any. - * - * Someday we could do the work to support the possibility of - * forkctx() or lwp_createctx() failing. Currently, this would - * only be needed on x86 for the occasional process using a - * private LDT. + * Fork thread context ops, if any. */ if (t->t_ctx) forkctx(t, ct); -- cgit v1.2.3