~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to ffcall/trampoline/tramp-powerpc.old.S

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Trampoline for powerpc CPU with AIX calling convention */
2
 
 
3
 
/*
4
 
 * Copyright 1995-2006 Bruno Haible, <bruno@clisp.org>
5
 
 *
6
 
 * This is free software distributed under the GNU General Public Licence
7
 
 * described in the file COPYING. Contact the author if you don't have this
8
 
 * or can't live with it. There is ABSOLUTELY NO WARRANTY, explicit or implied,
9
 
 * on this software.
10
 
 */
11
 
 
12
 
/* Available registers: r0, r12, r11, r10, r9, r8, r7, r6, r5, r4, r3. */
13
 
/* However, r0 is special in that it cannot be used as a base register. */
14
 
/* And r3...r10 should not be clobbered because they contain the first 8
15
 
 * integer arguments to the function being called. */
16
 
 
17
 
        .globl tramp
18
 
        .globl .tramp
19
 
.csect tramp[DS]
20
 
tramp:
21
 
        .long .tramp, 0, 0
22
 
.csect .text[PR]
23
 
.tramp:
24
 
/* Move <data> into <variable> */
25
 
        l 11,0(2)       /* get <variable> */
26
 
        l 12,4(2)       /* get <data> */
27
 
        st 12,0(11)
28
 
/* Get <function> */
29
 
        l 12,8(2)
30
 
/*
31
 
 * gcc-2.6.3 source says:
32
 
 * A function pointer is a pointer to a data area whose first word contains
33
 
 * the actual address of the function, whose second word contains a pointer
34
 
 * to its TOC, and whose third word contains a value to place in the static
35
 
 * chain register (r11).
36
 
 */
37
 
        l 11,8(12)      /* pass static chain in r11 */
38
 
        l 2,4(12)       /* pass TOC in r2 */
39
 
        l 0,0(12)       /* actual code address */
40
 
        mtctr 0
41
 
        bctr
42
 
 
43
 
_section_.text:
44
 
.csect .data[RW]
45
 
        .long _section_.text