3 #include "diskBack.unix.c"
4 #include "displayMem.proc.c"
5 #include "mmap-protect.c"
10 static void catcher (__attribute__ ((unused
)) int signo
,
11 __attribute__ ((unused
)) siginfo_t
* info
,
13 ucontext_t
* ucp
= (ucontext_t
*)context
;
15 #if (defined (__x86_64__))
16 GC_handleSigProf ((code_pointer
) ucp
->sc_rip
);
17 #elif (defined (__i386__))
18 GC_handleSigProf ((code_pointer
) ucp
->sc_eip
);
20 #error Profiling handler is missing for this architecture
25 void GC_setSigProfHandler (struct sigaction
*sa
) {
26 sa
->sa_flags
= SA_ONSTACK
| SA_RESTART
| SA_SIGINFO
;
27 sa
->sa_sigaction
= (void (*)(int, siginfo_t
*, void*))catcher
;