PERFORCE change 152800 for review
Peter Wemm
peter at FreeBSD.org
Tue Nov 11 00:04:09 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=152800
Change 152800 by peter at peter_freefall on 2008/11/11 08:03:33
Get a little closer to 32 bit libthr functionality. Put the client's startup
args on the correct stack.
Affected files ...
.. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-x86-freebsd.c#14 edit
Differences ...
==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-x86-freebsd.c#14 (text+ko) ====
@@ -355,15 +355,15 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &blockall, &savedmask);
/* Set the client state for scheduler to run libthr's trampoline */
- ctst->arch.vex.guest_ESP = (Addr)tp.stack_base + tp.stack_size - 4;
+ ctst->arch.vex.guest_ESP = (Addr)tp.stack_base + tp.stack_size - 8;
ctst->arch.vex.guest_EIP = (Addr)tp.start_func;
+ *(UWord *)(ctst->arch.vex.guest_ESP + 4) = (UWord)tp.arg; /* Client arg */
+ *(UWord *)(ctst->arch.vex.guest_ESP + 0) = 0; /* fake return addr */
/* Set up valgrind's trampoline on its own stack */
stk = ML_(allocstack)(ctid);
tp.stack_base = (void *)ctst->os_state.valgrind_stack_base;
tp.stack_size = (Addr)stk - (Addr)tp.stack_base;
- *(UWord *)(stk - 4) = (UWord)tp.arg; /* Client arg */
- *(UWord *)(stk - 8) = 0xdeadc0de; /* fake return addr */
/* This is for thr_new() to run valgrind's trampoline */
tp.start_func = (void *)ML_(start_thread_NORETURN);
tp.arg = &VG_(threads)[ctid];
@@ -383,6 +383,7 @@
POST_MEM_WRITE((Addr)tp.parent_tid, sizeof(long));
POST_MEM_WRITE((Addr)tp.child_tid, sizeof(long));
+ POST_MEM_WRITE((Addr)ctst->arch.vex.guest_ESP, 8);
/* Thread creation was successful; let the child have the chance
to run */
More information about the p4-projects
mailing list