Changeset 924e17a in rtems

Jun 25, 1998, 4:10:45 PM (23 years ago)
Joel Sherrill <joel.sherrill@…>
4.10, 4.11, 4.8, 4.9, 5, master

Patch from Robin Kirkham <Robin.Kirkham@…> to distinguish
between CPU32 and CPU32+ cores. Commentary follows:

Unfortunately c/src/exec/score/cpu/m68k/m68k.h incorrectly defines
M68K_HAS_MISALIGNED for the plain old CPU32 (it is correct for the CPU32+).
As a consequence, the recently-relocated m68k memcpy() may still attempt
misaligned memory accesses.

I suggest that until such time as egcs/gcc differentiates these cores
that we invent a new preprocessor symbol, RTEMSmcpu32p for this
purpose, on the assumption that egcs may one day grow a -mcpu32+ option
which will define a mcpu32p symbol (whether this option would also
define mcpu32 is yet to be resolved).

BSPs that have a CPU32+ (like gen68360) would for the time being define
RTEMSmcpu32p using -D. The symbol is `RTEMSmcpu32p' because
symbols of the form xxx should only be defined by the compiler

Note that the patch tests for RTEMSmcpu32p *before* mcpu32, since
mcpu32 is still defined for the CPU32+. It does not change the
gen68360 BSP.

An aside:
Note that in egcs-1.0.3a, the option -m68332 is identical to -mcpu32,
except it defines mc68332 as well as mcpu32. This is only
for the sake of compatibility. The story with -m68302 is similar;
it defines mc68302 and mc68000. In my opinion these options
are depreciated and ought to be avoided in RTEMS.

1 edited


  • c/src/exec/score/cpu/m68k/m68k.h

    r803de41 r924e17a  
    3838 *     -m68040
    3939 *     -m68040 -msoft-float
    40  *     -m68302        (no FP)
    41  *     -m68332        (no FP)
     40 *     -m68302        (no FP) (deprecated, use -m68000)
     41 *     -m68332        (no FP) (deprecated, use -mcpu32)
    4242 *     -mcpu32        (no FP)
     43 *
     44 *  As of gcc 2.8.1 and egcs 1.1, there is no distinction made between
     45 *  the CPU32 and CPU32+.  The option -mcpu32 generates code which can
     46 *  be run on either core.  RTEMS distinguishes between these two cores
     47 *  because they have different alignment rules which impact performance.
     48 *  If you are using a CPU32+, then the symbol RTEMS__mcpu32p__ should
     49 *  be defined in your custom file (see make/custom/gen68360.cfg for an
     50 *  example of how to do this.  If gcc ever distinguishes between these
     51 *  two cores, then RTEMS__mcpu32p__ usage will be replaced with the
     52 *  appropriate compiler defined predefine.
    4353 *
    4454 *  Here is some information on the 040 variants (courtesy of Doug McBride,
    130140#define M68K_HAS_FPSP_PACKAGE    0
    132 #elif defined(__mc68332__)
    134 #define CPU_MODEL_NAME          "mcpu32"
    135 #define M68K_HAS_VBR             1
    136 #define M68K_HAS_SEPARATE_STACKS 0
    137 #define M68K_HAS_BFFFO           0
    138 #define M68K_HAS_PREINDEXING     1
    139 #define M68K_HAS_EXTB_L          1
    140 #define M68K_HAS_MISALIGNED      0
     142  /* gcc and egcs do not distinguish between CPU32 and CPU32+ */
     143#elif defined(RTEMS__mcpu32p__)
     145#define CPU_MODEL_NAME          "mcpu32+"
     146#define M68K_HAS_VBR             1
     147#define M68K_HAS_SEPARATE_STACKS 0
     148#define M68K_HAS_BFFFO           0
     149#define M68K_HAS_PREINDEXING     1
     150#define M68K_HAS_EXTB_L          1
     151#define M68K_HAS_MISALIGNED      1
    141152#define M68K_HAS_FPU             0
    142153#define M68K_HAS_FPSP_PACKAGE    0
    144155#elif defined(__mcpu32__)
    146 #define CPU_MODEL_NAME          "mcpu32+"
    147 #define M68K_HAS_VBR             1
    148 #define M68K_HAS_SEPARATE_STACKS 0
    149 #define M68K_HAS_BFFFO           0
    150 #define M68K_HAS_PREINDEXING     1
    151 #define M68K_HAS_EXTB_L          1
    152 #define M68K_HAS_MISALIGNED      1
     157#define CPU_MODEL_NAME          "mcpu32"
     158#define M68K_HAS_VBR             1
     159#define M68K_HAS_SEPARATE_STACKS 0
     160#define M68K_HAS_BFFFO           0
     161#define M68K_HAS_PREINDEXING     1
     162#define M68K_HAS_EXTB_L          1
     163#define M68K_HAS_MISALIGNED      0
    153164#define M68K_HAS_FPU             0
    154165#define M68K_HAS_FPSP_PACKAGE    0
Note: See TracChangeset for help on using the changeset viewer.