HPCToolkit
specific-inline-asm-gctxt.h
Go to the documentation of this file.
1 #ifndef SPECIFIC_INLINE_ASM_GCTXT
2 #define SPECIFIC_INLINE_ASM_GCTXT
3 
5 
6 //
7 #if 0 // ppc code unknown, so "inline asm"
8  // for ppc platform doesn't work yet
9 
10 #define icat(pre, base) pre ## base
11 #define lcl_label(txt) icat(L, txt)
12 
13 // ****FIXME**** mov instructions need to be worked out for ppc64
14 
15 #define INLINE_ASM_GCTXT(LABEL, uc) \
16  extern void lcl_label(LABEL); \
17  asm volatile (".globl " "L" #LABEL); \
18  asm volatile ("L" #LABEL ":"); \
19  UC_REG_IP(uc) = (greg_t) &lcl_label(LABEL); \
20 // need equivalent ppc code here
21  asm volatile ("movq %%rbp, %0" \
22  : "=m" (UC_REG_BP(uc))); \
23  asm volatile ("movq %%rsp, %0" \
24  : "=m" (UC_REG_SP(uc)))
25 #else // for now, "inline asm" getcontext turns into syscall getcontext
26 #define INLINE_ASM_GCTXT(uc) getcontext(&uc)
27 #endif // ppc code unknown
28 
29 
30 #endif // SPECIFIC_INLINE_ASM_GCTXT
#define UC_REG_BP(uc)
unsigned char uc
Definition: amd-xop.c:3
#define UC_REG_SP(uc)