aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/asm-offsets.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-11 05:15:21 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-11 06:25:39 -0500
commita7f290dad32ee34d931561b7943c858fe2aae503 (patch)
tree850f04ed9ffba8aef6e151fa9c9e8a0c667bb795 /arch/powerpc/kernel/asm-offsets.c
parent6761c4a07378e19e3710bb69cea65795774529b1 (diff)
[PATCH] powerpc: Merge vdso's and add vdso support to 32 bits kernel
This patch moves the vdso's to arch/powerpc, adds support for the 32 bits vdso to the 32 bits kernel, rename systemcfg (finally !), and adds some new (still untested) routines to both vdso's: clock_gettime() with support for CLOCK_REALTIME and CLOCK_MONOTONIC, clock_getres() (same clocks) and get_tbfreq() for glibc to retreive the timebase frequency. Tom,Steve: The implementation of get_tbfreq() I've done for 32 bits returns a long long (r3, r4) not a long. This is such that if we ever add support for >4Ghz timebases on ppc32, the userland interface won't have to change. I have tested gettimeofday() using some glibc patches in both ppc32 and ppc64 kernels using 32 bits userland (I haven't had a chance to test a 64 bits userland yet, but the implementation didn't change and was tested earlier). I haven't tested yet the new functions. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/asm-offsets.c')
-rw-r--r--arch/powerpc/kernel/asm-offsets.c45
1 files changed, 31 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 8793102711a8..4550eb4f4fbd 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -37,12 +37,12 @@
37#include <asm/cputable.h> 37#include <asm/cputable.h>
38#include <asm/thread_info.h> 38#include <asm/thread_info.h>
39#include <asm/rtas.h> 39#include <asm/rtas.h>
40#include <asm/vdso_datapage.h>
40#ifdef CONFIG_PPC64 41#ifdef CONFIG_PPC64
41#include <asm/paca.h> 42#include <asm/paca.h>
42#include <asm/lppaca.h> 43#include <asm/lppaca.h>
43#include <asm/iseries/hv_lp_event.h> 44#include <asm/iseries/hv_lp_event.h>
44#include <asm/cache.h> 45#include <asm/cache.h>
45#include <asm/systemcfg.h>
46#include <asm/compat.h> 46#include <asm/compat.h>
47#endif 47#endif
48 48
@@ -251,25 +251,42 @@ int main(void)
251 251
252 DEFINE(TASK_SIZE, TASK_SIZE); 252 DEFINE(TASK_SIZE, TASK_SIZE);
253 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); 253 DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
254#else /* CONFIG_PPC64 */ 254#endif /* ! CONFIG_PPC64 */
255 /* systemcfg offsets for use by vdso */
256 DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct systemcfg, tb_orig_stamp));
257 DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct systemcfg, tb_ticks_per_sec));
258 DEFINE(CFG_TB_TO_XS, offsetof(struct systemcfg, tb_to_xs));
259 DEFINE(CFG_STAMP_XSEC, offsetof(struct systemcfg, stamp_xsec));
260 DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct systemcfg, tb_update_count));
261 DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct systemcfg, tz_minuteswest));
262 DEFINE(CFG_TZ_DSTTIME, offsetof(struct systemcfg, tz_dsttime));
263 DEFINE(CFG_SYSCALL_MAP32, offsetof(struct systemcfg, syscall_map_32));
264 DEFINE(CFG_SYSCALL_MAP64, offsetof(struct systemcfg, syscall_map_64));
265 255
266 /* timeval/timezone offsets for use by vdso */ 256 /* datapage offsets for use by vdso */
257 DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct vdso_data, tb_orig_stamp));
258 DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct vdso_data, tb_ticks_per_sec));
259 DEFINE(CFG_TB_TO_XS, offsetof(struct vdso_data, tb_to_xs));
260 DEFINE(CFG_STAMP_XSEC, offsetof(struct vdso_data, stamp_xsec));
261 DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct vdso_data, tb_update_count));
262 DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct vdso_data, tz_minuteswest));
263 DEFINE(CFG_TZ_DSTTIME, offsetof(struct vdso_data, tz_dsttime));
264 DEFINE(CFG_SYSCALL_MAP32, offsetof(struct vdso_data, syscall_map_32));
265 DEFINE(WTOM_CLOCK_SEC, offsetof(struct vdso_data, wtom_clock_sec));
266 DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
267#ifdef CONFIG_PPC64
268 DEFINE(CFG_SYSCALL_MAP64, offsetof(struct vdso_data, syscall_map_64));
267 DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec)); 269 DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec));
268 DEFINE(TVAL64_TV_USEC, offsetof(struct timeval, tv_usec)); 270 DEFINE(TVAL64_TV_USEC, offsetof(struct timeval, tv_usec));
269 DEFINE(TVAL32_TV_SEC, offsetof(struct compat_timeval, tv_sec)); 271 DEFINE(TVAL32_TV_SEC, offsetof(struct compat_timeval, tv_sec));
270 DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec)); 272 DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec));
273 DEFINE(TSPC32_TV_SEC, offsetof(struct compat_timespec, tv_sec));
274 DEFINE(TSPC32_TV_NSEC, offsetof(struct compat_timespec, tv_nsec));
275#else
276 DEFINE(TVAL32_TV_SEC, offsetof(struct timeval, tv_sec));
277 DEFINE(TVAL32_TV_USEC, offsetof(struct timeval, tv_usec));
278 DEFINE(TSPEC32_TV_SEC, offsetof(struct timespec, tv_sec));
279 DEFINE(TSPEC32_TV_NSEC, offsetof(struct timespec, tv_nsec));
280#endif
281 /* timeval/timezone offsets for use by vdso */
271 DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest)); 282 DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest));
272 DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime)); 283 DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime));
273#endif /* CONFIG_PPC64 */ 284
285 /* Other bits used by the vdso */
286 DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
287 DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
288 DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
289 DEFINE(CLOCK_REALTIME_RES, TICK_NSEC);
290
274 return 0; 291 return 0;
275} 292}