summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2022-10-23 16:20:25 +1100
committerDamien Zammit <damien@zamaudio.com>2022-10-23 16:20:25 +1100
commit4e730f91a399d6e02a6fe65f4927e206e7b7473b (patch)
tree2199142c6484b5f81de32b3867034e6ab0af4fb7
parentb1299d23dcf70779775437023d101a605e648f28 (diff)
Fix pcb.cfeat-smp
-rw-r--r--i386/i386/pcb.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c
index d45c53a3..71abd8fa 100644
--- a/i386/i386/pcb.c
+++ b/i386/i386/pcb.c
@@ -123,8 +123,8 @@ vm_offset_t stack_detach(thread_t thread)
#define curr_gdt(mycpu) (mp_gdt[mycpu])
#define curr_ktss(mycpu) (mp_ktss[mycpu])
#else
-#define curr_gdt(mycpu) ((void)(mycpu), gdt)
-#define curr_ktss(mycpu) ((void)(mycpu), (struct task_tss *)&ktss)
+#define curr_gdt(mycpu) (gdt)
+#define curr_ktss(mycpu) ((struct task_tss *)&ktss)
#endif
#define gdt_desc_p(mycpu,sel) \
@@ -282,8 +282,7 @@ void stack_handoff(
vm_offset_t stack;
task_t old_task, new_task;
int mycpu;
-
- spl_t s = splhigh();
+ spl_t s;
mycpu = cpu_number();
@@ -302,10 +301,11 @@ void stack_handoff(
PMAP_ACTIVATE_USER(vm_map_pmap(new_task->map),
new, mycpu);
+ s = splhigh();
simple_lock (&new_task->machine.iopb_lock);
- if (new_task->machine.iopb)
- update_ktss_iopb (new_task->machine.iopb, new_task->machine.iopb_size);
+ update_ktss_iopb (new_task->machine.iopb, new_task->machine.iopb_size);
simple_unlock (&new_task->machine.iopb_lock);
+ splx(s);
}
/*
@@ -327,8 +327,6 @@ void stack_handoff(
*/
STACK_IEL(stack)->saved_state = USER_REGS(new);
-
- splx(s);
}
/*
@@ -371,8 +369,7 @@ thread_t switch_context(
s = splhigh();
simple_lock (&new_task->machine.iopb_lock);
- if (new_task->machine.iopb)
- update_ktss_iopb (new_task->machine.iopb, new_task->machine.iopb_size);
+ update_ktss_iopb (new_task->machine.iopb, new_task->machine.iopb_size);
simple_unlock (&new_task->machine.iopb_lock);
splx(s);
}