summaryrefslogtreecommitdiff
path: root/gcc/libgcc2.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1993-11-21 20:38:55 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1993-11-21 20:38:55 +0000
commit767a6cf59207bc3654f0f527a3eb02692a3ac0fa (patch)
tree6aea90fa6e398667ad4e38a45e07219ccf0975f5 /gcc/libgcc2.c
parent2db718f1a734944e1944ff676fa7e8c7f301a1e0 (diff)
downloadgcc-767a6cf59207bc3654f0f527a3eb02692a3ac0fa.tar.gz
(__enable_execute_stack): Add DolphinOS version.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6136 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r--gcc/libgcc2.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 7331b8930e2..273c03dd50c 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -1,6 +1,6 @@
/* More subroutines needed by GCC output code on some machines. */
/* Compile this one with gcc. */
-/* Copyright (C) 1989, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1992, 1993 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -1843,6 +1843,38 @@ __enable_execute_stack ()
}
#endif /* __convex__ */
+#ifdef __DOLPHIN__
+
+/* Modified from the convex -code above. */
+
+#include <sys/param.h>
+#include <errno.h>
+#include <sys/m88kbcs.h>
+
+void
+__enable_execute_stack ()
+{
+ int save_errno;
+ static unsigned long lowest = USRSTACK;
+ unsigned long current = (unsigned long) &save_errno & -NBPC;
+
+ /* Ignore errno being set. memctl sets errno to EINVAL whenever the
+ address is seen as 'negative'. That is the case with the stack. */
+
+ save_errno=errno;
+ if (lowest > current)
+ {
+ unsigned len=lowest-current;
+ memctl(current,len,MCT_TEXT);
+ lowest = current;
+ }
+ else
+ memctl(current,NBPC,MCT_TEXT);
+ errno=save_errno;
+}
+
+#endif /* __DOLPHIN__ */
+
#ifdef __pyr__
#undef NULL /* Avoid errors if stdio.h and our stddef.h mismatch. */