[d5607c5a] | 1 | /** |
---|
[d9e0006] | 2 | * @file |
---|
| 3 | * |
---|
[c006bf50] | 4 | * @brief IBM/Motorola PowerPC Definitions |
---|
[d9e0006] | 5 | * |
---|
| 6 | * This file contains definitions for the IBM/Motorola PowerPC |
---|
| 7 | * family members. |
---|
[d5607c5a] | 8 | */ |
---|
| 9 | |
---|
| 10 | /* |
---|
[b6bf7d53] | 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 |
---|
[c499856] | 37 | * http://www.rtems.org/license/LICENSE. |
---|
[b6bf7d53] | 38 | * |
---|
| 39 | * |
---|
| 40 | * Note: |
---|
| 41 | * This file is included by both C and assembler code ( -DASM ) |
---|
| 42 | */ |
---|
| 43 | |
---|
| 44 | |
---|
[7f70d1b7] | 45 | #ifndef _RTEMS_SCORE_POWERPC_H |
---|
| 46 | #define _RTEMS_SCORE_POWERPC_H |
---|
[b6bf7d53] | 47 | |
---|
| 48 | #ifdef __cplusplus |
---|
| 49 | extern "C" { |
---|
| 50 | #endif |
---|
| 51 | |
---|
| 52 | #include <rtems/score/types.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 |
---|
[06aab39] | 62 | * RTEMS for the PowerPC family. |
---|
[b6bf7d53] | 63 | */ |
---|
[5bb38e15] | 64 | |
---|
[61c9801] | 65 | /* Generic ppc */ |
---|
| 66 | |
---|
| 67 | #ifdef _SOFT_FLOAT |
---|
[06aab39] | 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)" |
---|
[b6bf7d53] | 71 | #else |
---|
[06aab39] | 72 | #define CPU_MODEL_NAME "Generic (classic FPU)" |
---|
[61c9801] | 73 | #endif |
---|
| 74 | |
---|
[7c16e1a5] | 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) |
---|
[84d3b9b0] | 82 | |
---|
| 83 | #define PPC_STRUCTURE_ALIGNMENT PPC_DEFAULT_CACHE_LINE_SIZE |
---|
[b6bf7d53] | 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 | */ |
---|
[06aab39] | 91 | |
---|
[b6bf7d53] | 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 | |
---|
[0d0095f1] | 109 | /* |
---|
| 110 | * Use worst case stack alignment. For the EABI an 8-byte alignment would be |
---|
| 111 | * sufficient. |
---|
[06aab39] | 112 | */ |
---|
[0d0095f1] | 113 | |
---|
| 114 | #define PPC_STACK_ALIGN_POWER 4 |
---|
| 115 | #define PPC_STACK_ALIGNMENT (1 << PPC_STACK_ALIGN_POWER) |
---|
[b6bf7d53] | 116 | |
---|
| 117 | /* |
---|
[06aab39] | 118 | * Assume PPC_HAS_FPU to be a synonym for _SOFT_FLOAT. |
---|
[b6bf7d53] | 119 | */ |
---|
| 120 | |
---|
[3e2647a7] | 121 | #if defined(_SOFT_FLOAT) \ |
---|
| 122 | || defined(__NO_FPRS__) /* e500 has unified integer/FP registers */ \ |
---|
| 123 | || defined(__PPC_CPU_E6500__) |
---|
[52ebfcb] | 124 | #define PPC_HAS_FPU 0 |
---|
| 125 | #else |
---|
[b6bf7d53] | 126 | #define PPC_HAS_FPU 1 |
---|
| 127 | #endif |
---|
| 128 | |
---|
[3e2647a7] | 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 | |
---|
[e4752d1d] | 137 | #ifdef PPC_MULTILIB_ALTIVEC |
---|
| 138 | #define PPC_ALIGNMENT 16 |
---|
| 139 | #else |
---|
| 140 | #define PPC_ALIGNMENT 8 |
---|
| 141 | #endif |
---|
| 142 | |
---|
[a6f84b27] | 143 | #ifdef __powerpc64__ |
---|
| 144 | #define PPC_STACK_RED_ZONE_SIZE 512 |
---|
| 145 | #else |
---|
| 146 | #define PPC_STACK_RED_ZONE_SIZE 0 |
---|
| 147 | #endif |
---|
| 148 | |
---|
[b6bf7d53] | 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 |
---|
[5bb38e15] | 154 | * NOT have double length FP registers. |
---|
[b6bf7d53] | 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 | /* |
---|
[06aab39] | 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. |
---|
[b6bf7d53] | 173 | */ |
---|
| 174 | |
---|
[06aab39] | 175 | #define PPC_ASM_ELF 0 |
---|
[b6bf7d53] | 176 | |
---|
| 177 | /* |
---|
[06aab39] | 178 | * Default to the assembler format used by the current GNU tools. |
---|
[b6bf7d53] | 179 | */ |
---|
[06aab39] | 180 | #define PPC_ASM PPC_ASM_ELF |
---|
[b6bf7d53] | 181 | |
---|
| 182 | |
---|
| 183 | #ifdef __cplusplus |
---|
| 184 | } |
---|
| 185 | #endif |
---|
| 186 | |
---|
[f6ed46df] | 187 | #endif /* _RTEMS_SCORE_POWERPC_H */ |
---|