PAPI
7.1.0.0
Loading...
Searching...
No Matches
linux-context.h
Go to the documentation of this file.
1
#ifndef _LINUX_CONTEXT_H
2
#define _LINUX_CONTEXT_H
3
4
/* Signal handling functions */
5
6
#undef hwd_siginfo_t
7
8
/* Changed from struct siginfo due to POSIX and Fedora 18 */
9
/* If this breaks anything then we need to add an aufoconf test */
10
typedef
siginfo_t
hwd_siginfo_t
;
11
12
#undef hwd_ucontext_t
13
typedef
ucontext_t
hwd_ucontext_t
;
14
15
#if defined(__ia64__)
16
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.sc_ip
17
#elif defined(__i386__)
18
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.gregs[REG_EIP]
19
#elif defined(__NEC__)
20
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.gregs[REG_RIP]
21
#elif defined(__x86_64__)
22
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.gregs[REG_RIP]
23
#elif defined(__powerpc__) && !defined(__powerpc64__)
24
/*
25
* The index of the Next IP (REG_NIP) was obtained by looking at kernel
26
* source code. It wasn't documented anywhere else that I could find.
27
*/
28
#define REG_NIP 32
29
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.uc_regs->gregs[REG_NIP]
30
#elif defined(__powerpc64__)
31
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.regs->nip
32
#elif defined(__sparc__)
33
#define OVERFLOW_ADDRESS(ctx) ((struct sigcontext *)ctx.ucontext)->si_regs.pc
34
#elif defined(__arm__)
35
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.arm_pc
36
#elif defined(__aarch64__)
37
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc
38
#elif defined(__mips__)
39
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc
40
#elif defined(__hppa__)
41
#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.sc_iaoq[0]
42
#else
43
#error "OVERFLOW_ADDRESS() undefined!"
44
#endif
45
46
#define GET_OVERFLOW_ADDRESS(ctx) (vptr_t)(OVERFLOW_ADDRESS(ctx))
47
48
#endif
hwd_siginfo_t
siginfo_t hwd_siginfo_t
Definition:
linux-context.h:10
hwd_ucontext_t
ucontext_t hwd_ucontext_t
Definition:
linux-context.h:13
siginfo_t
Definition:
papi_fwrappers_.c:1827
ucontext_t
Definition:
papi_fwrappers_.c:2451
src
linux-context.h
Generated on Wed Dec 20 2023 18:12:52 for PAPI by
1.9.6