3 void pass(int sig
, siginfo_t
*info
, void *uc
)
5 assert(info
->si_code
== SEGV_MTESERR
);
11 enable_mte(PR_MTE_TCF_SYNC
);
14 if (brk
== (void *)-1) {
19 if (mprotect(brk
, 16, PROT_READ
| PROT_WRITE
| PROT_MTE
)) {
27 asm("irg %0,%1,%2" : "=r"(p1
) : "r"(brk
), "r"(excl
));
28 asm("gmi %0,%1,%0" : "+r"(excl
) : "r"(p1
));
29 asm("irg %0,%1,%2" : "=r"(p2
) : "r"(brk
), "r"(excl
));
30 asm("stg %0,[%0]" : : "r"(p1
));
35 memset(&sa
, 0, sizeof(sa
));
36 sa
.sa_sigaction
= pass
;
37 sa
.sa_flags
= SA_SIGINFO
;
38 sigaction(SIGSEGV
, &sa
, NULL
);