*/
#include "pub_core_basics.h"
+#include "pub_core_threadstate.h"
#include "pub_core_vki.h"
#include "pub_core_xarray.h"
#include "pub_core_clientstate.h"
Addr VG_(clstk_start_base) = 0;
/* Initial highest address of the stack segment of the main thread. */
Addr VG_(clstk_end) = 0;
-UWord VG_(clstk_id) = 0;
+UWord VG_(clstk_id) = NULL_STK_ID;
/* Maximum size of the main thread's client stack. */
SizeT VG_(clstk_max_size) = 0;
VG_TRACK(die_mem_munmap, a, sizeof(struct vki_sc_shared));
/* Deregister thread's stack. */
- if (tst->os_state.stk_id != (UWord)-1)
+ if (tst->os_state.stk_id != NULL_STK_ID)
VG_(deregister_stack)(tst->os_state.stk_id);
/* Tell the tool this thread is exiting. */
new_start = new_end + 1 - new_size;
}
- if (tst->os_state.stk_id == (UWord)-1) {
+ if (tst->os_state.stk_id == NULL_STK_ID) {
/* This thread doesn't have a stack set yet. */
VG_(debugLog)(2, "syswrap-solaris",
"Stack set to %#lx-%#lx (new) for thread %u.\n",
new_start, new_end, tid);
tst->os_state.stk_id = VG_(register_stack)(new_start, new_end);
- }
- else {
+ } else {
/* Change a thread stack. */
VG_(debugLog)(2, "syswrap-solaris",
"Stack set to %#lx-%#lx (change) for thread %u.\n",
later by libc by a setustack() call (the getsetcontext syscall). */
ctst->client_stack_highest_byte = 0;
ctst->client_stack_szB = 0;
- vg_assert(ctst->os_state.stk_id == (UWord)(-1));
+ vg_assert(ctst->os_state.stk_id == NULL_STK_ID);
/* Inform a tool that a new thread is created. This has to be done before
any other core->tool event is sent. */