summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-11-09 22:22:21 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-17 23:50:20 +0200
commita656f71a7cde2285d41a4a03f2951982eac0002f (patch)
tree4066e1c87295d4da2e96a206db1214c1e83ca34c
parent298fd075dc3421943fabcde938aef7bcb34c47ae (diff)
2002-11-09 Marcus Brinkmann <marcus@gnu.org>
* i386/i386/pcb.c (switch_context): Update the I/O permission bitmap from stack_handoff() here (not only in stack_handoff()).
-rw-r--r--ChangeLog5
-rw-r--r--i386/i386/pcb.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b4fa29ed..8c79b043 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-09 Marcus Brinkmann <marcus@gnu.org>
+
+ * 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 <roland@frob.com>
* 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);
}
}