4 * Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/)
5 * Copyright 2004 Giovanni Bajo
6 * This file is part of DevLib - See README.devlib for information.
9 * \brief CPU detection through special preprocessor macros
15 *#* Revision 1.2 2005/06/14 06:15:10 bernie
16 *#* Add X86_64 support.
18 *#* Revision 1.1 2005/04/11 19:04:13 bernie
19 *#* Move top-level headers to cfg/ subdir.
21 *#* Revision 1.4 2005/02/16 20:33:24 bernie
22 *#* Preliminary PPC support.
24 *#* Revision 1.3 2004/12/31 17:39:26 bernie
25 *#* Use C89 comments only.
27 *#* Revision 1.2 2004/08/25 14:12:08 rasky
28 *#* Aggiornato il comment block dei log RCS
30 *#* Revision 1.1 2004/07/30 17:14:49 rasky
31 *#* File sfuggito al commit precedente (nuova gestione unificata del detect della CPU
33 *#* Revision 1.2 2004/07/30 10:31:07 rasky
34 *#* Aggiunto detect per ATmega128
40 #if defined(__IAR_SYSTEMS_ICC) || defined(__IAR_SYSTEMS_ICC__)
47 #if defined(__i386__) /* GCC */ \
48 || (defined(_M_IX86) && !defined(_WIN64)) /* MSVC */
53 #elif defined(__x86_64__) /* GCC */ \
54 || (defined(_M_IX86) && defined(_WIN64)) /* MSVC */
65 #if defined (_ARCH_PPC) || defined(_ARCH_PPC64)
68 #if defined(_ARCH_PPC)
73 #if defined(_ARCH_PPC64)
84 #if defined(__m56800E__) || defined(__m56800__)
95 #if defined(__AVR_ATmega64__)
96 #define CPU_AVR_ATMEGA64 1
98 #define CPU_AVR_ATMEGA64 0
101 #if defined(__AVR_ATmega103__)
102 #define CPU_AVR_ATMEGA103 1
104 #define CPU_AVR_ATMEGA103 0
107 #if defined(__AVR_ATmega128__)
108 #define CPU_AVR_ATMEGA128 1
110 #define CPU_AVR_ATMEGA128 0
113 #if defined(__AVR_ATmega8__)
114 #define CPU_AVR_ATMEGA8 1
116 #define CPU_AVR_ATMEGA8 0
120 #define CPU_AVR_ATMEGA8 0
121 #define CPU_AVR_ATMEGA64 0
122 #define CPU_AVR_ATMEGA103 0
123 #define CPU_AVR_ATMEGA128 0
127 /* Self-check for the detection: only one CPU must be detected */
128 #if CPU_I196 + CPU_X86 + CPU_PPC + CPU_DSP56K + CPU_AVR == 0
130 #elif !defined(CPU_ID)
131 #error CPU_ID not defined
132 #elif CPU_I196 + CPU_X86 + CPU_PPC + CPU_DSP56K + CPU_AVR != 1
133 #error Internal CPU configuration error
137 #endif /* CPU_DETECT_H */