feat(scheduler): working scheduler
This commit is contained in:
@@ -52,14 +52,18 @@ void GICCWriteEOIR(UInt32 irqID) {
|
||||
GICC[kGICCEOIR / 4] = irqID;
|
||||
}
|
||||
|
||||
void GICDispatch(ExceptionsType type) {
|
||||
if (type != ExceptionsIRQEl1h && type != ExceptionsIRQEl064) return;
|
||||
Address GICDispatch(ExceptionsContext* frame, ExceptionsType type) {
|
||||
if (type != ExceptionsIRQEl1h && type != ExceptionsIRQEl064) return (Address)frame;
|
||||
UInt32 irqID = GICCReadIAR() & 0x3FF;
|
||||
if (irqID == 1023) return; // spurious interrupt
|
||||
if (irqID == 1023) return (Address)frame; // spurious interrupt
|
||||
|
||||
|
||||
Address newStackPointer = (Address)frame;
|
||||
|
||||
if (irqID == kTimerIRQ) {
|
||||
TimerReset(kTimerFrequency);
|
||||
newStackPointer = TimerHandler(frame);
|
||||
}
|
||||
|
||||
GICCWriteEOIR(irqID);
|
||||
return newStackPointer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user