]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmSoftFloatLib/arm-gcc.h
ArmPkg/DebugAgentSymbolsBaseLib: remove exception handling
[mirror_edk2.git] / ArmPkg / Library / ArmSoftFloatLib / arm-gcc.h
CommitLineData
1dbda2b4
AB
1/** @file\r
2\r
3 Copyright (c) 2014, ARM Limited. All rights reserved.\r
4\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15/* $NetBSD: arm-gcc.h,v 1.4 2013/01/26 07:08:14 matt Exp $ */\r
16\r
17/*\r
18-------------------------------------------------------------------------------\r
19One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.\r
20-------------------------------------------------------------------------------\r
21*/\r
22#ifdef __ARMEB__\r
23#define BIGENDIAN\r
24#else\r
25#define LITTLEENDIAN\r
26#endif\r
27\r
28/*\r
29-------------------------------------------------------------------------------\r
30The macro `BITS64' can be defined to indicate that 64-bit integer types are\r
31supported by the compiler.\r
32-------------------------------------------------------------------------------\r
33*/\r
34#define BITS64\r
35\r
36/*\r
37-------------------------------------------------------------------------------\r
38Each of the following `typedef's defines the most convenient type that holds\r
39integers of at least as many bits as specified. For example, `uint8' should\r
40be the most convenient type that can hold unsigned integers of as many as\r
418 bits. The `flag' type must be able to hold either a 0 or 1. For most\r
42implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed\r
43to the same as `int'.\r
44-------------------------------------------------------------------------------\r
45*/\r
46typedef int flag;\r
47typedef int uint8;\r
48typedef int int8;\r
49typedef int uint16;\r
50typedef int int16;\r
51typedef unsigned int uint32;\r
52typedef signed int int32;\r
53#ifdef BITS64\r
54typedef unsigned long long int uint64;\r
55typedef signed long long int int64;\r
56#endif\r
57\r
58/*\r
59-------------------------------------------------------------------------------\r
60Each of the following `typedef's defines a type that holds integers\r
61of _exactly_ the number of bits specified. For instance, for most\r
62implementation of C, `bits16' and `sbits16' should be `typedef'ed to\r
63`unsigned short int' and `signed short int' (or `short int'), respectively.\r
64-------------------------------------------------------------------------------\r
65*/\r
66typedef unsigned char bits8;\r
67typedef signed char sbits8;\r
68typedef unsigned short int bits16;\r
69typedef signed short int sbits16;\r
70typedef unsigned int bits32;\r
71typedef signed int sbits32;\r
72#ifdef BITS64\r
73typedef unsigned long long int bits64;\r
74typedef signed long long int sbits64;\r
75#endif\r
76\r
77#ifdef BITS64\r
78/*\r
79-------------------------------------------------------------------------------\r
80The `LIT64' macro takes as its argument a textual integer literal and\r
81if necessary ``marks'' the literal as having a 64-bit integer type.\r
82For example, the GNU C Compiler (`gcc') requires that 64-bit literals be\r
83appended with the letters `LL' standing for `long long', which is `gcc's\r
84name for the 64-bit integer type. Some compilers may allow `LIT64' to be\r
85defined as the identity macro: `#define LIT64( a ) a'.\r
86-------------------------------------------------------------------------------\r
87*/\r
88#define LIT64( a ) a##ULL\r
89#endif\r
90\r
91/*\r
92-------------------------------------------------------------------------------\r
93The macro `INLINE' can be used before functions that should be inlined. If\r
94a compiler does not support explicit inlining, this macro should be defined\r
95to be `static'.\r
96-------------------------------------------------------------------------------\r
97*/\r
98#define INLINE static inline\r
99\r
100/*\r
101-------------------------------------------------------------------------------\r
102The ARM FPA is odd in that it stores doubles high-order word first, no matter\r
103what the endianness of the CPU. VFP is sane.\r
104-------------------------------------------------------------------------------\r
105*/\r
106#if defined(SOFTFLOAT_FOR_GCC)\r
107#if defined(__VFP_FP__) || defined(__ARMEB__)\r
108#define FLOAT64_DEMANGLE(a) (a)\r
109#define FLOAT64_MANGLE(a) (a)\r
110#else\r
111#define FLOAT64_DEMANGLE(a) (((a) << 32) | ((a) >> 32))\r
112#define FLOAT64_MANGLE(a) FLOAT64_DEMANGLE(a)\r
113#endif\r
114#endif\r