1 | /** |
---|
2 | * @file rtems/score/avr.h |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * This file sets up basic CPU dependency settings based on |
---|
7 | * compiler settings. For example, it can determine if |
---|
8 | * floating point is available. This particular implementation |
---|
9 | * is specified to the avr port. |
---|
10 | * |
---|
11 | * COPYRIGHT 2004, Ralf Corsepius, Ulm, Germany. |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.com/license/LICENSE. |
---|
16 | * |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef _RTEMS_SCORE_AVR_H |
---|
20 | #define _RTEMS_SCORE_AVR_H |
---|
21 | |
---|
22 | #ifdef __cplusplus |
---|
23 | extern "C" { |
---|
24 | #endif |
---|
25 | |
---|
26 | /* |
---|
27 | * This file contains the information required to build |
---|
28 | * RTEMS for a particular member of the NO CPU family. |
---|
29 | * It does this by setting variables to indicate which |
---|
30 | * implementation dependent features are present in a particular |
---|
31 | * member of the family. |
---|
32 | * |
---|
33 | * This is a good place to list all the known CPU models |
---|
34 | * that this port supports and which RTEMS CPU model they correspond |
---|
35 | * to. |
---|
36 | */ |
---|
37 | |
---|
38 | /* |
---|
39 | * Figure out all CPU Model Feature Flags based upon compiler |
---|
40 | * predefines. |
---|
41 | */ |
---|
42 | #if defined(__AVR__) |
---|
43 | |
---|
44 | #if defined(__AVR_ARCH__) |
---|
45 | #if __AVR_ARCH__ == 1 |
---|
46 | #define CPU_MODEL_NAME "avr1" |
---|
47 | #define AVR_HAS_FPU 1 |
---|
48 | |
---|
49 | #elif __AVR_ARCH__ == 2 |
---|
50 | #define CPU_MODEL_NAME "avr2" |
---|
51 | #define AVR_HAS_FPU 1 |
---|
52 | |
---|
53 | #elif __AVR_ARCH__ == 3 |
---|
54 | #define CPU_MODEL_NAME "avr3" |
---|
55 | #define AVR_HAS_FPU 1 |
---|
56 | |
---|
57 | #elif __AVR_ARCH__ == 4 |
---|
58 | #define CPU_MODEL_NAME "avr4" |
---|
59 | #define AVR_HAS_FPU 1 |
---|
60 | |
---|
61 | #elif __AVR_ARCH__ == 5 |
---|
62 | #define CPU_MODEL_NAME "avr5" |
---|
63 | #define AVR_HAS_FPU 1 |
---|
64 | |
---|
65 | #elif __AVR_ARCH__ == 25 |
---|
66 | #define CPU_MODEL_NAME "avr25" |
---|
67 | #define AVR_HAS_FPU 1 |
---|
68 | |
---|
69 | #elif __AVR_ARCH__ == 31 |
---|
70 | #define CPU_MODEL_NAME "avr31" |
---|
71 | #define AVR_HAS_FPU 1 |
---|
72 | |
---|
73 | #elif __AVR_ARCH__ == 35 |
---|
74 | #define CPU_MODEL_NAME "avr35" |
---|
75 | #define AVR_HAS_FPU 1 |
---|
76 | |
---|
77 | #elif __AVR_ARCH__ == 51 |
---|
78 | #define CPU_MODEL_NAME "avr51" |
---|
79 | #define AVR_HAS_FPU 1 |
---|
80 | |
---|
81 | #elif __AVR_ARCH__ == 6 |
---|
82 | #define CPU_MODEL_NAME "avr6" |
---|
83 | #define AVR_HAS_FPU 1 |
---|
84 | |
---|
85 | #else |
---|
86 | #error "Unsupported __AVR_ARCH__" |
---|
87 | #endif |
---|
88 | #else |
---|
89 | #error "__AVR_ARCH__ undefined" |
---|
90 | #endif |
---|
91 | |
---|
92 | #else |
---|
93 | |
---|
94 | #error "Unsupported CPU Model" |
---|
95 | |
---|
96 | #endif |
---|
97 | |
---|
98 | /* |
---|
99 | * Define the name of the CPU family. |
---|
100 | */ |
---|
101 | |
---|
102 | #define CPU_NAME "avr" |
---|
103 | |
---|
104 | #ifdef __cplusplus |
---|
105 | } |
---|
106 | #endif |
---|
107 | |
---|
108 | #endif /* _RTEMS_SCORE_AVR_H */ |
---|