Artifact 0a7eb6f774315717bbdf84c9b30126c4c4f60eb0:


0000: 2f 2a 20 54 72 61 6d 70 6f 6c 69 6e 65 20 66 6f  /* Trampoline fo
0010: 72 20 70 6f 77 65 72 70 63 20 43 50 55 20 2a 2f  r powerpc CPU */
0020: 0a 0a 2f 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68  ../*. * Copyrigh
0030: 74 20 31 39 39 35 2d 32 30 30 36 20 42 72 75 6e  t 1995-2006 Brun
0040: 6f 20 48 61 69 62 6c 65 2c 20 3c 62 72 75 6e 6f  o Haible, <bruno
0050: 40 63 6c 69 73 70 2e 6f 72 67 3e 0a 20 2a 0a 20  @clisp.org>. *. 
0060: 2a 20 54 68 69 73 20 69 73 20 66 72 65 65 20 73  * This is free s
0070: 6f 66 74 77 61 72 65 20 64 69 73 74 72 69 62 75  oftware distribu
0080: 74 65 64 20 75 6e 64 65 72 20 74 68 65 20 47 4e  ted under the GN
0090: 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63  U General Public
00a0: 20 4c 69 63 65 6e 63 65 0a 20 2a 20 64 65 73 63   Licence. * desc
00b0: 72 69 62 65 64 20 69 6e 20 74 68 65 20 66 69 6c  ribed in the fil
00c0: 65 20 43 4f 50 59 49 4e 47 2e 20 43 6f 6e 74 61  e COPYING. Conta
00d0: 63 74 20 74 68 65 20 61 75 74 68 6f 72 20 69 66  ct the author if
00e0: 20 79 6f 75 20 64 6f 6e 27 74 20 68 61 76 65 20   you don't have 
00f0: 74 68 69 73 0a 20 2a 20 6f 72 20 63 61 6e 27 74  this. * or can't
0100: 20 6c 69 76 65 20 77 69 74 68 20 69 74 2e 20 54   live with it. T
0110: 68 65 72 65 20 69 73 20 41 42 53 4f 4c 55 54 45  here is ABSOLUTE
0120: 4c 59 20 4e 4f 20 57 41 52 52 41 4e 54 59 2c 20  LY NO WARRANTY, 
0130: 65 78 70 6c 69 63 69 74 20 6f 72 20 69 6d 70 6c  explicit or impl
0140: 69 65 64 2c 0a 20 2a 20 6f 6e 20 74 68 69 73 20  ied,. * on this 
0150: 73 6f 66 74 77 61 72 65 2e 0a 20 2a 2f 0a 0a 2f  software.. */../
0160: 2a 20 41 76 61 69 6c 61 62 6c 65 20 72 65 67 69  * Available regi
0170: 73 74 65 72 73 3a 20 72 30 2c 20 72 31 31 2c 20  sters: r0, r11, 
0180: 72 31 30 2c 20 72 38 2c 20 72 37 2c 20 72 36 2c  r10, r8, r7, r6,
0190: 20 72 35 2c 20 72 34 2c 20 6d 61 79 62 65 20 72   r5, r4, maybe r
01a0: 39 2e 20 2a 2f 0a 2f 2a 20 48 6f 77 65 76 65 72  9. */./* However
01b0: 2c 20 72 30 20 69 73 20 73 70 65 63 69 61 6c 20  , r0 is special 
01c0: 69 6e 20 74 68 61 74 20 69 74 20 63 61 6e 6e 6f  in that it canno
01d0: 74 20 62 65 20 75 73 65 64 20 61 73 20 61 20 62  t be used as a b
01e0: 61 73 65 20 72 65 67 69 73 74 65 72 2e 20 2a 2f  ase register. */
01f0: 0a 0a 09 2e 67 6c 6f 62 6c 20 2e 74 72 61 6d 70  ....globl .tramp
0200: 0a 2e 63 73 65 63 74 20 2e 74 65 78 74 5b 50 52  ..csect .text[PR
0210: 5d 0a 2e 74 72 61 6d 70 3a 0a 2f 2a 20 4d 6f 76  ]..tramp:./* Mov
0220: 65 20 3c 64 61 74 61 3e 20 69 6e 74 6f 20 3c 76  e <data> into <v
0230: 61 72 69 61 62 6c 65 3e 20 2a 2f 0a 09 6c 69 75  ariable> */..liu
0240: 20 31 31 2c 30 78 31 32 33 34 0a 09 6f 72 69 6c   11,0x1234..oril
0250: 20 31 31 2c 31 31 2c 30 78 35 36 37 38 0a 09 6c   11,11,0x5678..l
0260: 69 75 20 31 30 2c 30 78 37 33 35 35 0a 09 6f 72  iu 10,0x7355..or
0270: 69 6c 20 31 30 2c 31 30 2c 30 78 34 37 31 31 0a  il 10,10,0x4711.
0280: 09 73 74 20 31 30 2c 30 28 31 31 29 0a 2f 2a 20  .st 10,0(11)./* 
0290: 47 65 74 20 3c 66 75 6e 63 74 69 6f 6e 3e 20 2a  Get <function> *
02a0: 2f 0a 09 6c 69 75 20 31 30 2c 30 78 62 61 62 65  /..liu 10,0xbabe
02b0: 0a 09 6f 72 69 6c 20 31 30 2c 31 30 2c 30 78 62  ..oril 10,10,0xb
02c0: 65 63 30 0a 2f 2a 0a 20 2a 20 67 63 63 2d 32 2e  ec0./*. * gcc-2.
02d0: 36 2e 33 20 73 6f 75 72 63 65 20 73 61 79 73 3a  6.3 source says:
02e0: 0a 20 2a 20 41 20 66 75 6e 63 74 69 6f 6e 20 70  . * A function p
02f0: 6f 69 6e 74 65 72 20 69 73 20 61 20 70 6f 69 6e  ointer is a poin
0300: 74 65 72 20 74 6f 20 61 20 64 61 74 61 20 61 72  ter to a data ar
0310: 65 61 20 77 68 6f 73 65 20 66 69 72 73 74 20 77  ea whose first w
0320: 6f 72 64 20 63 6f 6e 74 61 69 6e 73 0a 20 2a 20  ord contains. * 
0330: 74 68 65 20 61 63 74 75 61 6c 20 61 64 64 72 65  the actual addre
0340: 73 73 20 6f 66 20 74 68 65 20 66 75 6e 63 74 69  ss of the functi
0350: 6f 6e 2c 20 77 68 6f 73 65 20 73 65 63 6f 6e 64  on, whose second
0360: 20 77 6f 72 64 20 63 6f 6e 74 61 69 6e 73 20 61   word contains a
0370: 20 70 6f 69 6e 74 65 72 0a 20 2a 20 74 6f 20 69   pointer. * to i
0380: 74 73 20 54 4f 43 2c 20 61 6e 64 20 77 68 6f 73  ts TOC, and whos
0390: 65 20 74 68 69 72 64 20 77 6f 72 64 20 63 6f 6e  e third word con
03a0: 74 61 69 6e 73 20 61 20 76 61 6c 75 65 20 74 6f  tains a value to
03b0: 20 70 6c 61 63 65 20 69 6e 20 74 68 65 20 73 74   place in the st
03c0: 61 74 69 63 0a 20 2a 20 63 68 61 69 6e 20 72 65  atic. * chain re
03d0: 67 69 73 74 65 72 20 28 72 31 31 29 2e 0a 20 2a  gister (r11).. *
03e0: 2f 0a 09 6c 20 31 31 2c 38 28 31 30 29 09 2f 2a  /..l 11,8(10)./*
03f0: 20 70 61 73 73 20 73 74 61 74 69 63 20 63 68 61   pass static cha
0400: 69 6e 20 69 6e 20 72 31 31 20 2a 2f 0a 09 6c 20  in in r11 */..l 
0410: 32 2c 34 28 31 30 29 09 2f 2a 20 70 61 73 73 20  2,4(10)./* pass 
0420: 54 4f 43 20 69 6e 20 72 32 20 2a 2f 0a 09 6c 20  TOC in r2 */..l 
0430: 30 2c 30 28 31 30 29 09 2f 2a 20 61 63 74 75 61  0,0(10)./* actua
0440: 6c 20 63 6f 64 65 20 61 64 64 72 65 73 73 20 2a  l code address *
0450: 2f 0a 09 6d 74 63 74 72 20 30 0a 09 62 63 74 72  /..mtctr 0..bctr
0460: 0a                                               .