1 #include <sysdep/kernel-offsets.h> !! 1 /* >> 2 * Generate definitions needed by assembly language modules. >> 3 * This code generates raw asm output which is post-processed >> 4 * to extract and format the required data. >> 5 */ >> 6 >> 7 #include <linux/signal.h> >> 8 #include <asm/ucontext.h> >> 9 #include "sigframe.h" >> 10 >> 11 #define DEFINE(sym, val) \ >> 12 asm volatile("\n->" #sym " %0 " #val : : "i" (val)) >> 13 >> 14 #define BLANK() asm volatile("\n->" : : ) >> 15 >> 16 void foo(void) >> 17 { >> 18 DEFINE(SIGCONTEXT_eax, offsetof (struct sigcontext, eax)); >> 19 DEFINE(SIGCONTEXT_ebx, offsetof (struct sigcontext, ebx)); >> 20 DEFINE(SIGCONTEXT_ecx, offsetof (struct sigcontext, ecx)); >> 21 DEFINE(SIGCONTEXT_edx, offsetof (struct sigcontext, edx)); >> 22 DEFINE(SIGCONTEXT_esi, offsetof (struct sigcontext, esi)); >> 23 DEFINE(SIGCONTEXT_edi, offsetof (struct sigcontext, edi)); >> 24 DEFINE(SIGCONTEXT_ebp, offsetof (struct sigcontext, ebp)); >> 25 DEFINE(SIGCONTEXT_esp, offsetof (struct sigcontext, esp)); >> 26 DEFINE(SIGCONTEXT_eip, offsetof (struct sigcontext, eip)); >> 27 BLANK(); >> 28 >> 29 DEFINE(RT_SIGFRAME_sigcontext, >> 30 offsetof (struct rt_sigframe, uc.uc_mcontext)); >> 31 } 2 32
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.