1

IntDispatcher: Use default initialization instead of loop

This commit is contained in:
2022-12-08 13:31:02 +01:00
parent 4532afffb4
commit e21fdbf3d4
2 changed files with 6 additions and 16 deletions

View File

@ -15,10 +15,11 @@
#include "kernel/system/Globals.h"
#include "kernel/exception/Bluescreen.h"
#include "lib/util/System.h"
#include "kernel/system/System.h"
namespace Kernel {
NamedLogger IntDispatcher::log = NamedLogger("IntDispatcher");
int IntDispatcher::assign(uint8_t vector, ISR &isr) {
/* hier muss Code eingefuegt werden */

View File

@ -29,19 +29,9 @@ public:
};
public:
IntDispatcher(const IntDispatcher &copy) = delete; // Verhindere Kopieren
IntDispatcher() = default;
// TODO: Somehow the logs don't appear, is this not executed, does the Array::iterator not work?
IntDispatcher() : log("IntDis") {
for (ISR *&slot: handlerMap) { // TODO: What the fuck is *&
if (slot == nullptr) {
log.debug() << "SLOT IS NULLPTR" << endl;
} else {
log.debug() << "SLOT IS NOT NULLPTR" << endl;
slot = nullptr;
}
}
}
IntDispatcher(const IntDispatcher &copy) = delete; // Verhindere Kopieren
// Registrierung einer ISR. (Rueckgabewert: 0 = Erfolg, -1 = Fehler)
int assign(uint8_t vector, ISR &isr);
@ -50,10 +40,9 @@ public:
int dispatch(uint8_t vector);
private:
// TODO: Initialize to nullptr like this: handlerMap = {nullptr};
Container::Array<ISR *, 256> handlerMap;
Container::Array<ISR *, 256> handlerMap = {nullptr};
NamedLogger log;
static NamedLogger log;
};
}