write kernel sp to tss in dispatcher
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// vim: set noet ts=4 sw=4:
|
||||
|
||||
#include "dispatcher.h"
|
||||
#include "../arch/tss.h"
|
||||
#include "thread.h"
|
||||
|
||||
#include "../arch/core.h"
|
||||
#include "../debug/output.h" // IWYU pragma: keep
|
||||
@@ -12,6 +14,7 @@ Thread *Dispatcher::active() const { return life; }
|
||||
void Dispatcher::go(Thread *first) {
|
||||
assert(active() == nullptr);
|
||||
setActive(first);
|
||||
mytss.sp0 = first->StackPointer.isr;
|
||||
first->go();
|
||||
}
|
||||
|
||||
@@ -20,7 +23,7 @@ void Dispatcher::dispatch(Thread *next) {
|
||||
assert(current != nullptr);
|
||||
if (current != next) {
|
||||
setActive(next);
|
||||
|
||||
mytss.sp0 = next->StackPointer.isr;
|
||||
current->resume(next);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user