|
<< Click to Display Table of Contents >> Navigation: ASA-EMulatR Reference Guide > Introduction > Appendix > Appendix A - Topics - Core > A.3 – Global Singletons |
ASA-EmulatR uses Meyer's Singleton pattern for global subsystem access. Each singleton is a function returning a static local instance, guaranteeing thread-safe lazy initialization (C++20 and later).
Singleton |
Responsibility |
|---|---|
globalHWPCBBank() |
Per-CPU HWPCB context blocks (indexed by cpuId and slot) |
globalIprRegistry() |
IPR storage registry (Hot and Cold partitions) |
globalPalVectorTable() |
PAL exception/interrupt vector table (initialized at startup) |
globalIRQController() |
Interrupt controller (IPL arbitration and delivery) |
globalReservationManager() |
LL/SC reservation tracking (per-CPU, cache-line granularity) |
globalDMACoherencyManager() |
DMA coherency coordination |
globalIPICoordinator() |
IPI routing and coordination |
globalInstructionGrainFactory() |
Instruction grain dispatch decoder table |
global_MemoryBarrierCoordinator() |
SMP memory barrier synchronization |
global_EmulatR_init() |
System initialization coordinator (QScopedPointer-managed subsystems) |
global_EmulatorSettings() |
Configuration (ASA-EmulatR.ini parser, accessed anywhere after load) |
Initialization pattern: global_EmulatR_init() orchestrates system startup. It creates subsystems via QScopedPointer (automatic cleanup) and exposes them via Meyer's Singletons. The main.cpp entry point calls init.initializeSystem() followed by init.initializeDeviceInterrupts(), then enters the Qt event loop.
See Also: initLib/EmulatR_init.cpp; Chapter 20 – Boot Sequence, PAL, and SRM Integration (Phase 0 static construction).