From a656f71a7cde2285d41a4a03f2951982eac0002f Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sat, 9 Nov 2002 22:22:21 +0000 Subject: 2002-11-09 Marcus Brinkmann * i386/i386/pcb.c (switch_context): Update the I/O permission bitmap from stack_handoff() here (not only in stack_handoff()). --- ChangeLog | 5 +++++ i386/i386/pcb.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index b4fa29ed..8c79b043 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-11-09 Marcus Brinkmann + + * i386/i386/pcb.c (switch_context): Update the I/O permission + bitmap from stack_handoff() here (not only in stack_handoff()). + 2002-11-05 Roland McGrath * oskit/pc/osenv_bell.c (direct_cons_bell): Use a private timer diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c index cd9ecdc6..f83d22ed 100644 --- a/i386/i386/pcb.c +++ b/i386/i386/pcb.c @@ -313,6 +313,19 @@ thread_t switch_context(old, continuation, new) old, mycpu); PMAP_ACTIVATE_USER(vm_map_pmap(new_task->map), new, mycpu); + + simple_lock (&new_task->machine.iopb_lock); +#if NCPUS>1 +#warning SMP support missing (avoid races with io_perm_modify). +#else + /* This optimization only works on a single processor + machine, where old_task's iopb can not change while + we are switching. */ + if (old_task->machine.iopb || new_task->machine.iopb) +#endif + update_ktss_iopb (new_task->machine.iopb, + new_task->machine.iopb_size); + simple_unlock (&new_task->machine.iopb_lock); } } -- cgit v1.2.3