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

« back to all changes in this revision

Viewing changes to ffcall/trampoline/tramp-hppa-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 hppa CPU
2
 
 
3
 
; Copyright 1995 Bruno Haible, <bruno@clisp.org>
4
 
;
5
 
; This is free software distributed under the GNU General Public Licence
6
 
; described in the file COPYING. Contact the author if you don't have this
7
 
; or can't live with it. There is ABSOLUTELY NO WARRANTY, explicit or implied,
8
 
; on this software.
9
 
 
10
 
; Available registers: %r19, %r20, %r21, %r22.
11
 
 
12
 
        .SPACE $PRIVATE$
13
 
        .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
14
 
        .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
15
 
        .SPACE $TEXT$
16
 
        .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
17
 
        .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
18
 
 
19
 
        .SPACE $TEXT$
20
 
        .SUBSPA $CODE$
21
 
 
22
 
        .align 4
23
 
        .EXPORT tramp
24
 
tramp
25
 
        .PROC
26
 
        .CALLINFO
27
 
        .ENTRY
28
 
; Move <data> into <variable>
29
 
        ldil L'0x73554711,%r20
30
 
        ldil L'0x12345678,%r19
31
 
        ldo R'0x73554711(%r20),%r20
32
 
        stw %r20,R'0x12345678(%r19)
33
 
; Get <function>
34
 
        ldil L'0xbabebec0,%r21
35
 
        ldo R'0xbabebec0(%r21),%r21
36
 
; Jump to %r21, just like the gcc-2.6.3 trampoline does it:
37
 
        bb,>=,n %r21,30,tramp2  ; check bit 1 of %r21
38
 
        depi 0,31,2,%r21        ; if set, clear bits 1..0
39
 
        ldw 4(0,%r21),%r19      ; ... dereference the function struct
40
 
        ldw 0(0,%r21),%r21      ; ... to get the actual code address
41
 
tramp2
42
 
        ldsid (0,%r21),%r1
43
 
        mtsp %r1,%sr0           ; set segment register
44
 
        be,n 0(%sr0,%r21)       ; now do an inter-module jump
45
 
        nop
46
 
        .EXIT
47
 
        .PROCEND