00001 /* Miscellaneous BPABI functions. 00002 00003 Copyright (C) 2003, 2004 Free Software Foundation, Inc. 00004 Contributed by CodeSourcery, LLC. 00005 00006 This file is free software; you can redistribute it and/or modify it 00007 under the terms of the GNU General Public License as published by the 00008 Free Software Foundation; either version 2, or (at your option) any 00009 later version. 00010 00011 In addition to the permissions in the GNU General Public License, the 00012 Free Software Foundation gives you unlimited permission to link the 00013 compiled version of this file into combinations with other programs, 00014 and to distribute those combinations without any restriction coming 00015 from the use of this file. (The General Public License restrictions 00016 do apply in other respects; for example, they cover modification of 00017 the file, and distribution when not linked into a combine 00018 executable.) 00019 00020 This file is distributed in the hope that it will be useful, but 00021 WITHOUT ANY WARRANTY; without even the implied warranty of 00022 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00023 General Public License for more details. 00024 00025 You should have received a copy of the GNU General Public License 00026 along with this program; see the file COPYING. If not, write to 00027 the Free Software Foundation, 59 Temple Place - Suite 330, 00028 Boston, MA 02111-1307, USA. */ 00029 00030 extern long long __divdi3 (long long, long long); 00031 extern unsigned long long __udivdi3 (unsigned long long, 00032 unsigned long long); 00033 extern long long __gnu_ldivmod_helper (long long, long long, long long *); 00034 extern unsigned long long __gnu_uldivmod_helper (unsigned long long, 00035 unsigned long long, 00036 unsigned long long *); 00037 00038 00039 long long 00040 __gnu_ldivmod_helper (long long a, 00041 long long b, 00042 long long *remainder) 00043 { 00044 long long quotient; 00045 00046 quotient = __divdi3 (a, b); 00047 *remainder = a - b * quotient; 00048 return quotient; 00049 } 00050 00051 unsigned long long 00052 __gnu_uldivmod_helper (unsigned long long a, 00053 unsigned long long b, 00054 unsigned long long *remainder) 00055 { 00056 unsigned long long quotient; 00057 00058 quotient = __udivdi3 (a, b); 00059 *remainder = a - b * quotient; 00060 return quotient; 00061 }
1.5.6