mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-09 05:10:23 +00:00
it to setup vsyscall redirects on amd64 and the _dl_sysinfo_int80 redirect on x86. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3503
29 lines
677 B
C
29 lines
677 B
C
#include "core.h"
|
|
|
|
/* Rerouted entry point for __NR_gettimeofday */
|
|
static void amd64_linux_rerouted__vgettimeofday(void)
|
|
{
|
|
asm(
|
|
" movq $96, %rax\n"
|
|
" syscall\n"
|
|
);
|
|
}
|
|
|
|
/* Rerouted entry point for __NR_time */
|
|
static void amd64_linux_rerouted__vtime(void)
|
|
{
|
|
asm(
|
|
" movq $201, %rax\n"
|
|
" syscall\n"
|
|
);
|
|
}
|
|
|
|
void VGP_(setup_redirects)(void)
|
|
{
|
|
/* Redirect vsyscalls to local versions */
|
|
VG_(add_redirect_addr_to_addr)(0xFFFFFFFFFF600000ULL,
|
|
(Addr)amd64_linux_rerouted__vgettimeofday);
|
|
VG_(add_redirect_addr_to_addr)(0xFFFFFFFFFF600400ULL,
|
|
(Addr)amd64_linux_rerouted__vtime);
|
|
}
|