sparc: Use existing macros to avoid code duplication
[glibc.git] / sysdeps / or1k / sotruss-lib.c
blob73368488b1bce740c9c90d8d24aa4aa3a152c67c
1 /* Override generic sotruss-lib.c to define actual functions for OpenRISC.
2 Copyright (C) 2022-2024 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, see
17 <https://www.gnu.org/licenses/>. */
19 #define HAVE_ARCH_PLTENTER
20 #define HAVE_ARCH_PLTEXIT
22 #include <elf/sotruss-lib.c>
24 Elf32_Addr
25 la_or1k_gnu_pltenter (Elf32_Sym *sym __attribute__ ((unused)),
26 unsigned int ndx __attribute__ ((unused)),
27 uintptr_t *refcook, uintptr_t *defcook,
28 La_or1k_regs *regs, unsigned int *flags,
29 const char *symname, long int *framesizep)
31 print_enter (refcook, defcook, symname,
32 regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
33 *flags);
35 /* No need to copy anything, we will not need the parameters in any case. */
36 *framesizep = 0;
38 return sym->st_value;
41 unsigned int
42 la_or1k_gnu_pltexit (Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
43 uintptr_t *defcook,
44 const struct La_or1k_regs *inregs,
45 struct La_or1k_retval *outregs,
46 const char *symname)
48 print_exit (refcook, defcook, symname, outregs->lrv_reg[0]);
50 return 0;