[PATCH 11/26] sparc: Move CPU_Interrupt_frame related defines

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Nov 15 13:51:43 UTC 2016


Move CPU_Interrupt_frame related defines to <rtems/score/cpuimpl.h>.

Update #2809.
---
 c/src/lib/libbsp/sparc/shared/irq_asm.S            |  2 +-
 cpukit/score/cpu/sparc/cpu.c                       |  7 ++-
 cpukit/score/cpu/sparc/rtems/score/cpu.h           | 50 ---------------------
 cpukit/score/cpu/sparc/rtems/score/cpuimpl.h       | 51 +++++++++++++++++++++-
 cpukit/score/cpu/sparc/sparc-context-validate.S    |  2 +-
 .../cpu/sparc/sparc-context-volatile-clobber.S     |  2 +-
 6 files changed, 59 insertions(+), 55 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/shared/irq_asm.S b/c/src/lib/libbsp/sparc/shared/irq_asm.S
index 3143b10..7a595d1 100644
--- a/c/src/lib/libbsp/sparc/shared/irq_asm.S
+++ b/c/src/lib/libbsp/sparc/shared/irq_asm.S
@@ -393,7 +393,7 @@ dont_do_the_window:
          *  REGISTERS SAME AS AT _ISR_Handler
          */
 
-        sub     %fp, CONTEXT_CONTROL_INTERRUPT_FRAME_SIZE, %sp
+        sub     %fp, CPU_INTERRUPT_FRAME_SIZE, %sp
                                                ! make space for ISF
 
         std     %l0, [%sp + ISF_PSR_OFFSET]    ! save psr, PC
diff --git a/cpukit/score/cpu/sparc/cpu.c b/cpukit/score/cpu/sparc/cpu.c
index 5afad17..92d1c66 100644
--- a/cpukit/score/cpu/sparc/cpu.c
+++ b/cpukit/score/cpu/sparc/cpu.c
@@ -106,7 +106,12 @@ SPARC_ASSERT_ISF_OFFSET(y, Y);
 SPARC_ASSERT_ISF_OFFSET(tpc, TPC);
 
 RTEMS_STATIC_ASSERT(
-  sizeof(CPU_Interrupt_frame) == CONTEXT_CONTROL_INTERRUPT_FRAME_SIZE,
+  sizeof(SPARC_Minimum_stack_frame) == SPARC_MINIMUM_STACK_FRAME_SIZE,
+  SPARC_MINIMUM_STACK_FRAME_SIZE
+);
+
+RTEMS_STATIC_ASSERT(
+  sizeof(CPU_Interrupt_frame) == CPU_INTERRUPT_FRAME_SIZE,
   CPU_Interrupt_frame_size
 );
 
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h
index f0f8110..27393b7 100644
--- a/cpukit/score/cpu/sparc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h
@@ -344,9 +344,6 @@ typedef struct {
 /** This macro defines an offset into the stack frame for use in assembly. */
 #define CPU_STACK_FRAME_PAD0_OFFSET           0x5c
 
-/** This defines the size of the minimum stack frame. */
-#define SPARC_MINIMUM_STACK_FRAME_SIZE          0x60
-
 #define CPU_MAXIMUM_PROCESSORS 32
 
 /**
@@ -683,53 +680,6 @@ typedef struct {
 
 #endif /* ASM */
 
-/*
- *  Offsets of fields with CPU_Interrupt_frame for assembly routines.
- */
-
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_PSR_OFFSET         SPARC_MINIMUM_STACK_FRAME_SIZE + 0x00
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_PC_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x04
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_NPC_OFFSET         SPARC_MINIMUM_STACK_FRAME_SIZE + 0x08
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_G1_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x0c
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_G2_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x10
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_G3_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x14
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_G4_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x18
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_G5_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x1c
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_G7_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x24
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_I0_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x28
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_I1_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x2c
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_I2_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x30
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_I3_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x34
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_I4_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x38
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_I5_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x3c
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_I6_FP_OFFSET       SPARC_MINIMUM_STACK_FRAME_SIZE + 0x40
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_I7_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x44
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_Y_OFFSET           SPARC_MINIMUM_STACK_FRAME_SIZE + 0x48
-/** This macro defines an offset into the ISF for use in assembly. */
-#define ISF_TPC_OFFSET         SPARC_MINIMUM_STACK_FRAME_SIZE + 0x4c
-
-/** This defines the size of the ISF area for use in assembly. */
-#define CONTEXT_CONTROL_INTERRUPT_FRAME_SIZE \
-        SPARC_MINIMUM_STACK_FRAME_SIZE + 0x50
-
 #ifndef ASM
 /**
  * This variable is contains the initialize context for the FP unit.
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpuimpl.h b/cpukit/score/cpu/sparc/rtems/score/cpuimpl.h
index 27a8d77..51071ab 100644
--- a/cpukit/score/cpu/sparc/rtems/score/cpuimpl.h
+++ b/cpukit/score/cpu/sparc/rtems/score/cpuimpl.h
@@ -5,7 +5,7 @@
  */
 
 /*
- * Copyright (c) 2007 On-Line Applications Research Corporation (OAR)
+ * Copyright (c) 1989, 2007 On-Line Applications Research Corporation (OAR)
  * Copyright (c) 2013, 2016 embedded brains GmbH
  *
  * The license and distribution terms for this file may be
@@ -18,6 +18,55 @@
 
 #include <rtems/score/cpu.h>
 
+/** This defines the size of the minimum stack frame. */
+#define SPARC_MINIMUM_STACK_FRAME_SIZE 0x60
+
+/*
+ *  Offsets of fields with CPU_Interrupt_frame for assembly routines.
+ */
+
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_PSR_OFFSET         SPARC_MINIMUM_STACK_FRAME_SIZE + 0x00
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_PC_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x04
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_NPC_OFFSET         SPARC_MINIMUM_STACK_FRAME_SIZE + 0x08
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_G1_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x0c
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_G2_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x10
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_G3_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x14
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_G4_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x18
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_G5_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x1c
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_G7_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x24
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_I0_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x28
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_I1_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x2c
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_I2_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x30
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_I3_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x34
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_I4_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x38
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_I5_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x3c
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_I6_FP_OFFSET       SPARC_MINIMUM_STACK_FRAME_SIZE + 0x40
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_I7_OFFSET          SPARC_MINIMUM_STACK_FRAME_SIZE + 0x44
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_Y_OFFSET           SPARC_MINIMUM_STACK_FRAME_SIZE + 0x48
+/** This macro defines an offset into the ISF for use in assembly. */
+#define ISF_TPC_OFFSET         SPARC_MINIMUM_STACK_FRAME_SIZE + 0x4c
+
+/** This defines the size of the ISF area for use in assembly. */
+#define CPU_INTERRUPT_FRAME_SIZE SPARC_MINIMUM_STACK_FRAME_SIZE + 0x50
+
 #if ( SPARC_HAS_FPU == 1 )
   #define CPU_PER_CPU_CONTROL_SIZE 8
 #else
diff --git a/cpukit/score/cpu/sparc/sparc-context-validate.S b/cpukit/score/cpu/sparc/sparc-context-validate.S
index af77721..e0724e0 100644
--- a/cpukit/score/cpu/sparc/sparc-context-validate.S
+++ b/cpukit/score/cpu/sparc/sparc-context-validate.S
@@ -17,7 +17,7 @@
 #endif
 
 #include <rtems/asm.h>
-#include <rtems/score/cpu.h>
+#include <rtems/score/cpuimpl.h>
 
 #define FRAME_OFFSET_BUFFER_0 (SPARC_MINIMUM_STACK_FRAME_SIZE)
 #define FRAME_OFFSET_BUFFER_1 (FRAME_OFFSET_BUFFER_0 + 0x04)
diff --git a/cpukit/score/cpu/sparc/sparc-context-volatile-clobber.S b/cpukit/score/cpu/sparc/sparc-context-volatile-clobber.S
index feed22b..d221c44 100644
--- a/cpukit/score/cpu/sparc/sparc-context-volatile-clobber.S
+++ b/cpukit/score/cpu/sparc/sparc-context-volatile-clobber.S
@@ -17,7 +17,7 @@
 #endif
 
 #include <rtems/asm.h>
-#include <rtems/score/cpu.h>
+#include <rtems/score/cpuimpl.h>
 
 #define SCRATCH_0 (SPARC_MINIMUM_STACK_FRAME_SIZE)
 #define SCRATCH_1 (SCRATCH_0 + 0x04)
-- 
1.8.4.5




More information about the devel mailing list