1 /* Override generic sotruss-lib.c to define actual functions for MicroBlaze.
2    Copyright (C) 2012-2022 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4 
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.
9 
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.
14 
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/>.  */
18 
19 #define HAVE_ARCH_PLTENTER
20 #define HAVE_ARCH_PLTEXIT
21 
22 #include <elf/sotruss-lib.c>
23 
24 ElfW(Addr)
la_microblaze_gnu_pltenter(ElfW (Sym)* sym,unsigned int ndx,uintptr_t * refcook,uintptr_t * defcook,La_microblaze_regs * regs,unsigned int * flags,const char * symname,long int * framesizep)25 la_microblaze_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
26                             unsigned int ndx __attribute__ ((unused)),
27                             uintptr_t *refcook, uintptr_t *defcook,
28                             La_microblaze_regs *regs, unsigned int *flags,
29                             const char *symname, long int *framesizep)
30 {
31   print_enter (refcook, defcook, symname,
32                regs->lr_r0, regs->lr_r1, regs->lr_sp,
33                *flags);
34 
35   /* No need to copy anything, we will not need the parameters in any case.  */
36   *framesizep = 0;
37 
38   return sym->st_value;
39 }
40 
41 unsigned int
la_microblaze_gnu_pltexit(ElfW (Sym)* sym,unsigned int ndx,uintptr_t * refcook,uintptr_t * defcook,const struct La_microblaze_regs * inregs,struct La_microblaze_retval * outregs,const char * symname)42 la_microblaze_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx,
43                            uintptr_t *refcook,
44                            uintptr_t *defcook,
45                            const struct La_microblaze_regs *inregs,
46                            struct La_microblaze_retval *outregs,
47                            const char *symname)
48 {
49   print_exit (refcook, defcook, symname, outregs->lrv_r3);
50 
51   return 0;
52 }
53