This commit is contained in:
Niklas Gollenstede
2025-04-14 11:20:52 +02:00
commit 5a2e32aaeb
126 changed files with 16742 additions and 0 deletions

30
interrupt/guard.cc Normal file
View File

@@ -0,0 +1,30 @@
#include "guard.h"
#include "../arch/core.h"
#include "../debug/output.h"
#include "../object/bbuffer.h"
#include "../sync/ticketlock.h"
#include "epilogues.h"
#define FOR_CURRENT_CORE [Core::getID()]
//! \brief The protected data for the epilogue level
static Vault global_vault;
// lists of pending epilogues
static BBuffer<Epilogue, 32> epilogue_queue[Core::MAX] = {};
// Big Kernel Lock (BKL) for the epilogue level
constinit Ticketlock global_lock;
constinit bool epi_flag[Core::MAX] = {false};
Vault::Vault() {}
Guarded::~Guarded() { Guard::leave(); }
Guarded Guard::enter() { while (true); }
void Guard::leave() {}
void Guard::relay(Epilogue handler) { (void)handler; }
const Vault &Guard::unsafeConstAccess() { return global_vault; }