Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* ashrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) This file is part of GNU CC.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) GNU CC is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) it under the terms of the GNU General Public License as published by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) the Free Software Foundation; either version 2, or (at your option)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) any later version.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) GNU CC is distributed in the hope that it will be useful,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) but WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) GNU General Public License for more details. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/compiler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/export.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define BITS_PER_UNIT 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) typedef		 int SItype	__mode(SI);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) typedef unsigned int USItype	__mode(SI);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) typedef		 int DItype	__mode(DI);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) typedef int word_type           __mode(__word__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct DIstruct {SItype high, low;};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) typedef union
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)   struct DIstruct s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)   DItype ll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) } DIunion;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) DItype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) __ashrdi3 (DItype u, word_type b)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)   DIunion w;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)   word_type bm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)   DIunion uu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)   if (b == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)     return u;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)   uu.ll = u;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)   bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)   if (bm <= 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)     {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)       /* w.s.high = 1..1 or 0..0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)       w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)       w.s.low = uu.s.high >> -bm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)     }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)   else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)     {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)       USItype carries = (USItype)uu.s.high << bm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)       w.s.high = uu.s.high >> b;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)       w.s.low = ((USItype)uu.s.low >> b) | carries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)     }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)   return w.ll;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) EXPORT_SYMBOL(__ashrdi3);