mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
riscv: Add hwprobe vdso call support
The new riscv_hwprobe syscall also comes with a vDSO for faster answers to your most common questions. Call in today to speak with a kernel representative near you! Signed-off-by: Evan Green <evan@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
parent
c6c33339b4
commit
e7919e0db2
4 changed files with 16 additions and 2 deletions
|
@ -71,6 +71,16 @@ PROCINFO_CLASS int (*_dl_vdso_clock_getres_time64) (clockid_t,
|
||||||
# ifdef HAVE_GET_TBFREQ
|
# ifdef HAVE_GET_TBFREQ
|
||||||
PROCINFO_CLASS uint64_t (*_dl_vdso_get_tbfreq)(void) RELRO;
|
PROCINFO_CLASS uint64_t (*_dl_vdso_get_tbfreq)(void) RELRO;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
/* RISC-V specific ones. */
|
||||||
|
# ifdef HAVE_RISCV_HWPROBE
|
||||||
|
PROCINFO_CLASS int (*_dl_vdso_riscv_hwprobe)(void *,
|
||||||
|
size_t,
|
||||||
|
size_t,
|
||||||
|
unsigned long *,
|
||||||
|
unsigned int) RELRO;
|
||||||
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef RELRO
|
#undef RELRO
|
||||||
|
|
|
@ -47,6 +47,9 @@ setup_vdso_pointers (void)
|
||||||
#ifdef HAVE_GET_TBFREQ
|
#ifdef HAVE_GET_TBFREQ
|
||||||
GLRO(dl_vdso_get_tbfreq) = dl_vdso_vsym (HAVE_GET_TBFREQ);
|
GLRO(dl_vdso_get_tbfreq) = dl_vdso_vsym (HAVE_GET_TBFREQ);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_RISCV_HWPROBE
|
||||||
|
GLRO(dl_vdso_riscv_hwprobe) = dl_vdso_vsym (HAVE_RISCV_HWPROBE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -28,8 +28,8 @@ int __riscv_hwprobe (struct riscv_hwprobe *pairs, size_t pair_count,
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = INTERNAL_SYSCALL_CALL (riscv_hwprobe, pairs, pair_count,
|
r = INTERNAL_VSYSCALL (riscv_hwprobe, 5, pairs, pair_count,
|
||||||
cpu_count, cpus, flags);
|
cpu_count, cpus, flags);
|
||||||
|
|
||||||
/* Negate negative errno values to match pthreads API. */
|
/* Negate negative errno values to match pthreads API. */
|
||||||
return -r;
|
return -r;
|
||||||
|
|
|
@ -156,6 +156,7 @@
|
||||||
/* List of system calls which are supported as vsyscalls (for RV32 and
|
/* List of system calls which are supported as vsyscalls (for RV32 and
|
||||||
RV64). */
|
RV64). */
|
||||||
# define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
|
# define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
|
||||||
|
# define HAVE_RISCV_HWPROBE "__vdso_riscv_hwprobe"
|
||||||
|
|
||||||
# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
|
# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL
|
||||||
# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
|
# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue