From e21fdbf3d4ec5bf3d2556f270d57af29e710e430 Mon Sep 17 00:00:00 2001 From: ChUrl Date: Thu, 8 Dec 2022 13:31:02 +0100 Subject: [PATCH] IntDispatcher: Use default initialization instead of loop --- src/kernel/interrupt/IntDispatcher.cc | 3 ++- src/kernel/interrupt/IntDispatcher.h | 19 ++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/kernel/interrupt/IntDispatcher.cc b/src/kernel/interrupt/IntDispatcher.cc index d2bff5c..c21096e 100755 --- a/src/kernel/interrupt/IntDispatcher.cc +++ b/src/kernel/interrupt/IntDispatcher.cc @@ -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 */ diff --git a/src/kernel/interrupt/IntDispatcher.h b/src/kernel/interrupt/IntDispatcher.h index b3ed31b..b048c04 100755 --- a/src/kernel/interrupt/IntDispatcher.h +++ b/src/kernel/interrupt/IntDispatcher.h @@ -29,19 +29,9 @@ public: }; public: - IntDispatcher(const IntDispatcher ©) = 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 ©) = 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 handlerMap; + Container::Array handlerMap = {nullptr}; - NamedLogger log; + static NamedLogger log; }; }