machine-gmon.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* RISC-V definitions for profiling support.
  2. Copyright (C) 1996-2026 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; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. /* Accept 'frompc' address as argument from the function that calls
  16. _mcount for profiling. Use __builtin_return_address (0)
  17. for the 'selfpc' address. */
  18. #include <sysdep.h>
  19. static void mcount_internal (unsigned long int frompc,
  20. unsigned long int selfpc);
  21. #define _MCOUNT_DECL(frompc, selfpc) \
  22. static inline void mcount_internal (unsigned long int frompc, \
  23. unsigned long int selfpc)
  24. #define MCOUNT \
  25. void _mcount (void *frompc) \
  26. { \
  27. mcount_internal ((unsigned long int) frompc, \
  28. (unsigned long int) RETURN_ADDRESS (0)); \
  29. }