asm-offsets.c 883 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * This program is used to generate definitions needed by
  3. * assembly language modules.
  4. *
  5. * We use the technique used in the OSF Mach kernel code:
  6. * generate asm statements containing #defines,
  7. * compile this file to assembler, and then extract the
  8. * #defines from the assembly-language output.
  9. */
  10. #include <linux/stddef.h>
  11. #include <linux/types.h>
  12. #include <linux/mm.h>
  13. #include <linux/kbuild.h>
  14. #include <asm/thread_info.h>
  15. int main(void)
  16. {
  17. /* offsets into the thread_info struct */
  18. DEFINE(TI_TASK, offsetof(struct thread_info, task));
  19. DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
  20. DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
  21. DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
  22. DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
  23. DEFINE(TI_RESTART_BLOCK,offsetof(struct thread_info, restart_block));
  24. return 0;
  25. }