mozilla-ppc64le-xpcom.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Sun, 16 Mar 2014 10:38:59 +0100
changeset 710 5341dc98d26c
child 714 b686e856c800
permissions -rw-r--r--
update of PPC64LE patches taken from https://build.opensuse.org/request/show/224301
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
710
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     1
# HG changeset patch
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     2
# Parent 571f8d1f1501d31bd7c0d0affdc7cdc8b21203a0
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     3
# User Ulrich Weigand <uweigand@de.ibm.com>
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     4
Bug 976648 - powerpc64le-linux support - xptcall port
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     5
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     6
diff --git a/xpcom/reflect/xptcall/src/md/unix/moz.build b/xpcom/reflect/xptcall/src/md/unix/moz.build
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     7
--- a/xpcom/reflect/xptcall/src/md/unix/moz.build
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     8
+++ b/xpcom/reflect/xptcall/src/md/unix/moz.build
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     9
@@ -228,16 +228,23 @@ if CONFIG['OS_TEST'] == 'powerpc64':
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    10
     if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD'):
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    11
           SOURCES += [
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    12
               'xptcinvoke_asm_ppc64_linux.s',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    13
               'xptcinvoke_ppc64_linux.cpp',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    14
               'xptcstubs_asm_ppc64_linux.s',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    15
               'xptcstubs_ppc64_linux.cpp',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    16
           ]
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    17
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    18
+if CONFIG['OS_TEST'] == 'powerpc64le':
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    19
+    if CONFIG['OS_ARCH'] == 'Linux':
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    20
+          CPP_SOURCES += [
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    21
+              'xptcinvoke_ppc64_linux.cpp',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    22
+              'xptcstubs_ppc64_linux.cpp',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    23
+          ]
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    24
+
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    25
 if CONFIG['OS_TEST'] in ('macppc', 'bebox', 'ofppc', 'prep', 'amigappc'):
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
     if CONFIG['OS_ARCH'] == 'NetBSD':
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    27
         SOURCES += [
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    28
             'xptcinvoke_asm_ppc_netbsd.s',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    29
             'xptcinvoke_ppc_netbsd.cpp',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    30
             'xptcstubs_asm_ppc_netbsd.s',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    31
             'xptcstubs_ppc_netbsd.cpp',
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    32
         ]
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    33
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    34
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    35
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc64_linux.s
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    36
@@ -12,90 +12,121 @@
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    37
 .set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    38
 .set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    39
 .set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    40
 .set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    41
 .set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    42
 .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    43
 .set f30,30; .set f31,31
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    44
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    45
+# The ABI defines a fixed stack frame area of 4 doublewords (ELFv2)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    46
+# or 6 doublewords (ELFv1); the last of these doublewords is used
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    47
+# as TOC pointer save area.  The fixed area is followed by a parameter
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    48
+# save area of 8 doublewords (used for vararg routines), followed
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    49
+# by space for parameters passed on the stack.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    50
+#
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    51
+# We set STACK_TOC to the offset of the TOC pointer save area, and
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    52
+# STACK_PARAMS to the offset of the first on-stack parameter.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    53
+
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    54
+#if _CALL_ELF == 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    55
+#define STACK_TOC      24
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    56
+#define STACK_PARAMS   96
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    57
+#else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    58
+#define STACK_TOC      40
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    59
+#define STACK_PARAMS   112
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    60
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    61
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    62
 #
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    63
 # NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    64
 #                    uint32_t paramCount, nsXPTCVariant* params)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    65
 #
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    66
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    67
+#if _CALL_ELF == 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    68
+        .section ".text"
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    69
+        .type   NS_InvokeByIndex,@function
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    70
+        .globl  NS_InvokeByIndex
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    71
+        .align 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    72
+NS_InvokeByIndex:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    73
+0:      addis 2,12,(.TOC.-0b)@ha
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    74
+        addi 2,2,(.TOC.-0b)@l
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    75
+        .localentry NS_InvokeByIndex,.-NS_InvokeByIndex
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    76
+#else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    77
         .section ".toc","aw"
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    78
         .section ".text"
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    79
         .align 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    80
         .globl  NS_InvokeByIndex
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    81
         .section ".opd","aw"
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    82
         .align 3
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    83
 NS_InvokeByIndex:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    84
         .quad   .NS_InvokeByIndex,.TOC.@tocbase
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    85
         .previous
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    86
         .type   NS_InvokeByIndex,@function
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    87
 .NS_InvokeByIndex:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    88
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    89
         mflr    0
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    90
         std     0,16(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    91
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    92
         std     r29,-24(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    93
         std     r30,-16(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    94
         std     r31,-8(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    95
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    96
         mr      r29,r3                  # Save 'that' in r29
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    97
         mr      r30,r4                  # Save 'methodIndex' in r30
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    98
         mr      r31,r1                  # Save old frame
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    99
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   100
         # Allocate stack frame with space for params. Since at least the
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   101
         # first 7 parameters (not including 'that') will be in registers,
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   102
         # we don't actually need stack space for those. We must ensure
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   103
         # that the stack remains 16-byte aligned.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   104
         #
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   105
-        #  | ..128-byte stack frame.. |     | 7 GP | 13 FP | 3 NV |
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   106
-        #  |               |(params)........| regs | regs  | regs |
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   107
-        # (r1)...........(+112)....(+128)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   108
-        #                               (-23*8).(-16*8).(-3*8)..(r31)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   109
+        #  | (fixed area + |                | 7 GP | 13 FP | 3 NV |
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   110
+        #  |  param. save) |(params)........| regs | regs  | regs |
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   111
+        # (r1)......(+STACK_PARAMS)...  (-23*8).(-16*8).(-3*8)..(r31)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   112
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   113
         # +stack frame, -unused stack params, +regs storage, +1 for alignment
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   114
-        addi    r7,r5,((112/8)-7+7+13+3+1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   115
+        addi    r7,r5,((STACK_PARAMS/8)-7+7+13+3+1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   116
         rldicr  r7,r7,3,59              # multiply by 8 and mask with ~15
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   117
         neg     r7,r7
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   118
         stdux   r1,r1,r7
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   119
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   120
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   121
         # Call invoke_copy_to_stack(uint64_t* gpregs, double* fpregs,
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   122
         #                           uint32_t paramCount, nsXPTCVariant* s, 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   123
         #                           uint64_t* d))
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   124
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   125
         # r5, r6 are passed through intact (paramCount, params)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   126
-        # r7 (d) has to be r1+112 -- where parameters are passed on the stack.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   127
+        # r7 (d) has to be r1+STACK_PARAMS
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   128
+        #        -- where parameters are passed on the stack.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   129
         # r3, r4 are above that, easier to address from r31 than from r1
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   130
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   131
         subi    r3,r31,(23*8)           # r3 --> GPRS
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   132
         subi    r4,r31,(16*8)           # r4 --> FPRS
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   133
-        addi    r7,r1,112               # r7 --> params
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   134
+        addi    r7,r1,STACK_PARAMS      # r7 --> params
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   135
         bl      invoke_copy_to_stack
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   136
         nop
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   137
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   138
         # Set up to invoke function
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   139
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   140
         ld      r9,0(r29)               # vtable (r29 is 'that')
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   141
         mr      r3,r29                  # self is first arg, obviously
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   142
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   143
         sldi    r30,r30,3               # Find function descriptor 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   144
         add     r9,r9,r30
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   145
-        ld      r9,0(r9)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   146
+        ld      r12,0(r9)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   147
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   148
-        ld      r0,0(r9)                # Actual address from fd.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   149
-        std     r2,40(r1)               # Save r2 (TOC pointer)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   150
+        std     r2,STACK_TOC(r1)        # Save r2 (TOC pointer)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   151
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   152
+#if _CALL_ELF == 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   153
+        mtctr   r12
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   154
+#else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   155
+        ld      r0,0(r12)               # Actual address from fd.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   156
         mtctr   0
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   157
-        ld      r11,16(r9)              # Environment pointer from fd.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   158
-        ld      r2,8(r9)                # TOC pointer from fd.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   159
+        ld      r11,16(r12)             # Environment pointer from fd.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   160
+        ld      r2,8(r12)               # TOC pointer from fd.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   161
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   162
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   163
         # Load FP and GP registers as required
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   164
         ld      r4, -(23*8)(r31) 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   165
         ld      r5, -(22*8)(r31) 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   166
         ld      r6, -(21*8)(r31) 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   167
         ld      r7, -(20*8)(r31) 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   168
         ld      r8, -(19*8)(r31) 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   169
         ld      r9, -(18*8)(r31) 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   170
@@ -112,21 +143,25 @@ NS_InvokeByIndex:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   171
         lfd     f9, -(8*8)(r31)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   172
         lfd     f10, -(7*8)(r31)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   173
         lfd     f11, -(6*8)(r31)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   174
         lfd     f12, -(5*8)(r31)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   175
         lfd     f13, -(4*8)(r31)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   176
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   177
         bctrl                           # Do it
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   178
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   179
-        ld      r2,40(r1)               # Load our own TOC pointer
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   180
+        ld      r2,STACK_TOC(r1)        # Load our own TOC pointer
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   181
         ld      r1,0(r1)                # Revert stack frame
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   182
         ld      0,16(r1)                # Reload lr
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   183
         ld      29,-24(r1)              # Restore NVGPRS
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   184
         ld      30,-16(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   185
         ld      31,-8(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   186
         mtlr    0
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   187
         blr
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   188
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   189
+#if _CALL_ELF == 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   190
+        .size   NS_InvokeByIndex,.-NS_InvokeByIndex
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   191
+#else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   192
         .size   NS_InvokeByIndex,.-.NS_InvokeByIndex
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   193
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   194
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   195
         # Magic indicating no need for an executable stack
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   196
         .section .note.GNU-stack, "", @progbits ; .previous
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   197
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   198
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   199
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc64_linux.cpp
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   200
@@ -69,17 +69,19 @@ invoke_copy_to_stack(uint64_t* gpregs,
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   201
             else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   202
                 *(double *)d = s->val.d;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   203
         }
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   204
         else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   205
             if (i < FPR_COUNT) {
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   206
                 fpregs[i]   = s->val.f; // if passed in registers, floats are promoted to doubles
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   207
             } else {
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   208
                 float *p = (float *)d;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   209
+#ifndef __LITTLE_ENDIAN__
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   210
                 p++;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   211
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   212
                 *p = s->val.f;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   213
             }
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   214
         }
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   215
         else {
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   216
             if (i < GPR_COUNT)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   217
                 gpregs[i] = tempu64;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   218
             else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   219
                 *d = tempu64;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   220
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.s
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   221
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.s
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   222
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc64_linux.s
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   223
@@ -12,28 +12,50 @@
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   224
 .set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   225
 .set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   226
 .set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   227
 .set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   228
 .set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   229
 .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   230
 .set f30,30; .set f31,31
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   231
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   232
+#if _CALL_ELF == 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   233
+#define STACK_PARAMS   96
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   234
+#else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   235
+#define STACK_PARAMS   112
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   236
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   237
+
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   238
+#if _CALL_ELF == 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   239
+        .section ".text"
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   240
+        .type   SharedStub,@function
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   241
+        .globl  SharedStub
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   242
+        # Make the symbol hidden so that the branch from the stub does
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   243
+        # not go via a PLT.  This is not only better for performance,
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   244
+        # but may be necessary to avoid linker errors since there is
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   245
+        # no place to restore the TOC register in a sibling call.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   246
+        .hidden SharedStub
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   247
+        .align 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   248
+SharedStub:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   249
+0:      addis 2,12,(.TOC.-0b)@ha
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   250
+        addi 2,2,(.TOC.-0b)@l
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   251
+        .localentry SharedStub,.-SharedStub
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   252
+#else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   253
         .section ".text"
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   254
         .align 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   255
         .globl SharedStub
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   256
         .section ".opd","aw"
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   257
         .align 3
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   258
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   259
 SharedStub:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   260
         .quad   .SharedStub,.TOC.@tocbase
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   261
         .previous
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   262
         .type   SharedStub,@function
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   263
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   264
 .SharedStub:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   265
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   266
         mflr    r0
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   267
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   268
         std     r4, -56(r1)                     # Save all GPRS
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   269
         std     r5, -48(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   270
         std     r6, -40(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   271
         std     r7, -32(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   272
         std     r8, -24(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   273
         std     r9, -16(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   274
@@ -50,17 +72,17 @@ SharedStub:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   275
         stfd    f5, -128(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   276
         stfd    f4, -136(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   277
         stfd    f3, -144(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   278
         stfd    f2, -152(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   279
         stfd    f1, -160(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   280
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   281
         subi    r6,r1,56                        # r6 --> gprData
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   282
         subi    r7,r1,160                       # r7 --> fprData
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   283
-        addi    r5,r1,112                       # r5 --> extra stack args
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   284
+        addi    r5,r1,STACK_PARAMS              # r5 --> extra stack args
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   285
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   286
         std     r0, 16(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   287
 	
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   288
         stdu    r1,-288(r1)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   289
                                                 # r3 has the 'self' pointer
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   290
                                                 # already
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   291
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   292
         mr      r4,r11                          # r4 is methodIndex selector,
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   293
@@ -70,12 +92,16 @@ SharedStub:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   294
         bl      PrepareAndDispatch
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   295
         nop
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   296
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   297
         ld      1,0(r1)                         # restore stack
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   298
         ld      r0,16(r1)                       # restore LR
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   299
         mtlr    r0
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   300
         blr
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   301
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   302
+#if _CALL_ELF == 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   303
+        .size   SharedStub,.-SharedStub
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   304
+#else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   305
         .size   SharedStub,.-.SharedStub
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   306
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   307
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   308
         # Magic indicating no need for an executable stack
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   309
         .section .note.GNU-stack, "", @progbits ; .previous
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   310
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   311
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   312
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   313
@@ -78,17 +78,19 @@ PrepareAndDispatch(nsXPTCStubBase* self,
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   314
                 dp->val.d = fprData[i];
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   315
             else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   316
                 dp->val.d = *(double*) ap;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   317
         } else if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   318
             if (i < FPR_COUNT)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   319
                 dp->val.f = (float) fprData[i]; // in registers floats are passed as doubles
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   320
             else {
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   321
                 float *p = (float *)ap;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   322
+#ifndef __LITTLE_ENDIAN__
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   323
                 p++;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   324
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   325
                 dp->val.f = *p;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   326
             }
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   327
         } else { /* integer type or pointer */
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   328
             if (i < GPR_COUNT)
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   329
                 tempu64 = gprData[i];
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   330
             else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   331
                 tempu64 = *ap;
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   332
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   333
@@ -148,16 +150,53 @@ PrepareAndDispatch(nsXPTCStubBase* self,
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   334
 // Create names would be like:
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   335
 // _ZN14nsXPTCStubBase5Stub1Ev
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   336
 // _ZN14nsXPTCStubBase6Stub12Ev
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   337
 // _ZN14nsXPTCStubBase7Stub123Ev
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   338
 // _ZN14nsXPTCStubBase8Stub1234Ev
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   339
 // etc.
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   340
 // Use assembler directives to get the names right...
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   341
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   342
+#if _CALL_ELF == 2
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   343
+# define STUB_ENTRY(n)                                                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   344
+__asm__ (                                                               \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   345
+        ".section \".text\" \n\t"                                       \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   346
+        ".align 2 \n\t"                                                 \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   347
+        ".if "#n" < 10 \n\t"                                            \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   348
+        ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t"                    \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   349
+        ".type  _ZN14nsXPTCStubBase5Stub"#n"Ev,@function \n\n"          \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   350
+"_ZN14nsXPTCStubBase5Stub"#n"Ev: \n\t"                                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   351
+        "0: addis 2,12,.TOC.-0b@ha \n\t"                                \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   352
+        "addi     2,2,.TOC.-0b@l \n\t"                                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   353
+        ".localentry _ZN14nsXPTCStubBase5Stub"#n"Ev,.-_ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   354
+                                                                        \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   355
+        ".elseif "#n" < 100 \n\t"                                       \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   356
+        ".globl _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t"                    \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   357
+        ".type  _ZN14nsXPTCStubBase6Stub"#n"Ev,@function \n\n"          \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   358
+"_ZN14nsXPTCStubBase6Stub"#n"Ev: \n\t"                                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   359
+        "0: addis 2,12,.TOC.-0b@ha \n\t"                                \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   360
+        "addi     2,2,.TOC.-0b@l \n\t"                                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   361
+        ".localentry _ZN14nsXPTCStubBase6Stub"#n"Ev,.-_ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   362
+                                                                        \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   363
+        ".elseif "#n" < 1000 \n\t"                                      \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   364
+        ".globl _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t"                    \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   365
+        ".type  _ZN14nsXPTCStubBase7Stub"#n"Ev,@function \n\n"          \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   366
+"_ZN14nsXPTCStubBase7Stub"#n"Ev: \n\t"                                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   367
+        "0: addis 2,12,.TOC.-0b@ha \n\t"                                \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   368
+        "addi     2,2,.TOC.-0b@l \n\t"                                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   369
+        ".localentry _ZN14nsXPTCStubBase7Stub"#n"Ev,.-_ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   370
+                                                                        \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   371
+        ".else  \n\t"                                                   \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   372
+        ".err   \"stub number "#n" >= 1000 not yet supported\"\n"       \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   373
+        ".endif \n\t"                                                   \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   374
+                                                                        \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   375
+        "li     11,"#n" \n\t"                                           \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   376
+        "b      SharedStub \n"                                          \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   377
+);
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   378
+#else
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   379
 # define STUB_ENTRY(n)                                                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   380
 __asm__ (                                                               \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   381
         ".section \".toc\",\"aw\" \n\t"                                 \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   382
         ".section \".text\" \n\t"                                       \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   383
         ".align 2 \n\t"                                                 \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   384
         ".if "#n" < 10 \n\t"                                            \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   385
         ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t"                    \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   386
         ".section \".opd\",\"aw\" \n\t"                                 \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   387
@@ -190,16 +229,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   388
                                                                         \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   389
         ".else  \n\t"                                                   \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   390
         ".err   \"stub number "#n" >= 1000 not yet supported\"\n"       \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   391
         ".endif \n\t"                                                   \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   392
                                                                         \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   393
         "li     11,"#n" \n\t"                                           \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   394
         "b      SharedStub \n"                                          \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   395
 );
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   396
+#endif
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   397
 
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   398
 #define SENTINEL_ENTRY(n)                                               \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   399
 nsresult nsXPTCStubBase::Sentinel##n()                                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   400
 {                                                                       \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   401
     NS_ERROR("nsXPTCStubBase::Sentinel called");                  \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   402
     return NS_ERROR_NOT_IMPLEMENTED;                                    \
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   403
 }
5341dc98d26c update of PPC64LE patches taken from
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   404