From cf4f5f64a528e0a1f2334eff4ec61b564b109b45 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 13 Oct 2023 14:11:56 +0300 Subject: [PATCH] Kernel: add NEVER_INLINE and make Interruptable not constructable --- kernel/include/kernel/Attributes.h | 3 ++- kernel/include/kernel/InterruptController.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/include/kernel/Attributes.h b/kernel/include/kernel/Attributes.h index a8168232..159d931f 100644 --- a/kernel/include/kernel/Attributes.h +++ b/kernel/include/kernel/Attributes.h @@ -1,3 +1,4 @@ #pragma once -#define ALWAYS_INLINE inline __attribute__((always_inline)) \ No newline at end of file +#define ALWAYS_INLINE inline __attribute__((always_inline)) +#define NEVER_INLINE __attribute__((noinline)) diff --git a/kernel/include/kernel/InterruptController.h b/kernel/include/kernel/InterruptController.h index 06ed0a8a..505f0343 100644 --- a/kernel/include/kernel/InterruptController.h +++ b/kernel/include/kernel/InterruptController.h @@ -11,14 +11,16 @@ namespace Kernel class Interruptable { public: - Interruptable() = default; - void set_irq(int irq); void enable_interrupt(); void disable_interrupt(); virtual void handle_irq() = 0; + protected: + Interruptable() = default; + ~Interruptable() {} + private: int m_irq { -1 }; };