mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Make i386_set_ldt work on i386/XEN, step 5/5.
When cleaning up a thread, reset its LDT to the default LDT. Note: Casting the LDT pointer to an int and storing it in pc_currentldt is wildly bogus, but is harmless since pc_currentldt is a write-only variable. MFC after: 3 days
This commit is contained in:
parent
698cc19d6b
commit
aaaf607148
2 changed files with 6 additions and 0 deletions
|
|
@ -523,8 +523,13 @@ user_ldt_free(struct thread *td)
|
|||
}
|
||||
|
||||
if (td == PCPU_GET(curthread)) {
|
||||
#ifdef XEN
|
||||
i386_reset_ldt(&default_proc_ldt);
|
||||
PCPU_SET(currentldt, (int)&default_proc_ldt);
|
||||
#else
|
||||
lldt(_default_ldt);
|
||||
PCPU_SET(currentldt, _default_ldt);
|
||||
#endif
|
||||
}
|
||||
|
||||
mdp->md_ldt = NULL;
|
||||
|
|
|
|||
|
|
@ -257,6 +257,7 @@ struct region_descriptor {
|
|||
#ifdef _KERNEL
|
||||
extern int _default_ldt;
|
||||
#ifdef XEN
|
||||
extern struct proc_ldt default_proc_ldt;
|
||||
extern union descriptor *gdt;
|
||||
extern union descriptor *ldt;
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in a new issue