linkage.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. #ifndef _ASM_TILE_LINKAGE_H
  15. #define _ASM_TILE_LINKAGE_H
  16. #include <feedback.h>
  17. #define __ALIGN .align 8
  18. /*
  19. * The STD_ENTRY and STD_ENDPROC macros put the function in a
  20. * self-named .text.foo section, and if linker feedback collection
  21. * is enabled, add a suitable call to the feedback collection code.
  22. * STD_ENTRY_SECTION lets you specify a non-standard section name.
  23. */
  24. #define STD_ENTRY(name) \
  25. .pushsection .text.##name, "ax"; \
  26. ENTRY(name); \
  27. FEEDBACK_ENTER(name)
  28. #define STD_ENTRY_SECTION(name, section) \
  29. .pushsection section, "ax"; \
  30. ENTRY(name); \
  31. FEEDBACK_ENTER_EXPLICIT(name, section, .Lend_##name - name)
  32. #define STD_ENDPROC(name) \
  33. ENDPROC(name); \
  34. .Lend_##name:; \
  35. .popsection
  36. /* Create a file-static function entry set up for feedback gathering. */
  37. #define STD_ENTRY_LOCAL(name) \
  38. .pushsection .text.##name, "ax"; \
  39. ALIGN; \
  40. name:; \
  41. FEEDBACK_ENTER(name)
  42. #endif /* _ASM_TILE_LINKAGE_H */