kernel-offsets.h 743 B

1234567891011121314151617181920212223242526272829303132
  1. #include <linux/stddef.h>
  2. #include <linux/sched.h>
  3. #include <linux/time.h>
  4. #include <linux/elf.h>
  5. #include <linux/crypto.h>
  6. #include <asm/page.h>
  7. #include <asm/mman.h>
  8. #define DEFINE(sym, val) \
  9. asm volatile("\n->" #sym " %0 " #val : : "i" (val))
  10. #define DEFINE_STR1(x) #x
  11. #define DEFINE_STR(sym, val) asm volatile("\n->" #sym " " DEFINE_STR1(val) " " #val: : )
  12. #define BLANK() asm volatile("\n->" : : )
  13. #define OFFSET(sym, str, mem) \
  14. DEFINE(sym, offsetof(struct str, mem));
  15. #define __NO_STUBS 1
  16. #undef __SYSCALL
  17. #undef _ASM_X86_64_UNISTD_H_
  18. #define __SYSCALL(nr, sym) [nr] = 1,
  19. static char syscalls[] = {
  20. #include <asm/arch/unistd.h>
  21. };
  22. void foo(void)
  23. {
  24. #include <common-offsets.h>
  25. DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1);
  26. }