X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=lib_blackfin%2Fmuldi3.c;h=bf1ca535fa76c19326376b5b2486ba382fea8bbe;hb=1d7b31d97b34ccb6f9b20a2465864998b0bf2691;hp=1fc34e3d932d49cce4ad5fe1c9f5ecd169bc896e;hpb=f6e5739a68131998a5ae8aa0cf56a0316f810200;p=oweals%2Fu-boot.git diff --git a/lib_blackfin/muldi3.c b/lib_blackfin/muldi3.c index 1fc34e3d93..bf1ca535fa 100644 --- a/lib_blackfin/muldi3.c +++ b/lib_blackfin/muldi3.c @@ -1,7 +1,7 @@ /* * U-boot - muldi3.c contains routines for mult and div * - * Copyright (c) 2005 blackfin.uclinux.org + * Copyright (c) 2005-2007 Analog Devices Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -18,8 +18,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA */ /* Generic function got from GNU gcc package, libgcc2.c */ @@ -64,29 +64,29 @@ do { \ __w.ll; }) #endif -typedef unsigned int USItype __attribute__ ((mode (SI))); -typedef int SItype __attribute__ ((mode (SI))); -typedef int DItype __attribute__ ((mode (DI))); -typedef int word_type __attribute__ ((mode (__word__))); +typedef unsigned int USItype __attribute__ ((mode(SI))); +typedef int SItype __attribute__ ((mode(SI))); +typedef int DItype __attribute__ ((mode(DI))); +typedef int word_type __attribute__ ((mode(__word__))); -struct DIstruct {SItype low, high;}; -typedef union -{ +struct DIstruct { + SItype low, high; +}; +typedef union { struct DIstruct s; DItype ll; } DIunion; -DItype __muldi3 (DItype u, DItype v) +DItype __muldi3(DItype u, DItype v) { DIunion w; DIunion uu, vv; - uu.ll = u, - vv.ll = v; + uu.ll = u, vv.ll = v; /* panic("kernel panic for __muldi3"); */ - w.ll = __umulsidi3 (uu.s.low, vv.s.low); + w.ll = __umulsidi3(uu.s.low, vv.s.low); w.s.high += ((USItype) uu.s.low * (USItype) vv.s.high - + (USItype) uu.s.high * (USItype) vv.s.low); + + (USItype) uu.s.high * (USItype) vv.s.low); return w.ll; }