Artifact fb8a4b5aac78fe0aa9ca85d872a81c2a59f6b751:


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 36 34 20 43 50 55 20  r powerpc64 CPU 
0020: 77 69 74 68 20 41 49 58 20 63 61 6c 6c 69 6e 67  with AIX calling
0030: 20 63 6f 6e 76 65 6e 74 69 6f 6e 20 2a 2f 0a 0a   convention */..
0040: 2f 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 20  /*. * Copyright 
0050: 31 39 39 35 2d 32 30 30 36 20 42 72 75 6e 6f 20  1995-2006 Bruno 
0060: 48 61 69 62 6c 65 2c 20 3c 62 72 75 6e 6f 40 63  Haible, <bruno@c
0070: 6c 69 73 70 2e 6f 72 67 3e 0a 20 2a 0a 20 2a 20  lisp.org>. *. * 
0080: 54 68 69 73 20 69 73 20 66 72 65 65 20 73 6f 66  This is free sof
0090: 74 77 61 72 65 20 64 69 73 74 72 69 62 75 74 65  tware distribute
00a0: 64 20 75 6e 64 65 72 20 74 68 65 20 47 4e 55 20  d under the GNU 
00b0: 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c  General Public L
00c0: 69 63 65 6e 63 65 0a 20 2a 20 64 65 73 63 72 69  icence. * descri
00d0: 62 65 64 20 69 6e 20 74 68 65 20 66 69 6c 65 20  bed in the file 
00e0: 43 4f 50 59 49 4e 47 2e 20 43 6f 6e 74 61 63 74  COPYING. Contact
00f0: 20 74 68 65 20 61 75 74 68 6f 72 20 69 66 20 79   the author if y
0100: 6f 75 20 64 6f 6e 27 74 20 68 61 76 65 20 74 68  ou don't have th
0110: 69 73 0a 20 2a 20 6f 72 20 63 61 6e 27 74 20 6c  is. * or can't l
0120: 69 76 65 20 77 69 74 68 20 69 74 2e 20 54 68 65  ive with it. The
0130: 72 65 20 69 73 20 41 42 53 4f 4c 55 54 45 4c 59  re is ABSOLUTELY
0140: 20 4e 4f 20 57 41 52 52 41 4e 54 59 2c 20 65 78   NO WARRANTY, ex
0150: 70 6c 69 63 69 74 20 6f 72 20 69 6d 70 6c 69 65  plicit or implie
0160: 64 2c 0a 20 2a 20 6f 6e 20 74 68 69 73 20 73 6f  d,. * on this so
0170: 66 74 77 61 72 65 2e 0a 20 2a 2f 0a 0a 2f 2a 20  ftware.. */../* 
0180: 41 76 61 69 6c 61 62 6c 65 20 72 65 67 69 73 74  Available regist
0190: 65 72 73 3a 20 72 30 2c 20 72 31 32 2c 20 72 31  ers: r0, r12, r1
01a0: 31 2c 20 72 31 30 2c 20 72 39 2c 20 72 38 2c 20  1, r10, r9, r8, 
01b0: 72 37 2c 20 72 36 2c 20 72 35 2c 20 72 34 2c 20  r7, r6, r5, r4, 
01c0: 72 33 2e 20 2a 2f 0a 2f 2a 20 48 6f 77 65 76 65  r3. */./* Howeve
01d0: 72 2c 20 72 30 20 69 73 20 73 70 65 63 69 61 6c  r, r0 is special
01e0: 20 69 6e 20 74 68 61 74 20 69 74 20 63 61 6e 6e   in that it cann
01f0: 6f 74 20 62 65 20 75 73 65 64 20 61 73 20 61 20  ot be used as a 
0200: 62 61 73 65 20 72 65 67 69 73 74 65 72 2e 20 2a  base register. *
0210: 2f 0a 2f 2a 20 41 6e 64 20 72 33 2e 2e 2e 72 31  /./* And r3...r1
0220: 30 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 20  0 should not be 
0230: 63 6c 6f 62 62 65 72 65 64 20 62 65 63 61 75 73  clobbered becaus
0240: 65 20 74 68 65 79 20 63 6f 6e 74 61 69 6e 20 74  e they contain t
0250: 68 65 20 66 69 72 73 74 20 38 0a 20 2a 20 69 6e  he first 8. * in
0260: 74 65 67 65 72 20 61 72 67 75 6d 65 6e 74 73 20  teger arguments 
0270: 74 6f 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20  to the function 
0280: 62 65 69 6e 67 20 63 61 6c 6c 65 64 2e 20 2a 2f  being called. */
0290: 0a 0a 09 2e 67 6c 6f 62 6c 20 74 72 61 6d 70 5f  ....globl tramp_
02a0: 72 0a 09 2e 67 6c 6f 62 6c 20 2e 74 72 61 6d 70  r...globl .tramp
02b0: 5f 72 0a 74 72 61 6d 70 5f 72 3a 0a 09 2e 71 75  _r.tramp_r:...qu
02c0: 61 64 20 2e 74 72 61 6d 70 5f 72 0a 2e 74 72 61  ad .tramp_r..tra
02d0: 6d 70 5f 72 3a 0a 2f 2a 20 4d 6f 76 65 20 3c 64  mp_r:./* Move <d
02e0: 61 74 61 3e 20 69 6e 74 6f 20 72 65 67 69 73 74  ata> into regist
02f0: 65 72 20 72 31 31 20 2a 2f 0a 09 6c 64 20 31 31  er r11 */..ld 11
0300: 2c 30 28 32 29 09 2f 2a 20 67 65 74 20 3c 64 61  ,0(2)./* get <da
0310: 74 61 3e 20 2a 2f 0a 2f 2a 20 47 65 74 20 3c 66  ta> */./* Get <f
0320: 75 6e 63 74 69 6f 6e 3e 20 2a 2f 0a 09 6c 64 20  unction> */..ld 
0330: 31 32 2c 38 28 32 29 0a 2f 2a 0a 20 2a 20 67 63  12,8(2)./*. * gc
0340: 63 2d 32 2e 36 2e 33 20 73 6f 75 72 63 65 20 73  c-2.6.3 source s
0350: 61 79 73 3a 0a 20 2a 20 41 20 66 75 6e 63 74 69  ays:. * A functi
0360: 6f 6e 20 70 6f 69 6e 74 65 72 20 69 73 20 61 20  on pointer is a 
0370: 70 6f 69 6e 74 65 72 20 74 6f 20 61 20 64 61 74  pointer to a dat
0380: 61 20 61 72 65 61 20 77 68 6f 73 65 20 66 69 72  a area whose fir
0390: 73 74 20 77 6f 72 64 20 63 6f 6e 74 61 69 6e 73  st word contains
03a0: 0a 20 2a 20 74 68 65 20 61 63 74 75 61 6c 20 61  . * the actual a
03b0: 64 64 72 65 73 73 20 6f 66 20 74 68 65 20 66 75  ddress of the fu
03c0: 6e 63 74 69 6f 6e 2c 20 77 68 6f 73 65 20 73 65  nction, whose se
03d0: 63 6f 6e 64 20 77 6f 72 64 20 63 6f 6e 74 61 69  cond word contai
03e0: 6e 73 20 61 20 70 6f 69 6e 74 65 72 0a 20 2a 20  ns a pointer. * 
03f0: 74 6f 20 69 74 73 20 54 4f 43 2c 20 61 6e 64 20  to its TOC, and 
0400: 77 68 6f 73 65 20 74 68 69 72 64 20 77 6f 72 64  whose third word
0410: 20 63 6f 6e 74 61 69 6e 73 20 61 20 76 61 6c 75   contains a valu
0420: 65 20 74 6f 20 70 6c 61 63 65 20 69 6e 20 74 68  e to place in th
0430: 65 20 73 74 61 74 69 63 0a 20 2a 20 63 68 61 69  e static. * chai
0440: 6e 20 72 65 67 69 73 74 65 72 20 28 72 31 31 29  n register (r11)
0450: 2e 20 42 75 74 20 77 65 20 68 61 76 65 20 61 6c  . But we have al
0460: 72 65 61 64 79 20 70 6c 61 63 65 64 20 6f 75 72  ready placed our
0470: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 69 6e 20   information in 
0480: 72 31 31 2e 0a 20 2a 2f 0a 2f 2a 09 6c 64 20 31  r11.. */./*.ld 1
0490: 31 2c 31 36 28 31 32 29 09 20 20 20 70 61 73 73  1,16(12).   pass
04a0: 20 73 74 61 74 69 63 20 63 68 61 69 6e 20 69 6e   static chain in
04b0: 20 72 31 31 20 2a 2f 0a 09 6c 64 20 32 2c 38 28   r11 */..ld 2,8(
04c0: 31 32 29 09 2f 2a 20 70 61 73 73 20 54 4f 43 20  12)./* pass TOC 
04d0: 69 6e 20 72 32 20 2a 2f 0a 09 6c 64 20 30 2c 30  in r2 */..ld 0,0
04e0: 28 31 32 29 09 2f 2a 20 61 63 74 75 61 6c 20 63  (12)./* actual c
04f0: 6f 64 65 20 61 64 64 72 65 73 73 20 2a 2f 0a 09  ode address */..
0500: 6d 74 63 74 72 20 30 0a 09 62 63 74 72 0a        mtctr 0..bctr.