1 /* PLT trampolines. ia64 version.
2 Copyright (C) 2005 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23 This code is used in dl-runtime.c to call the `fixup' function
24 and then redirect to the address it returns. `fixup()' takes two
25 arguments, however profile_fixup() takes three.
27 The ABI specifies that we will never see more than 8 input
28 registers to a function call, thus it is safe to simply allocate
29 those, and simpler than playing stack games. */
31 ENTRY(_dl_runtime_resolve)
35 alloc loc0 = ar.pfs, 8, 6, 3, 0
45 mov out2 = b0 /* needed by fixup_profile */
49 mov loc2 = r8 /* preserve struct value register */
54 mov loc3 = r9 /* preserve language specific register */
55 mov loc4 = r10 /* preserve language specific register */
56 mov loc5 = r11 /* preserve language specific register */
59 stf.spill [r2] = f8, 32
60 stf.spill [r3] = f9, 32
65 stf.spill [r2] = f10, 32
66 stf.spill [r3] = f11, 32
71 stf.spill [r2] = f12, 32
72 stf.spill [r3] = f13, 32
73 shladd out1 = r15, 3, out1
79 br.call.sptk.many b0 = fixup
88 ldf.fill f8 = [r2], 32
89 ldf.fill f9 = [r3], 32
94 ldf.fill f10 = [r2], 32
95 ldf.fill f11 = [r3], 32
100 ldf.fill f12 = [r2], 32
101 ldf.fill f13 = [r3], 32
106 ldf.fill f14 = [r2], 32
107 ldf.fill f15 = [r3], 32
108 .restore sp /* pop the unwind frame state */
113 mov r9 = loc3 /* restore language specific register */
114 mov r10 = loc4 /* restore language specific register */
115 mov r11 = loc5 /* restore language specific register */
119 mov r8 = loc2 /* restore struct value register */
122 /* An alloc is needed for the break system call to work.
123 We don't care about the old value of the pfs register. */
127 alloc r2 = ar.pfs, 0, 0, 8, 0
131 END (_dl_runtime_resolve)
134 ENTRY(_dl_runtime_profile)
138 alloc loc0 = ar.pfs, 8, 6, 3, 0
148 mov out2 = b0 /* needed by fixup_profile */
152 mov loc2 = r8 /* preserve struct value register */
157 mov loc3 = r9 /* preserve language specific register */
158 mov loc4 = r10 /* preserve language specific register */
159 mov loc5 = r11 /* preserve language specific register */
162 stf.spill [r2] = f8, 32
163 stf.spill [r3] = f9, 32
168 stf.spill [r2] = f10, 32
169 stf.spill [r3] = f11, 32
174 stf.spill [r2] = f12, 32
175 stf.spill [r3] = f13, 32
176 shladd out1 = r15, 3, out1
182 br.call.sptk.many b0 = profile_fixup
191 ldf.fill f8 = [r2], 32
192 ldf.fill f9 = [r3], 32
197 ldf.fill f10 = [r2], 32
198 ldf.fill f11 = [r3], 32
203 ldf.fill f12 = [r2], 32
204 ldf.fill f13 = [r3], 32
209 ldf.fill f14 = [r2], 32
210 ldf.fill f15 = [r3], 32
211 .restore sp /* pop the unwind frame state */
216 mov r9 = loc3 /* restore language specific register */
217 mov r10 = loc4 /* restore language specific register */
218 mov r11 = loc5 /* restore language specific register */
222 mov r8 = loc2 /* restore struct value register */
225 /* An alloc is needed for the break system call to work.
226 We don't care about the old value of the pfs register. */
230 alloc r2 = ar.pfs, 0, 0, 8, 0
234 END (_dl_runtime_profile)