summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2021-11-16 10:26:00 -0600
committerJoel Sherrill <joel@rtems.org>2021-11-22 15:51:40 -0600
commit50cf19320d8886b9999ada4b6296ea08d5affd5f (patch)
tree081bc7fbf15d0f01fe64ca7e2b25f6c9dcf5f6b1
parent18484f02adfa27b16af5d5e12a4cbe8010eb3c60 (diff)
downloadrtems-50cf19320d8886b9999ada4b6296ea08d5affd5f.tar.bz2
cpukit: Enable debug for SMP AArch64
Ensure when both RTEMS_DEBUG is specified and pointers are large that enough space is allocated to accomodate the Per_CPU_Control structure. This changes the calculation to be more compositional instead of trying to list out every permutation of options possible.
-rw-r--r--cpukit/include/rtems/score/percpu.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/cpukit/include/rtems/score/percpu.h b/cpukit/include/rtems/score/percpu.h
index 6081653a86..0794f15f69 100644
--- a/cpukit/include/rtems/score/percpu.h
+++ b/cpukit/include/rtems/score/percpu.h
@@ -38,18 +38,31 @@
extern "C" {
#endif
-#if defined(RTEMS_SMP)
- #if defined(RTEMS_PROFILING)
- #define PER_CPU_CONTROL_SIZE_APPROX \
- ( 512 + CPU_PER_CPU_CONTROL_SIZE + CPU_INTERRUPT_FRAME_SIZE )
- #elif defined(RTEMS_DEBUG) || CPU_SIZEOF_POINTER > 4
- #define PER_CPU_CONTROL_SIZE_APPROX \
- ( 256 + CPU_PER_CPU_CONTROL_SIZE + CPU_INTERRUPT_FRAME_SIZE )
+#if defined( RTEMS_SMP )
+ #if defined( RTEMS_PROFILING )
+ #define PER_CPU_CONTROL_SIZE_PROFILING 332
+ #else
+ #define PER_CPU_CONTROL_SIZE_PROFILING 0
+ #endif
+
+ #if defined( RTEMS_DEBUG )
+ #define PER_CPU_CONTROL_SIZE_DEBUG 76
#else
- #define PER_CPU_CONTROL_SIZE_APPROX \
- ( 180 + CPU_PER_CPU_CONTROL_SIZE + CPU_INTERRUPT_FRAME_SIZE )
+ #define PER_CPU_CONTROL_SIZE_DEBUG 0
#endif
+ #if CPU_SIZEOF_POINTER > 4
+ #define PER_CPU_CONTROL_SIZE_BIG_POINTER 76
+ #else
+ #define PER_CPU_CONTROL_SIZE_BIG_POINTER 0
+ #endif
+
+ #define PER_CPU_CONTROL_SIZE_BASE 180
+ #define PER_CPU_CONTROL_SIZE_APPROX \
+ ( PER_CPU_CONTROL_SIZE_BASE + CPU_PER_CPU_CONTROL_SIZE + \
+ CPU_INTERRUPT_FRAME_SIZE + PER_CPU_CONTROL_SIZE_PROFILING + \
+ PER_CPU_CONTROL_SIZE_DEBUG + PER_CPU_CONTROL_SIZE_BIG_POINTER )
+
/*
* This ensures that on SMP configurations the individual per-CPU controls
* are on different cache lines to prevent false sharing. This define can be