asm-offsets.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * linux/arch/unicore32/kernel/asm-offsets.c
  3. *
  4. * Code specific to PKUnity SoC and UniCore ISA
  5. *
  6. * Copyright (C) 2001-2010 GUAN Xue-tao
  7. *
  8. * Generate definitions needed by assembly language modules.
  9. * This code generates raw asm output which is post-processed to extract
  10. * and format the required data.
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #include <linux/sched.h>
  17. #include <linux/mm.h>
  18. #include <linux/dma-mapping.h>
  19. #include <linux/kbuild.h>
  20. #include <linux/suspend.h>
  21. #include <linux/thread_info.h>
  22. #include <asm/memory.h>
  23. #include <asm/suspend.h>
  24. /*
  25. * GCC 3.0, 3.1: general bad code generation.
  26. * GCC 3.2.0: incorrect function argument offset calculation.
  27. * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c
  28. * (http://gcc.gnu.org/PR8896) and incorrect structure
  29. * initialisation in fs/jffs2/erase.c
  30. */
  31. #if (__GNUC__ < 4)
  32. #error Your compiler should upgrade to uc4
  33. #error Known good compilers: 4.2.2
  34. #endif
  35. int main(void)
  36. {
  37. DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
  38. BLANK();
  39. DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
  40. DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
  41. DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
  42. DEFINE(TI_TASK, offsetof(struct thread_info, task));
  43. DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
  44. DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
  45. DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
  46. DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp));
  47. #ifdef CONFIG_UNICORE_FPU_F64
  48. DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate));
  49. #endif
  50. BLANK();
  51. DEFINE(S_R0, offsetof(struct pt_regs, UCreg_00));
  52. DEFINE(S_R1, offsetof(struct pt_regs, UCreg_01));
  53. DEFINE(S_R2, offsetof(struct pt_regs, UCreg_02));
  54. DEFINE(S_R3, offsetof(struct pt_regs, UCreg_03));
  55. DEFINE(S_R4, offsetof(struct pt_regs, UCreg_04));
  56. DEFINE(S_R5, offsetof(struct pt_regs, UCreg_05));
  57. DEFINE(S_R6, offsetof(struct pt_regs, UCreg_06));
  58. DEFINE(S_R7, offsetof(struct pt_regs, UCreg_07));
  59. DEFINE(S_R8, offsetof(struct pt_regs, UCreg_08));
  60. DEFINE(S_R9, offsetof(struct pt_regs, UCreg_09));
  61. DEFINE(S_R10, offsetof(struct pt_regs, UCreg_10));
  62. DEFINE(S_R11, offsetof(struct pt_regs, UCreg_11));
  63. DEFINE(S_R12, offsetof(struct pt_regs, UCreg_12));
  64. DEFINE(S_R13, offsetof(struct pt_regs, UCreg_13));
  65. DEFINE(S_R14, offsetof(struct pt_regs, UCreg_14));
  66. DEFINE(S_R15, offsetof(struct pt_regs, UCreg_15));
  67. DEFINE(S_R16, offsetof(struct pt_regs, UCreg_16));
  68. DEFINE(S_R17, offsetof(struct pt_regs, UCreg_17));
  69. DEFINE(S_R18, offsetof(struct pt_regs, UCreg_18));
  70. DEFINE(S_R19, offsetof(struct pt_regs, UCreg_19));
  71. DEFINE(S_R20, offsetof(struct pt_regs, UCreg_20));
  72. DEFINE(S_R21, offsetof(struct pt_regs, UCreg_21));
  73. DEFINE(S_R22, offsetof(struct pt_regs, UCreg_22));
  74. DEFINE(S_R23, offsetof(struct pt_regs, UCreg_23));
  75. DEFINE(S_R24, offsetof(struct pt_regs, UCreg_24));
  76. DEFINE(S_R25, offsetof(struct pt_regs, UCreg_25));
  77. DEFINE(S_R26, offsetof(struct pt_regs, UCreg_26));
  78. DEFINE(S_FP, offsetof(struct pt_regs, UCreg_fp));
  79. DEFINE(S_IP, offsetof(struct pt_regs, UCreg_ip));
  80. DEFINE(S_SP, offsetof(struct pt_regs, UCreg_sp));
  81. DEFINE(S_LR, offsetof(struct pt_regs, UCreg_lr));
  82. DEFINE(S_PC, offsetof(struct pt_regs, UCreg_pc));
  83. DEFINE(S_PSR, offsetof(struct pt_regs, UCreg_asr));
  84. DEFINE(S_OLD_R0, offsetof(struct pt_regs, UCreg_ORIG_00));
  85. DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs));
  86. BLANK();
  87. DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));
  88. DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags));
  89. BLANK();
  90. DEFINE(VM_EXEC, VM_EXEC);
  91. BLANK();
  92. DEFINE(PAGE_SZ, PAGE_SIZE);
  93. BLANK();
  94. DEFINE(SYS_ERROR0, 0x9f0000);
  95. BLANK();
  96. DEFINE(PBE_ADDRESS, offsetof(struct pbe, address));
  97. DEFINE(PBE_ORIN_ADDRESS, offsetof(struct pbe, orig_address));
  98. DEFINE(PBE_NEXT, offsetof(struct pbe, next));
  99. DEFINE(SWSUSP_CPU, offsetof(struct swsusp_arch_regs, \
  100. cpu_context));
  101. #ifdef CONFIG_UNICORE_FPU_F64
  102. DEFINE(SWSUSP_FPSTATE, offsetof(struct swsusp_arch_regs, \
  103. fpstate));
  104. #endif
  105. BLANK();
  106. DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL);
  107. DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE);
  108. DEFINE(DMA_FROM_DEVICE, DMA_FROM_DEVICE);
  109. return 0;
  110. }