__unmapself.c 680 B

123456789101112131415161718192021222324
  1. #include "pthread_impl.h"
  2. void __unmapself_sh_mmu(void *, size_t);
  3. void __unmapself_sh_nommu(void *, size_t);
  4. #if !defined(__SH3__) && !defined(__SH4__)
  5. #define __unmapself __unmapself_sh_nommu
  6. #include "dynlink.h"
  7. #undef CRTJMP
  8. #define CRTJMP(pc,sp) __asm__ __volatile__( \
  9. "mov.l @%0+,r0 ; mov.l @%0,r12 ; jmp @r0 ; mov %1,r15" \
  10. : : "r"(pc), "r"(sp) : "r0", "memory" )
  11. #include "../../../src/thread/__unmapself.c"
  12. #undef __unmapself
  13. extern __attribute__((__visibility__("hidden"))) unsigned __sh_nommu;
  14. #else
  15. #define __sh_nommu 0
  16. #endif
  17. void __unmapself(void *base, size_t size)
  18. {
  19. if (__sh_nommu) __unmapself_sh_nommu(base, size);
  20. else __unmapself_sh_mmu(base, size);
  21. }