Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5da76157 authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

s390/vdso: remove NULL pointer check from clock_gettime



The explicit NULL pointer check on the timespec argument is only
required for clock_getres but not for clock_gettime.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 69928601
Loading
Loading
Loading
Loading
+3 −7
Original line number Original line Diff line number Diff line
@@ -22,13 +22,11 @@ __kernel_clock_gettime:
	basr	%r5,0
	basr	%r5,0
0:	al	%r5,21f-0b(%r5)			/* get &_vdso_data */
0:	al	%r5,21f-0b(%r5)			/* get &_vdso_data */
	chi	%r2,__CLOCK_REALTIME
	chi	%r2,__CLOCK_REALTIME
	je	10f
	je	11f
	chi	%r2,__CLOCK_MONOTONIC
	chi	%r2,__CLOCK_MONOTONIC
	jne	19f
	jne	19f


	/* CLOCK_MONOTONIC */
	/* CLOCK_MONOTONIC */
	ltr	%r3,%r3
	jz	9f				/* tp == NULL */
1:	l	%r4,__VDSO_UPD_COUNT+4(%r5)	/* load update counter */
1:	l	%r4,__VDSO_UPD_COUNT+4(%r5)	/* load update counter */
	tml	%r4,0x0001			/* pending update ? loop */
	tml	%r4,0x0001			/* pending update ? loop */
	jnz	1b
	jnz	1b
@@ -67,12 +65,10 @@ __kernel_clock_gettime:
	j	6b
	j	6b
8:	st	%r2,0(%r3)			/* store tp->tv_sec */
8:	st	%r2,0(%r3)			/* store tp->tv_sec */
	st	%r1,4(%r3)			/* store tp->tv_nsec */
	st	%r1,4(%r3)			/* store tp->tv_nsec */
9:	lhi	%r2,0
	lhi	%r2,0
	br	%r14
	br	%r14


	/* CLOCK_REALTIME */
	/* CLOCK_REALTIME */
10:	ltr	%r3,%r3				/* tp == NULL */
	jz	18f
11:	l	%r4,__VDSO_UPD_COUNT+4(%r5)	/* load update counter */
11:	l	%r4,__VDSO_UPD_COUNT+4(%r5)	/* load update counter */
	tml	%r4,0x0001			/* pending update ? loop */
	tml	%r4,0x0001			/* pending update ? loop */
	jnz	11b
	jnz	11b
@@ -111,7 +107,7 @@ __kernel_clock_gettime:
	j	15b
	j	15b
17:	st	%r2,0(%r3)			/* store tp->tv_sec */
17:	st	%r2,0(%r3)			/* store tp->tv_sec */
	st	%r1,4(%r3)			/* store tp->tv_nsec */
	st	%r1,4(%r3)			/* store tp->tv_nsec */
18:	lhi	%r2,0
	lhi	%r2,0
	br	%r14
	br	%r14


	/* Fallback to system call */
	/* Fallback to system call */
+3 −7
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@ __kernel_clock_gettime:
	.cfi_startproc
	.cfi_startproc
	larl	%r5,_vdso_data
	larl	%r5,_vdso_data
	cghi	%r2,__CLOCK_REALTIME
	cghi	%r2,__CLOCK_REALTIME
	je	4f
	je	5f
	cghi	%r2,__CLOCK_THREAD_CPUTIME_ID
	cghi	%r2,__CLOCK_THREAD_CPUTIME_ID
	je	9f
	je	9f
	cghi	%r2,-2		/* Per-thread CPUCLOCK with PID=0, VIRT=1 */
	cghi	%r2,-2		/* Per-thread CPUCLOCK with PID=0, VIRT=1 */
@@ -30,8 +30,6 @@ __kernel_clock_gettime:
	jne	12f
	jne	12f


	/* CLOCK_MONOTONIC */
	/* CLOCK_MONOTONIC */
	ltgr	%r3,%r3
	jz	3f				/* tp == NULL */
0:	lg	%r4,__VDSO_UPD_COUNT(%r5)	/* load update counter */
0:	lg	%r4,__VDSO_UPD_COUNT(%r5)	/* load update counter */
	tmll	%r4,0x0001			/* pending update ? loop */
	tmll	%r4,0x0001			/* pending update ? loop */
	jnz	0b
	jnz	0b
@@ -53,12 +51,10 @@ __kernel_clock_gettime:
	j	1b
	j	1b
2:	stg	%r0,0(%r3)			/* store tp->tv_sec */
2:	stg	%r0,0(%r3)			/* store tp->tv_sec */
	stg	%r1,8(%r3)			/* store tp->tv_nsec */
	stg	%r1,8(%r3)			/* store tp->tv_nsec */
3:	lghi	%r2,0
	lghi	%r2,0
	br	%r14
	br	%r14


	/* CLOCK_REALTIME */
	/* CLOCK_REALTIME */
4:	ltr	%r3,%r3				/* tp == NULL */
	jz	8f
5:	lg	%r4,__VDSO_UPD_COUNT(%r5)	/* load update counter */
5:	lg	%r4,__VDSO_UPD_COUNT(%r5)	/* load update counter */
	tmll	%r4,0x0001			/* pending update ? loop */
	tmll	%r4,0x0001			/* pending update ? loop */
	jnz	5b
	jnz	5b
@@ -80,7 +76,7 @@ __kernel_clock_gettime:
	j	6b
	j	6b
7:	stg	%r0,0(%r3)			/* store tp->tv_sec */
7:	stg	%r0,0(%r3)			/* store tp->tv_sec */
	stg	%r1,8(%r3)			/* store tp->tv_nsec */
	stg	%r1,8(%r3)			/* store tp->tv_nsec */
8:	lghi	%r2,0
	lghi	%r2,0
	br	%r14
	br	%r14


	/* CLOCK_THREAD_CPUTIME_ID for this thread */
	/* CLOCK_THREAD_CPUTIME_ID for this thread */