1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief IBM/Motorola PowerPC Definitions |
---|
5 | * |
---|
6 | * This file contains definitions for the IBM/Motorola PowerPC |
---|
7 | * family members. |
---|
8 | */ |
---|
9 | |
---|
10 | /* |
---|
11 | * Author: Andrew Bray <andy@i-cubed.co.uk> |
---|
12 | * |
---|
13 | * COPYRIGHT (c) 1995 by i-cubed ltd. |
---|
14 | * |
---|
15 | * MPC860 support code was added by Jay Monkman <jmonkman@frasca.com> |
---|
16 | * MPC8260 support added by Andy Dachs <a.dachs@sstl.co.uk> |
---|
17 | * Surrey Satellite Technology Limited |
---|
18 | * |
---|
19 | * To anyone who acknowledges that this file is provided "AS IS" |
---|
20 | * without any express or implied warranty: |
---|
21 | * permission to use, copy, modify, and distribute this file |
---|
22 | * for any purpose is hereby granted without fee, provided that |
---|
23 | * the above copyright notice and this notice appears in all |
---|
24 | * copies, and that the name of i-cubed limited not be used in |
---|
25 | * advertising or publicity pertaining to distribution of the |
---|
26 | * software without specific, written prior permission. |
---|
27 | * i-cubed limited makes no representations about the suitability |
---|
28 | * of this software for any purpose. |
---|
29 | * |
---|
30 | * Derived from c/src/exec/cpu/no_cpu/no_cpu.h: |
---|
31 | * |
---|
32 | * COPYRIGHT (c) 1989-1997. |
---|
33 | * On-Line Applications Research Corporation (OAR). |
---|
34 | * |
---|
35 | * The license and distribution terms for this file may in |
---|
36 | * the file LICENSE in this distribution or at |
---|
37 | * http://www.rtems.org/license/LICENSE. |
---|
38 | * |
---|
39 | * |
---|
40 | * Note: |
---|
41 | * This file is included by both C and assembler code ( -DASM ) |
---|
42 | */ |
---|
43 | |
---|
44 | |
---|
45 | #ifndef _RTEMS_SCORE_POWERPC_H |
---|
46 | #define _RTEMS_SCORE_POWERPC_H |
---|
47 | |
---|
48 | #ifdef __cplusplus |
---|
49 | extern "C" { |
---|
50 | #endif |
---|
51 | |
---|
52 | #include <rtems/score/basedefs.h> |
---|
53 | |
---|
54 | /* |
---|
55 | * Define the name of the CPU family. |
---|
56 | */ |
---|
57 | |
---|
58 | #define CPU_NAME "PowerPC" |
---|
59 | |
---|
60 | /* |
---|
61 | * This file contains the information required to build |
---|
62 | * RTEMS for the PowerPC family. |
---|
63 | */ |
---|
64 | |
---|
65 | /* Generic ppc */ |
---|
66 | |
---|
67 | #ifdef _SOFT_FLOAT |
---|
68 | #define CPU_MODEL_NAME "Generic (no FPU)" |
---|
69 | #elif defined(__NO_FPRS__) || defined(__SPE__) |
---|
70 | #define CPU_MODEL_NAME "Generic (E500/float-gprs/SPE)" |
---|
71 | #else |
---|
72 | #define CPU_MODEL_NAME "Generic (classic FPU)" |
---|
73 | #endif |
---|
74 | |
---|
75 | #ifdef __PPC_CPU_E6500__ |
---|
76 | #define PPC_DEFAULT_CACHE_LINE_POWER 6 |
---|
77 | #else |
---|
78 | #define PPC_DEFAULT_CACHE_LINE_POWER 5 |
---|
79 | #endif |
---|
80 | |
---|
81 | #define PPC_DEFAULT_CACHE_LINE_SIZE (1 << PPC_DEFAULT_CACHE_LINE_POWER) |
---|
82 | |
---|
83 | #define PPC_STRUCTURE_ALIGNMENT PPC_DEFAULT_CACHE_LINE_SIZE |
---|
84 | |
---|
85 | /* |
---|
86 | * Application binary interfaces. |
---|
87 | * |
---|
88 | * PPC_ABI MUST be defined as one of these. |
---|
89 | * Only big endian is currently supported. |
---|
90 | */ |
---|
91 | |
---|
92 | /* |
---|
93 | * SVR4 ABI |
---|
94 | */ |
---|
95 | #define PPC_ABI_SVR4 2 |
---|
96 | /* |
---|
97 | * Embedded ABI |
---|
98 | */ |
---|
99 | #define PPC_ABI_EABI 3 |
---|
100 | |
---|
101 | /* |
---|
102 | * Default to the EABI used by current GNU tools |
---|
103 | */ |
---|
104 | |
---|
105 | #ifndef PPC_ABI |
---|
106 | #define PPC_ABI PPC_ABI_EABI |
---|
107 | #endif |
---|
108 | |
---|
109 | /* |
---|
110 | * Use worst case stack alignment. For the EABI an 8-byte alignment would be |
---|
111 | * sufficient. |
---|
112 | */ |
---|
113 | |
---|
114 | #define PPC_STACK_ALIGN_POWER 4 |
---|
115 | #define PPC_STACK_ALIGNMENT (1 << PPC_STACK_ALIGN_POWER) |
---|
116 | |
---|
117 | /* |
---|
118 | * Assume PPC_HAS_FPU to be a synonym for _SOFT_FLOAT. |
---|
119 | */ |
---|
120 | |
---|
121 | #if defined(_SOFT_FLOAT) \ |
---|
122 | || defined(__NO_FPRS__) /* e500 has unified integer/FP registers */ \ |
---|
123 | || defined(__PPC_CPU_E6500__) |
---|
124 | #define PPC_HAS_FPU 0 |
---|
125 | #else |
---|
126 | #define PPC_HAS_FPU 1 |
---|
127 | #endif |
---|
128 | |
---|
129 | #if defined(__PPC_CPU_E6500__) && defined(__ALTIVEC__) |
---|
130 | #define PPC_MULTILIB_ALTIVEC |
---|
131 | #endif |
---|
132 | |
---|
133 | #if defined(__PPC_CPU_E6500__) && !defined(_SOFT_FLOAT) |
---|
134 | #define PPC_MULTILIB_FPU |
---|
135 | #endif |
---|
136 | |
---|
137 | #ifdef PPC_MULTILIB_ALTIVEC |
---|
138 | #define PPC_ALIGNMENT 16 |
---|
139 | #else |
---|
140 | #define PPC_ALIGNMENT 8 |
---|
141 | #endif |
---|
142 | |
---|
143 | #ifdef __powerpc64__ |
---|
144 | #define PPC_STACK_RED_ZONE_SIZE 512 |
---|
145 | #else |
---|
146 | #define PPC_STACK_RED_ZONE_SIZE 0 |
---|
147 | #endif |
---|
148 | |
---|
149 | /* |
---|
150 | * Unless specified above, If the model has FP support, it is assumed to |
---|
151 | * support doubles (8-byte floating point numbers). |
---|
152 | * |
---|
153 | * If the model does NOT have FP support, then the model does |
---|
154 | * NOT have double length FP registers. |
---|
155 | */ |
---|
156 | |
---|
157 | #if (PPC_HAS_FPU) |
---|
158 | #define PPC_HAS_DOUBLE 1 |
---|
159 | #else |
---|
160 | #define PPC_HAS_DOUBLE 0 |
---|
161 | #endif |
---|
162 | |
---|
163 | /* |
---|
164 | * Assemblers. |
---|
165 | * PPC_ASM MUST be defined as one of these. |
---|
166 | * |
---|
167 | * PPC_ASM_ELF: ELF assembler. Currently used for all ABIs. |
---|
168 | * |
---|
169 | * NOTE: Only PPC_ABI_ELF is currently fully supported. |
---|
170 | * |
---|
171 | * Also NOTE: cpukit doesn't need this but asm.h which is defined |
---|
172 | * in cpukit for consistency with other ports does. |
---|
173 | */ |
---|
174 | |
---|
175 | #define PPC_ASM_ELF 0 |
---|
176 | |
---|
177 | /* |
---|
178 | * Default to the assembler format used by the current GNU tools. |
---|
179 | */ |
---|
180 | #define PPC_ASM PPC_ASM_ELF |
---|
181 | |
---|
182 | |
---|
183 | #ifdef __cplusplus |
---|
184 | } |
---|
185 | #endif |
---|
186 | |
---|
187 | #endif /* _RTEMS_SCORE_POWERPC_H */ |
---|