From 2acafd029082666bad16de877b7382adec70bbb4 Mon Sep 17 00:00:00 2001
From: dtc <dtc>
Date: Mon, 5 May 1997 23:13:59 +0000
Subject: [PATCH] Patches from Simon for the MIPS IRIX port: hacks for foreign
 functions which are not yet supported; hack for errno; signed-array support.

---
 code/foreign.lisp            |  6 ++---
 code/unix.lisp               |  8 ++++++-
 compiler/mips/array.lisp     | 18 ++++++++++++++-
 compiler/mips/type-vops.lisp | 45 ++++++++++++++++++++++++++++++++++--
 lisp/undefineds.h            |  6 ++---
 5 files changed, 73 insertions(+), 10 deletions(-)

diff --git a/code/foreign.lisp b/code/foreign.lisp
index ddc08ed72..ce13027dc 100644
--- a/code/foreign.lisp
+++ b/code/foreign.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/foreign.lisp,v 1.21 1997/01/18 14:30:46 ram Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/foreign.lisp,v 1.22 1997/05/05 23:13:52 dtc Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -31,7 +31,7 @@
  (defconstant foreign-segment-size  #x00400000)
 
 (defvar *previous-linked-object-file* nil)
-#-linux
+#-(or linux irix)
 (defvar *foreign-segment-free-pointer* foreign-segment-start)
 
 (defun pick-temporary-file-name (&optional (base "/tmp/tmp~D~C"))
@@ -304,7 +304,7 @@
 	    (setf (gethash symbol symbol-table) address)))))
     (setf lisp::*foreign-symbols* symbol-table)))
 
-#-(or linux solaris)
+#-(or linux irix solaris)
 (defun load-foreign (files &key
 			   (libraries '("-lc"))
 			   (base-file
diff --git a/code/unix.lisp b/code/unix.lisp
index f83137e3d..33b46c900 100644
--- a/code/unix.lisp
+++ b/code/unix.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix.lisp,v 1.44 1997/02/20 01:29:36 pw Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix.lisp,v 1.45 1997/05/05 23:13:54 dtc Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -712,8 +712,14 @@
 ;;; And now for something completely different ...
 (emit-unix-errors)
 
+#-irix
 (def-alien-variable ("errno" unix-errno) int)
 
+#+irix
+(setf (alien::heap-alien-info-sap-form
+       (info variable alien::alien-info 'unix-errno))
+        (int-sap (alien-funcall (extern-alien "__oserror" (function int)))))
+
 ;;; GET-UNIX-ERROR-MSG -- public.
 ;;; 
 (defun get-unix-error-msg (&optional (error-number unix-errno))
diff --git a/compiler/mips/array.lisp b/compiler/mips/array.lisp
index e84f9a968..c9ce71933 100644
--- a/compiler/mips/array.lisp
+++ b/compiler/mips/array.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/array.lisp,v 1.46 1994/10/31 04:44:16 ram Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/array.lisp,v 1.47 1997/05/05 23:13:56 dtc Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -169,6 +169,22 @@
 (def-full-data-vector-frobs simple-array-unsigned-byte-32 unsigned-num
   unsigned-reg)
 
+#+signed-array
+(def-partial-data-vector-frobs simple-array-signed-byte-8 tagged-num
+  :byte t signed-reg)
+
+#+signed-array
+(def-partial-data-vector-frobs simple-array-signed-byte-16 tagged-num
+  :short t signed-reg)
+
+#+signed-array
+(def-full-data-vector-frobs simple-array-signed-byte-30 tagged-num
+  any-reg)
+
+#+signed-array
+(def-full-data-vector-frobs simple-array-signed-byte-32 signed-num
+  signed-reg)
+
 
 
 ;;; Integer vectors whos elements are smaller than a byte.  I.e. bit, 2-bit,
diff --git a/compiler/mips/type-vops.lisp b/compiler/mips/type-vops.lisp
index 76fb8d74c..8398b653a 100644
--- a/compiler/mips/type-vops.lisp
+++ b/compiler/mips/type-vops.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/type-vops.lisp,v 1.43 1994/10/31 04:44:16 ram Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/mips/type-vops.lisp,v 1.44 1997/05/05 23:13:58 dtc Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -307,6 +307,34 @@
   object-not-simple-array-unsigned-byte-32-error
   simple-array-unsigned-byte-32-type)
 
+#+signed-array
+(def-type-vops simple-array-signed-byte-8-p
+  check-simple-array-signed-byte-8
+  simple-array-signed-byte-8
+  object-not-simple-array-signed-byte-8-error
+  simple-array-signed-byte-8-type)
+
+#+signed-array
+(def-type-vops simple-array-signed-byte-16-p
+  check-simple-array-signed-byte-16
+  simple-array-signed-byte-16
+  object-not-simple-array-signed-byte-16-error
+  simple-array-signed-byte-16-type)
+
+#+signed-array
+(def-type-vops simple-array-signed-byte-30-p
+  check-simple-array-signed-byte-30
+  simple-array-signed-byte-30
+  object-not-simple-array-signed-byte-30-error
+  simple-array-signed-byte-30-type)
+
+#+signed-array
+(def-type-vops simple-array-signed-byte-32-p
+  check-simple-array-signed-byte-32
+  simple-array-signed-byte-32
+  object-not-simple-array-signed-byte-32-error
+  simple-array-signed-byte-32-type)
+
 (def-type-vops simple-array-single-float-p check-simple-array-single-float
   simple-array-single-float object-not-simple-array-single-float-error
   simple-array-single-float-type)
@@ -360,7 +388,12 @@
   simple-string-type simple-bit-vector-type simple-vector-type
   simple-array-unsigned-byte-2-type simple-array-unsigned-byte-4-type
   simple-array-unsigned-byte-8-type simple-array-unsigned-byte-16-type
-  simple-array-unsigned-byte-32-type simple-array-single-float-type
+  simple-array-unsigned-byte-32-type
+  #+signed-array simple-array-signed-byte-8-type
+  #+signed-array simple-array-signed-byte-16-type
+  #+signed-array simple-array-signed-byte-30-type
+  #+signed-array simple-array-signed-byte-32-type
+  simple-array-single-float-type
   simple-array-double-float-type complex-string-type
   complex-bit-vector-type complex-vector-type)
 
@@ -369,6 +402,10 @@
   simple-vector-type simple-array-unsigned-byte-2-type
   simple-array-unsigned-byte-4-type simple-array-unsigned-byte-8-type
   simple-array-unsigned-byte-16-type simple-array-unsigned-byte-32-type
+  #+signed-array simple-array-signed-byte-8-type
+  #+signed-array simple-array-signed-byte-16-type
+  #+signed-array simple-array-signed-byte-30-type
+  #+signed-array simple-array-signed-byte-32-type
   simple-array-single-float-type simple-array-double-float-type)
 
 (def-type-vops arrayp check-array nil object-not-array-error
@@ -376,6 +413,10 @@
   simple-vector-type simple-array-unsigned-byte-2-type
   simple-array-unsigned-byte-4-type simple-array-unsigned-byte-8-type
   simple-array-unsigned-byte-16-type simple-array-unsigned-byte-32-type
+  #+signed-array simple-array-signed-byte-8-type
+  #+signed-array simple-array-signed-byte-16-type
+  #+signed-array simple-array-signed-byte-30-type
+  #+signed-array simple-array-signed-byte-32-type
   simple-array-single-float-type simple-array-double-float-type
   complex-string-type complex-bit-vector-type complex-vector-type
   complex-array-type)
diff --git a/lisp/undefineds.h b/lisp/undefineds.h
index cf70e654c..cc6400973 100644
--- a/lisp/undefineds.h
+++ b/lisp/undefineds.h
@@ -1,5 +1,5 @@
 /* Routines that must be linked into the core for lisp to work. */
-/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/undefineds.h,v 1.16 1997/04/19 15:25:48 pw Exp $ */
+/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/undefineds.h,v 1.17 1997/05/05 23:13:59 dtc Exp $ */
 
 /* Pick up all the syscalls. */
 accept,
@@ -110,7 +110,7 @@ setpgrp,
 #if !defined(SVR4) ||  defined(SOLARIS25)
 setpriority,
 #endif
-#if !defined(mach) && !defined(SOLARIS) && !defined(__FreeBSD__) && !defined(__linux__) && !defined(SUNOS) && !defined(osf1)
+#if !defined(mach) && !defined(SOLARIS) && !defined(__FreeBSD__) && !defined(__linux__) && !defined(SUNOS) && !defined(osf1) && !defined(irix)
 setquota,
 #endif
 #if !defined(hpux) && !defined(SVR4) ||  defined(SOLARIS25)
@@ -218,7 +218,7 @@ timezone,
 altzone,
 daylight,
 tzname,
-#ifndef __linux__
+#if !defined(__linux__) && !defined (irix)
 dlopen,
 dlsym,
 dlclose,
-- 
GitLab