thermosphere: barrier & active core mask

This commit is contained in:
TuxSH
2019-08-12 23:24:30 +02:00
parent c34df08ed9
commit 322d796004
7 changed files with 111 additions and 14 deletions

View File

@@ -30,27 +30,33 @@ typedef struct IrqManager {
// Note: we don't store interrupt handlers since we will handle some SGI + uart interrupt(s)...
} IrqManager;
typedef enum ThermosphereSgi {
ThermosphereSgi_ExecuteFunction = 0,
ThermosphereSgi_Max = 1,
} ThermosphereSgi;
extern IrqManager g_irqManager;
void initIrq(void);
void handleIrqException(ExceptionStackFrame *frame, bool isLowerEl, bool isA32);
static inline void generateSgiForAllOthers(u32 id)
static inline void generateSgiForAllOthers(ThermosphereSgi id)
{
g_irqManager.gic.gicd->sgir = (1 << 24) | (id & 0xF);
g_irqManager.gic.gicd->sgir = (1 << 24) | ((u32)id & 0xF);
}
static inline void generateSgiForSelf(u32 id)
static inline void generateSgiForSelf(ThermosphereSgi id)
{
g_irqManager.gic.gicd->sgir = (2 << 24) | (id & 0xF);
g_irqManager.gic.gicd->sgir = (2 << 24) | ((u32)id & 0xF);
}
static inline void generateSgiForList(u32 id, u32 list)
static inline void generateSgiForList(ThermosphereSgi id, u32 list)
{
g_irqManager.gic.gicd->sgir = (0 << 24) | (list << 16) | (id & 0xF);
g_irqManager.gic.gicd->sgir = (0 << 24) | (list << 16) | ((u32)id & 0xF);
}
static inline void generateSgiForAll(u32 id)
static inline void generateSgiForAll(ThermosphereSgi id)
{
generateSgiForList(id, MASK(g_irqManager.numCpuInterfaces));
}