dl-tls.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Thread-local storage handling in the ELF dynamic linker. Xtensa version.
  2. Copyright (C) 2013 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; see the file COPYING.LIB. If
  14. not, see <http://www.gnu.org/licenses/>.  */
  15. #ifndef _XTENSA_DL_TLS_H
  16. #define _XTENSA_DL_TLS_H 1
  17. /* Type used for the representation of TLS information in the GOT. */
  18. typedef struct
  19. {
  20. unsigned long int ti_module;
  21. unsigned long int ti_offset;
  22. } tls_index;
  23. extern void *__tls_get_addr (tls_index *ti);
  24. /* Type used as the argument in a TLS descriptor for a symbol that
  25. needs dynamic TLS offsets. */
  26. struct tlsdesc_dynamic_arg
  27. {
  28. tls_index tlsinfo;
  29. size_t gen_count;
  30. };
  31. #ifdef __FDPIC__
  32. /* Type used to represent a TLS descriptor. */
  33. struct tlsdesc
  34. {
  35. ptrdiff_t (*entry)(struct tlsdesc *);
  36. void *argument;
  37. };
  38. extern ptrdiff_t attribute_hidden
  39. _dl_tlsdesc_return(struct tlsdesc *);
  40. extern void *_dl_make_tlsdesc_dynamic (struct link_map *map, size_t ti_offset);
  41. extern ptrdiff_t attribute_hidden
  42. _dl_tlsdesc_dynamic(struct tlsdesc *);
  43. #else
  44. /* Type used to represent a TLS descriptor. */
  45. struct tlsdesc
  46. {
  47. union
  48. {
  49. void *pointer;
  50. long value;
  51. } argument;
  52. ptrdiff_t (*entry)(struct tlsdesc *);
  53. };
  54. extern ptrdiff_t attribute_hidden
  55. _dl_tlsdesc_return(struct tlsdesc_dynamic_arg *);
  56. extern void *_dl_make_tlsdesc_dynamic (struct link_map *map, size_t ti_offset);
  57. extern ptrdiff_t attribute_hidden
  58. _dl_tlsdesc_dynamic(struct tlsdesc_dynamic_arg *);
  59. #endif
  60. #endif