summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-07-09 08:21:18 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-07-09 08:21:18 +0200
commit7ad77a3b86078d6a2468111c1b9986dadcccf89b (patch)
treed737bc6038372e137767d99c24c021cb964ffba1 /include
parent6af0422208def55bb4eb5a5a0235b48a7c815c8e (diff)
parent36c4247aabccf3ed18db52086fc9d894ee4fc5eb (diff)
downloadbarebox-7ad77a3b86078d6a2468111c1b9986dadcccf89b.tar.gz
barebox-7ad77a3b86078d6a2468111c1b9986dadcccf89b.tar.xz
Merge branch 'for-next/riscv'
Diffstat (limited to 'include')
-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 */