summaryrefslogtreecommitdiffstats
path: root/include/lib
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2018-06-28 10:39:42 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2018-06-29 09:29:42 +0200
commit5302dff3b60d6ef288bfd9526b69381ffc3ed990 (patch)
tree5baafca9c7b48e383e6145485101724fdcc0a66c /include/lib
parentfe040e0977fab29216f5039e8f9b04e6dbec859a (diff)
downloadbarebox-5302dff3b60d6ef288bfd9526b69381ffc3ed990.tar.gz
barebox-5302dff3b60d6ef288bfd9526b69381ffc3ed990.tar.xz
lib: Add shared copies of some GCC library routines
This commit is based on these linux kernel commits: | commit b35cd9884fa5d81c9d5e7f57c9d03264ae2bd835 | Author: Palmer Dabbelt <palmer@dabbelt.com> | Date: Tue May 23 10:28:26 2017 -0700 | | lib: Add shared copies of some GCC library routines | | commit e3d5980568fdf83c15a5a3c8ddca1590551ab7a2 | Author: Matt Redfearn <matt.redfearn@mips.com> | Date: Wed Apr 11 08:50:17 2018 +0100 | | lib: Rename compiler intrinsic selects to GENERIC_LIB_* Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/lib')
-rw-r--r--include/lib/libgcc.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/lib/libgcc.h b/include/lib/libgcc.h
new file mode 100644
index 0000000000..adad27704a
--- /dev/null
+++ b/include/lib/libgcc.h
@@ -0,0 +1,47 @@
+/*
+ * include/lib/libgcc.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.
+ */
+
+#ifndef __LIB_LIBGCC_H
+#define __LIB_LIBGCC_H
+
+#include <asm/byteorder.h>
+
+typedef int word_type __attribute__ ((mode (__word__)));
+
+#ifdef __BIG_ENDIAN
+struct DWstruct {
+ int high, low;
+};
+#elif defined(__LITTLE_ENDIAN)
+struct DWstruct {
+ int low, high;
+};
+#else
+#error I feel sick.
+#endif
+
+typedef union {
+ struct DWstruct s;
+ long long ll;
+} DWunion;
+
+long long __lshrdi3(long long u, word_type b);
+long long __ashldi3(long long u, word_type b);
+long long __ashrdi3(long long u, word_type b);
+
+#endif /* __ASM_LIBGCC_H */