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>
        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
  */
 V_FUNCTION_BEGIN(__kernel_sync_dicache_p5)
   .cfi_startproc
+       crclr   cr0*4+so
        sync
        isync
        li      r3,0
 
   .cfi_startproc
        mflr    r12
   .cfi_register lr,r12
-
        mr      r4,r3
        bl      __get_datapage@local
        mtlr    r12
        beqlr
        li      r0,__NR_syscalls
        stw     r0,0(r4)
+       crclr   cr0*4+so
        blr
   .cfi_endproc
 V_FUNCTION_END(__kernel_get_syscall_map)
        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)
 
        stw     r5,TZONE_TZ_DSTTIME(r11)
 
 1:     mtlr    r12
+       crclr   cr0*4+so
        li      r3,0
        blr
 
        mulli   r5,r5,1000
        stw     r5,TSPC32_TV_NSEC(r11)
        mtlr    r12
+       crclr   cr0*4+so
        li      r3,0
        blr
 
        stw     r4,TSPC32_TV_NSEC(r11)
 
        mtlr    r12
+       crclr   cr0*4+so
        li      r3,0
        blr
 
 
        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
 
        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
  */
 V_FUNCTION_BEGIN(__kernel_sync_dicache_p5)
   .cfi_startproc
+       crclr   cr0*4+so
        sync
        isync
        li      r3,0
 
   .cfi_startproc
        mflr    r12
   .cfi_register lr,r12
-
        mr      r4,r3
        bl      V_LOCAL_FUNC(__get_datapage)
        mtlr    r12
        addi    r3,r3,CFG_SYSCALL_MAP64
        cmpli   cr0,r4,0
+       crclr   cr0*4+so
        beqlr
        li      r0,__NR_syscalls
        stw     r0,0(r4)
        bl      V_LOCAL_FUNC(__get_datapage)
        ld      r3,CFG_TB_TICKS_PER_SEC(r3)
        mtlr    r12
+       crclr   cr0*4+so
        blr
   .cfi_endproc
 V_FUNCTION_END(__kernel_get_tbfreq)
 
        stw     r4,TZONE_TZ_MINWEST(r10)
        stw     r5,TZONE_TZ_DSTTIME(r10)
 1:     mtlr    r12
+       crclr   cr0*4+so
        li      r3,0                    /* always success */
        blr
   .cfi_endproc
        std     r0,TSPC64_TV_NSEC(r11)  /* store nsec in tp */
 
        mtlr    r12
+       crclr   cr0*4+so
        li      r3,0
        blr
 
        std     r7,TSPC64_TV_NSEC(r11)
 
        mtlr    r12
+       crclr   cr0*4+so
        li      r3,0
        blr
 
 
        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
 
 #define VDSO32_MBASE   VDSO32_LBASE
 #define VDSO64_MBASE   VDSO64_LBASE
 
-#define VDSO_VERSION_STRING    LINUX_2.6.12
+#define VDSO_VERSION_STRING    LINUX_2.6.15
 
 /* Define if 64 bits VDSO has procedure descriptors */
 #undef VDS64_HAS_DESCRIPTORS