|
From: Nicholas N. <nj...@ca...> - 2004-10-18 15:34:18
|
CVS commit by nethercote:
Arch-abstraction:
- factor out code for restarting syscalls
A x86-linux/syscalls.c 1.1 [GPL (v2+)]
M +4 -0 core.h 1.39
M +1 -1 stage1.c 1.25
M +1 -17 vg_syscalls.c 1.146
M +2 -1 x86-linux/Makefile.am 1.4
--- valgrind/coregrind/core.h #1.38:1.39
@@ -1521,5 +1521,9 @@ extern void VGA_(push_signal_frame) ( Th
extern Int VGA_(pop_signal_frame) ( ThreadId tid );
+// ---------------------------------------------------------------------
+// Platform-specific things defined in eg. x86/*.c
+// ---------------------------------------------------------------------
+void VGA_(restart_syscall)(arch_thread_t *tst);
/* ---------------------------------------------------------------------
--- valgrind/coregrind/stage1.c #1.24:1.25
@@ -307,5 +307,5 @@ int main(int argc, char** argv)
// Initial stack pointer is to argc, which is immediately before argv[0]
- // on the stack.
+ // on the stack. Nb: Assumes argc is word-aligned.
init_sp = argv - 1;
--- valgrind/coregrind/vg_syscalls.c #1.145:1.146
@@ -6353,21 +6353,5 @@ static void restart_syscall(ThreadId tid
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);
}
--- valgrind/coregrind/x86-linux/Makefile.am #1.3:1.4
@@ -12,3 +12,4 @@
libplatform_a_SOURCES = \
- ldt.c
+ ldt.c \
+ syscalls.c
|