[POWERPC] Fix MMIO ops to provide expected barrier behaviour
[safe/jmp/linux-2.6] / arch / powerpc / kernel / asm-offsets.c
index b757572..7ee8496 100644 (file)
@@ -13,7 +13,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <asm/cputable.h>
 #include <asm/thread_info.h>
 #include <asm/rtas.h>
+#include <asm/vdso_datapage.h>
 #ifdef CONFIG_PPC64
 #include <asm/paca.h>
 #include <asm/lppaca.h>
 #include <asm/iseries/hv_lp_event.h>
 #include <asm/cache.h>
-#include <asm/systemcfg.h>
 #include <asm/compat.h>
 #endif
 
@@ -91,10 +90,10 @@ int main(void)
 #endif /* CONFIG_PPC64 */
 
        DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
+       DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
        DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
-       DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror));
-#ifdef CONFIG_PPC32
        DEFINE(TI_TASK, offsetof(struct thread_info, task));
+#ifdef CONFIG_PPC32
        DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
        DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
 #endif /* CONFIG_PPC32 */
@@ -106,9 +105,6 @@ int main(void)
        DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size));
        DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
        DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
-       DEFINE(PLATFORM, offsetof(struct systemcfg, platform));
-       DEFINE(PLATFORM_LPAR, PLATFORM_LPAR);
-
        /* paca */
        DEFINE(PACA_SIZE, sizeof(struct paca_struct));
        DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index));
@@ -125,21 +121,21 @@ int main(void)
        DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
        DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
        DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
-#ifdef CONFIG_PPC_64K_PAGES
-       DEFINE(PACAPGDIR, offsetof(struct paca_struct, pgdir));
-#endif
+       DEFINE(PACACONTEXTSLLP, offsetof(struct paca_struct, context.sllp));
+       DEFINE(PACAVMALLOCSLLP, offsetof(struct paca_struct, vmalloc_sllp));
 #ifdef CONFIG_HUGETLB_PAGE
        DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas));
        DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas));
 #endif /* CONFIG_HUGETLB_PAGE */
-       DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr));
        DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
        DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc));
        DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb));
-       DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi));
        DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
-       DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca));
+       DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr));
        DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
+       DEFINE(PACA_STARTPURR, offsetof(struct paca_struct, startpurr));
+       DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time));
+       DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time));
 
        DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0));
        DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1));
@@ -252,25 +248,44 @@ int main(void)
 
        DEFINE(TASK_SIZE, TASK_SIZE);
        DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
-#else /* CONFIG_PPC64 */
-       /* systemcfg offsets for use by vdso */
-       DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct systemcfg, tb_orig_stamp));
-       DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct systemcfg, tb_ticks_per_sec));
-       DEFINE(CFG_TB_TO_XS, offsetof(struct systemcfg, tb_to_xs));
-       DEFINE(CFG_STAMP_XSEC, offsetof(struct systemcfg, stamp_xsec));
-       DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct systemcfg, tb_update_count));
-       DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct systemcfg, tz_minuteswest));
-       DEFINE(CFG_TZ_DSTTIME, offsetof(struct systemcfg, tz_dsttime));
-       DEFINE(CFG_SYSCALL_MAP32, offsetof(struct systemcfg, syscall_map_32));
-       DEFINE(CFG_SYSCALL_MAP64, offsetof(struct systemcfg, syscall_map_64));
+#endif /* ! CONFIG_PPC64 */
 
-       /* timeval/timezone offsets for use by vdso */
+       /* datapage offsets for use by vdso */
+       DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct vdso_data, tb_orig_stamp));
+       DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct vdso_data, tb_ticks_per_sec));
+       DEFINE(CFG_TB_TO_XS, offsetof(struct vdso_data, tb_to_xs));
+       DEFINE(CFG_STAMP_XSEC, offsetof(struct vdso_data, stamp_xsec));
+       DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct vdso_data, tb_update_count));
+       DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct vdso_data, tz_minuteswest));
+       DEFINE(CFG_TZ_DSTTIME, offsetof(struct vdso_data, tz_dsttime));
+       DEFINE(CFG_SYSCALL_MAP32, offsetof(struct vdso_data, syscall_map_32));
+       DEFINE(WTOM_CLOCK_SEC, offsetof(struct vdso_data, wtom_clock_sec));
+       DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
+#ifdef CONFIG_PPC64
+       DEFINE(CFG_SYSCALL_MAP64, offsetof(struct vdso_data, syscall_map_64));
        DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec));
        DEFINE(TVAL64_TV_USEC, offsetof(struct timeval, tv_usec));
        DEFINE(TVAL32_TV_SEC, offsetof(struct compat_timeval, tv_sec));
        DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec));
+       DEFINE(TSPC64_TV_SEC, offsetof(struct timespec, tv_sec));
+       DEFINE(TSPC64_TV_NSEC, offsetof(struct timespec, tv_nsec));
+       DEFINE(TSPC32_TV_SEC, offsetof(struct compat_timespec, tv_sec));
+       DEFINE(TSPC32_TV_NSEC, offsetof(struct compat_timespec, tv_nsec));
+#else
+       DEFINE(TVAL32_TV_SEC, offsetof(struct timeval, tv_sec));
+       DEFINE(TVAL32_TV_USEC, offsetof(struct timeval, tv_usec));
+       DEFINE(TSPC32_TV_SEC, offsetof(struct timespec, tv_sec));
+       DEFINE(TSPC32_TV_NSEC, offsetof(struct timespec, tv_nsec));
+#endif
+       /* timeval/timezone offsets for use by vdso */
        DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest));
        DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime));
-#endif /* CONFIG_PPC64 */
+
+       /* Other bits used by the vdso */
+       DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
+       DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
+       DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
+       DEFINE(CLOCK_REALTIME_RES, TICK_NSEC);
+
        return 0;
 }