OSDN Git Service

UPSTREAM: MIPS: VDSO: Add implementation of gettimeofday() fallback
authorGoran Ferenc <goran.ferenc@imgtec.com>
Wed, 28 Jun 2017 15:55:30 +0000 (17:55 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 5 Feb 2018 16:58:32 +0000 (08:58 -0800)
commit491fef35384656b5e11f3bf4ea21693b7a3cc9e4
tree7a773ebcd97ee1ab2b1f52155b0b539221958404
parent3ab7b67564de5335868033205bd11cdfa7da4377
UPSTREAM: MIPS: VDSO: Add implementation of gettimeofday() fallback

This patch adds gettimeofday_fallback() function that wraps assembly
invocation of gettimeofday() syscall using __NR_gettimeofday.

This function is used if pure VDSO implementation gettimeofday()
does not succeed for any reason. Its imeplementation is enclosed in
"#ifdef CONFIG_MIPS_CLOCK_VSYSCALL" to be in sync with the similar
arrangement for __vdso_gettimeofday().

If syscall invocation via __NR_gettimeofday fails, register a3 will
be set. So, after the syscall, register a3 is tested and the return
valuem is negated if it's set.

Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
Cc: Douglas Leung <douglas.leung@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Petar Jovanovic <petar.jovanovic@imgtec.com>
Cc: Raghu Gandham <raghu.gandham@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/16640/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
(cherry picked from commit 0b523a85e134d41f57ddd8c5193bd9f0a5e20b0d)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
arch/mips/vdso/gettimeofday.c