diff options
author | Masahiro Yamada <yamada.m@jp.panasonic.com> | 2015-02-10 21:37:01 +0900 |
---|---|---|
committer | Nobuhiro Iwamatsu <iwamatsu@nigauri.org> | 2015-02-25 13:57:29 +0900 |
commit | 5f91a3adb86475aada63da0975637ab203184e0a (patch) | |
tree | 33e1c097b43b0d016b28855a6763b12b0809b154 /arch/sh/lib/ashrdi3.c | |
parent | 72cedad2b89aac188e56ac8bc6a4146786791693 (diff) | |
download | u-boot-imx-5f91a3adb86475aada63da0975637ab203184e0a.zip u-boot-imx-5f91a3adb86475aada63da0975637ab203184e0a.tar.gz u-boot-imx-5f91a3adb86475aada63da0975637ab203184e0a.tar.bz2 |
sh: import missing private libraries from Linux 3.19
SuperH is supposed to support the Private Library feature, but it is
actually not working.
If CONFIG_USE_PRIVATE_LIBGCC is enabled, the build fails for the
undefined references to '__sdivsi3_i4i' and '__udivsi3_i4i'.
To fix this error, import missing libraries from Linux 3.19
and adjust them for U-Boot:
- Remove "#include <linux/module.h>" and "EXPORT_SYMBOL(...)"
- Use SPDX-License-Identifier
- Remove white space
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'arch/sh/lib/ashrdi3.c')
-rw-r--r-- | arch/sh/lib/ashrdi3.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/sh/lib/ashrdi3.c b/arch/sh/lib/ashrdi3.c new file mode 100644 index 0000000..f30359b --- /dev/null +++ b/arch/sh/lib/ashrdi3.c @@ -0,0 +1,27 @@ +#include "libgcc.h" + +long long __ashrdi3(long long u, word_type b) +{ + DWunion uu, w; + word_type bm; + + if (b == 0) + return u; + + uu.ll = u; + bm = 32 - b; + + if (bm <= 0) { + /* w.s.high = 1..1 or 0..0 */ + w.s.high = + uu.s.high >> 31; + w.s.low = uu.s.high >> -bm; + } else { + const unsigned int carries = (unsigned int) uu.s.high << bm; + + w.s.high = uu.s.high >> b; + w.s.low = ((unsigned int) uu.s.low >> b) | carries; + } + + return w.ll; +} |