summaryrefslogtreecommitdiff
path: root/libgcc/generic-morestack.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgcc/generic-morestack.c')
-rw-r--r--libgcc/generic-morestack.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libgcc/generic-morestack.c b/libgcc/generic-morestack.c
index f2d6d835fc4..da878640d04 100644
--- a/libgcc/generic-morestack.c
+++ b/libgcc/generic-morestack.c
@@ -378,7 +378,7 @@ allocate_segment (size_t frame_size)
{
void *guard;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
guard = space;
space = (char *) space + pagesize;
#else
@@ -496,7 +496,7 @@ __generic_morestack_set_initial_sp (void *sp, size_t len)
to the nearest 512 byte boundary. It's not essential that we be
precise here; getting it wrong will just leave some stack space
unused. */
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
sp = (void *) ((((__UINTPTR_TYPE__) sp + 511U) / 512U) * 512U);
#else
sp = (void *) ((((__UINTPTR_TYPE__) sp - 511U) / 512U) * 512U);
@@ -584,7 +584,7 @@ __generic_morestack (size_t *pframe_size, void *old_stack, size_t param_size)
/* Align the returned stack to a 32-byte boundary. */
aligned = (param_size + 31) & ~ (size_t) 31;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
{
char *bottom = (char *) (current + 1) + current->size;
to = bottom - aligned;
@@ -628,7 +628,7 @@ __generic_releasestack (size_t *pavailable)
if (current != NULL)
{
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
*pavailable = (char *) old_stack - (char *) (current + 1);
#else
*pavailable = (char *) (current + 1) + current->size - (char *) old_stack;
@@ -639,7 +639,7 @@ __generic_releasestack (size_t *pavailable)
size_t used;
/* We have popped back to the original stack. */
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
if ((char *) old_stack >= (char *) __morestack_initial_sp.sp)
used = 0;
else
@@ -778,7 +778,7 @@ __generic_findstack (void *stack)
&& (char *) pss + pss->size > (char *) stack)
{
__morestack_current_segment = pss;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
return (char *) stack - (char *) (pss + 1);
#else
return (char *) (pss + 1) + pss->size - (char *) stack;
@@ -791,7 +791,7 @@ __generic_findstack (void *stack)
if (__morestack_initial_sp.sp == NULL)
return 0;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
if ((char *) stack >= (char *) __morestack_initial_sp.sp)
used = 0;
else
@@ -869,7 +869,7 @@ __splitstack_find (void *segment_arg, void *sp, size_t *len,
*next_segment = (void *) (uintptr_type) 2;
*next_sp = NULL;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
if ((char *) sp >= isp)
return NULL;
*len = (char *) isp - (char *) sp;
@@ -942,7 +942,7 @@ __splitstack_find (void *segment_arg, void *sp, size_t *len,
*next_sp = (void *) nsp;
}
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
*len = (char *) (segment + 1) + segment->size - (char *) sp;
ret = (void *) sp;
#else
@@ -1046,7 +1046,7 @@ __splitstack_makecontext (size_t stack_size, void *context[NUMBER_OFFSETS],
segment = allocate_segment (stack_size);
context[MORESTACK_SEGMENTS] = segment;
context[CURRENT_SEGMENT] = segment;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
initial_sp = (void *) ((char *) (segment + 1) + segment->size);
#else
initial_sp = (void *) (segment + 1);
@@ -1082,13 +1082,13 @@ __splitstack_resetcontext (void *context[10], size_t *size)
initial_sp = context[INITIAL_SP];
initial_size = (uintptr_type) context[INITIAL_SP_LEN];
ret = initial_sp;
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
ret = (void *) ((char *) ret - initial_size);
#endif
}
else
{
-#ifdef STACK_GROWS_DOWNWARD
+#ifdef __LIBGCC_STACK_GROWS_DOWNWARD__
initial_sp = (void *) ((char *) (segment + 1) + segment->size);
#else
initial_sp = (void *) (segment + 1);