njn | a7598f6 | 2005-06-18 03:27:58 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
| 3 | /*--- The trampoline code page. pub_core_trampoline.h ---*/ |
| 4 | /*--------------------------------------------------------------------*/ |
| 5 | |
| 6 | /* |
| 7 | This file is part of Valgrind, a dynamic binary instrumentation |
| 8 | framework. |
| 9 | |
| 10 | Copyright (C) 2000-2005 Julian Seward |
| 11 | jseward@acm.org |
| 12 | |
| 13 | This program is free software; you can redistribute it and/or |
| 14 | modify it under the terms of the GNU General Public License as |
| 15 | published by the Free Software Foundation; either version 2 of the |
| 16 | License, or (at your option) any later version. |
| 17 | |
| 18 | This program is distributed in the hope that it will be useful, but |
| 19 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | General Public License for more details. |
| 22 | |
| 23 | You should have received a copy of the GNU General Public License |
| 24 | along with this program; if not, write to the Free Software |
| 25 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 26 | 02111-1307, USA. |
| 27 | |
| 28 | The GNU General Public License is contained in the file COPYING. |
| 29 | */ |
| 30 | |
| 31 | #ifndef __PUB_CORE_TRAMPOLINE_H |
| 32 | #define __PUB_CORE_TRAMPOLINE_H |
| 33 | |
| 34 | //-------------------------------------------------------------------- |
sewardj | b9bce63 | 2005-06-21 01:41:34 +0000 | [diff] [blame] | 35 | // PURPOSE: This module defines a few replacement functions for Linux |
| 36 | // vsyscalls, which we can't implement directly. It also contains |
| 37 | // stubs for signal returns. Note, all the code within runs on the |
| 38 | // simulated CPU. The vsyscall stubs are gotten to by use of the |
| 39 | // redirect mechanism. |
njn | a7598f6 | 2005-06-18 03:27:58 +0000 | [diff] [blame] | 40 | //-------------------------------------------------------------------- |
| 41 | |
sewardj | b9bce63 | 2005-06-21 01:41:34 +0000 | [diff] [blame] | 42 | /* These two delimit our handwritten assembly code, so we can tell |
| 43 | tools which track memory that this area should be regarded as |
| 44 | readable, at least. Otherwise Memcheck complains we're jumping to |
| 45 | invalid addresses. */ |
njn | 7d2a9c4 | 2005-06-19 21:49:28 +0000 | [diff] [blame] | 46 | |
sewardj | b9bce63 | 2005-06-21 01:41:34 +0000 | [diff] [blame] | 47 | extern void VG_(trampoline_stuff_start); |
| 48 | extern void VG_(trampoline_stuff_end); |
njn | a7598f6 | 2005-06-18 03:27:58 +0000 | [diff] [blame] | 49 | |
sewardj | b9bce63 | 2005-06-21 01:41:34 +0000 | [diff] [blame] | 50 | #if defined(VGP_x86_linux) |
| 51 | extern void VG_(x86_linux_SUBST_FOR_sigreturn); |
| 52 | extern void VG_(x86_linux_SUBST_FOR_rt_sigreturn); |
| 53 | extern void VG_(x86_linux_REDIR_FOR__dl_sysinfo_int80); |
| 54 | #endif |
njn | a7598f6 | 2005-06-18 03:27:58 +0000 | [diff] [blame] | 55 | |
sewardj | b9bce63 | 2005-06-21 01:41:34 +0000 | [diff] [blame] | 56 | #if defined(VGP_amd64_linux) |
| 57 | extern void VG_(amd64_linux_SUBST_FOR_rt_sigreturn); |
| 58 | extern void VG_(amd64_linux_REDIR_FOR_vgettimeofday); |
| 59 | extern void VG_(amd64_linux_REDIR_FOR_vtime); |
| 60 | #endif |
sewardj | ad50be3 | 2005-08-18 11:54:30 +0000 | [diff] [blame] | 61 | |
| 62 | #if defined(VGP_ppc32_linux) |
sewardj | 31d8342 | 2005-10-15 02:00:41 +0000 | [diff] [blame] | 63 | extern UInt VG_(ppc32_linux_REDIR_FOR_strlen)( void* ); |
| 64 | extern UInt VG_(ppc32_linux_REDIR_FOR_strcmp)( void*, void* ); |
| 65 | extern void* VG_(ppc32_linux_REDIR_FOR_strchr)( void*, Int ); |
sewardj | ad50be3 | 2005-08-18 11:54:30 +0000 | [diff] [blame] | 66 | #endif |
njn | a7598f6 | 2005-06-18 03:27:58 +0000 | [diff] [blame] | 67 | |
| 68 | #endif // __PUB_CORE_TRAMPOLINE_H |
| 69 | |
| 70 | /*--------------------------------------------------------------------*/ |
| 71 | /*--- end ---*/ |
| 72 | /*--------------------------------------------------------------------*/ |