rum
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "epilogues.h"
|
||||
|
||||
#include "../debug/output.h"
|
||||
#include "guard.h"
|
||||
|
||||
extern Key kout_key;
|
||||
@@ -8,6 +9,7 @@ extern TextStream kout;
|
||||
namespace Epilogues {
|
||||
|
||||
void keyboard(Vault& g) {
|
||||
DBG << "keyboard epi" << endl << flush;
|
||||
(void)g;
|
||||
kout << kout_key.ascii() << endl << flush ;
|
||||
}
|
||||
|
||||
@@ -44,22 +44,23 @@ void Guard::leave() {
|
||||
}
|
||||
|
||||
void Guard::relay(Epilogue handler) {
|
||||
if(!epilogue_queue FOR_CURRENT_CORE.consume(handler))
|
||||
return; // enqueue, but dont execute
|
||||
if(epi_flag FOR_CURRENT_CORE){
|
||||
enter();
|
||||
Core::Interrupt::disable();
|
||||
leave();
|
||||
}
|
||||
//Core::Interrupt::enable(); // goto level 0.5
|
||||
//if(epi_flag FOR_CURRENT_CORE){
|
||||
// epilogue_queue->produce(handler);
|
||||
//}
|
||||
//else{
|
||||
// epi_flag FOR_CURRENT_CORE = true;
|
||||
//if(!epilogue_queue FOR_CURRENT_CORE.produce(handler))
|
||||
// return; // enqueue, but dont execute
|
||||
//if(!epi_flag FOR_CURRENT_CORE){
|
||||
// enter();
|
||||
// Core::Interrupt::enable();
|
||||
// handler(global_vault);
|
||||
// leave(); // maybe not needed since destructor also calls leave
|
||||
// leave();
|
||||
//}
|
||||
Core::Interrupt::enable(); // goto level 0.5
|
||||
if(epi_flag FOR_CURRENT_CORE){
|
||||
epilogue_queue->produce(handler);
|
||||
}
|
||||
else{
|
||||
epi_flag FOR_CURRENT_CORE = true;
|
||||
handler(global_vault);
|
||||
leave(); // maybe not needed since destructor also calls leave
|
||||
}
|
||||
}
|
||||
|
||||
const Vault &Guard::unsafeConstAccess() { return global_vault; }
|
||||
|
||||
@@ -78,6 +78,7 @@ extern Ticketlock koutlock;
|
||||
extern Vault keyboard_vault;
|
||||
|
||||
void handle_keyboard() {
|
||||
DBG << "keyboard pro" << endl << flush;
|
||||
//Key key = Key();
|
||||
if (PS2Controller::fetch(kout_key)) {
|
||||
Guard::relay(Epilogues::keyboard);
|
||||
|
||||
Reference in New Issue
Block a user