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

Commit 28dfbe6e authored by Andrew Waterman's avatar Andrew Waterman Committed by Palmer Dabbelt
Browse files

RISC-V: Add VDSO entries for clock_get/gettimeofday/getcpu



For now these are just placeholders that execute the syscall.  We will
later optimize them to avoid kernel crossings, but we'd like to have the
VDSO entries from the first released kernel version to make the ABI
simpler.

Signed-off-by: default avatarAndrew Waterman <andrew@sifive.com>
Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
parent b7e5a591
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2,6 +2,10 @@

# Symbols present in the vdso
vdso-syms  = rt_sigreturn
vdso-syms += gettimeofday
vdso-syms += clock_gettime
vdso-syms += clock_getres
vdso-syms += getcpu

# Files to link into the vdso
obj-vdso = $(patsubst %, %.o, $(vdso-syms))
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 SiFive
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation, version 2.
 *
 *   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.
 */

#include <linux/linkage.h>
#include <asm/unistd.h>

	.text
/* int __vdso_clock_getres(clockid_t clock_id, struct timespec *res); */
ENTRY(__vdso_clock_getres)
	.cfi_startproc
	/* For now, just do the syscall. */
	li a7, __NR_clock_getres
	ecall
	ret
	.cfi_endproc
ENDPROC(__vdso_clock_getres)
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 SiFive
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation, version 2.
 *
 *   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.
 */

#include <linux/linkage.h>
#include <asm/unistd.h>

	.text
/* int __vdso_clock_gettime(clockid_t clock_id, struct timespec *tp); */
ENTRY(__vdso_clock_gettime)
	.cfi_startproc
	/* For now, just do the syscall. */
	li a7, __NR_clock_gettime
	ecall
	ret
	.cfi_endproc
ENDPROC(__vdso_clock_gettime)
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 SiFive
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation, version 2.
 *
 *   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.
 */

#include <linux/linkage.h>
#include <asm/unistd.h>

	.text
/* int __vdso_getcpu(unsigned *cpu, unsigned *node, void *unused); */
ENTRY(__vdso_getcpu)
	.cfi_startproc
	/* For now, just do the syscall. */
	li a7, __NR_getcpu
	ecall
	ret
	.cfi_endproc
ENDPROC(__vdso_getcpu)
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 SiFive
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation, version 2.
 *
 *   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.
 */

#include <linux/linkage.h>
#include <asm/unistd.h>

	.text
/* int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz); */
ENTRY(__vdso_gettimeofday)
	.cfi_startproc
	/* For now, just do the syscall. */
	li a7, __NR_gettimeofday
	ecall
	ret
	.cfi_endproc
ENDPROC(__vdso_gettimeofday)
Loading