mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 04:49:25 +08:00
* dcrt0.cc (alloc_stack_hard_way): Revert to previous implementation.
(alloc_stack): Ditto. * exceptions.cc (ctrl_c_handler): Add debugging output.
This commit is contained in:
parent
e6ea2b9671
commit
c21e74cce8
@ -1,3 +1,9 @@
|
|||||||
|
2004-02-13 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* dcrt0.cc (alloc_stack_hard_way): Revert to previous implementation.
|
||||||
|
(alloc_stack): Ditto.
|
||||||
|
* exceptions.cc (ctrl_c_handler): Add debugging output.
|
||||||
|
|
||||||
2004-02-13 Christopher Faylor <cgf@redhat.com>
|
2004-02-13 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* Makefile.in (clean): Remove sigfe.s.
|
* Makefile.in (clean): Remove sigfe.s.
|
||||||
|
@ -459,9 +459,8 @@ static MEMORY_BASIC_INFORMATION NO_COPY sm;
|
|||||||
#define CYGWIN_GUARD ((wincap.has_page_guard ()) ? \
|
#define CYGWIN_GUARD ((wincap.has_page_guard ()) ? \
|
||||||
PAGE_EXECUTE_READWRITE|PAGE_GUARD : PAGE_NOACCESS)
|
PAGE_EXECUTE_READWRITE|PAGE_GUARD : PAGE_NOACCESS)
|
||||||
|
|
||||||
// __inline__ void
|
static void
|
||||||
extern void
|
alloc_stack_hard_way (child_info_fork *ci, volatile char *b)
|
||||||
alloc_stack_hard_way (child_info_fork *ci)
|
|
||||||
{
|
{
|
||||||
void *new_stack_pointer;
|
void *new_stack_pointer;
|
||||||
MEMORY_BASIC_INFORMATION m;
|
MEMORY_BASIC_INFORMATION m;
|
||||||
@ -496,7 +495,7 @@ alloc_stack_hard_way (child_info_fork *ci)
|
|||||||
api_fatal ("fork: couldn't get new stack info, %E");
|
api_fatal ("fork: couldn't get new stack info, %E");
|
||||||
if (!noguard)
|
if (!noguard)
|
||||||
{
|
{
|
||||||
m.BaseAddress = (LPVOID)((DWORD)m.BaseAddress - 1);
|
m.BaseAddress = (LPVOID) ((DWORD) m.BaseAddress - 1);
|
||||||
if (!VirtualAlloc ((LPVOID) m.BaseAddress, 1, MEM_COMMIT,
|
if (!VirtualAlloc ((LPVOID) m.BaseAddress, 1, MEM_COMMIT,
|
||||||
CYGWIN_GUARD))
|
CYGWIN_GUARD))
|
||||||
api_fatal ("fork: couldn't allocate new stack guard page %p, %E",
|
api_fatal ("fork: couldn't allocate new stack guard page %p, %E",
|
||||||
@ -505,6 +504,7 @@ alloc_stack_hard_way (child_info_fork *ci)
|
|||||||
if (!VirtualQuery ((LPCVOID) m.BaseAddress, &m, sizeof m))
|
if (!VirtualQuery ((LPCVOID) m.BaseAddress, &m, sizeof m))
|
||||||
api_fatal ("fork: couldn't get new stack info, %E");
|
api_fatal ("fork: couldn't get new stack info, %E");
|
||||||
ci->stacktop = m.BaseAddress;
|
ci->stacktop = m.BaseAddress;
|
||||||
|
b[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* extend the stack prior to fork longjmp */
|
/* extend the stack prior to fork longjmp */
|
||||||
@ -512,16 +512,18 @@ alloc_stack_hard_way (child_info_fork *ci)
|
|||||||
static void
|
static void
|
||||||
alloc_stack (child_info_fork *ci)
|
alloc_stack (child_info_fork *ci)
|
||||||
{
|
{
|
||||||
if (!VirtualQuery ((LPCVOID) _tlstop, &sm, sizeof sm))
|
/* FIXME: adding 16384 seems to avoid a stack copy problem during
|
||||||
|
fork on Win95, but I don't know exactly why yet. DJ */
|
||||||
|
volatile char b[ci->stacksize + 16384];
|
||||||
|
|
||||||
|
if (!VirtualQuery ((LPCVOID) &b, &sm, sizeof sm))
|
||||||
api_fatal ("fork: couldn't get stack info, %E");
|
api_fatal ("fork: couldn't get stack info, %E");
|
||||||
|
|
||||||
if (sm.AllocationBase == ci->stacktop)
|
if (sm.AllocationBase == ci->stacktop)
|
||||||
{
|
ci->stacksize = 0;
|
||||||
ci->stacksize = 0;
|
else
|
||||||
return;
|
alloc_stack_hard_way (ci, b + sizeof (b) - 1);
|
||||||
}
|
|
||||||
|
|
||||||
alloc_stack_hard_way (ci);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -785,7 +787,6 @@ dll_crt0_1 (char *)
|
|||||||
_tlsbase = (char *) fork_info->stackbottom;
|
_tlsbase = (char *) fork_info->stackbottom;
|
||||||
_tlstop = (char *) fork_info->stacktop;
|
_tlstop = (char *) fork_info->stacktop;
|
||||||
}
|
}
|
||||||
|
|
||||||
longjmp (fork_info->jmp, fork_info->cygpid);
|
longjmp (fork_info->jmp, fork_info->cygpid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -829,7 +829,10 @@ ctrl_c_handler (DWORD type)
|
|||||||
static bool saw_close;
|
static bool saw_close;
|
||||||
|
|
||||||
if (!cygwin_finished_initializing)
|
if (!cygwin_finished_initializing)
|
||||||
ExitProcess (STATUS_CONTROL_C_EXIT);
|
{
|
||||||
|
debug_printf ("exiting with status %p", STATUS_CONTROL_C_EXIT);
|
||||||
|
ExitProcess (STATUS_CONTROL_C_EXIT);
|
||||||
|
}
|
||||||
|
|
||||||
_my_tls.remove (INFINITE);
|
_my_tls.remove (INFINITE);
|
||||||
|
|
||||||
|
@ -664,7 +664,6 @@ fork ()
|
|||||||
child_info_fork ch;
|
child_info_fork ch;
|
||||||
|
|
||||||
int res = setjmp (ch.jmp);
|
int res = setjmp (ch.jmp);
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
res = fork_child (grouped.hParent, grouped.first_dll, grouped.load_dlls);
|
res = fork_child (grouped.hParent, grouped.first_dll, grouped.load_dlls);
|
||||||
else
|
else
|
||||||
|
@ -281,6 +281,5 @@ _longjmp:
|
|||||||
movl 20(%edi),%edi
|
movl 20(%edi),%edi
|
||||||
popfl
|
popfl
|
||||||
ret
|
ret
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user