X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=cpu_detect.h;h=6909ab5512cc4b43c2577fee204be6b29327a197;hb=0021318b90d6cc2da07904de709f9901f77b2c86;hp=94b05680af113d94bfc364514ce5a9b6950196f3;hpb=f1710d97efaf32c5e0ff00432b6b9e80d69e1c50;p=bertos.git diff --git a/cpu_detect.h b/cpu_detect.h index 94b05680..6909ab55 100755 --- a/cpu_detect.h +++ b/cpu_detect.h @@ -1,30 +1,32 @@ /*! * \file * * * \brief CPU detection through special preprocessor macros * */ -/* - * $Log$ - * Revision 1.1 2004/07/30 17:14:49 rasky - * File sfuggito al commit precedente (nuova gestione unificata del detect della CPU - * - * Revision 1.2 2004/07/30 10:31:07 rasky - * Aggiunto detect per ATmega128 - * - * Revision 1.1 2004/07/22 16:37:34 rasky - * Nuovo file cpu_detect.h per il detect della CPU - * Nuova macro CPU_HEADER per includere l'header cpu-specific di ogni modulo - * Razionalizzazione dei principali #ifdef per piattaforma con le nuove macro - * Nuove macro-utility PP_STRINGIZE e PP_CATn - * - */ +/*#* + *#* $Log$ + *#* Revision 1.4 2005/02/16 20:33:24 bernie + *#* Preliminary PPC support. + *#* + *#* Revision 1.3 2004/12/31 17:39:26 bernie + *#* Use C89 comments only. + *#* + *#* Revision 1.2 2004/08/25 14:12:08 rasky + *#* Aggiornato il comment block dei log RCS + *#* + *#* Revision 1.1 2004/07/30 17:14:49 rasky + *#* File sfuggito al commit precedente (nuova gestione unificata del detect della CPU + *#* + *#* Revision 1.2 2004/07/30 10:31:07 rasky + *#* Aggiunto detect per ATmega128 + *#*/ #ifndef CPU_DETECT_H #define CPU_DETECT_H @@ -43,6 +45,25 @@ #define CPU_X86 0 #endif +#if defined (_ARCH_PPC) || defined(_ARCH_PPC64) + #define CPU_PPC 1 + #define CPU_ID ppc + #if defined(_ARCH_PPC) + #define CPU_PPC32 1 + #else + #define CPU_PPC32 0 + #endif + #if defined(_ARCH_PPC64) + #define CPU_PPC64 1 + #else + #define CPU_PPC64 0 + #endif +#else + #define CPU_PPC 0 + #define CPU_PPC32 0 + #define CPU_PPC64 0 +#endif + #if defined(__m56800E__) || defined(__m56800__) #define CPU_DSP56K 1 #define CPU_ID dsp56k @@ -86,12 +107,12 @@ #endif -// Self-check for the detection: only one CPU must be detected -#if CPU_I196 + CPU_X86 + CPU_DSP56K + CPU_AVR == 0 +/* Self-check for the detection: only one CPU must be detected */ +#if CPU_I196 + CPU_X86 + CPU_PPC + CPU_DSP56K + CPU_AVR == 0 #error Unknown CPU #elif !defined(CPU_ID) #error CPU_ID not defined -#elif CPU_I196 + CPU_X86 + CPU_DSP56K + CPU_AVR != 1 +#elif CPU_I196 + CPU_X86 + CPU_PPC + CPU_DSP56K + CPU_AVR != 1 #error Internal CPU configuration error #endif