31 lines
		
	
	
		
			752 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			752 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#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; }
 |