X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=cpu_detect.h;h=6909ab5512cc4b43c2577fee204be6b29327a197;hb=b3a25d5dc805f7f92262a2156d82b0cf5a9e5492;hp=aca9c554f6bf18f4c446a9383adc936e2ff66ff0;hpb=43eafa5bd0ec0d61c6d21b309108b8b05660cbf8;p=bertos.git diff --git a/cpu_detect.h b/cpu_detect.h index aca9c554..6909ab55 100755 --- a/cpu_detect.h +++ b/cpu_detect.h @@ -1,9 +1,9 @@ /*! * \file * * * \brief CPU detection through special preprocessor macros @@ -12,6 +12,9 @@ /*#* *#* $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. *#* @@ -23,13 +26,6 @@ *#* *#* 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 - *#* *#*/ #ifndef CPU_DETECT_H @@ -49,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 @@ -93,11 +108,11 @@ /* Self-check for the detection: only one CPU must be detected */ -#if CPU_I196 + CPU_X86 + CPU_DSP56K + CPU_AVR == 0 +#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