xref: /third_party/musl/src/thread/sh/__unmapself.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/musl/src/thread/sh/
1570af302Sopenharmony_ci#include "pthread_impl.h"
2570af302Sopenharmony_ci
3570af302Sopenharmony_cihidden void __unmapself_sh_mmu(void *, size_t);
4570af302Sopenharmony_cihidden void __unmapself_sh_nommu(void *, size_t);
5570af302Sopenharmony_ci
6570af302Sopenharmony_ci#if !defined(__SH3__) && !defined(__SH4__)
7570af302Sopenharmony_ci#define __unmapself __unmapself_sh_nommu
8570af302Sopenharmony_ci#include "dynlink.h"
9570af302Sopenharmony_ci#undef CRTJMP
10570af302Sopenharmony_ci#define CRTJMP(pc,sp) __asm__ __volatile__( \
11570af302Sopenharmony_ci	"mov.l @%0+,r0 ; mov.l @%0,r12 ; jmp @r0 ; mov %1,r15" \
12570af302Sopenharmony_ci	: : "r"(pc), "r"(sp) : "r0", "memory" )
13570af302Sopenharmony_ci#include "../__unmapself.c"
14570af302Sopenharmony_ci#undef __unmapself
15570af302Sopenharmony_ciextern hidden unsigned __sh_nommu;
16570af302Sopenharmony_ci#else
17570af302Sopenharmony_ci#define __sh_nommu 0
18570af302Sopenharmony_ci#endif
19570af302Sopenharmony_ci
20570af302Sopenharmony_civoid __unmapself(void *base, size_t size)
21570af302Sopenharmony_ci{
22570af302Sopenharmony_ci	if (__sh_nommu) __unmapself_sh_nommu(base, size);
23570af302Sopenharmony_ci	else __unmapself_sh_mmu(base, size);
24570af302Sopenharmony_ci}
25

Indexes created Thu Nov 07 10:32:03 CST 2024