-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: Andrew Waterman <andrew@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
- Loading branch information
Andrew Waterman
authored and
Palmer Dabbelt
committed
Nov 27, 2017
1 parent
b7e5a59
commit 28dfbe6
Showing
6 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters