]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/Aarch64/arm-gcc.h
StdLib: Add support for AArch64
[mirror_edk2.git] / StdLib / Include / Aarch64 / arm-gcc.h
diff --git a/StdLib/Include/Aarch64/arm-gcc.h b/StdLib/Include/Aarch64/arm-gcc.h
new file mode 100644 (file)
index 0000000..ef0014b
--- /dev/null
@@ -0,0 +1,110 @@
+/** @file\r
+\r
+  Copyright (c) 2014, ARM Limited. All rights reserved.\r
+\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+/* $NetBSD: arm-gcc.h,v 1.4 2013/01/26 07:08:14 matt Exp $ */\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+One of the macros `BIGENDIAN' or `LITTLEENDIAN' must be defined.\r
+-------------------------------------------------------------------------------\r
+*/\r
+#define LITTLEENDIAN\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+The macro `BITS64' can be defined to indicate that 64-bit integer types are\r
+supported by the compiler.\r
+-------------------------------------------------------------------------------\r
+*/\r
+#define BITS64\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Each of the following `typedef's defines the most convenient type that holds\r
+integers of at least as many bits as specified.  For example, `uint8' should\r
+be the most convenient type that can hold unsigned integers of as many as\r
+8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most\r
+implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed\r
+to the same as `int'.\r
+-------------------------------------------------------------------------------\r
+*/\r
+typedef int flag;\r
+typedef int uint8;\r
+typedef int int8;\r
+typedef int uint16;\r
+typedef int int16;\r
+typedef unsigned int uint32;\r
+typedef signed int int32;\r
+#ifdef BITS64\r
+typedef unsigned long long int uint64;\r
+typedef signed long long int int64;\r
+#endif\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Each of the following `typedef's defines a type that holds integers\r
+of _exactly_ the number of bits specified.  For instance, for most\r
+implementation of C, `bits16' and `sbits16' should be `typedef'ed to\r
+`unsigned short int' and `signed short int' (or `short int'), respectively.\r
+-------------------------------------------------------------------------------\r
+*/\r
+typedef unsigned char bits8;\r
+typedef signed char sbits8;\r
+typedef unsigned short int bits16;\r
+typedef signed short int sbits16;\r
+typedef unsigned int bits32;\r
+typedef signed int sbits32;\r
+#ifdef BITS64\r
+typedef unsigned long long int bits64;\r
+typedef signed long long int sbits64;\r
+#endif\r
+\r
+#ifdef BITS64\r
+/*\r
+-------------------------------------------------------------------------------\r
+The `LIT64' macro takes as its argument a textual integer literal and\r
+if necessary ``marks'' the literal as having a 64-bit integer type.\r
+For example, the GNU C Compiler (`gcc') requires that 64-bit literals be\r
+appended with the letters `LL' standing for `long long', which is `gcc's\r
+name for the 64-bit integer type.  Some compilers may allow `LIT64' to be\r
+defined as the identity macro:  `#define LIT64( a ) a'.\r
+-------------------------------------------------------------------------------\r
+*/\r
+#define LIT64( a ) a##ULL\r
+#endif\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+The macro `INLINE' can be used before functions that should be inlined.  If\r
+a compiler does not support explicit inlining, this macro should be defined\r
+to be `static'.\r
+-------------------------------------------------------------------------------\r
+*/\r
+#define INLINE static inline\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+The ARM FPA is odd in that it stores doubles high-order word first, no matter\r
+what the endianness of the CPU.  VFP is sane.\r
+-------------------------------------------------------------------------------\r
+*/\r
+#if defined(SOFTFLOAT_FOR_GCC)\r
+#if defined(__VFP_FP__)\r
+#define FLOAT64_DEMANGLE(a) (a)\r
+#define FLOAT64_MANGLE(a)   (a)\r
+#else\r
+#define FLOAT64_DEMANGLE(a) (((a) << 32) | ((a) >> 32))\r
+#define FLOAT64_MANGLE(a)   FLOAT64_DEMANGLE(a)\r
+#endif\r
+#endif\r