Artifact
6daa6b826dc515750be96bb314cd2465d1d4555a:
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 20 42 72 75 6e 6f 20 48 61 69 62 1995 Bruno Haib
0040: 6c 65 2c 20 3c 62 72 75 6e 6f 40 63 6c 69 73 70 le, <bruno@clisp
0050: 2e 6f 72 67 3e 0a 20 2a 0a 20 2a 20 54 68 69 73 .org>. *. * This
0060: 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 is free softwar
0070: 65 20 64 69 73 74 72 69 62 75 74 65 64 20 75 6e e distributed un
0080: 64 65 72 20 74 68 65 20 47 4e 55 20 47 65 6e 65 der the GNU Gene
0090: 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e ral Public Licen
00a0: 63 65 0a 20 2a 20 64 65 73 63 72 69 62 65 64 20 ce. * described
00b0: 69 6e 20 74 68 65 20 66 69 6c 65 20 43 4f 50 59 in the file COPY
00c0: 49 4e 47 2e 20 43 6f 6e 74 61 63 74 20 74 68 65 ING. Contact the
00d0: 20 61 75 74 68 6f 72 20 69 66 20 79 6f 75 20 64 author if you d
00e0: 6f 6e 27 74 20 68 61 76 65 20 74 68 69 73 0a 20 on't have this.
00f0: 2a 20 6f 72 20 63 61 6e 27 74 20 6c 69 76 65 20 * or can't live
0100: 77 69 74 68 20 69 74 2e 20 54 68 65 72 65 20 69 with it. There i
0110: 73 20 41 42 53 4f 4c 55 54 45 4c 59 20 4e 4f 20 s ABSOLUTELY NO
0120: 57 41 52 52 41 4e 54 59 2c 20 65 78 70 6c 69 63 WARRANTY, explic
0130: 69 74 20 6f 72 20 69 6d 70 6c 69 65 64 2c 0a 20 it or implied,.
0140: 2a 20 6f 6e 20 74 68 69 73 20 73 6f 66 74 77 61 * on this softwa
0150: 72 65 2e 0a 20 2a 2f 0a 0a 2f 2a 20 41 76 61 69 re.. */../* Avai
0160: 6c 61 62 6c 65 20 72 65 67 69 73 74 65 72 73 3a lable registers:
0170: 20 72 30 2c 20 72 31 31 2c 20 72 31 30 2c 20 72 r0, r11, r10, r
0180: 38 2c 20 72 37 2c 20 72 36 2c 20 72 35 2c 20 72 8, r7, r6, r5, r
0190: 34 2c 20 6d 61 79 62 65 20 72 39 2e 20 2a 2f 0a 4, maybe r9. */.
01a0: 2f 2a 20 48 6f 77 65 76 65 72 2c 20 72 30 20 69 /* However, r0 i
01b0: 73 20 73 70 65 63 69 61 6c 20 69 6e 20 74 68 61 s special in tha
01c0: 74 20 69 74 20 63 61 6e 6e 6f 74 20 62 65 20 75 t it cannot be u
01d0: 73 65 64 20 61 73 20 61 20 62 61 73 65 20 72 65 sed as a base re
01e0: 67 69 73 74 65 72 2e 20 2a 2f 0a 0a 09 2e 67 6c gister. */....gl
01f0: 6f 62 6c 20 2e 74 72 61 6d 70 0a 2e 63 73 65 63 obl .tramp..csec
0200: 74 20 2e 74 65 78 74 5b 50 52 5d 0a 2e 74 72 61 t .text[PR]..tra
0210: 6d 70 3a 0a 2f 2a 20 4d 6f 76 65 20 3c 64 61 74 mp:./* Move <dat
0220: 61 3e 20 69 6e 74 6f 20 3c 76 61 72 69 61 62 6c a> into <variabl
0230: 65 3e 20 2a 2f 0a 09 6c 69 75 20 31 31 2c 30 78 e> */..liu 11,0x
0240: 31 32 33 34 0a 09 6f 72 69 6c 20 31 31 2c 31 31 1234..oril 11,11
0250: 2c 30 78 35 36 37 38 0a 09 6c 69 75 20 31 30 2c ,0x5678..liu 10,
0260: 30 78 37 33 35 35 0a 09 6f 72 69 6c 20 31 30 2c 0x7355..oril 10,
0270: 31 30 2c 30 78 34 37 31 31 0a 09 73 74 20 31 30 10,0x4711..st 10
0280: 2c 30 28 31 31 29 0a 2f 2a 20 47 65 74 20 3c 66 ,0(11)./* Get <f
0290: 75 6e 63 74 69 6f 6e 3e 20 2a 2f 0a 09 6c 69 75 unction> */..liu
02a0: 20 31 30 2c 30 78 62 61 62 65 0a 09 6f 72 69 6c 10,0xbabe..oril
02b0: 20 31 30 2c 31 30 2c 30 78 62 65 63 30 0a 2f 2a 10,10,0xbec0./*
02c0: 0a 20 2a 20 67 63 63 2d 32 2e 36 2e 33 20 73 6f . * gcc-2.6.3 so
02d0: 75 72 63 65 20 73 61 79 73 3a 0a 20 2a 20 41 20 urce says:. * A
02e0: 66 75 6e 63 74 69 6f 6e 20 70 6f 69 6e 74 65 72 function pointer
02f0: 20 69 73 20 61 20 70 6f 69 6e 74 65 72 20 74 6f is a pointer to
0300: 20 61 20 64 61 74 61 20 61 72 65 61 20 77 68 6f a data area who
0310: 73 65 20 66 69 72 73 74 20 77 6f 72 64 20 63 6f se first word co
0320: 6e 74 61 69 6e 73 0a 20 2a 20 74 68 65 20 61 63 ntains. * the ac
0330: 74 75 61 6c 20 61 64 64 72 65 73 73 20 6f 66 20 tual address of
0340: 74 68 65 20 66 75 6e 63 74 69 6f 6e 2c 20 77 68 the function, wh
0350: 6f 73 65 20 73 65 63 6f 6e 64 20 77 6f 72 64 20 ose second word
0360: 63 6f 6e 74 61 69 6e 73 20 61 20 70 6f 69 6e 74 contains a point
0370: 65 72 0a 20 2a 20 74 6f 20 69 74 73 20 54 4f 43 er. * to its TOC
0380: 2c 20 61 6e 64 20 77 68 6f 73 65 20 74 68 69 72 , and whose thir
0390: 64 20 77 6f 72 64 20 63 6f 6e 74 61 69 6e 73 20 d word contains
03a0: 61 20 76 61 6c 75 65 20 74 6f 20 70 6c 61 63 65 a value to place
03b0: 20 69 6e 20 74 68 65 20 73 74 61 74 69 63 0a 20 in the static.
03c0: 2a 20 63 68 61 69 6e 20 72 65 67 69 73 74 65 72 * chain register
03d0: 20 28 72 31 31 29 2e 0a 20 2a 2f 0a 09 6c 20 31 (r11).. */..l 1
03e0: 31 2c 38 28 31 30 29 09 2f 2a 20 70 61 73 73 20 1,8(10)./* pass
03f0: 73 74 61 74 69 63 20 63 68 61 69 6e 20 69 6e 20 static chain in
0400: 72 31 31 20 2a 2f 0a 09 6c 20 32 2c 34 28 31 30 r11 */..l 2,4(10
0410: 29 09 2f 2a 20 70 61 73 73 20 54 4f 43 20 69 6e )./* pass TOC in
0420: 20 72 32 20 2a 2f 0a 09 6c 20 30 2c 30 28 31 30 r2 */..l 0,0(10
0430: 29 09 2f 2a 20 61 63 74 75 61 6c 20 63 6f 64 65 )./* actual code
0440: 20 61 64 64 72 65 73 73 20 2a 2f 0a 09 6d 74 63 address */..mtc
0450: 74 72 20 30 0a 09 62 63 74 72 0a tr 0..bctr.