HPCToolkit
specific-ucontext-manip.h
Go to the documentation of this file.
1 #ifndef SPECIFIC_UCONTEXT_MANIP
2 #define SPECIFIC_UCONTEXT_MANIP
3 
4 #include <ucontext.h>
6 
7 #if __WORDSIZE == 32
8 # define UC_REGS(uc, reg) (uc.uc_mcontext.uc_regs->gregs[reg])
9 #else
10 # define UC_REGS(uc, reg) (uc.uc_mcontext.gp_regs[reg])
11 #endif
12 
13 #define UC_REG_IP(uc) UC_REGS(uc, PPC_REG_PC)
14 #define UC_REG_FP(uc) UC_REGS(uc, PPC_REG_FP)
15 #define UC_REG_SP(uc) UC_REGS(uc, PPC_REG_SP)
16 
17 #endif // SPECIFIC_UCONTEXT_MANIP