1
2
3
4
5
6
7
8
9 #include <asm/vdso.h>
10 #include <asm/asm-offsets.h>
11 #include <asm/unistd.h>
12 #include <asm/dwarf.h>
13 #include <asm/ptrace.h>
14
15 .text
16 .align 4
17 .globl __kernel_gettimeofday
18 .type __kernel_gettimeofday,@function
19 __kernel_gettimeofday:
20 CFI_STARTPROC
21 aghi %r15,-16
22 CFI_ADJUST_CFA_OFFSET 16
23 CFI_VAL_OFFSET 15, -STACK_FRAME_OVERHEAD
24 larl %r5,_vdso_data
25 0: ltgr %r3,%r3
26 je 1f
27 mvc 0(8,%r3),__VDSO_TIMEZONE(%r5)
28 1: ltgr %r2,%r2
29 je 4f
30 lg %r4,__VDSO_UPD_COUNT(%r5)
31 tmll %r4,0x0001
32 jnz 0b
33 stcke 0(%r15)
34 lg %r1,1(%r15)
35 lg %r0,__VDSO_TS_END(%r5)
36 slgr %r0,%r1
37 ltgr %r0,%r0
38 jm 6f
39 srlg %r0,%r0,15
40 tm __VDSO_TS_DIR+3(%r5),0x01
41 jz 7f
42 lcgr %r0,%r0
43 7: algr %r1,%r0
44 6: sg %r1,__VDSO_XTIME_STAMP(%r5)
45 msgf %r1,__VDSO_TK_MULT(%r5)
46 alg %r1,__VDSO_XTIME_NSEC(%r5)
47 lg %r0,__VDSO_XTIME_SEC(%r5)
48 clg %r4,__VDSO_UPD_COUNT(%r5)
49 jne 0b
50 lgf %r5,__VDSO_TK_SHIFT(%r5)
51 srlg %r1,%r1,0(%r5)
52 larl %r5,5f
53 2: clg %r1,0(%r5)
54 jl 3f
55 slg %r1,0(%r5)
56 aghi %r0,1
57 j 2b
58 3: stg %r0,0(%r2)
59 slgr %r0,%r0
60 ml %r0,8(%r5)
61 srlg %r0,%r0,6
62 stg %r0,8(%r2)
63 4: lghi %r2,0
64 aghi %r15,16
65 CFI_ADJUST_CFA_OFFSET -16
66 CFI_RESTORE 15
67 br %r14
68 CFI_ENDPROC
69 5: .quad 1000000000
70 .long 274877907
71 .size __kernel_gettimeofday,.-__kernel_gettimeofday