diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2008-07-10 21:51:55 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2008-07-10 21:51:55 +0000 |
commit | e1df032b954cc3dbde843b47bce2d55507470f8c (patch) | |
tree | fdb84d411be9376991b81a7d882ec6dc427fe5e6 /c/src/lib/libcpu | |
parent | 2008-07-10 Till Straumann <strauman@slac.stanford.edu> (diff) | |
download | rtems-e1df032b954cc3dbde843b47bce2d55507470f8c.tar.bz2 |
2008-07-10 Till Straumann <strauman@slac.stanford.edu>
* ChangeLog, mpc8xx/clock/clock.c, ppc403/clock/clock.c,
ppc403/irq/ictrl.h, rtems/powerpc/powerpc.h:
Removed all macro definitions which depended on
the compiler defining a PPC CPU-model dependent
symbol from files in cpukit.
Macros which were not used by cpukit have been
moved to libcpu/powerpc/rtems/powerpc/powerpc.h.
Diffstat (limited to 'c/src/lib/libcpu')
-rw-r--r-- | c/src/lib/libcpu/powerpc/ChangeLog | 10 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c | 1 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/ppc403/clock/clock.c | 1 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/ppc403/irq/ictrl.h | 1 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h | 151 |
5 files changed, 26 insertions, 138 deletions
diff --git a/c/src/lib/libcpu/powerpc/ChangeLog b/c/src/lib/libcpu/powerpc/ChangeLog index 30c8fadbe8..f2f8e1cb29 100644 --- a/c/src/lib/libcpu/powerpc/ChangeLog +++ b/c/src/lib/libcpu/powerpc/ChangeLog @@ -1,5 +1,15 @@ 2008-07-10 Till Straumann <strauman@slac.stanford.edu> + * ChangeLog, mpc8xx/clock/clock.c, ppc403/clock/clock.c, + ppc403/irq/ictrl.h, rtems/powerpc/powerpc.h: + Removed all macro definitions which depended on + the compiler defining a PPC CPU-model dependent + symbol from files in cpukit. + Macros which were not used by cpukit have been + moved to libcpu/powerpc/rtems/powerpc/powerpc.h. + +2008-07-10 Till Straumann <strauman@slac.stanford.edu> + * new-exceptions/bspsupport/README, new-exceptions/bspsupport/ppc_exc.S, new-exceptions/bspsupport/ppc_exc_asm_macros.h, diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c b/c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c index 30cf071615..8fd50f5ba5 100644 --- a/c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c +++ b/c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c @@ -38,6 +38,7 @@ #include <rtems.h> #include <rtems/clockdrv.h> #include <rtems/libio.h> +#include <rtems/powerpc/powerpc.h> #include <stdlib.h> /* for atexit() */ #include <mpc8xx.h> diff --git a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c index 2910ac68a8..18de62efc7 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c +++ b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c @@ -42,6 +42,7 @@ #include <rtems/libio.h> #include <stdlib.h> /* for atexit() */ #include <rtems/bspIo.h> +#include <rtems/powerpc/powerpc.h> /* * check, which exception handling code is present */ diff --git a/c/src/lib/libcpu/powerpc/ppc403/irq/ictrl.h b/c/src/lib/libcpu/powerpc/ppc403/irq/ictrl.h index 4370788108..cda39dc5cf 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/irq/ictrl.h +++ b/c/src/lib/libcpu/powerpc/ppc403/irq/ictrl.h @@ -30,6 +30,7 @@ #include <rtems.h> #include <rtems/system.h> #include <rtems/score/isr.h> +#include <rtems/powerpc/powerpc.h> #ifdef __cplusplus extern "C" { #endif diff --git a/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h b/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h index 727e9ad0d4..9d9db55bc5 100644 --- a/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h +++ b/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h @@ -1,5 +1,5 @@ /** - * @file rtems/score/powerpc.h + * @file rtems/powerpc/powerpc.h */ /* @@ -49,13 +49,19 @@ extern "C" { #endif -#include <rtems/score/powerpc.h> -/* - * Define the name of the CPU family. +/* Till S. 2008/07/10: + * + * Using the macros/definitions which depend on a preprocessor + * symbol defining the CPU flavor is discouraged. + * I recommend to not use definitions from this file and + * in particular - not to add more bits and pieces. + * + * Instead, try to use run-time detection (see e.g. cpuIdent.c/cpuIdent.h) + * of features etc. */ -#define CPU_NAME "PowerPC" +#include <rtems/score/powerpc.h> /* * This file contains the information required to build @@ -71,9 +77,6 @@ extern "C" { * + PPC_CACHE_ALIGNMENT - 32 * + PPC_LOW_POWER_MODE - PPC_LOW_POWER_MODE_NONE * + PPC_HAS_EXCEPTION_PREFIX - 1 - * + PPC_HAS_FPU - 1 - * + PPC_HAS_DOUBLE - 1 if PPC_HAS_FPU, - * - 0 otherwise * + PPC_USE_MULTIPLE - 0 */ @@ -102,11 +105,6 @@ extern "C" { * Does not have user mode. */ -#if defined(ppc403) -#define CPU_MODEL_NAME "PowerPC 403" -#elif defined (ppc405) -#define CPU_MODEL_NAME "PowerPC 405" -#endif #define PPC_CACHE_ALIGNMENT 16 #define PPC_HAS_RI 0 #define PPC_HAS_RFCI 1 @@ -119,8 +117,6 @@ extern "C" { #elif defined(mpc555) -#define CPU_MODEL_NAME "PowerPC 555" - /* Copied from mpc505 */ #define PPC_CACHE_ALIGNMENT 16 @@ -138,8 +134,6 @@ extern "C" { * to get the setting correct. */ -#define CPU_MODEL_NAME "PowerPC 505/509" - #define PPC_CACHE_ALIGNMENT 16 #define PPC_I_CACHE 4096 #define PPC_D_CACHE 0 @@ -151,36 +145,20 @@ extern "C" { * Submitted with original port -- book checked only. */ -#define CPU_MODEL_NAME "PowerPC 601" - #define PPC_USE_MULTIPLE 1 #define PPC_I_CACHE 0 #define PPC_D_CACHE 32768 -#elif defined(ppc602) -/* - * Submitted with original port -- book checked only. - */ - -#define CPU_MODEL_NAME "PowerPC 602" - -#define PPC_HAS_DOUBLE 0 -#define PPC_I_CACHE 4096 -#define PPC_D_CACHE 4096 - #elif defined(ppc603) /* * Submitted with original port -- book checked only. */ -#define CPU_MODEL_NAME "PowerPC 603" - #define PPC_I_CACHE 8192 #define PPC_D_CACHE 8192 #elif defined(ppc603e) -#define CPU_MODEL_NAME "PowerPC 603e" /* * Submitted with original port. * @@ -197,8 +175,6 @@ extern "C" { * Submitted with original port -- book checked only. */ -#define CPU_MODEL_NAME "PowerPC 604" - #define PPC_I_CACHE 16384 #define PPC_D_CACHE 16384 @@ -207,8 +183,6 @@ extern "C" { * Added by Jay Monkman (jmonkman@frasca.com) 6/28/98 * with some changes by Darlene Stewart (Darlene.Stewart@iit.nrc.ca) */ -#define CPU_MODEL_NAME "PowerPC MPC860" - #define PPC_I_CACHE 4096 #define PPC_D_CACHE 4096 #define PPC_CACHE_ALIGNMENT 16 @@ -224,8 +198,6 @@ extern "C" { /* * Added by Andrew Bray <andy@chaos.org.uk> 6/April/1999 */ -#define CPU_MODEL_NAME "PowerPC MPC821" - #define PPC_I_CACHE 4096 #define PPC_D_CACHE 4096 #define PPC_CACHE_ALIGNMENT 16 @@ -238,15 +210,11 @@ extern "C" { #elif defined(mpc750) -#define CPU_MODEL_NAME "PowerPC 750" - #define PPC_I_CACHE 16384 #define PPC_D_CACHE 16384 #elif defined(mpc7400) -#define CPU_MODEL_NAME "PowerPC 7400" - #define PPC_I_CACHE 32768 #define PPC_D_CACHE 32768 @@ -255,8 +223,6 @@ extern "C" { * Added by S.K. Feng <feng1@bnl.gov> 10/03 */ -#define CPU_MODEL_NAME "PowerPC 7455" - #define PPC_CACHE_ALIGNMENT 32 #define PPC_I_CACHE 32768 #define PPC_D_CACHE 32768 @@ -265,8 +231,6 @@ extern "C" { /* * Added by Andy Dachs <a.dachs@sstl.co.uk> 23/11/2000 */ -#define CPU_MODEL_NAME "PowerPC MPC8260" - #define PPC_I_CACHE 16384 #define PPC_D_CACHE 16384 #define PPC_CACHE_ALIGNMENT 32 @@ -274,10 +238,8 @@ extern "C" { #define PPC_USE_MULTIPLE 1 #elif defined(__ppc_generic) -/* PPC_INTERRUPT_MAX and PPC_CACHE_ALIGNMENT already defined by score/powerc.h */ -#ifndef PPC_ABI -#define PPC_ABI PPC_ABI_SVR4 -#endif +#define PPC_CACHE_ALIGNMENT 32 + #else #error "Unsupported CPU Model" @@ -285,56 +247,6 @@ extern "C" { #endif /* - * Application binary interfaces. - * - * PPC_ABI MUST be defined as one of these. - * Only big endian is currently supported. - */ -/* - * SVR4 ABI - */ -#define PPC_ABI_SVR4 2 -/* - * Embedded ABI - */ -#define PPC_ABI_EABI 3 - -/* - * Default to the EABI used by current GNU tools - */ - -#ifndef PPC_ABI -#define PPC_ABI PPC_ABI_EABI -#endif - -#if (PPC_ABI == PPC_ABI_SVR4) -#define PPC_STACK_ALIGNMENT 16 -#elif (PPC_ABI == PPC_ABI_EABI) -#define PPC_STACK_ALIGNMENT 8 -#else -#error "PPC_ABI is not properly defined" -#endif - -/* - * Assemblers. - * PPC_ASM MUST be defined as one of these. - * - * PPC_ASM_ELF: ELF assembler. Currently used for all ABIs. - * - * NOTE: Only PPC_ABI_ELF is currently fully supported. - */ - -#define PPC_ASM_ELF 0 - -/* - * Default to the assembler format used by the current GNU tools. - */ - -#ifndef PPC_ASM -#define PPC_ASM PPC_ASM_ELF -#endif - -/* * If the maximum number of exception sources has not been defined, * then default it to 16. */ @@ -396,36 +308,6 @@ extern "C" { #endif /* - * Unless specified above, assume PPC_HAS_FPU to be a synonym for _SOFT_FLOAT. - * FIXME: Should we tie PPC_HAS_FPU to _SOFT_FLOAT, directly - * and disallow explicitly setting PPC_HAS_FPU? - */ - -#ifndef PPC_HAS_FPU -#ifdef _SOFT_FLOAT -#define PPC_HAS_FPU 0 -#else -#define PPC_HAS_FPU 1 -#endif -#endif - -/* - * Unless specified above, If the model has FP support, it is assumed to - * support doubles (8-byte floating point numbers). - * - * If the model does NOT have FP support, then the model does - * NOT have double length FP registers. - */ - -#ifndef PPC_HAS_DOUBLE -#if (PPC_HAS_FPU) -#define PPC_HAS_DOUBLE 1 -#else -#define PPC_HAS_DOUBLE 0 -#endif -#endif - -/* * Unless specified above, then assume the model does NOT have critical * interrupt support. */ @@ -712,13 +594,6 @@ extern "C" { #define PPC_MSR_DISABLE_MASK (PPC_MSR_ME|PPC_MSR_EE|PPC_MSR_CE) -/* - * Initial value for the FPSCR register - */ - -#define PPC_INIT_FPSCR 0x000000f8 - - #define PPC_MINIMUM_STACK_FRAME_SIZE PPC_STACK_ALIGNMENT #ifdef __cplusplus |