aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/vdso64
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-15 21:54:32 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-15 22:05:11 -0500
commit5d66da3d71e6aeca80ca08dbebd8a1cd72e6ee1f (patch)
tree1bdc54e617fc209925f33118f414ce0a4ebb62ac /arch/powerpc/kernel/vdso64
parentd3ed65832029dcaf5fe086670a2f2c25600b51e9 (diff)
[PATCH] powerpc: Make the vDSO functions set error code (#2)
The vDSO functions should have the same calling convention as a syscall. Unfortunately, they currently don't set the cr0.so bit which is used to indicate an error. This patch makes them clear this bit unconditionally since all functions currently succeed. The syscall fallback done by some of them will eventually override this if the syscall fails. This also changes the symbol version of all vdso exports to make sure glibc can differenciate between old and fixed calls for existing ones like __kernel_gettimeofday. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/vdso64')
-rw-r--r--arch/powerpc/kernel/vdso64/cacheflush.S2
-rw-r--r--arch/powerpc/kernel/vdso64/datapage.S3
-rw-r--r--arch/powerpc/kernel/vdso64/gettimeofday.S4
3 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/vdso64/cacheflush.S b/arch/powerpc/kernel/vdso64/cacheflush.S
index d4a0ad28d534..cb4ae0a5edd0 100644
--- a/arch/powerpc/kernel/vdso64/cacheflush.S
+++ b/arch/powerpc/kernel/vdso64/cacheflush.S
@@ -35,6 +35,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache)
35 subf r8,r6,r4 /* compute length */ 35 subf r8,r6,r4 /* compute length */
36 add r8,r8,r5 /* ensure we get enough */ 36 add r8,r8,r5 /* ensure we get enough */
37 srwi. r8,r8,7 /* compute line count */ 37 srwi. r8,r8,7 /* compute line count */
38 crclr cr0*4+so
38 beqlr /* nothing to do? */ 39 beqlr /* nothing to do? */
39 mtctr r8 40 mtctr r8
40 mr r3,r6 41 mr r3,r6
@@ -58,6 +59,7 @@ V_FUNCTION_END(__kernel_sync_dicache)
58 */ 59 */
59V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) 60V_FUNCTION_BEGIN(__kernel_sync_dicache_p5)
60 .cfi_startproc 61 .cfi_startproc
62 crclr cr0*4+so
61 sync 63 sync
62 isync 64 isync
63 li r3,0 65 li r3,0
diff --git a/arch/powerpc/kernel/vdso64/datapage.S b/arch/powerpc/kernel/vdso64/datapage.S
index 6393e4137bc7..3b2dd7d0c1eb 100644
--- a/arch/powerpc/kernel/vdso64/datapage.S
+++ b/arch/powerpc/kernel/vdso64/datapage.S
@@ -54,12 +54,12 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map)
54 .cfi_startproc 54 .cfi_startproc
55 mflr r12 55 mflr r12
56 .cfi_register lr,r12 56 .cfi_register lr,r12
57
58 mr r4,r3 57 mr r4,r3
59 bl V_LOCAL_FUNC(__get_datapage) 58 bl V_LOCAL_FUNC(__get_datapage)
60 mtlr r12 59 mtlr r12
61 addi r3,r3,CFG_SYSCALL_MAP64 60 addi r3,r3,CFG_SYSCALL_MAP64
62 cmpli cr0,r4,0 61 cmpli cr0,r4,0
62 crclr cr0*4+so
63 beqlr 63 beqlr
64 li r0,__NR_syscalls 64 li r0,__NR_syscalls
65 stw r0,0(r4) 65 stw r0,0(r4)
@@ -80,6 +80,7 @@ V_FUNCTION_BEGIN(__kernel_get_tbfreq)
80 bl V_LOCAL_FUNC(__get_datapage) 80 bl V_LOCAL_FUNC(__get_datapage)
81 ld r3,CFG_TB_TICKS_PER_SEC(r3) 81 ld r3,CFG_TB_TICKS_PER_SEC(r3)
82 mtlr r12 82 mtlr r12
83 crclr cr0*4+so
83 blr 84 blr
84 .cfi_endproc 85 .cfi_endproc
85V_FUNCTION_END(__kernel_get_tbfreq) 86V_FUNCTION_END(__kernel_get_tbfreq)
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S
index 1a89094715cc..ccaeda5136d1 100644
--- a/arch/powerpc/kernel/vdso64/gettimeofday.S
+++ b/arch/powerpc/kernel/vdso64/gettimeofday.S
@@ -52,6 +52,7 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday)
52 stw r4,TZONE_TZ_MINWEST(r10) 52 stw r4,TZONE_TZ_MINWEST(r10)
53 stw r5,TZONE_TZ_DSTTIME(r10) 53 stw r5,TZONE_TZ_DSTTIME(r10)
541: mtlr r12 541: mtlr r12
55 crclr cr0*4+so
55 li r3,0 /* always success */ 56 li r3,0 /* always success */
56 blr 57 blr
57 .cfi_endproc 58 .cfi_endproc
@@ -99,6 +100,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
99 std r0,TSPC64_TV_NSEC(r11) /* store nsec in tp */ 100 std r0,TSPC64_TV_NSEC(r11) /* store nsec in tp */
100 101
101 mtlr r12 102 mtlr r12
103 crclr cr0*4+so
102 li r3,0 104 li r3,0
103 blr 105 blr
104 106
@@ -159,6 +161,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
159 std r7,TSPC64_TV_NSEC(r11) 161 std r7,TSPC64_TV_NSEC(r11)
160 162
161 mtlr r12 163 mtlr r12
164 crclr cr0*4+so
162 li r3,0 165 li r3,0
163 blr 166 blr
164 167
@@ -193,6 +196,7 @@ V_FUNCTION_BEGIN(__kernel_clock_getres)
193 196
194 li r3,0 197 li r3,0
195 cmpli cr0,r4,0 198 cmpli cr0,r4,0
199 crclr cr0*4+so
196 beqlr 200 beqlr
197 lis r5,CLOCK_REALTIME_RES@h 201 lis r5,CLOCK_REALTIME_RES@h
198 ori r5,r5,CLOCK_REALTIME_RES@l 202 ori r5,r5,CLOCK_REALTIME_RES@l