const vki_ksigset_t *mask);
extern Int VGA_(pop_signal_frame) ( ThreadId tid );
+// ---------------------------------------------------------------------
+// Platform-specific things defined in eg. x86/*.c
+// ---------------------------------------------------------------------
+void VGA_(restart_syscall)(arch_thread_t *tst);
/* ---------------------------------------------------------------------
Finally - autoconf-generated settings
vg_assert(tst->syscallno != -1);
SYSNO = tst->syscallno;
- tst->arch.m_eip -= 2; /* sizeof(int $0x80) */
-
- /* Make sure our caller is actually sane, and we're really backing
- back over a syscall.
-
- int $0x80 == CD 80
- */
- {
- UChar *p = (UChar *)tst->arch.m_eip;
-
- if (p[0] != 0xcd || p[1] != 0x80)
- VG_(message)(Vg_DebugMsg,
- "?! restarting over syscall at %p %02x %02x\n",
- tst->arch.m_eip, p[0], p[1]);
-
- vg_assert(p[0] == 0xcd && p[1] == 0x80);
- }
+ VGA_(restart_syscall)(&tst->arch);
}
void VG_(post_syscall) ( ThreadId tid, Bool restart )
--- /dev/null
+
+/*--------------------------------------------------------------------*/
+/*--- x86/Linux-specific syscalls, etc. syscalls.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, an extensible x86 protected-mode
+ emulator for monitoring program execution on x86-Unixes.
+
+ Copyright (C) 2000-2004 Nicholas Nethercote
+ njn25@cam.ac.uk
+
+ 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; either version 2 of the
+ License, or (at your option) any later version.
+
+ 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.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "core.h"
+
+// Back up to restart a system call.
+void VGA_(restart_syscall)(arch_thread_t *tst)
+{
+ tst->m_eip -= 2; // sizeof(int $0x80)
+
+ /* Make sure our caller is actually sane, and we're really backing
+ back over a syscall.
+
+ int $0x80 == CD 80
+ */
+ {
+ UChar *p = (UChar *)tst->m_eip;
+
+ if (p[0] != 0xcd || p[1] != 0x80)
+ VG_(message)(Vg_DebugMsg,
+ "?! restarting over syscall at %p %02x %02x\n",
+ tst->m_eip, p[0], p[1]);
+
+ vg_assert(p[0] == 0xcd && p[1] == 0x80);
+ }
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/