arm: vdso: move vgettimeofday.c to lib/vdso/
Subsystems (2)
PATCH v5 9/12 arm: vdso: move vgettimeofday.c to lib/vdso/
Take an effort to recode the arm64 vdso code from assembler to C previously submitted by Andrew Pinski <[email protected]>, rework it for use in both arm and arm64, overlapping any optimizations for each architecture. But instead of landing it in arm64, land the result into lib/vdso and unify both implementations to simplify future maintenance.
Declare arch/arm/vdso/vgettimeofday.c to be a candidate for a global implementation of the vdso timer calls. The hope is that new architectures can take advantage of the current unification of arm and arm64 implementations.
We urge future efforts to merge their implementations into the global vgettimeofday.c file and thus provide functional parity.
v3:
- added this change
- move arch/arm/vdso/vgettimeofday.c to lib/vdso/vgettimeofday.c
- adjust vgettimeofday.c to be a better global candidate, switch to using ARCH_PROVIDES_TIMER and __arch_counter_get() as more generic.
v4:
- update commit message to reflect overall reasoning
- adjust to reflect dropping of any forced inline
v5:
- rebase due to changes in series.
--- arch/arm/vdso/compiler.h | 4 + arch/arm/vdso/vgettimeofday.c | 343 +---------------------------------------- lib/vdso/compiler.h | 24 +++ lib/vdso/datapage.h | 24 +++ lib/vdso/vgettimeofday.c | 344 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 397 insertions(+), 342 deletions(-) create mode 100644 lib/vdso/compiler.h create mode 100644 lib/vdso/datapage.h create mode 100644 lib/vdso/vgettimeofday.c
arch/arm/vdso/compiler.h +4 -0
@@ -34,6 +34,10 @@#error This code depends on AEABI system call conventions#endif +#ifdef CONFIG_ARM_ARCH_TIMER +#define ARCH_PROVIDES_TIMER +#endif +#define DEFINE_FALLBACK (name, type_arg1, name_arg1, type_arg2, name_arg2) \ static notrace long name##_fallback(type_arg1 _##name_arg1, \ type_arg2 _##name_arg2) \
arch/arm/vdso/vgettimeofday.c +1 -342
345 lines not on this page · raw message
lib/vdso/compiler.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Userspace implementations of fallback calls +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __VDSO_COMPILER_H +#define __VDSO_COMPILER_H + +#error "vdso: Provide architectural overrides such as ARCH_PROVIDES_TIMER," +#error " DEFINE_FALLBACK and __arch_counter_get or any overrides. eg:" +#error " vdso entry points or compilation time helpers." + +#endif /* __VDSO_COMPILER_H */
lib/vdso/datapage.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Userspace implementations of __get_datapage +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __VDSO_DATAPAGE_H +#define __VDSO_DATAPAGE_H + +#error "vdso: Provide a user space architecture specific definition or" +#error "prototype for struct vdso_data *__get_datapage(void). Also define" +#error "ARCH_CLOCK_FIXED_MASK if not provided by cs_mask." + +#endif /* __VDSO_DATAPAGE_H */
lib/vdso/vgettimeofday.c new file +344 -0
344 lines not on this page · raw message
Signature · 1 line
2.15.0.403.gc27cc4dac6-goog