FROMLIST: [PATCH v5 10/12] arm64: vdso: replace gettimeofday.S with global vgettimeof...
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / arch / arm64 / kernel / asm-offsets.c
index 40ef661bd3a50ed8c47b956f75ea8084808527a9..f2d0391d387624e8a4e3a5af88ae26e0f2a0b45f 100644 (file)
 #include <linux/mm.h>
 #include <linux/dma-mapping.h>
 #include <linux/kvm_host.h>
+#include <asm/fixmap.h>
 #include <asm/thread_info.h>
 #include <asm/memory.h>
 #include <asm/smp_plat.h>
 #include <asm/suspend.h>
 #include <asm/vdso_datapage.h>
 #include <linux/kbuild.h>
+#include <linux/arm-smccc.h>
 
 int main(void)
 {
   DEFINE(TSK_ACTIVE_MM,                offsetof(struct task_struct, active_mm));
   BLANK();
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+  DEFINE(TSK_TI_FLAGS,         offsetof(struct task_struct, thread_info.flags));
+  DEFINE(TSK_TI_PREEMPT,       offsetof(struct task_struct, thread_info.preempt_count));
+  DEFINE(TSK_TI_ADDR_LIMIT,    offsetof(struct task_struct, thread_info.addr_limit));
+  DEFINE(TSK_STACK,            offsetof(struct task_struct, stack));
+#else
   DEFINE(TI_FLAGS,             offsetof(struct thread_info, flags));
   DEFINE(TI_PREEMPT,           offsetof(struct thread_info, preempt_count));
   DEFINE(TI_ADDR_LIMIT,                offsetof(struct thread_info, addr_limit));
-  DEFINE(TI_TASK,              offsetof(struct thread_info, task));
-  DEFINE(TI_CPU,               offsetof(struct thread_info, cpu));
+#endif
 #ifdef CONFIG_ARM64_SW_TTBR0_PAN
   DEFINE(TSK_TI_TTBR0,         offsetof(struct thread_info, ttbr0));
 #endif
@@ -77,36 +84,11 @@ int main(void)
   DEFINE(DMA_TO_DEVICE,                DMA_TO_DEVICE);
   DEFINE(DMA_FROM_DEVICE,      DMA_FROM_DEVICE);
   BLANK();
-  DEFINE(CLOCK_REALTIME,       CLOCK_REALTIME);
-  DEFINE(CLOCK_MONOTONIC,      CLOCK_MONOTONIC);
-  DEFINE(CLOCK_REALTIME_RES,   MONOTONIC_RES_NSEC);
-  DEFINE(CLOCK_REALTIME_COARSE,        CLOCK_REALTIME_COARSE);
-  DEFINE(CLOCK_MONOTONIC_COARSE,CLOCK_MONOTONIC_COARSE);
-  DEFINE(CLOCK_COARSE_RES,     LOW_RES_NSEC);
-  DEFINE(NSEC_PER_SEC,         NSEC_PER_SEC);
-  BLANK();
-  DEFINE(VDSO_CS_CYCLE_LAST,   offsetof(struct vdso_data, cs_cycle_last));
-  DEFINE(VDSO_XTIME_CLK_SEC,   offsetof(struct vdso_data, xtime_clock_sec));
-  DEFINE(VDSO_XTIME_CLK_NSEC,  offsetof(struct vdso_data, xtime_clock_nsec));
-  DEFINE(VDSO_XTIME_CRS_SEC,   offsetof(struct vdso_data, xtime_coarse_sec));
-  DEFINE(VDSO_XTIME_CRS_NSEC,  offsetof(struct vdso_data, xtime_coarse_nsec));
-  DEFINE(VDSO_WTM_CLK_SEC,     offsetof(struct vdso_data, wtm_clock_sec));
-  DEFINE(VDSO_WTM_CLK_NSEC,    offsetof(struct vdso_data, wtm_clock_nsec));
-  DEFINE(VDSO_TB_SEQ_COUNT,    offsetof(struct vdso_data, tb_seq_count));
-  DEFINE(VDSO_CS_MULT,         offsetof(struct vdso_data, cs_mult));
-  DEFINE(VDSO_CS_SHIFT,                offsetof(struct vdso_data, cs_shift));
-  DEFINE(VDSO_TZ_MINWEST,      offsetof(struct vdso_data, tz_minuteswest));
-  DEFINE(VDSO_TZ_DSTTIME,      offsetof(struct vdso_data, tz_dsttime));
-  DEFINE(VDSO_USE_SYSCALL,     offsetof(struct vdso_data, use_syscall));
-  BLANK();
-  DEFINE(TVAL_TV_SEC,          offsetof(struct timeval, tv_sec));
-  DEFINE(TVAL_TV_USEC,         offsetof(struct timeval, tv_usec));
-  DEFINE(TSPEC_TV_SEC,         offsetof(struct timespec, tv_sec));
-  DEFINE(TSPEC_TV_NSEC,                offsetof(struct timespec, tv_nsec));
-  BLANK();
-  DEFINE(TZ_MINWEST,           offsetof(struct timezone, tz_minuteswest));
-  DEFINE(TZ_DSTTIME,           offsetof(struct timezone, tz_dsttime));
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+  DEFINE(CPU_BOOT_STACK,       offsetof(struct secondary_data, stack));
+  DEFINE(CPU_BOOT_TASK,                offsetof(struct secondary_data, task));
   BLANK();
+#endif
 #ifdef CONFIG_KVM_ARM_HOST
   DEFINE(VCPU_CONTEXT,         offsetof(struct kvm_vcpu, arch.ctxt));
   DEFINE(CPU_GP_REGS,          offsetof(struct kvm_cpu_context, gp_regs));
@@ -164,6 +146,12 @@ int main(void)
   DEFINE(SLEEP_SAVE_SP_SZ,     sizeof(struct sleep_save_sp));
   DEFINE(SLEEP_SAVE_SP_PHYS,   offsetof(struct sleep_save_sp, save_ptr_stash_phys));
   DEFINE(SLEEP_SAVE_SP_VIRT,   offsetof(struct sleep_save_sp, save_ptr_stash));
+#endif
+  DEFINE(ARM_SMCCC_RES_X0_OFFS,        offsetof(struct arm_smccc_res, a0));
+  DEFINE(ARM_SMCCC_RES_X2_OFFS,        offsetof(struct arm_smccc_res, a2));
+  BLANK();
+#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+  DEFINE(TRAMP_VALIAS,         TRAMP_VALIAS);
 #endif
   return 0;
 }