From 63f64619bcf269aa0111f3d4c8b376d27912a05c 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 a816823235..159d931fe9 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 06ed0a8af4..505f0343f0 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 }; };