thermosphere: vgic code draft

This commit is contained in:
TuxSH
2019-08-18 00:40:47 +02:00
parent 176be2386d
commit c17b81aaf6
7 changed files with 1031 additions and 69 deletions

View File

@@ -21,25 +21,31 @@
#include "exceptions.h"
#include "utils.h"
#define IRQ_PRIORITY_HOST 0
#define IRQ_PRIORITY_GUEST 1
typedef struct IrqManager {
RecursiveSpinlock lock;
ArmGicV2 gic;
u8 numPriorityLevels;
u8 numCpuInterfaces;
u8 numSharedInterrupts;
u8 numListRegisters;
// Note: we don't store interrupt handlers since we will handle some SGI + uart interrupt(s)...
} IrqManager;
typedef enum ThermosphereSgi {
ThermosphereSgi_ExecuteFunction = 0,
ThermosphereSgi_VgicUpdate = 1,
ThermosphereSgi_Max = 1,
ThermosphereSgi_Max = 2,
} ThermosphereSgi;
extern IrqManager g_irqManager;
void initIrq(void);
void handleIrqException(ExceptionStackFrame *frame, bool isLowerEl, bool isA32);
bool isGuestIrq(u16 id);
static inline void generateSgiForAllOthers(ThermosphereSgi id)
{