[rtems commit] m68k: Avoid _Addresses_Add_offset()

Sebastian Huber sebh at rtems.org
Tue Jan 29 12:27:16 UTC 2019


Module:    rtems
Branch:    master
Commit:    f0ae613ba72bc4b95797e2482c4bd0fa5546331d
Changeset: http://git.rtems.org/rtems/commit/?id=f0ae613ba72bc4b95797e2482c4bd0fa5546331d

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Jan 17 07:33:08 2019 +0100

m68k: Avoid _Addresses_Add_offset()

This prevents a cyclic dependency between <rtems/score/cpu.h> and
<rtems/score/address.h>.

---

 cpukit/score/cpu/m68k/include/rtems/score/cpu.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/cpukit/score/cpu/m68k/include/rtems/score/cpu.h b/cpukit/score/cpu/m68k/include/rtems/score/cpu.h
index 38fe763..2d48cb0 100644
--- a/cpukit/score/cpu/m68k/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/m68k/include/rtems/score/cpu.h
@@ -222,8 +222,6 @@ typedef struct {
     #define _CPU_Context_Initialize_fp( _fp_area ) \
       memset( *(_fp_area), 0, sizeof( Context_Control_fp ) )
   #else
-    #include <rtems/score/address.h>
-
     /*
      *  FP context save area for the M68881/M68882 and 68060 numeric
      *  coprocessors.
@@ -245,8 +243,8 @@ typedef struct {
      */
     #define _CPU_Context_Initialize_fp( _fp_area ) \
        { \
-         uint32_t *_fp_context = _Addresses_Add_offset( \
-           *(_fp_area), CPU_CONTEXT_FP_SIZE - 4); \
+         uint32_t *_fp_context = (uint32_t *) \
+           ( (uintptr_t) *( _fp_area ) + CPU_CONTEXT_FP_SIZE - 4 ); \
          *(--(_fp_context)) = 0; \
          *(_fp_area) = (void *)(_fp_context); \
        }



More information about the vc mailing list