|
From: <sv...@va...> - 2012-01-15 19:12:50
|
Author: bart
Date: 2012-01-15 19:08:13 +0000 (Sun, 15 Jan 2012)
New Revision: 12331
Log:
drd: Refactor functions for starting / stopping to access stack memory
Modified:
trunk/drd/drd_main.c
Modified: trunk/drd/drd_main.c
===================================================================
--- trunk/drd/drd_main.c 2012-01-15 19:02:20 UTC (rev 12330)
+++ trunk/drd/drd_main.c 2012-01-15 19:08:13 UTC (rev 12331)
@@ -454,29 +454,40 @@
* Assumption: stacks grow downward.
*/
static __inline__
-void drd_start_using_mem_stack(const Addr a, const SizeT len)
+void drd_start_using_mem_stack2(const DrdThreadId tid, const Addr a,
+ const SizeT len)
{
- DRD_(thread_set_stack_min)(DRD_(thread_get_running_tid)(),
- a - VG_STACK_REDZONE_SZB);
- drd_start_using_mem(a - VG_STACK_REDZONE_SZB,
- len + VG_STACK_REDZONE_SZB,
+ DRD_(thread_set_stack_min)(tid, a - VG_STACK_REDZONE_SZB);
+ drd_start_using_mem(a - VG_STACK_REDZONE_SZB, len + VG_STACK_REDZONE_SZB,
True);
}
+static __inline__
+void drd_start_using_mem_stack(const Addr a, const SizeT len)
+{
+ drd_start_using_mem_stack2(DRD_(thread_get_running_tid)(), a, len);
+}
+
/**
* Called by the core when the stack of a thread shrinks, to indicate that
* the addresses [ a, a + len [ are no longer accessible for the client.
* Assumption: stacks grow downward.
*/
static __inline__
-void drd_stop_using_mem_stack(const Addr a, const SizeT len)
+void drd_stop_using_mem_stack2(const DrdThreadId tid, const Addr a,
+ const SizeT len)
{
- DRD_(thread_set_stack_min)(DRD_(thread_get_running_tid)(),
- a + len - VG_STACK_REDZONE_SZB);
+ DRD_(thread_set_stack_min)(tid, a + len - VG_STACK_REDZONE_SZB);
drd_stop_using_mem(a - VG_STACK_REDZONE_SZB, len + VG_STACK_REDZONE_SZB,
True);
}
+static __inline__
+void drd_stop_using_mem_stack(const Addr a, const SizeT len)
+{
+ drd_stop_using_mem_stack2(DRD_(thread_get_running_tid)(), a, len);
+}
+
static
Bool on_alt_stack(const Addr a)
{
|