]> git.proxmox.com Git - mirror_edk2.git/commitdiff
StdLib: Add support for AArch64
authorHarry Liebel <Harry.Liebel@arm.com>
Thu, 30 Jul 2015 09:51:04 +0000 (09:51 +0000)
committerlersek <lersek@Edk2>
Thu, 30 Jul 2015 09:51:04 +0000 (09:51 +0000)
- Use some files from ARM version.
- Use NetBSD software floating point library to provide floating point
  operations not handled directly by hardware floating point enabled
  GCC compiler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18118 6f19259b-4bc3-4df7-8a09-765794883524

27 files changed:
StdLib/Include/Aarch64/arm-gcc.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/ansi.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/bswap.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/byte_swap.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/endian.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/endian_machdep.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/fenv.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/float.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/ieee.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/ieeefp.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/int_const.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/int_limits.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/int_mwgwtypes.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/int_types.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/limits.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/math.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/param.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/signal.h [new file with mode: 0644]
StdLib/Include/Aarch64/machine/types.h [new file with mode: 0644]
StdLib/Include/Aarch64/milieu.h [new file with mode: 0644]
StdLib/Include/Aarch64/softfloat.h [new file with mode: 0644]
StdLib/LibC/LibC.inf
StdLib/LibC/Softfloat/Softfloat.inf
StdLib/LibC/gdtoa/gdtoa.inf
StdLib/StdLib.dec
StdLib/StdLib.dsc
StdLib/StdLib.inc

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
diff --git a/StdLib/Include/Aarch64/machine/ansi.h b/StdLib/Include/Aarch64/machine/ansi.h
new file mode 100644 (file)
index 0000000..8273905
--- /dev/null
@@ -0,0 +1,106 @@
+/** @file\r
+    Machine dependent ANSI type definitions.\r
+\r
+    Copyright (c) 2010-2012, Intel Corporation. All rights reserved.<BR>\r
+    This program and the accompanying materials are licensed and made available\r
+    under the terms and conditions of the BSD License that accompanies this\r
+    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
+ * Copyright (c) 1990, 1993\r
+ *  The Regents of the University of California.  All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the University nor the names of its contributors\r
+ *    may be used to endorse or promote products derived from this software\r
+ *    without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ *\r
+ *  from: @(#)ansi.h  8.2 (Berkeley) 1/4/94\r
+    NetBSD: ansi.h,v 1.7 2006/10/04 13:51:59 tnozaki Exp\r
+**/\r
+#ifndef _ANSI_H_\r
+#define _ANSI_H_\r
+\r
+#include <sys/EfiCdefs.h>\r
+\r
+#include <machine/int_types.h>\r
+\r
+/*\r
+ * Types which are fundamental to the implementation and may appear in\r
+ * more than one standard header are defined here.  Standard headers\r
+ * then use:\r
+ *  #ifdef  _BSD_SIZE_T_\r
+ *  typedef _BSD_SIZE_T_ size_t;\r
+ *  #undef  _BSD_SIZE_T_\r
+ *  #endif\r
+ */\r
+#define _BSD_CLOCK_T_     _EFI_CLOCK_T      /* clock() */\r
+#define _BSD_PTRDIFF_T_   _EFI_PTRDIFF_T_   /* ptr1 - ptr2 */\r
+#define _BSD_SIZE_T_      _EFI_SIZE_T_      /* sizeof() */\r
+#define _BSD_SSIZE_T_     INTN              /* byte count or error */\r
+#define _BSD_TIME_T_      _EFI_TIME_T       /* time() */\r
+#define _BSD_VA_LIST_     VA_LIST\r
+#define _BSD_CLOCKID_T_   INT64             /* clockid_t */\r
+#define _BSD_TIMER_T_     INT64             /* timer_t */\r
+#define _BSD_SUSECONDS_T_ INT64             /* suseconds_t */\r
+#define _BSD_USECONDS_T_  UINT64            /* useconds_t */\r
+\r
+/*\r
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not\r
+ * be instantiated outside of lib/libc/locale.  use wchar_t.\r
+ *\r
+ * Runes (wchar_t) is declared to be an ``int'' instead of the more natural\r
+ * ``unsigned long'' or ``long''.  Two things are happening here.  It is not\r
+ * unsigned so that EOF (-1) can be naturally assigned to it and used.  Also,\r
+ * it looks like 10646 will be a 31 bit standard.  This means that if your\r
+ * ints cannot hold 32 bits, you will be in trouble.  The reason an int was\r
+ * chosen over a long is that the is*() and to*() routines take ints (says\r
+ * ANSI C), but they use _RUNE_T_ instead of int.  By changing it here, you\r
+ * lose a bit of ANSI conformance, but your programs will still work.\r
+ *\r
+ * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.  When wchar_t\r
+ * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains\r
+ * defined for ctype.h.\r
+ */\r
+#define _BSD_WCHAR_T_       _EFI_WCHAR_T    /* wchar_t */\r
+#define _BSD_WINT_T_        _EFI_WINT_T     /* wint_t */\r
+#define _BSD_RUNE_T_        _EFI_WCHAR_T    /* rune_t */\r
+#define _BSD_WCTRANS_T_     void *          /* wctrans_t */\r
+#define _BSD_WCTYPE_T_      unsigned int    /* wctype_t */\r
+\r
+/*\r
+ * mbstate_t is an opaque object to keep conversion state, during multibyte\r
+ * stream conversions.  The content must not be referenced by user programs.\r
+ */\r
+typedef struct {\r
+  UINT32  A;      // Np;\r
+  UINT32  B;      // U;\r
+  UINT32  E;      // L\r
+  UINT8   C[4];   // n[4]\r
+  UINT16  D[2];   // w[2]\r
+} __mbstate_t;\r
+#define _BSD_MBSTATE_T_   __mbstate_t /* mbstate_t */\r
+\r
+#endif  /* _ANSI_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/bswap.h b/StdLib/Include/Aarch64/machine/bswap.h
new file mode 100644 (file)
index 0000000..142f739
--- /dev/null
@@ -0,0 +1,13 @@
+/*      $NetBSD: bswap.h,v 1.4 2006/01/31 07:49:18 dsl Exp $      */\r
+\r
+/* Written by Manuel Bouyer. Public domain */\r
+\r
+#ifndef _MACHINE_BSWAP_H_\r
+#define _MACHINE_BSWAP_H_\r
+\r
+#include <machine/byte_swap.h>\r
+\r
+#define __BSWAP_RENAME\r
+#include <sys/bswap.h>\r
+\r
+#endif /* !_MACHINE_BSWAP_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/byte_swap.h b/StdLib/Include/Aarch64/machine/byte_swap.h
new file mode 100644 (file)
index 0000000..8e1272c
--- /dev/null
@@ -0,0 +1,63 @@
+/*-\r
+ * Copyright (c) 1997, 1999, 2002 The NetBSD Foundation, Inc.\r
+ * All rights reserved.\r
+ *\r
+ * This code is derived from software contributed to The NetBSD Foundation\r
+ * by Charles M. Hannum, Neil A. Carson, and Jason R. Thorpe.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+ * POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+#ifndef _AARCH64_BYTE_SWAP_H_\r
+#define _AARCH64_BYTE_SWAP_H_\r
+\r
+#ifdef __GNUC__\r
+#include <sys/types.h>\r
+__BEGIN_DECLS\r
+\r
+#define __BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable\r
+static __inline uint32_t\r
+__byte_swap_u32_variable(uint32_t v)\r
+{\r
+        uint32_t t1;\r
+\r
+        t1 = v ^ ((v << 16) | (v >> 16));\r
+        t1 &= 0xff00ffffU;\r
+        v = (v >> 8) | (v << 24);\r
+        v ^= (t1 >> 8);\r
+        return (v);\r
+}\r
+\r
+#define __BYTE_SWAP_U16_VARIABLE __byte_swap_u16_variable\r
+static __inline uint16_t\r
+__byte_swap_u16_variable(uint16_t v)\r
+{\r
+\r
+        v &= 0xffff;\r
+        v = (v >> 8) | (v << 8);\r
+        return (v);\r
+}\r
+\r
+__END_DECLS\r
+#endif\r
+\r
+#endif /* _AARCH64_BYTE_SWAP_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/endian.h b/StdLib/Include/Aarch64/machine/endian.h
new file mode 100644 (file)
index 0000000..bb53c0b
--- /dev/null
@@ -0,0 +1,3 @@
+/*      $NetBSD: endian.h,v 1.3 2001/06/23 12:20:27 bjh21 Exp $ */\r
+\r
+#include <sys/endian.h>\r
diff --git a/StdLib/Include/Aarch64/machine/endian_machdep.h b/StdLib/Include/Aarch64/machine/endian_machdep.h
new file mode 100644 (file)
index 0000000..1940786
--- /dev/null
@@ -0,0 +1,3 @@
+/* $NetBSD: endian_machdep.h,v 1.8 2006/01/30 21:52:38 dsl Exp $ */\r
+\r
+#define _BYTE_ORDER _LITTLE_ENDIAN\r
diff --git a/StdLib/Include/Aarch64/machine/fenv.h b/StdLib/Include/Aarch64/machine/fenv.h
new file mode 100644 (file)
index 0000000..8e255f5
--- /dev/null
@@ -0,0 +1,39 @@
+/*  $NetBSD: fenv.h,v 1.2 2014/01/29 00:22:09 matt Exp $    */\r
+\r
+/*\r
+ * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995\r
+ * Public domain.\r
+ */\r
+\r
+#ifndef _AARCH64_FENV_H_\r
+#define _AARCH64_FENV_H_\r
+\r
+/* AArch64 split FPSCR into two registers FPCR and FPSR */\r
+typedef struct {\r
+    unsigned int __fpcr;\r
+    unsigned int __fpsr;\r
+} fenv_t;\r
+typedef int fexcept_t;\r
+\r
+#define FE_INVALID      0x01    /* invalid operation exception */\r
+#define FE_DIVBYZERO    0x02    /* divide-by-zero exception */\r
+#define FE_OVERFLOW     0x04    /* overflow exception */\r
+#define FE_UNDERFLOW    0x08    /* underflow exception */\r
+#define FE_INEXACT      0x10    /* imprecise (loss of precision; "inexact") */\r
+\r
+#define FE_ALL_EXCEPT   0x1f\r
+\r
+#define FE_TONEAREST    0   /* round to nearest representable number */\r
+#define FE_UPWARD       1   /* round toward positive infinity */\r
+#define FE_DOWNWARD     2   /* round toward negative infinity */\r
+#define FE_TOWARDZERO   3   /* round to zero (truncate) */\r
+\r
+__BEGIN_DECLS\r
+\r
+/* Default floating-point environment */\r
+extern const fenv_t __fe_dfl_env;\r
+#define FE_DFL_ENV  (&__fe_dfl_env)\r
+\r
+__END_DECLS\r
+\r
+#endif /* _AARCH64_FENV_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/float.h b/StdLib/Include/Aarch64/machine/float.h
new file mode 100644 (file)
index 0000000..f1da46c
--- /dev/null
@@ -0,0 +1,59 @@
+/*  $NetBSD: float.h,v 1.6 2005/12/11 12:16:47 christos Exp $   */\r
+/*-\r
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.\r
+ * All rights reserved.\r
+ *\r
+ * This code is derived from software contributed to The NetBSD Foundation\r
+ * by\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+ * POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+#ifndef _AARCH64_FLOAT_H_\r
+#define _AARCH64_FLOAT_H_\r
+\r
+#ifndef __VFP_FP__\r
+#define LDBL_MANT_DIG   64\r
+#define LDBL_EPSILON    1.0842021724855044340E-19L\r
+#define LDBL_DIG        18\r
+#define LDBL_MIN_EXP    (-16381)\r
+#define LDBL_MIN        1.6810515715560467531E-4932L\r
+#define LDBL_MIN_10_EXP (-4931)\r
+#define LDBL_MAX_EXP    16384\r
+#define LDBL_MAX        1.1897314953572317650E+4932L\r
+#define LDBL_MAX_10_EXP 4932\r
+#endif\r
+\r
+#include <sys/float_ieee754.h>\r
+\r
+#ifndef __VFP_FP__\r
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \\r
+    !defined(_XOPEN_SOURCE) || \\r
+    ((__STDC_VERSION__ - 0) >= 199901L) || \\r
+    ((_POSIX_C_SOURCE - 0) >= 200112L) || \\r
+    ((_XOPEN_SOURCE  - 0) >= 600) || \\r
+    defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)\r
+#define DECIMAL_DIG     21\r
+#endif /* !defined(_ANSI_SOURCE) && ... */\r
+#endif /* !__VFP_FP__ */\r
+\r
+#endif /* !_AARCH64_FLOAT_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/ieee.h b/StdLib/Include/Aarch64/machine/ieee.h
new file mode 100644 (file)
index 0000000..4aa90bd
--- /dev/null
@@ -0,0 +1,31 @@
+/*  $NetBSD: ieee.h,v 1.9 2005/12/11 12:16:47 christos Exp $    */\r
+/*-\r
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.\r
+ * All rights reserved.\r
+ *\r
+ * This code is derived from software contributed to The NetBSD Foundation\r
+ * by\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+ * POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+#include <sys/ieee754.h>\r
diff --git a/StdLib/Include/Aarch64/machine/ieeefp.h b/StdLib/Include/Aarch64/machine/ieeefp.h
new file mode 100644 (file)
index 0000000..f37278b
--- /dev/null
@@ -0,0 +1,45 @@
+/*  $NetBSD: ieeefp.h,v 1.3 2013/04/23 05:42:23 matt Exp $  */\r
+\r
+/*\r
+ * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995\r
+ * Public domain.\r
+ */\r
+\r
+#ifndef _AARCH64_IEEEFP_H_\r
+#define _AARCH64_IEEEFP_H_\r
+\r
+#include <LibConfig.h>\r
+#include <sys/featuretest.h>\r
+\r
+#if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)\r
+\r
+#include <machine/fenv.h>\r
+\r
+#if !defined(_ISOC99_SOURCE)\r
+\r
+/* Exception type (used by fpsetmask() et al.) */\r
+\r
+typedef int fp_except;\r
+\r
+/* Bit defines for fp_except */\r
+\r
+#define FP_X_INV    FE_INVALID      /* invalid operation exception */\r
+#define FP_X_DZ     FE_DIVBYZERO    /* divide-by-zero exception */\r
+#define FP_X_OFL    FE_OVERFLOW     /* overflow exception */\r
+#define FP_X_UFL    FE_UNDERFLOW    /* underflow exception */\r
+#define FP_X_IMP    FE_INEXACT      /* imprecise (prec. loss; "inexact") */\r
+\r
+/* Rounding modes */\r
+\r
+typedef enum {\r
+    FP_RN=FE_TONEAREST,     /* round to nearest representable number */\r
+    FP_RP=FE_UPWARD,        /* round toward positive infinity */\r
+    FP_RM=FE_DOWNWARD,      /* round toward negative infinity */\r
+    FP_RZ=FE_TOWARDZERO     /* round to zero (truncate) */\r
+} fp_rnd;\r
+\r
+#endif /* !_ISOC99_SOURCE */\r
+\r
+#endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */\r
+\r
+#endif /* _AARCH64_IEEEFP_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/int_const.h b/StdLib/Include/Aarch64/machine/int_const.h
new file mode 100644 (file)
index 0000000..22db5cd
--- /dev/null
@@ -0,0 +1,63 @@
+/*  $NetBSD: int_const.h,v 1.1 2001/04/14 22:38:38 kleink Exp $ */\r
+\r
+/*-\r
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.\r
+ * All rights reserved.\r
+ *\r
+ * This code is derived from software contributed to The NetBSD Foundation\r
+ * by Klaus Klein.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. All advertising materials mentioning features or use of this software\r
+ *    must display the following acknowledgement:\r
+ *        This product includes software developed by the NetBSD\r
+ *        Foundation, Inc. and its contributors.\r
+ * 4. Neither the name of The NetBSD Foundation nor the names of its\r
+ *    contributors may be used to endorse or promote products derived\r
+ *    from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+ * POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+#ifndef _AARCH64_INT_CONST_H_\r
+#define _AARCH64_INT_CONST_H_\r
+\r
+/*\r
+ * 7.18.4 Macros for integer constants\r
+ */\r
+\r
+/* 7.18.4.1 Macros for minimum-width integer constants */\r
+\r
+#define INT8_C(c) c\r
+#define INT16_C(c)  c\r
+#define INT32_C(c)  c\r
+#define INT64_C(c)  c ## LL\r
+\r
+#define UINT8_C(c)  c ## U\r
+#define UINT16_C(c) c ## U\r
+#define UINT32_C(c) c ## U\r
+#define UINT64_C(c) c ## ULL\r
+\r
+/* 7.18.4.2 Macros for greatest-width integer constants */\r
+\r
+#define INTMAX_C(c) c ## LL\r
+#define UINTMAX_C(c)  c ## ULL\r
+\r
+#endif /* !_AARCH64_INT_CONST_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/int_limits.h b/StdLib/Include/Aarch64/machine/int_limits.h
new file mode 100644 (file)
index 0000000..48379a0
--- /dev/null
@@ -0,0 +1,127 @@
+/*      $NetBSD: int_limits.h,v 1.9 2008/08/29 19:08:29 matt Exp $      */\r
+\r
+/*-\r
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.\r
+ * All rights reserved.\r
+ *\r
+ * This code is derived from software contributed to The NetBSD Foundation\r
+ * by Klaus Klein.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+ * POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+#ifndef _AARCH64_INT_LIMITS_H_\r
+#define _AARCH64_INT_LIMITS_H_\r
+\r
+/*\r
+ * 7.18.2 Limits of specified-width integer types\r
+ */\r
+\r
+/* 7.18.2.1 Limits of exact-width integer types */\r
+\r
+/* minimum values of exact-width signed integer types */\r
+#define INT8_MIN        (-0x7f-1)                       /* int8_t         */\r
+#define INT16_MIN       (-0x7fff-1)                     /* int16_t        */\r
+#define INT32_MIN       (-0x7fffffff-1)                 /* int32_t        */\r
+#define INT64_MIN       (-0x7fffffffffffffffLL-1)       /* int64_t        */\r
+\r
+/* maximum values of exact-width signed integer types */\r
+#define INT8_MAX        0x7f                            /* int8_t         */\r
+#define INT16_MAX       0x7fff                          /* int16_t        */\r
+#define INT32_MAX       0x7fffffff                      /* int32_t        */\r
+#define INT64_MAX       0x7fffffffffffffffLL            /* int64_t        */\r
+\r
+/* maximum values of exact-width unsigned integer types */\r
+#define UINT8_MAX       0xff                            /* uint8_t        */\r
+#define UINT16_MAX      0xffff                          /* uint16_t       */\r
+#define UINT32_MAX      0xffffffffU                     /* uint32_t       */\r
+#define UINT64_MAX      0xffffffffffffffffULL           /* uint64_t       */\r
+\r
+/* 7.18.2.2 Limits of minimum-width integer types */\r
+\r
+/* minimum values of minimum-width signed integer types */\r
+#define INT_LEAST8_MIN  (-0x7f-1)                       /* int_least8_t   */\r
+#define INT_LEAST16_MIN (-0x7fff-1)                     /* int_least16_t  */\r
+#define INT_LEAST32_MIN (-0x7fffffff-1)                 /* int_least32_t  */\r
+#define INT_LEAST64_MIN (-0x7fffffffffffffffLL-1)       /* int_least64_t  */\r
+\r
+/* maximum values of minimum-width signed integer types */\r
+#define INT_LEAST8_MAX  0x7f                            /* int_least8_t   */\r
+#define INT_LEAST16_MAX 0x7fff                          /* int_least16_t  */\r
+#define INT_LEAST32_MAX 0x7fffffff                      /* int_least32_t  */\r
+#define INT_LEAST64_MAX 0x7fffffffffffffffLL            /* int_least64_t  */\r
+\r
+/* maximum values of minimum-width unsigned integer types */\r
+#define UINT_LEAST8_MAX  0xff                           /* uint_least8_t  */\r
+#define UINT_LEAST16_MAX 0xffff                         /* uint_least16_t */\r
+#define UINT_LEAST32_MAX 0xffffffffU                    /* uint_least32_t */\r
+#define UINT_LEAST64_MAX 0xffffffffffffffffULL          /* uint_least64_t */\r
+\r
+/* 7.18.2.3 Limits of fastest minimum-width integer types */\r
+\r
+/* minimum values of fastest minimum-width signed integer types */\r
+#define INT_FAST8_MIN   (-0x7fffffff-1)                 /* int_fast8_t    */\r
+#define INT_FAST16_MIN  (-0x7fffffff-1)                 /* int_fast16_t   */\r
+#define INT_FAST32_MIN  (-0x7fffffff-1)                 /* int_fast32_t   */\r
+#define INT_FAST64_MIN  (-0x7fffffffffffffffLL-1)       /* int_fast64_t   */\r
+\r
+/* maximum values of fastest minimum-width signed integer types */\r
+#define INT_FAST8_MAX   0x7fffffff                      /* int_fast8_t    */\r
+#define INT_FAST16_MAX  0x7fffffff                      /* int_fast16_t   */\r
+#define INT_FAST32_MAX  0x7fffffff                      /* int_fast32_t   */\r
+#define INT_FAST64_MAX  0x7fffffffffffffffLL            /* int_fast64_t   */\r
+\r
+/* maximum values of fastest minimum-width unsigned integer types */\r
+#define UINT_FAST8_MAX  0xffffffffU                     /* uint_fast8_t   */\r
+#define UINT_FAST16_MAX 0xffffffffU                     /* uint_fast16_t  */\r
+#define UINT_FAST32_MAX 0xffffffffU                     /* uint_fast32_t  */\r
+#define UINT_FAST64_MAX 0xffffffffffffffffULL           /* uint_fast64_t  */\r
+\r
+/* 7.18.2.4 Limits of integer types capable of holding object pointers */\r
+\r
+#define INTPTR_MIN      (-0x7fffffffffffffffLL-1)       /* intptr_t       */\r
+#define INTPTR_MAX      0x7fffffffffffffffLL            /* intptr_t       */\r
+#define UINTPTR_MAX     0xffffffffffffffffULL           /* uintptr_t      */\r
+\r
+/* 7.18.2.5 Limits of greatest-width integer types */\r
+\r
+#define INTMAX_MIN      (-0x7fffffffffffffffLL-1)       /* intmax_t       */\r
+#define INTMAX_MAX      0x7fffffffffffffffLL            /* intmax_t       */\r
+#define UINTMAX_MAX     0xffffffffffffffffULL           /* uintmax_t      */\r
+\r
+\r
+/*\r
+ * 7.18.3 Limits of other integer types\r
+ */\r
+\r
+/* limits of ptrdiff_t */\r
+#define PTRDIFF_MIN     (-0x7fffffffffffffffLL-1)       /* ptrdiff_t      */\r
+#define PTRDIFF_MAX     0x7fffffffffffffffLL            /* ptrdiff_t      */\r
+\r
+/* limits of sig_atomic_t */\r
+#define SIG_ATOMIC_MIN  (-0x7fffffffffffffffLL-1)       /* sig_atomic_t   */\r
+#define SIG_ATOMIC_MAX  0x7fffffffffffffffLL            /* sig_atomic_t   */\r
+\r
+/* limit of size_t */\r
+#define SIZE_MAX        0xffffffffffffffffULL           /* size_t         */\r
+\r
+#endif /* !_AARCH64_INT_LIMITS_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/int_mwgwtypes.h b/StdLib/Include/Aarch64/machine/int_mwgwtypes.h
new file mode 100644 (file)
index 0000000..d3a1784
--- /dev/null
@@ -0,0 +1,82 @@
+/** @file\r
+    Minimum and Greatest Width Integer types.\r
+\r
+    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+    This program and the accompanying materials are licensed and made available under\r
+    the terms and conditions of the BSD License that accompanies this distribution.\r
+    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
+    Portions Copyright (c) 2001 The NetBSD Foundation, Inc.\r
+    All rights reserved.\r
+\r
+    This code is derived from software contributed to The NetBSD Foundation\r
+    by Klaus Klein.\r
+\r
+    Redistribution and use in source and binary forms, with or without\r
+    modification, are permitted provided that the following conditions\r
+    are met:\r
+      1.  Redistributions of source code must retain the above copyright\r
+          notice, this list of conditions and the following disclaimer.\r
+      2.  Redistributions in binary form must reproduce the above copyright\r
+          notice, this list of conditions and the following disclaimer in the\r
+          documentation and/or other materials provided with the distribution.\r
+      3.  All advertising materials mentioning features or use of this software\r
+          must display the following acknowledgement:\r
+            This product includes software developed by the NetBSD\r
+            Foundation, Inc. and its contributors.\r
+      4.  Neither the name of The NetBSD Foundation nor the names of its\r
+          contributors may be used to endorse or promote products derived\r
+          from this software without specific prior written permission.\r
+\r
+    THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r
+    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
+    TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+    PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r
+    BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+    POSSIBILITY OF SUCH DAMAGE.\r
+\r
+    NetBSD: int_mwgwtypes.h,v 1.5 2005/12/24 20:06:47 perry Exp\r
+**/\r
+#ifndef _AARCH64_INT_MWGWTYPES_H_\r
+#define _AARCH64_INT_MWGWTYPES_H_\r
+\r
+/*\r
+ * 7.18.1 Integer types\r
+ */\r
+\r
+/* 7.18.1.2 Minimum-width integer types */\r
+\r
+typedef CHAR8     int_least8_t;\r
+typedef UINT8     uint_least8_t;\r
+typedef INT16     int_least16_t;\r
+typedef UINT16    uint_least16_t;\r
+typedef INT32     int_least32_t;\r
+typedef UINT32    uint_least32_t;\r
+typedef INT64     int_least64_t;\r
+typedef UINT64    uint_least64_t;\r
+\r
+/* 7.18.1.3 Fastest minimum-width integer types */\r
+typedef INT32     int_fast8_t;\r
+typedef UINT32    uint_fast8_t;\r
+typedef INT32     int_fast16_t;\r
+typedef UINT32    uint_fast16_t;\r
+typedef INT32     int_fast32_t;\r
+typedef UINT32    uint_fast32_t;\r
+typedef INT64     int_fast64_t;\r
+typedef UINT64    uint_fast64_t;\r
+\r
+/* 7.18.1.5 Greatest-width integer types */\r
+\r
+typedef INT64     intmax_t;\r
+typedef UINT64    uintmax_t;\r
+\r
+#endif /* !_AARCH64_INT_MWGWTYPES_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/int_types.h b/StdLib/Include/Aarch64/machine/int_types.h
new file mode 100644 (file)
index 0000000..2fafff0
--- /dev/null
@@ -0,0 +1,61 @@
+/*  $NetBSD: int_types.h,v 1.10 2005/12/24 20:07:10 perry Exp $ */\r
+\r
+/*-\r
+ * Copyright (c) 1990 The Regents of the University of California.\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the University nor the names of its contributors\r
+ *    may be used to endorse or promote products derived from this software\r
+ *    without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ *\r
+ *  from: @(#)types.h 7.5 (Berkeley) 3/9/91\r
+ */\r
+\r
+#ifndef _AARCH64_INT_TYPES_H_\r
+#define _AARCH64_INT_TYPES_H_\r
+\r
+#include  <sys/EfiCdefs.h>\r
+\r
+/*\r
+ * 7.18.1 Integer types\r
+ */\r
+\r
+/* 7.18.1.1 Exact-width integer types */\r
+\r
+typedef INT8    __int8_t;\r
+typedef UINT8   __uint8_t;\r
+typedef INT16   __int16_t;\r
+typedef UINT16  __uint16_t;\r
+typedef INT32   __int32_t;\r
+typedef UINT32  __uint32_t;\r
+typedef INT64   __int64_t;\r
+typedef UINT64  __uint64_t;\r
+\r
+#define __BIT_TYPES_DEFINED__\r
+\r
+/* 7.18.1.4 Integer types capable of holding object pointers */\r
+\r
+typedef INTN    __intptr_t;\r
+typedef UINTN   __uintptr_t;\r
+\r
+#endif  /* !_AARCH64_INT_TYPES_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/limits.h b/StdLib/Include/Aarch64/machine/limits.h
new file mode 100644 (file)
index 0000000..dec214d
--- /dev/null
@@ -0,0 +1,100 @@
+/*      $NetBSD: limits.h,v 1.9 2008/08/29 19:08:29 matt Exp $  */\r
+\r
+/*\r
+ * Copyright (c) 1988 The Regents of the University of California.\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the University nor the names of its contributors\r
+ *    may be used to endorse or promote products derived from this software\r
+ *    without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ *\r
+ *      from: @(#)limits.h      7.2 (Berkeley) 6/28/90\r
+ */\r
+\r
+//TODO These values have been chosen during porting with the selection criteria\r
+//of being different from ARMv7 in the hope of discovering as many bugs as\r
+//possible as soon as possible. They are NOT authoritative!\r
+// ... (and should be replaced ASAP with more carefully chosen ones)\r
+\r
+#ifndef _AARCH64_LIMITS_H_\r
+#define _AARCH64_LIMITS_H_\r
+\r
+#include <sys/featuretest.h>\r
+\r
+#define __CHAR_BIT        8               /* number of bits in a char */\r
+//#define __MB_LEN_MAX      32              /* no multibyte characters */\r
+\r
+#define __SCHAR_MIN       (-0x7f-1)       /* max value for a signed char */\r
+#define __SCHAR_MAX       0x7f            /* min value for a signed char */\r
+\r
+#define __UCHAR_MAX       0xff            /* max value for an unsigned char */\r
+#define __CHAR_MAX        0xff            /* max value for a char */\r
+#define __CHAR_MIN        0               /* min value for a char */\r
+\r
+#define __USHRT_MAX       0xffff          /* max value for an unsigned short */\r
+#define __SHRT_MAX        0x7fff          /* max value for a short */\r
+#define __SHRT_MIN        (-0x7fff-1)     /* min value for a short */\r
+\r
+#define __UINT_MAX        0xffffffffU     /* max value for an unsigned int */\r
+#define __INT_MAX         0x7fffffff      /* max value for an int */\r
+#define __INT_MIN         (-0x7fffffff-1) /* min value for an int */\r
+\r
+#define __ULONG_MAX       0xffffffffffffffffUL    /* max value for an unsigned long */\r
+#define __LONG_MAX        0x7fffffffffffffffL     /* max value for a long */\r
+#define __LONG_MIN        (-0x7fffffffffffffffL-1)        /* min value for a long */\r
+\r
+#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \\r
+    defined(_NETBSD_SOURCE)\r
+#define SSIZE_MAX         LONG_MAX        /* max value for a ssize_t */\r
+\r
+#if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \\r
+    defined(_NETBSD_SOURCE)\r
+#define __ULLONG_MAX      0xffffffffffffffffULL   /* max unsigned long long */\r
+#define __LLONG_MAX       0x7fffffffffffffffLL    /* max signed long long */\r
+#define __LLONG_MIN       (-0x7fffffffffffffffLL-1) /* min signed long long */\r
+#endif\r
+\r
+#if defined(_NETBSD_SOURCE)\r
+#define SIZE_T_MAX      LONG_MAX        /* max value for a size_t */\r
+\r
+#define UQUAD_MAX       0xffffffffffffffffLL            /* max unsigned quad */\r
+#define QUAD_MAX        0x7fffffffffffffffLL            /* max signed quad */\r
+#define QUAD_MIN        (-0x7fffffffffffffffLL-1)       /* min signed quad */\r
+\r
+#endif /* _NETBSD_SOURCE */\r
+#endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */\r
+\r
+#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)\r
+#define LONG_BIT        64\r
+#define WORD_BIT        32\r
+\r
+#define DBL_DIG         15\r
+#define DBL_MAX         1.7976931348623157E+308\r
+#define DBL_MIN         2.2250738585072014E-308\r
+\r
+//#define FLT_DIG         6\r
+//#define FLT_MAX         3.40282347E+38F\r
+//#define FLT_MIN         1.17549435E-38F\r
+#endif\r
+\r
+#endif  /* _AARCH64_LIMITS_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/math.h b/StdLib/Include/Aarch64/machine/math.h
new file mode 100644 (file)
index 0000000..35ace3d
--- /dev/null
@@ -0,0 +1,3 @@
+/*  $NetBSD: math.h,v 1.2 2002/02/19 13:08:14 simonb Exp $  */\r
+\r
+#define __HAVE_NANF\r
diff --git a/StdLib/Include/Aarch64/machine/param.h b/StdLib/Include/Aarch64/machine/param.h
new file mode 100644 (file)
index 0000000..c7700b3
--- /dev/null
@@ -0,0 +1,124 @@
+/*      $NetBSD: param.h,v 1.13 2010/05/06 19:10:26 joerg Exp $ */\r
+\r
+/*\r
+ * Copyright (c) 1994,1995 Mark Brinicombe.\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. All advertising materials mentioning features or use of this software\r
+ *    must display the following acknowledgement:\r
+ *      This product includes software developed by the RiscBSD team.\r
+ * 4. The name "RiscBSD" nor the name of the author may be used to\r
+ *    endorse or promote products derived from this software without specific\r
+ *    prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY RISCBSD ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
+ * IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\r
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ */\r
+\r
+#ifndef _AARCH64_PARAM_H_\r
+#define _AARCH64_PARAM_H_\r
+\r
+// TODO: These were based on the ARMv7 version. Verify that it is correct.\r
+\r
+/*\r
+ * Machine dependent constants for all ARM processors\r
+ */\r
+\r
+/*\r
+ * For KERNEL code:\r
+ *      MACHINE must be defined by the individual port.  This is so that\r
+ *      uname returns the correct thing, etc.\r
+ *\r
+ *      MACHINE_ARCH may be defined by individual ports as a temporary\r
+ *      measure while we're finishing the conversion to ELF.\r
+ *\r
+ * For non-KERNEL code:\r
+ *      If ELF, MACHINE and MACHINE_ARCH are forced to "arm/armeb".\r
+ */\r
+\r
+#if defined(_KERNEL)\r
+#undef _MACHINE\r
+#undef MACHINE\r
+#undef _MACHINE_ARCH\r
+#undef MACHINE_ARCH\r
+#define _MACHINE        aarch64\r
+#define MACHINE         "aarch64"\r
+#define _MACHINE_ARCH   aarch64\r
+#define MACHINE_ARCH    "aarch64"\r
+#endif /* !_KERNEL */\r
+\r
+#define MID_MACHINE     MID_AARCH64\r
+\r
+/*\r
+ * Round p (pointer or byte index) up to a correctly-aligned value\r
+ * for all data types (int, long, ...).   The result is u_int and\r
+ * must be cast to any desired pointer type.\r
+ *\r
+ * ALIGNED_POINTER is a boolean macro that checks whether an address\r
+ * is valid to fetch data elements of type t from on this architecture.\r
+ * This does not reflect the optimal alignment, just the possibility\r
+ * (within reasonable limits).\r
+ *\r
+ */\r
+#define ALIGNBYTES              (sizeof(int) - 1)\r
+#define ALIGN(p)                (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)\r
+#define ALIGNED_POINTER(p,t)    ((((u_long)(p)) & (sizeof(t)-1)) == 0)\r
+/* ARM-specific macro to align a stack pointer (downwards). */\r
+#define STACKALIGNBYTES         (8 - 1)\r
+#define STACKALIGN(p)           ((u_int)(p) &~ STACKALIGNBYTES)\r
+\r
+#define DEV_BSHIFT      9               /* log2(DEV_BSIZE) */\r
+#define DEV_BSIZE       (1 << DEV_BSHIFT)\r
+#define BLKDEV_IOSIZE   2048\r
+\r
+#ifndef MAXPHYS\r
+#define MAXPHYS         65536           /* max I/O transfer size */\r
+#endif\r
+\r
+/*\r
+ * Constants related to network buffer management.\r
+ * MCLBYTES must be no larger than NBPG (the software page size), and,\r
+ * on machines that exchange pages of input or output buffers with mbuf\r
+ * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple\r
+ * of the hardware page size.\r
+ */\r
+#define MSIZE           256             /* size of an mbuf */\r
+\r
+#ifndef MCLSHIFT\r
+#define MCLSHIFT        11              /* convert bytes to m_buf clusters */\r
+                                        /* 2K cluster can hold Ether frame */\r
+#endif  /* MCLSHIFT */\r
+\r
+#define MCLBYTES        (1 << MCLSHIFT) /* size of a m_buf cluster */\r
+\r
+#ifndef NMBCLUSTERS_MAX\r
+#define NMBCLUSTERS_MAX (0x2000000 / MCLBYTES)  /* Limit to 64MB for clusters */\r
+#endif\r
+\r
+/*\r
+ * Compatibility /dev/zero mapping.\r
+ */\r
+#ifdef _KERNEL\r
+#ifdef COMPAT_16\r
+#define COMPAT_ZERODEV(x)       (x == makedev(0, _DEV_ZERO_oARM))\r
+#endif\r
+#endif /* _KERNEL */\r
+\r
+#endif /* _AARCH64_PARAM_H_ */\r
diff --git a/StdLib/Include/Aarch64/machine/signal.h b/StdLib/Include/Aarch64/machine/signal.h
new file mode 100644 (file)
index 0000000..6628eb9
--- /dev/null
@@ -0,0 +1,22 @@
+/**\r
+Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under\r
+the terms and conditions of the BSD License that accompanies this distribution.\r
+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
+#ifndef _MACHINE_SIGNAL_H\r
+#define _MACHINE_SIGNAL_H\r
+#include  <sys/EfiCdefs.h>\r
+\r
+/** The type sig_atomic_t is the (possibly volatile-qualified) integer type of\r
+    an object that can be accessed as an atomic entity, even in the presence\r
+    of asynchronous interrupts.\r
+**/\r
+typedef INTN sig_atomic_t;\r
+\r
+#endif    /* _MACHINE_SIGNAL_H */\r
diff --git a/StdLib/Include/Aarch64/machine/types.h b/StdLib/Include/Aarch64/machine/types.h
new file mode 100644 (file)
index 0000000..a59d5be
--- /dev/null
@@ -0,0 +1,82 @@
+/** @file\r
+    Machine dependent type definitions.\r
+\r
+    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+    This program and the accompanying materials are licensed and made available\r
+    under the terms and conditions of the BSD License that accompanies this\r
+    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
+    Copyright (c) 1990 The Regents of the University of California.\r
+    All rights reserved.\r
+\r
+    Redistribution and use in source and binary forms, with or without\r
+    modification, are permitted provided that the following conditions\r
+    are met:\r
+    1. Redistributions of source code must retain the above copyright\r
+       notice, this list of conditions and the following disclaimer.\r
+    2. Redistributions in binary form must reproduce the above copyright\r
+       notice, this list of conditions and the following disclaimer in the\r
+       documentation and/or other materials provided with the distribution.\r
+    3. Neither the name of the University nor the names of its contributors\r
+       may be used to endorse or promote products derived from this software\r
+       without specific prior written permission.\r
+\r
+    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
+    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+    ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+    SUCH DAMAGE.\r
+\r
+    types.h 7.5 (Berkeley) 3/9/91\r
+    NetBSD: types.h,v 1.49 2006/09/03 13:51:23 bjh21 Exp\r
+**/\r
+#ifndef _MACHTYPES_H_\r
+#define _MACHTYPES_H_\r
+\r
+#include <sys/EfiCdefs.h>\r
+#include <sys/featuretest.h>\r
+#include <machine/int_types.h>\r
+\r
+/* Handle the long and unsigned long data types which EFI doesn't directly support. */\r
+//typedef INTN              LONGN;\r
+//typedef UINTN             ULONGN;\r
+\r
+typedef PHYSICAL_ADDRESS  paddr_t;\r
+typedef UINT64            psize_t;\r
+typedef PHYSICAL_ADDRESS  vaddr_t;\r
+typedef UINT64            vsize_t;\r
+\r
+typedef INT32   pmc_evid_t;\r
+typedef UINT64  pmc_ctr_t;\r
+typedef INT32   register_t;\r
+\r
+typedef volatile INT32    __cpu_simple_lock_t;\r
+\r
+#define __SIMPLELOCK_LOCKED   1\r
+#define __SIMPLELOCK_UNLOCKED 0\r
+\r
+/* The ARMv7 does not have strict alignment requirements. */\r
+#define __NO_STRICT_ALIGNMENT\r
+//TODO: Fixme for the ARM architecture that requires strict alignment\r
+\r
+#define __HAVE_DEVICE_REGISTER\r
+#define __HAVE_CPU_COUNTER\r
+#define __HAVE_SYSCALL_INTERN\r
+#define __HAVE_MINIMAL_EMUL\r
+#define __HAVE_OLD_DISKLABEL\r
+#define __HAVE_GENERIC_SOFT_INTERRUPTS\r
+#define __HAVE_CPU_MAXPROC\r
+#define __HAVE_TIMECOUNTER\r
+#define __HAVE_GENERIC_TODR\r
+\r
+#endif  /* _MACHTYPES_H_ */\r
diff --git a/StdLib/Include/Aarch64/milieu.h b/StdLib/Include/Aarch64/milieu.h
new file mode 100644 (file)
index 0000000..73643bf
--- /dev/null
@@ -0,0 +1,52 @@
+/* $NetBSD: milieu.h,v 1.1 2000/12/29 20:13:54 bjh21 Exp $ */\r
+\r
+/*\r
+===============================================================================\r
+\r
+This C header file is part of the SoftFloat IEC/IEEE Floating-point\r
+Arithmetic Package, Release 2a.\r
+\r
+Written by John R. Hauser.  This work was made possible in part by the\r
+International Computer Science Institute, located at Suite 600, 1947 Center\r
+Street, Berkeley, California 94704.  Funding was partially provided by the\r
+National Science Foundation under grant MIP-9311980.  The original version\r
+of this code was written as part of a project to build a fixed-point vector\r
+processor in collaboration with the University of California at Berkeley,\r
+overseen by Profs. Nelson Morgan and John Wawrzynek.  More information\r
+is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/\r
+arithmetic/SoftFloat.html'.\r
+\r
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort\r
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT\r
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO\r
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY\r
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.\r
+\r
+Derivative works are acceptable, even for commercial purposes, so long as\r
+(1) they include prominent notice that the work is derivative, and (2) they\r
+include prominent notice akin to these four paragraphs for those parts of\r
+this code that are retained.\r
+\r
+===============================================================================\r
+*/\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Include common integer types and flags.\r
+-------------------------------------------------------------------------------\r
+*/\r
+#include "arm-gcc.h"\r
+\r
+\r
+// Used by profiler.\r
+#if 0\r
+/*\r
+-------------------------------------------------------------------------------\r
+Symbolic Boolean literals.\r
+-------------------------------------------------------------------------------\r
+*/\r
+enum {\r
+    FALSE = 0,\r
+    TRUE  = 1\r
+};\r
+#endif\r
diff --git a/StdLib/Include/Aarch64/softfloat.h b/StdLib/Include/Aarch64/softfloat.h
new file mode 100644 (file)
index 0000000..c290657
--- /dev/null
@@ -0,0 +1,316 @@
+/*  $NetBSD: softfloat.h,v 1.10 2013/04/24 18:04:46 matt Exp $  */\r
+\r
+/* This is a derivative work. */\r
+\r
+/*\r
+===============================================================================\r
+\r
+This C header file is part of the SoftFloat IEC/IEEE Floating-point\r
+Arithmetic Package, Release 2a.\r
+\r
+Written by John R. Hauser.  This work was made possible in part by the\r
+International Computer Science Institute, located at Suite 600, 1947 Center\r
+Street, Berkeley, California 94704.  Funding was partially provided by the\r
+National Science Foundation under grant MIP-9311980.  The original version\r
+of this code was written as part of a project to build a fixed-point vector\r
+processor in collaboration with the University of California at Berkeley,\r
+overseen by Profs. Nelson Morgan and John Wawrzynek.  More information\r
+is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/\r
+arithmetic/SoftFloat.html'.\r
+\r
+THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort\r
+has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT\r
+TIMES RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO\r
+PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY\r
+AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE.\r
+\r
+Derivative works are acceptable, even for commercial purposes, so long as\r
+(1) they include prominent notice that the work is derivative, and (2) they\r
+include prominent notice akin to these four paragraphs for those parts of\r
+this code that are retained.\r
+\r
+===============================================================================\r
+*/\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+The macro `FLOATX80' must be defined to enable the extended double-precision\r
+floating-point format `floatx80'.  If this macro is not defined, the\r
+`floatx80' type will not be defined, and none of the functions that either\r
+input or output the `floatx80' type will be defined.  The same applies to\r
+the `FLOAT128' macro and the quadruple-precision format `float128'.\r
+-------------------------------------------------------------------------------\r
+*/\r
+/* #define FLOATX80 */\r
+#define FLOAT128\r
+\r
+#include <stdint.h>\r
+#include <machine/ieeefp.h>\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE floating-point types.\r
+-------------------------------------------------------------------------------\r
+*/\r
+typedef unsigned int float32;\r
+typedef unsigned long long float64;\r
+#ifdef FLOATX80\r
+typedef struct {\r
+    unsigned short high;\r
+    unsigned long long low;\r
+} floatx80;\r
+#endif\r
+#ifdef FLOAT128\r
+typedef struct {\r
+    unsigned long long high, low;\r
+} float128;\r
+#endif\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE floating-point underflow tininess-detection mode.\r
+-------------------------------------------------------------------------------\r
+*/\r
+#ifndef SOFTFLOAT_FOR_GCC\r
+extern int float_detect_tininess;\r
+#endif\r
+enum {\r
+    float_tininess_after_rounding  = 0,\r
+    float_tininess_before_rounding = 1\r
+};\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE floating-point rounding mode.\r
+-------------------------------------------------------------------------------\r
+*/\r
+extern fp_rnd float_rounding_mode;\r
+#define float_round_nearest_even FP_RN\r
+#define float_round_to_zero      FP_RZ\r
+#define float_round_down         FP_RM\r
+#define float_round_up           FP_RP\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE floating-point exception flags.\r
+-------------------------------------------------------------------------------\r
+*/\r
+extern fp_except float_exception_flags;\r
+extern fp_except float_exception_mask;\r
+enum {\r
+    float_flag_inexact   = FP_X_IMP,\r
+    float_flag_underflow = FP_X_UFL,\r
+    float_flag_overflow  = FP_X_OFL,\r
+    float_flag_divbyzero = FP_X_DZ,\r
+    float_flag_invalid   = FP_X_INV\r
+};\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Routine to raise any or all of the software IEC/IEEE floating-point\r
+exception flags.\r
+-------------------------------------------------------------------------------\r
+*/\r
+void float_raise( fp_except );\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE integer-to-floating-point conversion routines.\r
+-------------------------------------------------------------------------------\r
+*/\r
+float32 int32_to_float32( int32 );\r
+float32 uint32_to_float32( uint32 );\r
+float64 int32_to_float64( int32 );\r
+float64 uint32_to_float64( uint32 );\r
+#ifdef FLOATX80\r
+floatx80 int32_to_floatx80( int32 );\r
+floatx80 uint32_to_floatx80( uint32 );\r
+#endif\r
+#ifdef FLOAT128\r
+float128 int32_to_float128( int32 );\r
+float128 uint32_to_float128( uint32 );\r
+#endif\r
+#ifndef SOFTFLOAT_FOR_GCC /* __floatdi?f is in libgcc2.c */\r
+float32 int64_to_float32( long long );\r
+float64 int64_to_float64( long long );\r
+#ifdef FLOATX80\r
+floatx80 int64_to_floatx80( long long );\r
+#endif\r
+#ifdef FLOAT128\r
+float128 int64_to_float128( long long );\r
+#endif\r
+#endif\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE single-precision conversion routines.\r
+-------------------------------------------------------------------------------\r
+*/\r
+int float32_to_int32( float32 );\r
+int float32_to_int32_round_to_zero( float32 );\r
+#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)\r
+unsigned int float32_to_uint32_round_to_zero( float32 );\r
+#endif\r
+#ifndef SOFTFLOAT_FOR_GCC /* __fix?fdi provided by libgcc2.c */\r
+long long float32_to_int64( float32 );\r
+long long float32_to_int64_round_to_zero( float32 );\r
+#endif\r
+float64 float32_to_float64( float32 );\r
+#ifdef FLOATX80\r
+floatx80 float32_to_floatx80( float32 );\r
+#endif\r
+#ifdef FLOAT128\r
+float128 float32_to_float128( float32 );\r
+#endif\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE single-precision operations.\r
+-------------------------------------------------------------------------------\r
+*/\r
+float32 float32_round_to_int( float32 );\r
+float32 float32_add( float32, float32 );\r
+float32 float32_sub( float32, float32 );\r
+float32 float32_mul( float32, float32 );\r
+float32 float32_div( float32, float32 );\r
+float32 float32_rem( float32, float32 );\r
+float32 float32_sqrt( float32 );\r
+int float32_eq( float32, float32 );\r
+int float32_le( float32, float32 );\r
+int float32_lt( float32, float32 );\r
+int float32_eq_signaling( float32, float32 );\r
+int float32_le_quiet( float32, float32 );\r
+int float32_lt_quiet( float32, float32 );\r
+#ifndef SOFTFLOAT_FOR_GCC\r
+int float32_is_signaling_nan( float32 );\r
+#endif\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE double-precision conversion routines.\r
+-------------------------------------------------------------------------------\r
+*/\r
+int float64_to_int32( float64 );\r
+int float64_to_int32_round_to_zero( float64 );\r
+#if defined(SOFTFLOAT_FOR_GCC) && defined(SOFTFLOAT_NEED_FIXUNS)\r
+unsigned int float64_to_uint32_round_to_zero( float64 );\r
+#endif\r
+#ifndef SOFTFLOAT_FOR_GCC /* __fix?fdi provided by libgcc2.c */\r
+long long float64_to_int64( float64 );\r
+long long float64_to_int64_round_to_zero( float64 );\r
+#endif\r
+float32 float64_to_float32( float64 );\r
+#ifdef FLOATX80\r
+floatx80 float64_to_floatx80( float64 );\r
+#endif\r
+#ifdef FLOAT128\r
+float128 float64_to_float128( float64 );\r
+#endif\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE double-precision operations.\r
+-------------------------------------------------------------------------------\r
+*/\r
+float64 float64_round_to_int( float64 );\r
+float64 float64_add( float64, float64 );\r
+float64 float64_sub( float64, float64 );\r
+float64 float64_mul( float64, float64 );\r
+float64 float64_div( float64, float64 );\r
+float64 float64_rem( float64, float64 );\r
+float64 float64_sqrt( float64 );\r
+int float64_eq( float64, float64 );\r
+int float64_le( float64, float64 );\r
+int float64_lt( float64, float64 );\r
+int float64_eq_signaling( float64, float64 );\r
+int float64_le_quiet( float64, float64 );\r
+int float64_lt_quiet( float64, float64 );\r
+#ifndef SOFTFLOAT_FOR_GCC\r
+int float64_is_signaling_nan( float64 );\r
+#endif\r
+\r
+#ifdef FLOATX80\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE extended double-precision conversion routines.\r
+-------------------------------------------------------------------------------\r
+*/\r
+int floatx80_to_int32( floatx80 );\r
+int floatx80_to_int32_round_to_zero( floatx80 );\r
+long long floatx80_to_int64( floatx80 );\r
+long long floatx80_to_int64_round_to_zero( floatx80 );\r
+float32 floatx80_to_float32( floatx80 );\r
+float64 floatx80_to_float64( floatx80 );\r
+#ifdef FLOAT128\r
+float128 floatx80_to_float128( floatx80 );\r
+#endif\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE extended double-precision rounding precision.  Valid\r
+values are 32, 64, and 80.\r
+-------------------------------------------------------------------------------\r
+*/\r
+extern int floatx80_rounding_precision;\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE extended double-precision operations.\r
+-------------------------------------------------------------------------------\r
+*/\r
+floatx80 floatx80_round_to_int( floatx80 );\r
+floatx80 floatx80_add( floatx80, floatx80 );\r
+floatx80 floatx80_sub( floatx80, floatx80 );\r
+floatx80 floatx80_mul( floatx80, floatx80 );\r
+floatx80 floatx80_div( floatx80, floatx80 );\r
+floatx80 floatx80_rem( floatx80, floatx80 );\r
+floatx80 floatx80_sqrt( floatx80 );\r
+int floatx80_eq( floatx80, floatx80 );\r
+int floatx80_le( floatx80, floatx80 );\r
+int floatx80_lt( floatx80, floatx80 );\r
+int floatx80_eq_signaling( floatx80, floatx80 );\r
+int floatx80_le_quiet( floatx80, floatx80 );\r
+int floatx80_lt_quiet( floatx80, floatx80 );\r
+int floatx80_is_signaling_nan( floatx80 );\r
+\r
+#endif\r
+\r
+#ifdef FLOAT128\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE quadruple-precision conversion routines.\r
+-------------------------------------------------------------------------------\r
+*/\r
+int float128_to_int32( float128 );\r
+int float128_to_int32_round_to_zero( float128 );\r
+long long float128_to_int64( float128 );\r
+long long float128_to_int64_round_to_zero( float128 );\r
+float32 float128_to_float32( float128 );\r
+float64 float128_to_float64( float128 );\r
+#ifdef FLOATX80\r
+floatx80 float128_to_floatx80( float128 );\r
+#endif\r
+\r
+/*\r
+-------------------------------------------------------------------------------\r
+Software IEC/IEEE quadruple-precision operations.\r
+-------------------------------------------------------------------------------\r
+*/\r
+float128 float128_round_to_int( float128 );\r
+float128 float128_add( float128, float128 );\r
+float128 float128_sub( float128, float128 );\r
+float128 float128_mul( float128, float128 );\r
+float128 float128_div( float128, float128 );\r
+float128 float128_rem( float128, float128 );\r
+float128 float128_sqrt( float128 );\r
+int float128_eq( float128, float128 );\r
+int float128_le( float128, float128 );\r
+int float128_lt( float128, float128 );\r
+int float128_eq_signaling( float128, float128 );\r
+int float128_le_quiet( float128, float128 );\r
+int float128_lt_quiet( float128, float128 );\r
+int float128_is_signaling_nan( float128 );\r
+\r
+#endif\r
index e44d8a8a23ed38b1e578c677c385999dc57bf3e5..f13630648555f22eba302ae6884288e62b1c8c6c 100644 (file)
@@ -89,6 +89,9 @@
   Main/Arm/floatunsidf.c\r
   Main/Arm/flt_rounds.c\r
 \r
+[Sources.AARCH64]\r
+  Main/Arm/flt_rounds.c\r
+\r
 [Binaries.IA32]\r
   LIB|Main/Ia32/ftol2.obj|*|MSFT\r
 \r
index 012190c257be417bc222625fc6ea7d67603ce6ae..99763bcb57ba09988b59600f61227f1ca98e02a5 100644 (file)
@@ -22,7 +22,7 @@
   LIBRARY_CLASS                  = LibSoftfloat\r
 \r
 #\r
-#  VALID_ARCHITECTURES           = ARM\r
+#  VALID_ARCHITECTURES           = ARM AARCH64\r
 #\r
 \r
 #  Only tested with GCC\r
   Arm/__aeabi_dcmpun.c\r
   Arm/__aeabi_fcmpun.c\r
 \r
+[Sources.AARCH64]\r
+  bits64/softfloat.c\r
+  eqtf2.c\r
+  getf2.c\r
+  gttf2.c\r
+  letf2.c\r
+  lttf2.c\r
+  netf2.c\r
+\r
 [Sources]\r
   fpgetround.c\r
   fpsetround.c\r
index 48b7df403fde52c4df197d6b1f7c46b0491d3012..a23749a8cc88f2e316e9fad61f62fe214c32870e 100644 (file)
   strtof.c\r
   Ipf/strtold.c\r
 \r
+[Sources.AARCH64]\r
+  strtof.c\r
+  Ipf/strtold.c\r
+\r
 [Sources]\r
   strtod.c      # Public interfaces\r
   atof.c\r
index 7a0b5513e99e1ffa497eca6a289d7386a4352cba..98a5d89eac86876237871c7384464664b68422ba 100644 (file)
@@ -35,6 +35,9 @@
 [Includes.ARM]\r
   Include/Arm\r
 \r
+[Includes.AARCH64]\r
+  Include/Aarch64\r
+\r
 \r
 [Guids]\r
   gStdLibTokenSpaceGuid          = { 0x447559f0, 0xd02e, 0x4cf1, { 0x99, 0xbc, 0xca, 0x11, 0x65, 0x40, 0x54, 0xc2 }}\r
index c2842ce166db3d59cd348cd7a0072f35d9c33f48..f62d2ad4fd84a0c7f69bbe08a72a830ae34e2b70 100644 (file)
@@ -27,7 +27,7 @@
   PLATFORM_VERSION               = 0.01\r
   DSC_SPECIFICATION              = 0x00010006\r
   OUTPUT_DIRECTORY               = Build/StdLib\r
-  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM\r
+  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64\r
   BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT\r
   SKUID_IDENTIFIER               = DEFAULT\r
 \r
index ac2d5ac553206fdbe45ac1a3f656e42dadbed613..9d540abd9221c04c084eb5efed87a88dffc1cd87 100644 (file)
@@ -80,6 +80,9 @@
 [LibraryClasses.AArch64]\r
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf\r
 \r
+  # Use the softfloat library to cover missing hardfloat operations.\r
+  NULL|StdLib/LibC/Softfloat/Softfloat.inf\r
+\r
   # Add support for GCC stack protector\r
   NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf\r
 \r