summaryrefslogtreecommitdiffstats
path: root/sys/alpha/linux/linux_sysvec.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-12-19 02:55:34 +0000
committerjulian <julian@FreeBSD.org>1998-12-19 02:55:34 +0000
commit61490236bcee0615867517e76eb92c1b20075f82 (patch)
tree9a109f9996daee77886aee1062aa97f90896dd47 /sys/alpha/linux/linux_sysvec.c
parentda7c7a2e129d402169d2fbc6d83f596d7d16d83a (diff)
downloadFreeBSD-src-61490236bcee0615867517e76eb92c1b20075f82.zip
FreeBSD-src-61490236bcee0615867517e76eb92c1b20075f82.tar.gz
Reviewed by: Luoqi Chen, Jordan Hubbard
Submitted by: "Richard Seaman, Jr." <lists@tar.com> Obtained from: linux :-) Code to allow Linux Threads to run under FreeBSD. By default not enabled This code is dependent on the conditional COMPAT_LINUX_THREADS (suggested by Garret) This is not yet a 'real' option but will be within some number of hours.
Diffstat (limited to 'sys/alpha/linux/linux_sysvec.c')
-rw-r--r--sys/alpha/linux/linux_sysvec.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c
index 188e3d5..b863951 100644
--- a/sys/alpha/linux/linux_sysvec.c
+++ b/sys/alpha/linux/linux_sysvec.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_sysvec.c,v 1.39 1998/12/14 18:54:01 dt Exp $
+ * $Id: linux_sysvec.c,v 1.40 1998/12/16 16:28:57 bde Exp $
*/
/* XXX we use functions that might not exist. */
@@ -50,6 +50,10 @@
#include <vm/vm_prot.h>
#include <vm/vm_page.h>
#include <vm/vm_extern.h>
+#ifdef COMPAT_LINUX_THREADS
+#include <sys/lock.h> /* needed, for now, by vm_map.h */
+#include <vm/vm_map.h> /* needed, for now, for VM_STACK defines */
+#endif /* COMPAT_LINUX_THREADS */
#include <sys/exec.h>
#include <sys/kernel.h>
#include <sys/module.h>
@@ -217,7 +221,24 @@ linux_sendsig(sig_t catcher, int sig, int mask, u_long code)
* and the stack can not be grown. useracc will return FALSE
* if access is denied.
*/
+#ifdef COMPAT_LINUX_THREADS
+#ifdef USE_VM_STACK
+#ifndef USE_VM_STACK_FOR_EXEC
+ if ((((caddr_t)fp > p->p_vmspace->vm_maxsaddr &&
+ (caddr_t)fp < (caddr_t)USRSTACK &&
+ grow(p, (int)fp) == FALSE) ||
+ (((caddr_t)fp <= p->p_vmspace->vm_maxsaddr ||
+ (caddr_t)fp >= (caddr_t)USRSTACK) &&
+ grow_stack (p, (int)fp) == FALSE)) ||
+#else
+ if ((grow_stack (p, (int)fp) == FALSE) ||
+#endif
+#else
+#endif /* COMPAT_LINUX_THREADS */
if ((grow(p, (int)fp) == FALSE) ||
+#ifdef COMPAT_LINUX_THREADS
+#endif
+#endif /* COMPAT_LINUX_THREADS */
(useracc((caddr_t)fp, sizeof (struct linux_sigframe), B_WRITE) == FALSE)) {
/*
* Process has trashed its stack; give it an illegal
OpenPOWER on IntegriCloud