Rename parent stack members in child_info struct to align with OS names
* child_info.h (CURR_CHILD_INFO_MAGIC): Align to below change. (class child_info_fork): Rename stacktop to stacklimit. Rename stackbottom to stackbase. Accommodate name change throughout Cygwin. Rephrase comments to be clearer. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@@ -307,7 +307,7 @@ frok::parent (volatile char * volatile stack_here)
|
||||
|
||||
ch.forker_finished = forker_finished;
|
||||
|
||||
ch.stackbottom = NtCurrentTeb()->Tib.StackBase;
|
||||
ch.stackbase = NtCurrentTeb()->Tib.StackBase;
|
||||
ch.stackaddr = NtCurrentTeb ()->DeallocationStack;
|
||||
if (!ch.stackaddr)
|
||||
{
|
||||
@@ -315,25 +315,25 @@ frok::parent (volatile char * volatile stack_here)
|
||||
stack. If so, the entire stack is committed anyway and StackLimit
|
||||
points to the allocation address of the stack. Mark in guardsize that
|
||||
we must not set up guard pages. */
|
||||
ch.stackaddr = ch.stacktop = NtCurrentTeb()->Tib.StackLimit;
|
||||
ch.stackaddr = ch.stacklimit = NtCurrentTeb()->Tib.StackLimit;
|
||||
ch.guardsize = (size_t) -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Otherwise we're running on a system-allocated stack. Since stack_here
|
||||
is the address of the stack pointer we start the child with anyway, we
|
||||
can set ch.stacktop to this value rounded down to page size. The
|
||||
can set ch.stacklimit to this value rounded down to page size. The
|
||||
child will not need the rest of the stack anyway. Guardsize depends
|
||||
on whether we're running on a pthread or not. If pthread, we fetch
|
||||
the guardpage size from the pthread attribs, otherwise we use the
|
||||
system default. */
|
||||
ch.stacktop = (void *) ((uintptr_t) stack_here & ~wincap.page_size ());
|
||||
ch.stacklimit = (void *) ((uintptr_t) stack_here & ~wincap.page_size ());
|
||||
ch.guardsize = (&_my_tls != _main_tls && _my_tls.tid)
|
||||
? _my_tls.tid->attr.guardsize
|
||||
: wincap.def_guard_page_size ();
|
||||
}
|
||||
debug_printf ("stack - bottom %p, top %p, addr %p, guardsize %ly",
|
||||
ch.stackbottom, ch.stacktop, ch.stackaddr, ch.guardsize);
|
||||
ch.stackbase, ch.stacklimit, ch.stackaddr, ch.guardsize);
|
||||
|
||||
PROCESS_INFORMATION pi;
|
||||
STARTUPINFOW si;
|
||||
@@ -475,7 +475,7 @@ frok::parent (volatile char * volatile stack_here)
|
||||
impure_end = _impure_ptr + 1;
|
||||
}
|
||||
rc = child_copy (hchild, true,
|
||||
"stack", stack_here, ch.stackbottom,
|
||||
"stack", stack_here, ch.stackbase,
|
||||
impure, impure_beg, impure_end,
|
||||
NULL);
|
||||
|
||||
|
Reference in New Issue
Block a user