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

« back to all changes in this revision

Viewing changes to 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 */
 
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, r11, r10, r8, r7, r6, r5, r4, maybe r9. */
 
13
/* However, r0 is special in that it cannot be used as a base register. */
 
14
 
 
15
        .globl .tramp
 
16
.csect .text[PR]
 
17
.tramp:
 
18
/* Move <data> into <variable> */
 
19
        liu 11,0x1234
 
20
        oril 11,11,0x5678
 
21
        liu 10,0x7355
 
22
        oril 10,10,0x4711
 
23
        st 10,0(11)
 
24
/* Get <function> */
 
25
        liu 10,0xbabe
 
26
        oril 10,10,0xbec0
 
27
/*
 
28
 * gcc-2.6.3 source says:
 
29
 * A function pointer is a pointer to a data area whose first word contains
 
30
 * the actual address of the function, whose second word contains a pointer
 
31
 * to its TOC, and whose third word contains a value to place in the static
 
32
 * chain register (r11).
 
33
 */
 
34
        l 11,8(10)      /* pass static chain in r11 */
 
35
        l 2,4(10)       /* pass TOC in r2 */
 
36
        l 0,0(10)       /* actual code address */
 
37
        mtctr 0
 
38
        bctr