]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: convert LFs to CRLF, expand hard TABs
authorLaszlo Ersek <lersek@redhat.com>
Thu, 27 Feb 2020 21:39:01 +0000 (22:39 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 4 Mar 2020 12:22:07 +0000 (12:22 +0000)
We're going to switch the internal line terminators globally to LF at some
point, but until then, let's use CRLF consistently. Convert source files
with LFs in them to CRLF, using "unix2dos".

"git show -b" prints no code changes for this patch.

(I collected all the file name suffixes in this package, with:

$ git ls-files -- $PACKAGE | rev | cut -f 1 -d . | sort -u | rev

I eliminated those suffixes that didn't stand for text files, then
blanket-converted the rest with unix2dos. Finally, picked up the actual
changes with git-add.)

At the same time, the following three files had to undergo TAB expansion:

  ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.c
  ArmPkg/Library/GccLto/liblto-aarch64.s
  ArmPkg/Library/GccLto/liblto-arm.s

I used "expand -t 2", in order to stay close to the edk2 coding style
(which uses two spaces for indentation.)

Both the CRLF conversion and the TAB expansion are motivated by
"PatchCheck.py". "PatchCheck.py" is also the reason why CRLF conversion
and TAB expansion have to happen in the same patch.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1659
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200227213903.13884-2-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c
ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.c
ArmPkg/Library/CompilerIntrinsicsLib/memset.c
ArmPkg/Library/GccLto/liblto-aarch64.s
ArmPkg/Library/GccLto/liblto-arm.s

index 2cd292aabf88b5c7ded450c13bcd706cb2bbd4fa..2d79aadaf1fa3f16fdbd76a9bfe17b65dba7dcf8 100644 (file)
@@ -1,16 +1,16 @@
-//
-//  Copyright (c) 2016, Linaro Limited. All rights reserved.
-//
-//  SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-//
-
-#include <Base.h>
-#include <Library/ArmSmcLib.h>
-
-VOID
-ArmCallSmc (
-  IN OUT ARM_SMC_ARGS *Args
-  )
-{
-}
+//\r
+//  Copyright (c) 2016, Linaro Limited. All rights reserved.\r
+//\r
+//  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+//\r
+//\r
+\r
+#include <Base.h>\r
+#include <Library/ArmSmcLib.h>\r
+\r
+VOID\r
+ArmCallSmc (\r
+  IN OUT ARM_SMC_ARGS *Args\r
+  )\r
+{\r
+}\r
index 42bed7700c9927f457dfddfe4c09063c2f0d2a61..77e2473678a23d0dbd6f1a2f726ac83e6538fd09 100644 (file)
-/*
- * Copyright (c) 2015 - 2019, Linaro Limited
- *
- * SPDX-License-Identifier: BSD-2-Clause-Patent
- */
-
-#include "platform.h"
-#include <softfloat.h>
-
-/*
- * On ARM32 EABI defines both a soft-float ABI and a hard-float ABI,
- * hard-float is basically a super set of soft-float. Hard-float requires
- * all the support routines provided for soft-float, but the compiler may
- * choose to optimize to not use some of them.
- *
- * The AEABI functions uses soft-float calling convention even if the
- * functions are compiled for hard-float. So where float and double would
- * have been expected we use aeabi_float_t and aeabi_double_t respectively
- * instead.
- */
-typedef uint32_t aeabi_float_t;
-typedef uint64_t aeabi_double_t;
-
-/*
- * Helpers to convert between float32 and aeabi_float_t, and float64 and
- * aeabi_double_t used by the AEABI functions below.
- */
-static aeabi_float_t f32_to_f(float32_t val)
-{
-       return val.v;
-}
-
-static float32_t f32_from_f(aeabi_float_t val)
-{
-       float32_t res;
-
-       res.v = val;
-
-       return res;
-}
-
-static aeabi_double_t f64_to_d(float64_t val)
-{
-       return val.v;
-}
-
-static float64_t f64_from_d(aeabi_double_t val)
-{
-       float64_t res;
-
-       res.v = val;
-
-       return res;
-}
-
-/*
- * From ARM Run-time ABI for ARM Architecture
- * ARM IHI 0043D, current through ABI release 2.09
- *
- * 4.1.2 The floating-point helper functions
- */
-
-/*
- * Table 2, Standard aeabi_double_t precision floating-point arithmetic helper
- * functions
- */
-
-aeabi_double_t __aeabi_dadd(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_to_d(f64_add(f64_from_d(a), f64_from_d(b)));
-}
-
-aeabi_double_t __aeabi_ddiv(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_to_d(f64_div(f64_from_d(a), f64_from_d(b)));
-}
-
-aeabi_double_t __aeabi_dmul(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_to_d(f64_mul(f64_from_d(a), f64_from_d(b)));
-}
-
-
-aeabi_double_t __aeabi_drsub(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_to_d(f64_sub(f64_from_d(b), f64_from_d(a)));
-}
-
-aeabi_double_t __aeabi_dsub(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_to_d(f64_sub(f64_from_d(a), f64_from_d(b)));
-}
-
-/*
- * Table 3, double precision floating-point comparison helper functions
- */
-
-int __aeabi_dcmpeq(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_eq(f64_from_d(a), f64_from_d(b));
-}
-
-int __aeabi_dcmplt(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_lt(f64_from_d(a), f64_from_d(b));
-}
-
-int __aeabi_dcmple(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_le(f64_from_d(a), f64_from_d(b));
-}
-
-int __aeabi_dcmpge(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_le(f64_from_d(b), f64_from_d(a));
-}
-
-int __aeabi_dcmpgt(aeabi_double_t a, aeabi_double_t b)
-{
-       return f64_lt(f64_from_d(b), f64_from_d(a));
-}
-
-/*
- * Table 4, Standard single precision floating-point arithmetic helper
- * functions
- */
-
-aeabi_float_t __aeabi_fadd(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_to_f(f32_add(f32_from_f(a), f32_from_f(b)));
-}
-
-aeabi_float_t __aeabi_fdiv(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_to_f(f32_div(f32_from_f(a), f32_from_f(b)));
-}
-
-aeabi_float_t __aeabi_fmul(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_to_f(f32_mul(f32_from_f(a), f32_from_f(b)));
-}
-
-aeabi_float_t __aeabi_frsub(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_to_f(f32_sub(f32_from_f(b), f32_from_f(a)));
-}
-
-aeabi_float_t __aeabi_fsub(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_to_f(f32_sub(f32_from_f(a), f32_from_f(b)));
-}
-
-/*
- * Table 5, Standard single precision floating-point comparison helper
- * functions
- */
-
-int __aeabi_fcmpeq(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_eq(f32_from_f(a), f32_from_f(b));
-}
-
-int __aeabi_fcmplt(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_lt(f32_from_f(a), f32_from_f(b));
-}
-
-int __aeabi_fcmple(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_le(f32_from_f(a), f32_from_f(b));
-}
-
-int __aeabi_fcmpge(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_le(f32_from_f(b), f32_from_f(a));
-}
-
-int __aeabi_fcmpgt(aeabi_float_t a, aeabi_float_t b)
-{
-       return f32_lt(f32_from_f(b), f32_from_f(a));
-}
-
-/*
- * Table 6, Standard floating-point to integer conversions
- */
-
-int __aeabi_d2iz(aeabi_double_t a)
-{
-       return f64_to_i32_r_minMag(f64_from_d(a), false);
-}
-
-unsigned __aeabi_d2uiz(aeabi_double_t a)
-{
-       return f64_to_ui32_r_minMag(f64_from_d(a), false);
-}
-
-long long __aeabi_d2lz(aeabi_double_t a)
-{
-       return f64_to_i64_r_minMag(f64_from_d(a), false);
-}
-
-unsigned long long __aeabi_d2ulz(aeabi_double_t a)
-{
-       return f64_to_ui64_r_minMag(f64_from_d(a), false);
-}
-
-int __aeabi_f2iz(aeabi_float_t a)
-{
-       return f32_to_i32_r_minMag(f32_from_f(a), false);
-}
-
-unsigned __aeabi_f2uiz(aeabi_float_t a)
-{
-       return f32_to_ui32_r_minMag(f32_from_f(a), false);
-}
-
-long long __aeabi_f2lz(aeabi_float_t a)
-{
-       return f32_to_i64_r_minMag(f32_from_f(a), false);
-}
-
-unsigned long long __aeabi_f2ulz(aeabi_float_t a)
-{
-       return f32_to_ui64_r_minMag(f32_from_f(a), false);
-}
-
-/*
- * Table 7, Standard conversions between floating types
- */
-
-aeabi_float_t __aeabi_d2f(aeabi_double_t a)
-{
-       return f32_to_f(f64_to_f32(f64_from_d(a)));
-}
-
-aeabi_double_t __aeabi_f2d(aeabi_float_t a)
-{
-       return f64_to_d(f32_to_f64(f32_from_f(a)));
-}
-
-/*
- * Table 8, Standard integer to floating-point conversions
- */
-
-aeabi_double_t __aeabi_i2d(int a)
-{
-       return f64_to_d(i32_to_f64(a));
-}
-
-aeabi_double_t __aeabi_ui2d(unsigned a)
-{
-       return f64_to_d(ui32_to_f64(a));
-}
-
-aeabi_double_t __aeabi_l2d(long long a)
-{
-       return f64_to_d(i64_to_f64(a));
-}
-
-aeabi_double_t __aeabi_ul2d(unsigned long long a)
-{
-       return f64_to_d(ui64_to_f64(a));
-}
-
-aeabi_float_t __aeabi_i2f(int a)
-{
-       return f32_to_f(i32_to_f32(a));
-}
-
-aeabi_float_t __aeabi_ui2f(unsigned a)
-{
-       return f32_to_f(ui32_to_f32(a));
-}
-
-aeabi_float_t __aeabi_l2f(long long a)
-{
-       return f32_to_f(i64_to_f32(a));
-}
-
-aeabi_float_t __aeabi_ul2f(unsigned long long a)
-{
-       return f32_to_f(ui64_to_f32(a));
-}
+/*\r
+ * Copyright (c) 2015 - 2019, Linaro Limited\r
+ *\r
+ * SPDX-License-Identifier: BSD-2-Clause-Patent\r
+ */\r
+\r
+#include "platform.h"\r
+#include <softfloat.h>\r
+\r
+/*\r
+ * On ARM32 EABI defines both a soft-float ABI and a hard-float ABI,\r
+ * hard-float is basically a super set of soft-float. Hard-float requires\r
+ * all the support routines provided for soft-float, but the compiler may\r
+ * choose to optimize to not use some of them.\r
+ *\r
+ * The AEABI functions uses soft-float calling convention even if the\r
+ * functions are compiled for hard-float. So where float and double would\r
+ * have been expected we use aeabi_float_t and aeabi_double_t respectively\r
+ * instead.\r
+ */\r
+typedef uint32_t aeabi_float_t;\r
+typedef uint64_t aeabi_double_t;\r
+\r
+/*\r
+ * Helpers to convert between float32 and aeabi_float_t, and float64 and\r
+ * aeabi_double_t used by the AEABI functions below.\r
+ */\r
+static aeabi_float_t f32_to_f(float32_t val)\r
+{\r
+  return val.v;\r
+}\r
+\r
+static float32_t f32_from_f(aeabi_float_t val)\r
+{\r
+  float32_t res;\r
+\r
+  res.v = val;\r
+\r
+  return res;\r
+}\r
+\r
+static aeabi_double_t f64_to_d(float64_t val)\r
+{\r
+  return val.v;\r
+}\r
+\r
+static float64_t f64_from_d(aeabi_double_t val)\r
+{\r
+  float64_t res;\r
+\r
+  res.v = val;\r
+\r
+  return res;\r
+}\r
+\r
+/*\r
+ * From ARM Run-time ABI for ARM Architecture\r
+ * ARM IHI 0043D, current through ABI release 2.09\r
+ *\r
+ * 4.1.2 The floating-point helper functions\r
+ */\r
+\r
+/*\r
+ * Table 2, Standard aeabi_double_t precision floating-point arithmetic helper\r
+ * functions\r
+ */\r
+\r
+aeabi_double_t __aeabi_dadd(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_to_d(f64_add(f64_from_d(a), f64_from_d(b)));\r
+}\r
+\r
+aeabi_double_t __aeabi_ddiv(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_to_d(f64_div(f64_from_d(a), f64_from_d(b)));\r
+}\r
+\r
+aeabi_double_t __aeabi_dmul(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_to_d(f64_mul(f64_from_d(a), f64_from_d(b)));\r
+}\r
+\r
+\r
+aeabi_double_t __aeabi_drsub(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_to_d(f64_sub(f64_from_d(b), f64_from_d(a)));\r
+}\r
+\r
+aeabi_double_t __aeabi_dsub(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_to_d(f64_sub(f64_from_d(a), f64_from_d(b)));\r
+}\r
+\r
+/*\r
+ * Table 3, double precision floating-point comparison helper functions\r
+ */\r
+\r
+int __aeabi_dcmpeq(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_eq(f64_from_d(a), f64_from_d(b));\r
+}\r
+\r
+int __aeabi_dcmplt(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_lt(f64_from_d(a), f64_from_d(b));\r
+}\r
+\r
+int __aeabi_dcmple(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_le(f64_from_d(a), f64_from_d(b));\r
+}\r
+\r
+int __aeabi_dcmpge(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_le(f64_from_d(b), f64_from_d(a));\r
+}\r
+\r
+int __aeabi_dcmpgt(aeabi_double_t a, aeabi_double_t b)\r
+{\r
+  return f64_lt(f64_from_d(b), f64_from_d(a));\r
+}\r
+\r
+/*\r
+ * Table 4, Standard single precision floating-point arithmetic helper\r
+ * functions\r
+ */\r
+\r
+aeabi_float_t __aeabi_fadd(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_to_f(f32_add(f32_from_f(a), f32_from_f(b)));\r
+}\r
+\r
+aeabi_float_t __aeabi_fdiv(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_to_f(f32_div(f32_from_f(a), f32_from_f(b)));\r
+}\r
+\r
+aeabi_float_t __aeabi_fmul(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_to_f(f32_mul(f32_from_f(a), f32_from_f(b)));\r
+}\r
+\r
+aeabi_float_t __aeabi_frsub(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_to_f(f32_sub(f32_from_f(b), f32_from_f(a)));\r
+}\r
+\r
+aeabi_float_t __aeabi_fsub(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_to_f(f32_sub(f32_from_f(a), f32_from_f(b)));\r
+}\r
+\r
+/*\r
+ * Table 5, Standard single precision floating-point comparison helper\r
+ * functions\r
+ */\r
+\r
+int __aeabi_fcmpeq(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_eq(f32_from_f(a), f32_from_f(b));\r
+}\r
+\r
+int __aeabi_fcmplt(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_lt(f32_from_f(a), f32_from_f(b));\r
+}\r
+\r
+int __aeabi_fcmple(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_le(f32_from_f(a), f32_from_f(b));\r
+}\r
+\r
+int __aeabi_fcmpge(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_le(f32_from_f(b), f32_from_f(a));\r
+}\r
+\r
+int __aeabi_fcmpgt(aeabi_float_t a, aeabi_float_t b)\r
+{\r
+  return f32_lt(f32_from_f(b), f32_from_f(a));\r
+}\r
+\r
+/*\r
+ * Table 6, Standard floating-point to integer conversions\r
+ */\r
+\r
+int __aeabi_d2iz(aeabi_double_t a)\r
+{\r
+  return f64_to_i32_r_minMag(f64_from_d(a), false);\r
+}\r
+\r
+unsigned __aeabi_d2uiz(aeabi_double_t a)\r
+{\r
+  return f64_to_ui32_r_minMag(f64_from_d(a), false);\r
+}\r
+\r
+long long __aeabi_d2lz(aeabi_double_t a)\r
+{\r
+  return f64_to_i64_r_minMag(f64_from_d(a), false);\r
+}\r
+\r
+unsigned long long __aeabi_d2ulz(aeabi_double_t a)\r
+{\r
+  return f64_to_ui64_r_minMag(f64_from_d(a), false);\r
+}\r
+\r
+int __aeabi_f2iz(aeabi_float_t a)\r
+{\r
+  return f32_to_i32_r_minMag(f32_from_f(a), false);\r
+}\r
+\r
+unsigned __aeabi_f2uiz(aeabi_float_t a)\r
+{\r
+  return f32_to_ui32_r_minMag(f32_from_f(a), false);\r
+}\r
+\r
+long long __aeabi_f2lz(aeabi_float_t a)\r
+{\r
+  return f32_to_i64_r_minMag(f32_from_f(a), false);\r
+}\r
+\r
+unsigned long long __aeabi_f2ulz(aeabi_float_t a)\r
+{\r
+  return f32_to_ui64_r_minMag(f32_from_f(a), false);\r
+}\r
+\r
+/*\r
+ * Table 7, Standard conversions between floating types\r
+ */\r
+\r
+aeabi_float_t __aeabi_d2f(aeabi_double_t a)\r
+{\r
+  return f32_to_f(f64_to_f32(f64_from_d(a)));\r
+}\r
+\r
+aeabi_double_t __aeabi_f2d(aeabi_float_t a)\r
+{\r
+  return f64_to_d(f32_to_f64(f32_from_f(a)));\r
+}\r
+\r
+/*\r
+ * Table 8, Standard integer to floating-point conversions\r
+ */\r
+\r
+aeabi_double_t __aeabi_i2d(int a)\r
+{\r
+  return f64_to_d(i32_to_f64(a));\r
+}\r
+\r
+aeabi_double_t __aeabi_ui2d(unsigned a)\r
+{\r
+  return f64_to_d(ui32_to_f64(a));\r
+}\r
+\r
+aeabi_double_t __aeabi_l2d(long long a)\r
+{\r
+  return f64_to_d(i64_to_f64(a));\r
+}\r
+\r
+aeabi_double_t __aeabi_ul2d(unsigned long long a)\r
+{\r
+  return f64_to_d(ui64_to_f64(a));\r
+}\r
+\r
+aeabi_float_t __aeabi_i2f(int a)\r
+{\r
+  return f32_to_f(i32_to_f32(a));\r
+}\r
+\r
+aeabi_float_t __aeabi_ui2f(unsigned a)\r
+{\r
+  return f32_to_f(ui32_to_f32(a));\r
+}\r
+\r
+aeabi_float_t __aeabi_l2f(long long a)\r
+{\r
+  return f32_to_f(i64_to_f32(a));\r
+}\r
+\r
+aeabi_float_t __aeabi_ul2f(unsigned long long a)\r
+{\r
+  return f32_to_f(ui64_to_f32(a));\r
+}\r
index c5ae32e5ee712ddcf1fb7b10c5a6b7a85ac0fde4..24398d591f79a48025235a4c3b78df655bc19b0b 100644 (file)
@@ -1,55 +1,55 @@
-//------------------------------------------------------------------------------
-//
-// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-//------------------------------------------------------------------------------
-
-typedef __SIZE_TYPE__ size_t;
-
-static __attribute__((__used__))
-void *__memset(void *s, int c, size_t n)
-{
-  unsigned char *d = s;
-
-  while (n--)
-    *d++ = c;
-
-  return s;
-}
-
-//
-// Other modules (such as CryptoPkg/IntrinsicLib) may provide another
-// implementation of memset(), which may conflict with this one if this
-// object was pulled into the link due to the definitions below. So make
-// our memset() 'weak' to let the other implementation take precedence.
-//
-__attribute__((__weak__, __alias__("__memset")))
-void *memset(void *dest, int c, size_t n);
-
-#ifdef __arm__
-
-void __aeabi_memset(void *dest, size_t n, int c)
-{
-  __memset(dest, c, n);
-}
-
-__attribute__((__alias__("__aeabi_memset")))
-void __aeabi_memset4(void *dest, size_t n, int c);
-
-__attribute__((__alias__("__aeabi_memset")))
-void __aeabi_memset8(void *dest, size_t n, int c);
-
-void __aeabi_memclr(void *dest, size_t n)
-{
-  __memset(dest, 0, n);
-}
-
-__attribute__((__alias__("__aeabi_memclr")))
-void __aeabi_memclr4(void *dest, size_t n);
-
-__attribute__((__alias__("__aeabi_memclr")))
-void __aeabi_memclr8(void *dest, size_t n);
-
-#endif
+//------------------------------------------------------------------------------\r
+//\r
+// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
+//\r
+// SPDX-License-Identifier: BSD-2-Clause-Patent\r
+//\r
+//------------------------------------------------------------------------------\r
+\r
+typedef __SIZE_TYPE__ size_t;\r
+\r
+static __attribute__((__used__))\r
+void *__memset(void *s, int c, size_t n)\r
+{\r
+  unsigned char *d = s;\r
+\r
+  while (n--)\r
+    *d++ = c;\r
+\r
+  return s;\r
+}\r
+\r
+//\r
+// Other modules (such as CryptoPkg/IntrinsicLib) may provide another\r
+// implementation of memset(), which may conflict with this one if this\r
+// object was pulled into the link due to the definitions below. So make\r
+// our memset() 'weak' to let the other implementation take precedence.\r
+//\r
+__attribute__((__weak__, __alias__("__memset")))\r
+void *memset(void *dest, int c, size_t n);\r
+\r
+#ifdef __arm__\r
+\r
+void __aeabi_memset(void *dest, size_t n, int c)\r
+{\r
+  __memset(dest, c, n);\r
+}\r
+\r
+__attribute__((__alias__("__aeabi_memset")))\r
+void __aeabi_memset4(void *dest, size_t n, int c);\r
+\r
+__attribute__((__alias__("__aeabi_memset")))\r
+void __aeabi_memset8(void *dest, size_t n, int c);\r
+\r
+void __aeabi_memclr(void *dest, size_t n)\r
+{\r
+  __memset(dest, 0, n);\r
+}\r
+\r
+__attribute__((__alias__("__aeabi_memclr")))\r
+void __aeabi_memclr4(void *dest, size_t n);\r
+\r
+__attribute__((__alias__("__aeabi_memclr")))\r
+void __aeabi_memclr8(void *dest, size_t n);\r
+\r
+#endif\r
index 66819534a0456617d553da535faa7a332caaec2d..02a55ef4456ca2d8f92df7b6569f600cba26f85c 100644 (file)
@@ -1,21 +1,21 @@
-//
-// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-
-//
-// GCC in LTO mode interoperates poorly with non-standard libraries that
-// provide implementations of compiler intrinsics such as memcpy/memset
-// or the stack protector entry points.
-//
-// By referencing these functions from a non-LTO object that can be passed
-// to the linker via the -plugin-opt=-pass-through=-lxxx options, the
-// intrinsics are included in the link in a way that allows them to be
-// pruned again if no other references to them exist.
-//
-
-       .long   memcpy - .
-       .long   memset - .
-       .long   __stack_chk_fail - .
-       .long   __stack_chk_guard - .
+//\r
+// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
+//\r
+// SPDX-License-Identifier: BSD-2-Clause-Patent\r
+//\r
+\r
+//\r
+// GCC in LTO mode interoperates poorly with non-standard libraries that\r
+// provide implementations of compiler intrinsics such as memcpy/memset\r
+// or the stack protector entry points.\r
+//\r
+// By referencing these functions from a non-LTO object that can be passed\r
+// to the linker via the -plugin-opt=-pass-through=-lxxx options, the\r
+// intrinsics are included in the link in a way that allows them to be\r
+// pruned again if no other references to them exist.\r
+//\r
+\r
+  .long memcpy - .\r
+  .long memset - .\r
+  .long __stack_chk_fail - .\r
+  .long __stack_chk_guard - .\r
index 4b26d4320d5293b7637d86536e72888fc562567e..f19fb455519db1d694b8081e12679d47df9736a2 100644 (file)
@@ -1,55 +1,55 @@
-//
-// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-
-//
-// GCC in LTO mode interoperates poorly with non-standard libraries that
-// provide implementations of compiler intrinsics such as memcpy/memset
-// or the stack protector entry points.
-//
-// By referencing these functions from a non-LTO object that can be passed
-// to the linker via the -plugin-opt=-pass-through=-lxxx options, the
-// intrinsics are included in the link in a way that allows them to be
-// pruned again if no other references to them exist.
-//
-
-       .long   memcpy - .
-       .long   memset - .
-       .long   __stack_chk_fail - .
-       .long   __stack_chk_guard - .
-       .long __ashrdi3 - .
-       .long __ashldi3 - .
-       .long __aeabi_idiv - .
-       .long __aeabi_idivmod - .
-       .long __aeabi_uidiv - .
-       .long __aeabi_uidivmod - .
-       .long __divdi3 - .
-       .long __divsi3 - .
-       .long __lshrdi3 - .
-       .long __aeabi_memcpy - .
-       .long __aeabi_memset - .
-       .long memmove - .
-       .long __modsi3 - .
-       .long __moddi3 - .
-       .long __muldi3 - .
-       .long __aeabi_lmul - .
-       .long __ARM_ll_mullu - .
-       .long __udivsi3 - .
-       .long __umodsi3 - .
-       .long __udivdi3 - .
-       .long __umoddi3 - .
-       .long __udivmoddi4 - .
-       .long __clzsi2 - .
-       .long __ctzsi2 - .
-       .long __ucmpdi2 - .
-       .long __switch8 - .
-       .long __switchu8 - .
-       .long __switch16 - .
-       .long __switch32 - .
-       .long __aeabi_ulcmp - .
-       .long __aeabi_uldivmod - .
-       .long __aeabi_ldivmod - .
-       .long __aeabi_llsr - .
-       .long __aeabi_llsl - .
+//\r
+// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
+//\r
+// SPDX-License-Identifier: BSD-2-Clause-Patent\r
+//\r
+\r
+//\r
+// GCC in LTO mode interoperates poorly with non-standard libraries that\r
+// provide implementations of compiler intrinsics such as memcpy/memset\r
+// or the stack protector entry points.\r
+//\r
+// By referencing these functions from a non-LTO object that can be passed\r
+// to the linker via the -plugin-opt=-pass-through=-lxxx options, the\r
+// intrinsics are included in the link in a way that allows them to be\r
+// pruned again if no other references to them exist.\r
+//\r
+\r
+  .long memcpy - .\r
+  .long memset - .\r
+  .long __stack_chk_fail - .\r
+  .long __stack_chk_guard - .\r
+  .long __ashrdi3 - .\r
+  .long __ashldi3 - .\r
+  .long __aeabi_idiv - .\r
+  .long __aeabi_idivmod - .\r
+  .long __aeabi_uidiv - .\r
+  .long __aeabi_uidivmod - .\r
+  .long __divdi3 - .\r
+  .long __divsi3 - .\r
+  .long __lshrdi3 - .\r
+  .long __aeabi_memcpy - .\r
+  .long __aeabi_memset - .\r
+  .long memmove - .\r
+  .long __modsi3 - .\r
+  .long __moddi3 - .\r
+  .long __muldi3 - .\r
+  .long __aeabi_lmul - .\r
+  .long __ARM_ll_mullu - .\r
+  .long __udivsi3 - .\r
+  .long __umodsi3 - .\r
+  .long __udivdi3 - .\r
+  .long __umoddi3 - .\r
+  .long __udivmoddi4 - .\r
+  .long __clzsi2 - .\r
+  .long __ctzsi2 - .\r
+  .long __ucmpdi2 - .\r
+  .long __switch8 - .\r
+  .long __switchu8 - .\r
+  .long __switch16 - .\r
+  .long __switch32 - .\r
+  .long __aeabi_ulcmp - .\r
+  .long __aeabi_uldivmod - .\r
+  .long __aeabi_ldivmod - .\r
+  .long __aeabi_llsr - .\r
+  .long __aeabi_llsl - .\r