diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-11-11 05:15:21 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-11 06:25:39 -0500 |
commit | a7f290dad32ee34d931561b7943c858fe2aae503 (patch) | |
tree | 850f04ed9ffba8aef6e151fa9c9e8a0c667bb795 /arch/powerpc/kernel/vdso32/datapage.S | |
parent | 6761c4a07378e19e3710bb69cea65795774529b1 (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/vdso32/datapage.S')
-rw-r--r-- | arch/powerpc/kernel/vdso32/datapage.S | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/vdso32/datapage.S b/arch/powerpc/kernel/vdso32/datapage.S new file mode 100644 index 000000000000..a08c26e87835 --- /dev/null +++ b/arch/powerpc/kernel/vdso32/datapage.S | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * Access to the shared data page by the vDSO & syscall map | ||
3 | * | ||
4 | * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org), IBM Corp. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/config.h> | ||
13 | #include <asm/processor.h> | ||
14 | #include <asm/ppc_asm.h> | ||
15 | #include <asm/asm-offsets.h> | ||
16 | #include <asm/unistd.h> | ||
17 | #include <asm/vdso.h> | ||
18 | |||
19 | .text | ||
20 | V_FUNCTION_BEGIN(__get_datapage) | ||
21 | .cfi_startproc | ||
22 | /* We don't want that exposed or overridable as we want other objects | ||
23 | * to be able to bl directly to here | ||
24 | */ | ||
25 | .protected __get_datapage | ||
26 | .hidden __get_datapage | ||
27 | |||
28 | mflr r0 | ||
29 | .cfi_register lr,r0 | ||
30 | |||
31 | bcl 20,31,1f | ||
32 | .global __kernel_datapage_offset; | ||
33 | __kernel_datapage_offset: | ||
34 | .long 0 | ||
35 | 1: | ||
36 | mflr r3 | ||
37 | mtlr r0 | ||
38 | lwz r0,0(r3) | ||
39 | add r3,r0,r3 | ||
40 | blr | ||
41 | .cfi_endproc | ||
42 | V_FUNCTION_END(__get_datapage) | ||
43 | |||
44 | /* | ||
45 | * void *__kernel_get_syscall_map(unsigned int *syscall_count) ; | ||
46 | * | ||
47 | * returns a pointer to the syscall map. the map is agnostic to the | ||
48 | * size of "long", unlike kernel bitops, it stores bits from top to | ||
49 | * bottom so that memory actually contains a linear bitmap | ||
50 | * check for syscall N by testing bit (0x80000000 >> (N & 0x1f)) of | ||
51 | * 32 bits int at N >> 5. | ||
52 | */ | ||
53 | V_FUNCTION_BEGIN(__kernel_get_syscall_map) | ||
54 | .cfi_startproc | ||
55 | mflr r12 | ||
56 | .cfi_register lr,r12 | ||
57 | |||
58 | mr r4,r3 | ||
59 | bl __get_datapage@local | ||
60 | mtlr r12 | ||
61 | addi r3,r3,CFG_SYSCALL_MAP32 | ||
62 | cmpli cr0,r4,0 | ||
63 | beqlr | ||
64 | li r0,__NR_syscalls | ||
65 | stw r0,0(r4) | ||
66 | blr | ||
67 | .cfi_endproc | ||
68 | V_FUNCTION_END(__kernel_get_syscall_map) | ||
69 | |||
70 | /* | ||
71 | * void unsigned long long __kernel_get_tbfreq(void); | ||
72 | * | ||
73 | * returns the timebase frequency in HZ | ||
74 | */ | ||
75 | V_FUNCTION_BEGIN(__kernel_get_tbfreq) | ||
76 | .cfi_startproc | ||
77 | mflr r12 | ||
78 | .cfi_register lr,r12 | ||
79 | bl __get_datapage@local | ||
80 | lwz r3,CFG_TB_TICKS_PER_SEC(r3) | ||
81 | lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3) | ||
82 | mtlr r12 | ||
83 | .cfi_endproc | ||
84 | V_FUNCTION_END(__kernel_get_tbfreq) | ||