Artifact d44485d1c18e8db019da3eabf1454e09e2b3c8ee:


0000: 2f 2a 20 54 72 61 6d 70 6f 6c 69 6e 65 20 66 6f  /* Trampoline fo
0010: 72 20 6d 69 70 73 20 43 50 55 20 2a 2f 0a 0a 2f  r mips CPU */../
0020: 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 20 31  *. * Copyright 1
0030: 39 39 36 2d 31 39 39 38 20 42 72 75 6e 6f 20 48  996-1998 Bruno H
0040: 61 69 62 6c 65 2c 20 3c 62 72 75 6e 6f 40 63 6c  aible, <bruno@cl
0050: 69 73 70 2e 6f 72 67 3e 0a 20 2a 0a 20 2a 20 54  isp.org>. *. * T
0060: 68 69 73 20 69 73 20 66 72 65 65 20 73 6f 66 74  his is free soft
0070: 77 61 72 65 20 64 69 73 74 72 69 62 75 74 65 64  ware distributed
0080: 20 75 6e 64 65 72 20 74 68 65 20 47 4e 55 20 47   under the GNU G
0090: 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69  eneral Public Li
00a0: 63 65 6e 63 65 0a 20 2a 20 64 65 73 63 72 69 62  cence. * describ
00b0: 65 64 20 69 6e 20 74 68 65 20 66 69 6c 65 20 43  ed in the file C
00c0: 4f 50 59 49 4e 47 2e 20 43 6f 6e 74 61 63 74 20  OPYING. Contact 
00d0: 74 68 65 20 61 75 74 68 6f 72 20 69 66 20 79 6f  the author if yo
00e0: 75 20 64 6f 6e 27 74 20 68 61 76 65 20 74 68 69  u don't have thi
00f0: 73 0a 20 2a 20 6f 72 20 63 61 6e 27 74 20 6c 69  s. * or can't li
0100: 76 65 20 77 69 74 68 20 69 74 2e 20 54 68 65 72  ve with it. Ther
0110: 65 20 69 73 20 41 42 53 4f 4c 55 54 45 4c 59 20  e is ABSOLUTELY 
0120: 4e 4f 20 57 41 52 52 41 4e 54 59 2c 20 65 78 70  NO WARRANTY, exp
0130: 6c 69 63 69 74 20 6f 72 20 69 6d 70 6c 69 65 64  licit or implied
0140: 2c 0a 20 2a 20 6f 6e 20 74 68 69 73 20 73 6f 66  ,. * on this sof
0150: 74 77 61 72 65 2e 0a 20 2a 2f 0a 0a 2f 2a 20 41  tware.. */../* A
0160: 76 61 69 6c 61 62 6c 65 20 72 65 67 69 73 74 65  vailable registe
0170: 72 73 3a 20 24 32 2c 20 24 33 2e 20 2a 2f 0a 0a  rs: $2, $3. */..
0180: 09 2e 73 65 74 09 6e 6f 62 6f 70 74 0a 09 2e 73  ..set.nobopt...s
0190: 65 74 09 6e 6f 72 65 6f 72 64 65 72 0a 09 2e 74  et.noreorder...t
01a0: 65 78 74 0a 09 2e 67 6c 6f 62 6c 09 6d 61 69 6e  ext...globl.main
01b0: 0a 09 2e 65 6e 74 09 6d 61 69 6e 0a 6d 61 69 6e  ...ent.main.main
01c0: 3a 0a 09 2e 65 6e 64 09 6d 61 69 6e 0a 09 2e 67  :...end.main...g
01d0: 6c 6f 62 6c 09 74 72 61 6d 70 0a 09 2e 65 6e 74  lobl.tramp...ent
01e0: 09 74 72 61 6d 70 0a 74 72 61 6d 70 3a 0a 09 2f  .tramp.tramp:../
01f0: 2a 20 57 65 20 63 61 6e 20 61 73 73 75 6d 65 20  * We can assume 
0200: 74 68 61 74 20 6f 75 72 20 6f 77 6e 20 61 64 64  that our own add
0210: 72 65 73 73 20 28 3d 74 72 61 6d 70 29 20 69 73  ress (=tramp) is
0220: 20 69 6e 20 24 32 35 2e 20 2a 2f 0a 09 6c 77 09   in $25. */..lw.
0230: 24 32 2c 32 34 28 24 32 35 29 0a 09 6c 77 09 24  $2,24($25)..lw.$
0240: 33 2c 32 38 28 24 32 35 29 0a 09 73 77 09 24 33  3,28($25)..sw.$3
0250: 2c 30 28 24 32 29 0a 09 6c 77 09 24 32 35 2c 33  ,0($2)..lw.$25,3
0260: 32 28 24 32 35 29 0a 09 2f 2a 20 54 68 65 20 63  2($25)../* The c
0270: 61 6c 6c 65 64 20 66 75 6e 63 74 69 6f 6e 20 65  alled function e
0280: 78 70 65 63 74 73 20 74 6f 20 73 65 65 20 69 74  xpects to see it
0290: 73 20 6f 77 6e 20 61 64 64 72 65 73 73 20 69 6e  s own address in
02a0: 20 24 32 35 2e 20 2a 2f 0a 09 6a 09 24 32 35 0a   $25. */..j.$25.
02b0: 09 2f 2a 20 53 6f 6d 65 20 4d 69 70 73 20 68 61  ./* Some Mips ha
02c0: 72 64 77 61 72 65 20 72 75 6e 6e 69 6e 67 20 49  rdware running I
02d0: 72 69 78 2d 34 2e 30 2e 35 20 6e 65 65 64 73 20  rix-4.0.5 needs 
02e0: 74 68 69 73 20 6e 6f 70 2e 20 2a 2f 0a 09 6e 6f  this nop. */..no
02f0: 70 0a 09 2f 2a 20 57 65 27 6c 6c 20 61 63 74 75  p../* We'll actu
0300: 61 6c 6c 79 20 73 74 6f 72 65 20 74 68 65 20 64  ally store the d
0310: 61 74 61 20 77 6f 72 64 73 20 69 6d 6d 65 64 69  ata words immedi
0320: 61 74 65 6c 79 20 61 66 74 65 72 20 74 68 65 20  ately after the 
0330: 63 6f 64 65 2e 20 2a 2f 0a 09 2f 2a 20 54 68 65  code. */../* The
0340: 20 61 73 73 65 6d 62 6c 65 72 20 6a 75 73 74 20   assembler just 
0350: 64 6f 65 73 6e 27 74 20 6c 69 6b 65 20 22 2e 77  doesn't like ".w
0360: 6f 72 64 22 20 69 6e 73 69 64 65 20 73 65 63 74  ord" inside sect
0370: 69 6f 6e 20 2e 74 65 78 74 2e 20 2a 2f 0a 09 2e  ion .text. */...
0380: 64 61 74 61 0a 24 4c 43 30 3a 0a 09 2e 77 6f 72  data.$LC0:...wor
0390: 64 09 30 78 31 32 33 34 35 36 37 38 0a 24 4c 43  d.0x12345678.$LC
03a0: 31 3a 0a 09 2e 77 6f 72 64 09 30 78 37 33 35 35  1:...word.0x7355
03b0: 34 37 31 31 0a 24 4c 43 32 3a 0a 09 2e 77 6f 72  4711.$LC2:...wor
03c0: 64 09 30 78 62 61 62 65 62 65 63 30 0a 09 2e 65  d.0xbabebec0...e
03d0: 6e 64 09 74 72 61 6d 70 0a                       nd.tramp.