/*************************************************************************** * * Copyright (C) 2001 International Business Machines * All rights reserved. * * This file is part of the GPFS mmfslinux kernel module. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *************************************************************************** */ /* @(#)53 1.2 src/avs/fs/mmfs/ts/kernext/gpl-linux/mmwrap.c, mmfs, avs_rgpfs24, rgpfs240610b 2/27/06 03:01:20 */ /* This file is only used to support i386 Linux 2.6 Kernels built with * CONFIG_REGPARM. The libgcc functions __divdi3, __udivdi3, * __moddi3, __umoddi3 are used for 64bit integer division and * modulo. The compiler generates calls to these functions following the * -mregparm=3 option when compiling 32bit code. To get valid divide * and modulo in when compliing with -mregparm=3 we wrap these functions * using the --wrap ld option and call them with args on the stack. */ #if defined(GPFS_ARCH_I386) && LINUX_KERNEL_VERSION > 2060500 && !defined(NOKREGPARMS) extern long long __real___divdi3(long long a, long long b) __attribute__ ((regparm(0))); extern long long __real___udivdi3(long long a, long long b) __attribute__ ((regparm(0))); extern long long __real___moddi3(long long a, long long b) __attribute__ ((regparm(0))); extern long long __real___umoddi3(long long a, long long b) __attribute__ ((regparm(0))); long long __wrap___divdi3(long long a, long long b) { return(__real___divdi3(a,b)); } unsigned long long __wrap___udivdi3(unsigned long long a, unsigned long long b) { return(__real___udivdi3(a,b)); } long long __wrap___moddi3(long long a, long long b) { return(__real___moddi3(a,b)); } unsigned long long __wrap___umoddi3(unsigned long long a, unsigned long long b) { return(__real___umoddi3(a,b)); } #endif