fixed really all bugs, for real
This commit is contained in:
@@ -8,7 +8,9 @@ extern Key kout_key;
|
||||
namespace Epilogues {
|
||||
|
||||
void keyboard(Vault& g) {
|
||||
g.kout.setPos(0,0);
|
||||
g.kout << kout_key.ascii() << flush ;
|
||||
|
||||
}
|
||||
|
||||
void timer(Vault& g) { (void)g; }
|
||||
|
||||
@@ -25,7 +25,7 @@ Guarded::~Guarded() { Guard::leave(); }
|
||||
|
||||
Guarded Guard::enter() {
|
||||
epi_flag FOR_CURRENT_CORE = true;
|
||||
Core::Interrupt::enable();
|
||||
//Core::Interrupt::enable();
|
||||
global_lock.lock();
|
||||
return Guarded(global_vault);
|
||||
}
|
||||
@@ -34,16 +34,17 @@ void Guard::leave() {
|
||||
bool istate = Core::Interrupt::disable();
|
||||
|
||||
Epilogue next;
|
||||
global_lock.unlock();
|
||||
while(epilogue_queue FOR_CURRENT_CORE.consume(next)){
|
||||
Core::Interrupt::enable();
|
||||
global_lock.lock();
|
||||
next(global_vault);
|
||||
global_lock.unlock();
|
||||
Core::Interrupt::disable();
|
||||
}
|
||||
epi_flag FOR_CURRENT_CORE = false;
|
||||
global_lock.unlock();
|
||||
Core::Interrupt::restore(istate);
|
||||
}
|
||||
|
||||
void Guard::relay(Epilogue handler) {
|
||||
//if(!epilogue_queue FOR_CURRENT_CORE.produce(handler))
|
||||
// return; // enqueue, but dont execute
|
||||
@@ -62,9 +63,9 @@ void Guard::relay(Epilogue handler) {
|
||||
epi_flag FOR_CURRENT_CORE = true;
|
||||
global_lock.lock();
|
||||
handler(global_vault);
|
||||
global_lock.unlock();
|
||||
leave();
|
||||
}
|
||||
epilogue_queue->consume(handler);
|
||||
//epilogue_queue->consume(handler);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -79,15 +79,16 @@ extern Vault keyboard_vault;
|
||||
void handle_keyboard() {
|
||||
//Key key = Key();
|
||||
if (PS2Controller::fetch(kout_key)) {
|
||||
Guard::relay(Epilogues::keyboard);
|
||||
LAPIC::endOfInterrupt();
|
||||
if (kout_key.ctrl() && kout_key.alt() && kout_key.scancode == Key::KEY_DEL)
|
||||
System::reboot();
|
||||
Guard::relay(Epilogues::keyboard);
|
||||
//koutlock.lock();
|
||||
//kout << key.ascii() << endl << flush ;
|
||||
//koutlock.unlock();
|
||||
}
|
||||
else if (kout_key.ctrl() && kout_key.alt() && kout_key.scancode == Key::KEY_DEL)
|
||||
System::reboot();
|
||||
|
||||
LAPIC::endOfInterrupt();
|
||||
else
|
||||
LAPIC::endOfInterrupt();
|
||||
}
|
||||
|
||||
[[gnu::interrupt]] void handle_panic(InterruptContext *context) {
|
||||
|
||||
Reference in New Issue
Block a user