summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/m68k
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-01-25 14:32:02 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-01-26 07:31:09 +0100
commit27bfcd88f7e65c81b406afa85d81b060e2ea24e3 (patch)
tree17063cc375987e424335b9003da0c3ffdb7b9947 /cpukit/score/cpu/m68k
parentpsxtests: Relax shared memory tests (diff)
downloadrtems-27bfcd88f7e65c81b406afa85d81b060e2ea24e3.tar.bz2
score: Delete _CPU_Context_Fp_start()
Since the FP area pointer is passed by reference in _CPU_Context_Initialize_fp() the optional FP area adjustment via _CPU_Context_Fp_start() is superfluous. It is also wrong with respect to memory management, e.g. pointer passed to _Workspace_Free() may be not the one returned by _Workspace_Allocate(). Close #1400.
Diffstat (limited to 'cpukit/score/cpu/m68k')
-rw-r--r--cpukit/score/cpu/m68k/rtems/score/cpu.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/cpukit/score/cpu/m68k/rtems/score/cpu.h b/cpukit/score/cpu/m68k/rtems/score/cpu.h
index 0b9aa2df6d..2be10c9638 100644
--- a/cpukit/score/cpu/m68k/rtems/score/cpu.h
+++ b/cpukit/score/cpu/m68k/rtems/score/cpu.h
@@ -172,12 +172,6 @@ typedef struct {
} _operand2;
} Context_Control_fp;
- /*
- * This software FP implementation is only for GCC.
- */
- #define _CPU_Context_Fp_start( _base, _offset ) \
- ((void *) _Addresses_Add_offset( (_base), (_offset) ) )
-
#define _CPU_Context_Initialize_fp( _fp_area ) \
{ \
Context_Control_fp *_fp; \
@@ -234,9 +228,6 @@ typedef struct {
#endif
} Context_Control_fp;
- #define _CPU_Context_Fp_start( _base, _offset ) \
- ((void *) _Addresses_Add_offset( (_base), (_offset) ))
-
/*
* The reset value for all context relevant registers except the FP data
* registers is zero. The reset value of the FP data register is NAN. The
@@ -260,17 +251,15 @@ typedef struct {
uint8_t fp_save_area [M68K_FP_STATE_SIZE + 112];
} Context_Control_fp;
- #define _CPU_Context_Fp_start( _base, _offset ) \
- ( \
- (void *) _Addresses_Add_offset( \
- (_base), \
- (_offset) + CPU_CONTEXT_FP_SIZE - 4 \
- ) \
- )
-
+ /*
+ * The floating-point context is saved/restored via FSAVE/FRESTORE which
+ * use a growing down stack. Initialize the stack and adjust the FP area
+ * pointer accordingly.
+ */
#define _CPU_Context_Initialize_fp( _fp_area ) \
{ \
- uint32_t *_fp_context = (uint32_t *)*(_fp_area); \
+ uint32_t *_fp_context = _Addresses_Add_offset( \
+ *(_fp_area), CPU_CONTEXT_FP_SIZE - 4); \
*(--(_fp_context)) = 0; \
*(_fp_area) = (void *)(_fp_context); \
}