diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-11-16 13:54:32 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-16 14:05:11 +1100 |
commit | 5d66da3d71e6aeca80ca08dbebd8a1cd72e6ee1f (patch) | |
tree | 1bdc54e617fc209925f33118f414ce0a4ebb62ac /arch/powerpc/kernel/vdso32 | |
parent | d3ed65832029dcaf5fe086670a2f2c25600b51e9 (diff) | |
download | talos-op-linux-5d66da3d71e6aeca80ca08dbebd8a1cd72e6ee1f.tar.gz talos-op-linux-5d66da3d71e6aeca80ca08dbebd8a1cd72e6ee1f.zip |
[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/vdso32')
-rw-r--r-- | arch/powerpc/kernel/vdso32/cacheflush.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/vdso32/datapage.S | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/vdso32/gettimeofday.S | 4 |
3 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/vdso32/cacheflush.S b/arch/powerpc/kernel/vdso32/cacheflush.S index c8db993574ee..09629aea3e47 100644 --- a/arch/powerpc/kernel/vdso32/cacheflush.S +++ b/arch/powerpc/kernel/vdso32/cacheflush.S @@ -35,6 +35,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache) subf r8,r6,r4 /* compute length */ add r8,r8,r5 /* ensure we get enough */ srwi. r8,r8,7 /* compute line count */ + crclr cr0*4+so beqlr /* nothing to do? */ mtctr r8 mr r3,r6 @@ -58,6 +59,7 @@ V_FUNCTION_END(__kernel_sync_dicache) */ V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) .cfi_startproc + crclr cr0*4+so sync isync li r3,0 diff --git a/arch/powerpc/kernel/vdso32/datapage.S b/arch/powerpc/kernel/vdso32/datapage.S index f6b38472318d..4709f1d9542c 100644 --- a/arch/powerpc/kernel/vdso32/datapage.S +++ b/arch/powerpc/kernel/vdso32/datapage.S @@ -54,7 +54,6 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) .cfi_startproc mflr r12 .cfi_register lr,r12 - mr r4,r3 bl __get_datapage@local mtlr r12 @@ -63,6 +62,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map) beqlr li r0,__NR_syscalls stw r0,0(r4) + crclr cr0*4+so blr .cfi_endproc V_FUNCTION_END(__kernel_get_syscall_map) @@ -80,6 +80,7 @@ V_FUNCTION_BEGIN(__kernel_get_tbfreq) lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3) lwz r3,CFG_TB_TICKS_PER_SEC(r3) mtlr r12 + crclr cr0*4+so blr .cfi_endproc V_FUNCTION_END(__kernel_get_tbfreq) diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S index 0a32a41d50b0..7eebff03a041 100644 --- a/arch/powerpc/kernel/vdso32/gettimeofday.S +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S @@ -59,6 +59,7 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) stw r5,TZONE_TZ_DSTTIME(r11) 1: mtlr r12 + crclr cr0*4+so li r3,0 blr @@ -117,6 +118,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) mulli r5,r5,1000 stw r5,TSPC32_TV_NSEC(r11) mtlr r12 + crclr cr0*4+so li r3,0 blr @@ -185,6 +187,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) stw r4,TSPC32_TV_NSEC(r11) mtlr r12 + crclr cr0*4+so li r3,0 blr @@ -219,6 +222,7 @@ V_FUNCTION_BEGIN(__kernel_clock_getres) li r3,0 cmpli cr0,r4,0 + crclr cr0*4+so beqlr lis r5,CLOCK_REALTIME_RES@h ori r5,r5,CLOCK_REALTIME_RES@l |