From 13c4bc94ca3471c50a0df6f1f7c89ecfae275854 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 20 Feb 2019 10:33:36 -0500 Subject: [PATCH] kernel: Undo changes to pinned threads and blocking. This reverts commit 58ed2965d0362707ca043b365ac1f2e89ee8c789. This reverts commit 055d49b1fd44ba7c450ad40051a2f34f38508b5f. I was mistaken, it is perfectly legal to block a pinned thread. It seems we'll need some other way to detect invalid context switches. --- src/system/kernel/arch/x86/arch_int.cpp | 2 -- src/system/kernel/thread.cpp | 5 ----- 2 files changed, 7 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_int.cpp b/src/system/kernel/arch/x86/arch_int.cpp index b8213c6fcc..5588d5d181 100644 --- a/src/system/kernel/arch/x86/arch_int.cpp +++ b/src/system/kernel/arch/x86/arch_int.cpp @@ -233,9 +233,7 @@ x86_hardware_interrupt(struct iframe* frame) apic_end_of_interrupt(); } - thread->pinned_to_cpu++; int_io_interrupt_handler(vector, levelTriggered); - thread->pinned_to_cpu--; if (levelTriggered) { if (!sCurrentPIC->end_of_interrupt(vector)) diff --git a/src/system/kernel/thread.cpp b/src/system/kernel/thread.cpp index b92bdec833..1315338f1c 100644 --- a/src/system/kernel/thread.cpp +++ b/src/system/kernel/thread.cpp @@ -2847,11 +2847,6 @@ thread_block_timeout(timer* timer) static inline status_t thread_block_locked(Thread* thread) { - if (thread->pinned_to_cpu > 0) { - panic("attempting to block thread %" B_PRId32 ", which is pinned!", - thread->id); - } - if (thread->wait.status == 1) { // check for signals, if interruptible if (thread_is_interrupted(thread, thread->wait.flags)) {