1
; Trampoline for hppa CPU
3
; Copyright 1995 Bruno Haible, <bruno@clisp.org>
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,
10
; Available registers: %r19, %r20, %r21, %r22.
13
.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
14
.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
16
.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
17
.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
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)
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
43
mtsp %r1,%sr0 ; set segment register
44
be,n 0(%sr0,%r21) ; now do an inter-module jump