Artifact
80d114e87e6a7267a96a07548c942af98005b9b5:
0000: 2f 2a 20 54 72 61 6d 70 6f 6c 69 6e 65 20 66 6f /* Trampoline fo
0010: 72 20 72 73 36 30 30 30 20 43 50 55 20 2a 2f 0a r rs6000 CPU */.
0020: 0a 2f 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 ./*. * Copyright
0030: 20 31 39 39 35 2d 31 39 39 37 20 42 72 75 6e 6f 1995-1997 Bruno
0040: 20 48 61 69 62 6c 65 2c 20 3c 62 72 75 6e 6f 40 Haible, <bruno@
0050: 63 6c 69 73 70 2e 6f 72 67 3e 0a 20 2a 0a 20 2a clisp.org>. *. *
0060: 20 54 68 69 73 20 69 73 20 66 72 65 65 20 73 6f This is free so
0070: 66 74 77 61 72 65 20 64 69 73 74 72 69 62 75 74 ftware distribut
0080: 65 64 20 75 6e 64 65 72 20 74 68 65 20 47 4e 55 ed under the GNU
0090: 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 General Public
00a0: 4c 69 63 65 6e 63 65 0a 20 2a 20 64 65 73 63 72 Licence. * descr
00b0: 69 62 65 64 20 69 6e 20 74 68 65 20 66 69 6c 65 ibed in the file
00c0: 20 43 4f 50 59 49 4e 47 2e 20 43 6f 6e 74 61 63 COPYING. Contac
00d0: 74 20 74 68 65 20 61 75 74 68 6f 72 20 69 66 20 t the author if
00e0: 79 6f 75 20 64 6f 6e 27 74 20 68 61 76 65 20 74 you don't have t
00f0: 68 69 73 0a 20 2a 20 6f 72 20 63 61 6e 27 74 20 his. * or can't
0100: 6c 69 76 65 20 77 69 74 68 20 69 74 2e 20 54 68 live with it. Th
0110: 65 72 65 20 69 73 20 41 42 53 4f 4c 55 54 45 4c ere is ABSOLUTEL
0120: 59 20 4e 4f 20 57 41 52 52 41 4e 54 59 2c 20 65 Y NO WARRANTY, e
0130: 78 70 6c 69 63 69 74 20 6f 72 20 69 6d 70 6c 69 xplicit or impli
0140: 65 64 2c 0a 20 2a 20 6f 6e 20 74 68 69 73 20 73 ed,. * on this s
0150: 6f 66 74 77 61 72 65 2e 0a 20 2a 2f 0a 0a 2f 2a oftware.. */../*
0160: 20 41 76 61 69 6c 61 62 6c 65 20 72 65 67 69 73 Available regis
0170: 74 65 72 73 3a 20 72 30 2c 20 72 31 31 2c 20 72 ters: r0, r11, r
0180: 31 30 2c 20 72 38 2c 20 72 37 2c 20 72 36 2c 20 10, r8, r7, r6,
0190: 72 35 2c 20 72 34 2c 20 6d 61 79 62 65 20 72 39 r5, r4, maybe r9
01a0: 2e 20 2a 2f 0a 2f 2a 20 48 6f 77 65 76 65 72 2c . */./* However,
01b0: 20 72 30 20 69 73 20 73 70 65 63 69 61 6c 20 69 r0 is special i
01c0: 6e 20 74 68 61 74 20 69 74 20 63 61 6e 6e 6f 74 n that it cannot
01d0: 20 62 65 20 75 73 65 64 20 61 73 20 61 20 62 61 be used as a ba
01e0: 73 65 20 72 65 67 69 73 74 65 72 2e 20 2a 2f 0a se register. */.
01f0: 0a 09 2e 67 6c 6f 62 6c 20 2e 74 72 61 6d 70 0a ...globl .tramp.
0200: 2e 63 73 65 63 74 20 2e 74 65 78 74 5b 50 52 5d .csect .text[PR]
0210: 0a 2e 74 72 61 6d 70 3a 0a 2f 2a 20 4d 6f 76 65 ..tramp:./* Move
0220: 20 3c 64 61 74 61 3e 20 69 6e 74 6f 20 72 65 67 <data> into reg
0230: 69 73 74 65 72 20 72 31 31 20 2a 2f 0a 09 6c 69 ister r11 */..li
0240: 75 20 31 31 2c 30 78 37 33 35 35 0a 09 6f 72 69 u 11,0x7355..ori
0250: 6c 20 31 31 2c 31 31 2c 30 78 34 37 31 31 0a 2f l 11,11,0x4711./
0260: 2a 20 47 65 74 20 3c 66 75 6e 63 74 69 6f 6e 3e * Get <function>
0270: 20 2a 2f 0a 09 6c 69 75 20 31 30 2c 30 78 62 61 */..liu 10,0xba
0280: 62 65 0a 09 6f 72 69 6c 20 31 30 2c 31 30 2c 30 be..oril 10,10,0
0290: 78 62 65 63 30 0a 2f 2a 0a 20 2a 20 67 63 63 2d xbec0./*. * gcc-
02a0: 32 2e 36 2e 33 20 73 6f 75 72 63 65 20 73 61 79 2.6.3 source say
02b0: 73 3a 0a 20 2a 20 41 20 66 75 6e 63 74 69 6f 6e s:. * A function
02c0: 20 70 6f 69 6e 74 65 72 20 69 73 20 61 20 70 6f pointer is a po
02d0: 69 6e 74 65 72 20 74 6f 20 61 20 64 61 74 61 20 inter to a data
02e0: 61 72 65 61 20 77 68 6f 73 65 20 66 69 72 73 74 area whose first
02f0: 20 77 6f 72 64 20 63 6f 6e 74 61 69 6e 73 0a 20 word contains.
0300: 2a 20 74 68 65 20 61 63 74 75 61 6c 20 61 64 64 * the actual add
0310: 72 65 73 73 20 6f 66 20 74 68 65 20 66 75 6e 63 ress of the func
0320: 74 69 6f 6e 2c 20 77 68 6f 73 65 20 73 65 63 6f tion, whose seco
0330: 6e 64 20 77 6f 72 64 20 63 6f 6e 74 61 69 6e 73 nd word contains
0340: 20 61 20 70 6f 69 6e 74 65 72 0a 20 2a 20 74 6f a pointer. * to
0350: 20 69 74 73 20 54 4f 43 2c 20 61 6e 64 20 77 68 its TOC, and wh
0360: 6f 73 65 20 74 68 69 72 64 20 77 6f 72 64 20 63 ose third word c
0370: 6f 6e 74 61 69 6e 73 20 61 20 76 61 6c 75 65 20 ontains a value
0380: 74 6f 20 70 6c 61 63 65 20 69 6e 20 74 68 65 20 to place in the
0390: 73 74 61 74 69 63 0a 20 2a 20 63 68 61 69 6e 20 static. * chain
03a0: 72 65 67 69 73 74 65 72 20 28 72 31 31 29 2e 20 register (r11).
03b0: 42 75 74 20 77 65 20 68 61 76 65 20 61 6c 72 65 But we have alre
03c0: 61 64 79 20 70 6c 61 63 65 64 20 6f 75 72 20 69 ady placed our i
03d0: 6e 66 6f 72 6d 61 74 69 6f 6e 20 69 6e 20 72 31 nformation in r1
03e0: 31 2e 0a 20 2a 2f 0a 2f 2a 09 6c 20 31 31 2c 38 1.. */./*.l 11,8
03f0: 28 31 30 29 09 20 20 20 70 61 73 73 20 73 74 61 (10). pass sta
0400: 74 69 63 20 63 68 61 69 6e 20 69 6e 20 72 31 31 tic chain in r11
0410: 20 2a 2f 0a 09 6c 20 32 2c 34 28 31 30 29 09 2f */..l 2,4(10)./
0420: 2a 20 70 61 73 73 20 54 4f 43 20 69 6e 20 72 32 * pass TOC in r2
0430: 20 2a 2f 0a 09 6c 20 30 2c 30 28 31 30 29 09 2f */..l 0,0(10)./
0440: 2a 20 61 63 74 75 61 6c 20 63 6f 64 65 20 61 64 * actual code ad
0450: 64 72 65 73 73 20 2a 2f 0a 09 6d 74 63 74 72 20 dress */..mtctr
0460: 30 0a 09 62 63 74 72 0a 0..bctr.