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 | * $Id$ |
---|
18 | * |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef _RTEMS_SCORE_AVR_H |
---|
22 | #define _RTEMS_SCORE_AVR_H |
---|
23 | |
---|
24 | #ifdef __cplusplus |
---|
25 | extern "C" { |
---|
26 | #endif |
---|
27 | |
---|
28 | /* |
---|
29 | * This file contains the information required to build |
---|
30 | * RTEMS for a particular member of the NO CPU family. |
---|
31 | * It does this by setting variables to indicate which |
---|
32 | * implementation dependent features are present in a particular |
---|
33 | * member of the family. |
---|
34 | * |
---|
35 | * This is a good place to list all the known CPU models |
---|
36 | * that this port supports and which RTEMS CPU model they correspond |
---|
37 | * to. |
---|
38 | */ |
---|
39 | |
---|
40 | /* |
---|
41 | * Figure out all CPU Model Feature Flags based upon compiler |
---|
42 | * predefines. |
---|
43 | */ |
---|
44 | #if defined(__AVR__) |
---|
45 | |
---|
46 | #if defined(__AVR_ARCH__) |
---|
47 | #if __AVR_ARCH__ == 1 |
---|
48 | #define CPU_MODEL_NAME "avr1" |
---|
49 | #define AVR_HAS_FPU 1 |
---|
50 | |
---|
51 | #elif __AVR_ARCH__ == 2 |
---|
52 | #define CPU_MODEL_NAME "avr2" |
---|
53 | #define AVR_HAS_FPU 1 |
---|
54 | |
---|
55 | #elif __AVR_ARCH__ == 3 |
---|
56 | #define CPU_MODEL_NAME "avr3" |
---|
57 | #define AVR_HAS_FPU 1 |
---|
58 | |
---|
59 | #elif __AVR_ARCH__ == 4 |
---|
60 | #define CPU_MODEL_NAME "avr4" |
---|
61 | #define AVR_HAS_FPU 1 |
---|
62 | |
---|
63 | #elif __AVR_ARCH__ == 5 |
---|
64 | #define CPU_MODEL_NAME "avr5" |
---|
65 | #define AVR_HAS_FPU 1 |
---|
66 | |
---|
67 | #else |
---|
68 | #error "Unsupported __AVR_ARCH__" |
---|
69 | #endif |
---|
70 | #else |
---|
71 | #error "__AVR_ARCH__ undefined" |
---|
72 | #endif |
---|
73 | |
---|
74 | #else |
---|
75 | |
---|
76 | #error "Unsupported CPU Model" |
---|
77 | |
---|
78 | #endif |
---|
79 | |
---|
80 | /* |
---|
81 | * Define the name of the CPU family. |
---|
82 | */ |
---|
83 | |
---|
84 | #define CPU_NAME "avr" |
---|
85 | |
---|
86 | #ifdef __cplusplus |
---|
87 | } |
---|
88 | #endif |
---|
89 | |
---|
90 | #endif /* ! _rtems_score_avr_h */ |
---|