1 | /*************************************************************************** |
---|
2 | * |
---|
3 | * Copyright (C) 2001 International Business Machines |
---|
4 | * All rights reserved. |
---|
5 | * |
---|
6 | * This file is part of the GPFS mmfslinux kernel module. |
---|
7 | * |
---|
8 | * Redistribution and use in source and binary forms, with or without |
---|
9 | * modification, are permitted provided that the following conditions |
---|
10 | * are met: |
---|
11 | * |
---|
12 | * 1. Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
15 | * notice, this list of conditions and the following disclaimer in the |
---|
16 | * documentation and/or other materials provided with the distribution. |
---|
17 | * 3. The name of the author may not be used to endorse or promote products |
---|
18 | * derived from this software without specific prior written |
---|
19 | * permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
---|
22 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
---|
23 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
---|
24 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
---|
27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
---|
28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
---|
29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
---|
30 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
31 | * |
---|
32 | *************************************************************************** */ |
---|
33 | /* @(#)53 1.2 src/avs/fs/mmfs/ts/kernext/gpl-linux/mmwrap.c, mmfs, avs_rgpfs24, rgpfs240610b 2/27/06 03:01:20 */ |
---|
34 | /* This file is only used to support i386 Linux 2.6 Kernels built with |
---|
35 | * CONFIG_REGPARM. The libgcc functions __divdi3, __udivdi3, |
---|
36 | * __moddi3, __umoddi3 are used for 64bit integer division and |
---|
37 | * modulo. The compiler generates calls to these functions following the |
---|
38 | * -mregparm=3 option when compiling 32bit code. To get valid divide |
---|
39 | * and modulo in when compliing with -mregparm=3 we wrap these functions |
---|
40 | * using the --wrap ld option and call them with args on the stack. |
---|
41 | */ |
---|
42 | |
---|
43 | #if defined(GPFS_ARCH_I386) && LINUX_KERNEL_VERSION > 2060500 && !defined(NOKREGPARMS) |
---|
44 | |
---|
45 | extern long long __real___divdi3(long long a, long long b) __attribute__ ((regparm(0))); |
---|
46 | extern long long __real___udivdi3(long long a, long long b) __attribute__ ((regparm(0))); |
---|
47 | extern long long __real___moddi3(long long a, long long b) __attribute__ ((regparm(0))); |
---|
48 | extern long long __real___umoddi3(long long a, long long b) __attribute__ ((regparm(0))); |
---|
49 | |
---|
50 | long long |
---|
51 | __wrap___divdi3(long long a, long long b) |
---|
52 | { |
---|
53 | return(__real___divdi3(a,b)); |
---|
54 | } |
---|
55 | |
---|
56 | unsigned long long |
---|
57 | __wrap___udivdi3(unsigned long long a, unsigned long long b) |
---|
58 | { |
---|
59 | return(__real___udivdi3(a,b)); |
---|
60 | } |
---|
61 | |
---|
62 | long long |
---|
63 | __wrap___moddi3(long long a, long long b) |
---|
64 | { |
---|
65 | return(__real___moddi3(a,b)); |
---|
66 | } |
---|
67 | |
---|
68 | unsigned long long |
---|
69 | __wrap___umoddi3(unsigned long long a, unsigned long long b) |
---|
70 | { |
---|
71 | return(__real___umoddi3(a,b)); |
---|
72 | } |
---|
73 | |
---|
74 | #endif |
---|