summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/exec.c
diff options
context:
space:
mode:
authorrab <none@none>2006-01-06 10:19:31 -0800
committerrab <none@none>2006-01-06 10:19:31 -0800
commit0baeff3d96eae184e775c1064f1836090446a7bf (patch)
tree223a82fa3266e75588aace66980f22165d83fcff /usr/src/uts/common/os/exec.c
parentd045b9872121ef87817d5d01968d80cc01574bc8 (diff)
downloadillumos-joyent-0baeff3d96eae184e775c1064f1836090446a7bf.tar.gz
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 <jk@tools.de>
Diffstat (limited to 'usr/src/uts/common/os/exec.c')
-rw-r--r--usr/src/uts/common/os/exec.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/usr/src/uts/common/os/exec.c b/usr/src/uts/common/os/exec.c
index 004efdd5ed..e7a44db1d8 100644
--- a/usr/src/uts/common/os/exec.c
+++ b/usr/src/uts/common/os/exec.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -87,11 +87,6 @@ uint_t auxv_hwcap = 0; /* auxv AT_SUN_HWCAP value; determined on the fly */
uint_t auxv_hwcap32 = 0; /* 32-bit version of auxv_hwcap */
#endif
-#if defined(__i386) || defined(__amd64)
-extern void ldt_free(proc_t *p);
-extern void ldt_load(void);
-#endif
-
int exec_lpg_disable = 0;
#define PSUIDFLAGS (SNOCD|SUGID)
@@ -257,10 +252,12 @@ exec_common(const char *fname, const char **argp, const char **envp)
lwp_freeregs(lwp, 1);
/*
- * Free device context
+ * Free thread and process context ops.
*/
if (curthread->t_ctx)
freectx(curthread, 1);
+ if (p->p_pctx)
+ freepctx(p, 1);
/*
* Remember file name for accounting; clear any cached DTrace predicate.
@@ -343,30 +340,6 @@ exec_common(const char *fname, const char **argp, const char **envp)
ASSERT(curthread->t_schedctl == NULL);
-#if defined(__i386) || defined(__amd64)
- /* If the process uses a private LDT then change it to default */
- if (p->p_ldt)
- ldt_free(p);
-#endif /* __i386 || __amd64 */
-
-#if defined(__amd64)
- /*
- * Make sure the process has the correct LDT descriptor for its data
- * model.
- */
- if (p->p_model == DATAMODEL_LP64)
- p->p_ldt_desc = ldt0_default64_desc;
- else
- p->p_ldt_desc = ldt0_default_desc;
-
- /*
- * Ensure the change of LDT is propagated into the LDTR.
- */
- kpreempt_disable();
- ldt_load();
- kpreempt_enable();
-#endif /* __amd64 */
-
#if defined(__sparc)
if (p->p_utraps != NULL)
utrap_free(p);