From 3704c8323fd1897bb1160ebeea0ce693341e5dc9 Mon Sep 17 00:00:00 2001
From: Terraneo Federico <fede.tft@miosix.org>
Date: Wed, 8 Jan 2025 14:11:46 +0100
Subject: [PATCH] Incomplete fix to compile again the kernel with processes

---
 miosix/arch/cpu/armv6m/interfaces-impl/userspace_impl.h | 2 +-
 miosix/arch/cpu/armv7m/interfaces-impl/cpu.cpp          | 1 +
 miosix/arch/cpu/armv7m/interfaces-impl/userspace_impl.h | 2 +-
 miosix/arch/cpu/common/cortexMx_interrupts.cpp          | 1 +
 miosix/interfaces_private/userspace.h                   | 1 +
 miosix/kernel/kernel.h                                  | 3 +++
 6 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/miosix/arch/cpu/armv6m/interfaces-impl/userspace_impl.h b/miosix/arch/cpu/armv6m/interfaces-impl/userspace_impl.h
index bb1a317a..b0fcfcd8 100644
--- a/miosix/arch/cpu/armv6m/interfaces-impl/userspace_impl.h
+++ b/miosix/arch/cpu/armv6m/interfaces-impl/userspace_impl.h
@@ -91,7 +91,7 @@ namespace fault {
 enum FaultType
 {
     NONE=0,          //Not a fault
-    STACKOVERFLOW=1  //Stack overflow
+    STACKOVERFLOW=1, //Stack overflow
     MP=2,            //Process attempted data access outside its memory
     MP_NOADDR=3,     //Process attempted data access outside its memory (missing addr)
     MP_XN=4,         //Process attempted code access outside its memory
diff --git a/miosix/arch/cpu/armv7m/interfaces-impl/cpu.cpp b/miosix/arch/cpu/armv7m/interfaces-impl/cpu.cpp
index d6d016ef..d39c43bf 100644
--- a/miosix/arch/cpu/armv7m/interfaces-impl/cpu.cpp
+++ b/miosix/arch/cpu/armv7m/interfaces-impl/cpu.cpp
@@ -26,6 +26,7 @@
  ***************************************************************************/
 
 #include "interfaces_private/cpu.h"
+#include "interfaces_private/userspace.h"
 #include "interfaces/arch_registers.h"
 #include "kernel/kernel.h"
 
diff --git a/miosix/arch/cpu/armv7m/interfaces-impl/userspace_impl.h b/miosix/arch/cpu/armv7m/interfaces-impl/userspace_impl.h
index bb1a317a..b0fcfcd8 100644
--- a/miosix/arch/cpu/armv7m/interfaces-impl/userspace_impl.h
+++ b/miosix/arch/cpu/armv7m/interfaces-impl/userspace_impl.h
@@ -91,7 +91,7 @@ namespace fault {
 enum FaultType
 {
     NONE=0,          //Not a fault
-    STACKOVERFLOW=1  //Stack overflow
+    STACKOVERFLOW=1, //Stack overflow
     MP=2,            //Process attempted data access outside its memory
     MP_NOADDR=3,     //Process attempted data access outside its memory (missing addr)
     MP_XN=4,         //Process attempted code access outside its memory
diff --git a/miosix/arch/cpu/common/cortexMx_interrupts.cpp b/miosix/arch/cpu/common/cortexMx_interrupts.cpp
index d958c4d1..4f230b77 100644
--- a/miosix/arch/cpu/common/cortexMx_interrupts.cpp
+++ b/miosix/arch/cpu/common/cortexMx_interrupts.cpp
@@ -28,6 +28,7 @@
 #include "util/util.h"
 #include "kernel/logging.h"
 #include "kernel/kernel.h"
+#include "kernel/process.h"
 #include "kernel/scheduler/scheduler.h"
 #include "kernel/boot.h"
 #include "config/miosix_settings.h"
diff --git a/miosix/interfaces_private/userspace.h b/miosix/interfaces_private/userspace.h
index 0172eb53..dce444c5 100644
--- a/miosix/interfaces_private/userspace.h
+++ b/miosix/interfaces_private/userspace.h
@@ -32,6 +32,7 @@
 #error "If your code depends on a private header, it IS broken."
 #endif //COMPILING_MIOSIX
 
+#include <cstddef>
 #include <utility>
 #include "config/miosix_settings.h"
 
diff --git a/miosix/kernel/kernel.h b/miosix/kernel/kernel.h
index 5cc6684b..829519bb 100755
--- a/miosix/kernel/kernel.h
+++ b/miosix/kernel/kernel.h
@@ -413,6 +413,9 @@ class Mutex;
 class ConditionVariable;
 #ifdef WITH_PROCESSES
 class ProcessBase;
+class Process;
+class FaultData;
+class SyscallParameters;
 #endif //WITH_PROCESSES
 
 /**
-- 
GitLab