🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #100090

Emacs 18.55 on Mips, RISC/os 4.0

#100090
From: Eric Negaard
Date: Thu, 02 Nov 1989 22:32
517 lines
16804 bytes
The following archive contains a machine and system file and patches
to make emacs 18.55 work on Mips machines running RISC/os 4.0.  The
patch fixes a problem with the way emacs handles FIONREAD, and with
the values returned by nlist on RISC/os.

In the file sysdep.c FIONREAD is not undefined if BROKEN_FIONREAD has
been defined in the config files.

For some reason the nlist call sets the high order bit of the
n_value member of the nlist structure.  That bit needs to be
cleared to properly use n_value.

Starting with RISC/os 4.0 programs can be compiled in either a 4.3 BSD
environment or a SYSV environment, so I split m-mips.h into m-mips120.h
and s-riscos.h.  I called the machine file m-mips120.h because we
have a Mips m/120-5; I imagine this machine file will work with the
other Mips models as well but I haven't tested it.  To compile emacs
in the 4.3 BSD environment put the following lines in the config.h file
before including s-riscos.h: (or put them at the top of s-riscos.h)

	#ifndef BSD4_3
	# define BSD4_3
	#endif

The combination of m-mips120.h and s-riscos.h should work for
UMIPS (RISC/os) 3.0 and later.  It should work with emacs 18.52 and
later also.

			Eric Negaard
			negaard@aerospace.aero.org
			...!uunet!aero.org!negaard

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  m-mips120.h s-riscos.h diff-mips
# Wrapped by negaard@aerospace.aero.org on Thu Nov  2 12:15:49 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'm-mips120.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'m-mips120.h'\"
else
echo shar: Extracting \"'m-mips120.h'\" \(4713 characters\)
sed "s/^X//" >'m-mips120.h' <<'END_OF_FILE'
X/* m- file for Mips machines.
X   Copyright (C) 1987 Free Software Foundation, Inc.
X
XThis file is part of GNU Emacs.
X
XGNU Emacs is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the GNU Emacs General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XGNU Emacs, but only under the conditions described in the
XGNU Emacs General Public License.   A copy of this license is
Xsupposed to have been given to you along with GNU Emacs so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X
X/* The following three symbols give information on
X the size of various data types.  */
X
X#define SHORTBITS 16		/* Number of bits in a short */
X
X#define INTBITS 32		/* Number of bits in an int */
X
X#define LONGBITS 32		/* Number of bits in a long */
X
X/* Define BIG_ENDIAN iff lowest-numbered byte in a word
X   is the most significant byte.  */
X
X#define BIG_ENDIAN
X
X/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
X * group of arguments and treat it as an array of the arguments.  */
X
X#define NO_ARG_ARRAY
X
X/* Define WORD_MACHINE if addresses and such have
X * to be corrected before they can be used as byte counts.  */
X
X#undef WORD_MACHINE
X
X/* Define how to take a char and sign-extend into an int.
X   On machines where char is signed, this is a no-op.  */
X
X#define SIGN_EXTEND_CHAR(c) ((signed char)(c))
X
X/* Now define a symbol for the cpu type, if your compiler
X   does not define it automatically:
X   Ones defined so far include vax, m68000, ns16000, pyramid,
X   orion, tahoe, APOLLO and many others */
X#ifndef mips
X#	define mips
X#endif
X
X/* Use type int rather than a union, to represent Lisp_Object */
X/* This is desirable for most machines.  */
X
X#define NO_UNION_TYPE
X
X/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
X   the 24-bit bit field into an int.  In other words, if bit fields
X   are always unsigned.
X
X   If you use NO_UNION_TYPE, this flag does not matter.  */
X
X#define EXPLICIT_SIGN_EXTEND
X
X/* Data type of load average, as read out of kmem.  */
X
X#define LOAD_AVE_TYPE long
X
X/* Convert that into an integer that is 100 for a load average of 1.0  */
X
X#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / 256.0)
X
X/* Define CANNOT_DUMP on machines where unexec does not work.
X   Then the function dump-emacs will not be defined
X   and temacs will do (load "loadup") automatically unless told otherwise.  */
X
X#undef CANNOT_DUMP
X
X/* Define VIRT_ADDR_VARIES if the virtual addresses of
X   pure and impure space as loaded can vary, and even their
X   relative order cannot be relied on.
X
X   Otherwise Emacs assumes that text space precedes data space,
X   numerically.  */
X
X/* #define VIRT_ADDR_VARIES */
X
X/* Define C_ALLOCA if this machine does not support a true alloca
X   and the one written in C should be used instead.
X   Define HAVE_ALLOCA to say that the system provides a properly
X   working alloca function and it should be used.
X   Define neither one if an assembler-language alloca
X   in the file alloca.s should be used.  */
X
X#define C_ALLOCA
X/* #define HAVE_ALLOCA */
X
X/* Define NO_REMAP if memory segmentation makes it not work well
X   to change the boundary between the text section and data section
X   when Emacs is dumped.  If you define this, the preloaded Lisp
X   code will not be sharable; but that's better than failing completely.  */
X
X#define NO_REMAP
X
X/* This machine requires completely different unexec code
X   which lives in a separate file.  Specify the file name.  */
X
X#define UNEXEC unexmips.o
X
X/* Describe layout of the address space in an executing process.  */
X
X#define TEXT_START 0x400000
X#define DATA_START 0x800000
X
X/* Alter some of the options used when linking.  */
X
X#define START_FILES pre-crt0.o /lib/crt1.o
X#define LIB_STANDARD -lc /usr/lib/crtn.o
X#define LD_SWITCH_MACHINE -D 800000
X
X/* The standard definitions of these macros would work ok,
X   but these are faster because the constants are short.  */
X
X#define XUINT(a) (((unsigned)(a) << INTBITS-VALBITS) >> INTBITS-VALBITS)
X
X#define XSET(var, type, ptr) \
X   ((var) = ((int)(type) << VALBITS) + (((unsigned) (ptr) << INTBITS-VALBITS) >> INTBITS-VALBITS))
X
X#define XSETINT(a, b)  XSET(a, XTYPE(a), b)
X#define XSETUINT(a, b) XSET(a, XTYPE(a), b)
X#define XSETPNTR(a, b) XSET(a, XTYPE(a), b)
X
X#define XUNMARK(a) ((a) = (((a) << INTBITS-GCTYPEBITS-VALBITS) >> INTBITS-GCTYPEBITS-VALBITS))
END_OF_FILE
if test 4713 -ne `wc -c <'m-mips120.h'`; then
    echo shar: \"'m-mips120.h'\" unpacked with wrong size!
fi
# end of 'm-mips120.h'
fi
if test -f 's-riscos.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'s-riscos.h'\"
else
echo shar: Extracting \"'s-riscos.h'\" \(6284 characters\)
sed "s/^X//" >'s-riscos.h' <<'END_OF_FILE'
X/* Definitions file for GNU Emacs running on AT&T's System V Release 2.2
X   Copyright (C) 1985, 1986 Free Software Foundation, Inc.
X
XThis file is part of GNU Emacs.
X
XGNU Emacs is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY.  No author or distributor
Xaccepts responsibility to anyone for the consequences of using it
Xor for whether it serves any particular purpose or works at all,
Xunless he says so in writing.  Refer to the GNU Emacs General Public
XLicense for full details.
X
XEveryone is granted permission to copy, modify and redistribute
XGNU Emacs, but only under the conditions described in the
XGNU Emacs General Public License.   A copy of this license is
Xsupposed to have been given to you along with GNU Emacs so you
Xcan know your rights and responsibilities.  It should be in a
Xfile named COPYING.  Among other things, the copyright notice
Xand this notice must be preserved on all copies.  */
X
X
X/*
X *	Define symbols to identify the version of Unix this is.
X *	Define all the symbols that apply correctly.
X */
X
X#ifndef BSD4_3
X# define USG				/* System III, System V, etc */
X# define USG5
X# define IRIS				/* I think the IRIS code is
X					 * really UMIPS code, just a
X					 * misnomer.
X					 */
X#else
X# ifndef BSD
X#  define BSD
X# endif
X#endif
X
X#ifndef UMIPS
X# define UMIPS
X#endif
X
X/* SYSTEM_TYPE should indicate the kind of system you are using.
X It sets the Lisp variable system-type.  */
X
X#define SYSTEM_TYPE "umips"
X
X/* nomultiplejobs should be defined if your system's shell
X does not have "job control" (the ability to stop a program,
X run some other program, then continue the first one).  */
X
X/* #define NOMULTIPLEJOBS */
X
X/* Default is to set interrupt_input to 0: don't do input buffering within Emacs */
X
X#ifdef BSD4_3
X# undef INTERRUPT_INPUT
X#endif
X
X/* Letter to use in finding device name of first pty,
X  if system supports pty's.  'p' means it is /dev/ptyp0  */
X
X#define FIRST_PTY_LETTER 'p'
X
X/*
X *	Define HAVE_TERMIO if the system provides sysV-style ioctls
X *	for terminal control.
X */
X
X#ifndef BSD4_3
X# define HAVE_TERMIO
X#endif
X
X/*
X *	Define HAVE_TIMEVAL if the system supports the BSD style clock values.
X *	Look in <sys/time.h> for a timeval structure.
X */
X
X#define HAVE_TIMEVAL
X#define HAVE_GETTIMEOFDAY
X 
X/*
X *	Define HAVE_SELECT if the system supports the `select' system call.
X */
X
X#ifdef BSD4_3
X# define HAVE_SELECT
X#endif
X
X/*
X *	Define HAVE_PTYS if the system supports pty devices.
X */
X
X#define HAVE_PTYS
X
X/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
X
X#define HAVE_SOCKETS
X
X/*
X *	Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
X *      The 4.2 opendir, etc., library functions.
X */
X
X/* #define NONSYSTEM_DIR_LIBRARY */
X
X/*
X * 	Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir
X *	library functions.  Almost, but not quite the same as
X *	the 4.2 functions
X */
X#ifndef BSD4_3
X# define SYSV_SYSTEM_DIR
X#endif
X
X/* Define this symbol if your system has the functions bcopy, etc. */
X
X#ifdef BSD4_3
X# define BSTRING
X#endif
X
X/* subprocesses should be defined if you want to
X have code for asynchronous subprocesses
X (as used in M-x compile and M-x shell).
X This is supposed to work now on system V release 2.  */
X
X#define subprocesses
X
X/* If your system uses COFF (Common Object File Format) then define the
X   preprocessor symbol "COFF". */
X
X#define COFF
X
X/* define MAIL_USE_FLOCK if the mailer uses flock
X   to interlock access to /usr/spool/mail/$USER.
X   The alternative is that a lock file named
X   /usr/spool/mail/$USER.lock.  */
X
X/* #define MAIL_USE_FLOCK */
X
X/* Define CLASH_DETECTION if you want lock files to be written
X   so that Emacs can tell instantly when you try to modify
X   a file that someone else has modified in his Emacs.  */
X
X#define CLASH_DETECTION
X
X/* Define SHORTNAMES if the C compiler can distinguish only
X   short names.  It means that the stuff in ../shortnames
X   must be run to convert the long names to short ones.  */
X
X/* #define SHORTNAMES */
X
X/* We use the Berkeley (and usg5.2.2) interface to nlist.  */
X
X#define NLIST_STRUCT
X
X/* The file containing the kernel's symbol table is called /unix.  */
X
X#define KERNEL_FILE "/unix"
X
X/* The symbol in the kernel where the load average is found
X   is named avenrun.  */
X
X#define LDAV_SYMBOL "avenrun"
X
X/* Use terminfo instead of termcap.  */
X
X#define TERMINFO
X
X/* We do have dup2 and getwd in the bsd library */
X
X#define HAVE_DUP2
X#define HAVE_GETWD
X
X#if defined (HAVE_X_WINDOWS) && defined (X11)
X# define HAVE_VFORK		/* Graciously provided by libX.a */
X#endif
X
X/* Special hacks needed to make Emacs run on this system.  */
X
X/*
X *	Make the sigsetmask function go away.  Don't know what the
X *	ramifications of this are, but doesn't seem possible to
X *	emulate it properly anyway at this point.
X */
X
X#ifndef BSD4_3
X# define sigsetmask(mask)	/* Null expansion */
X#endif
X
X/* setjmp and longjmp can safely replace _setjmp and _longjmp,
X   but they will run slower.  */
X
X#define _setjmp setjmp
X#define _longjmp longjmp
X
X/* utime does the same thing as utimes? */
X#ifndef BSD4_3
X# define utimes utime
X#endif
X
X#ifndef BSD4_3
X/* On USG systems the system calls are interruptable by signals
X that the user program has elected to catch.  Thus the system call
X must be retried in these cases.  To handle this without massive
X changes in the source code, we remap the standard system call names
X to names for our own functions in sysdep.c that do the system call
X with retries. */
X
X#define read sys_read
X#define open sys_open
X#define write sys_write
X
X#define INTERRUPTABLE_OPEN
X#define INTERRUPTABLE_IO
X
X/* On USG systems these have different names */
X
X#define index strchr
X#define rindex strrchr
X
X#endif /* ! BSD4_3 */
X
X/* Compiler bug bites on many systems when default ADDR_CORRECT is used.  */
X
X#define ADDR_CORRECT(x) (x)
X
X/* Prevent -lg from being used for debugging.  Not implemented?  */
X
X#define LIBS_DEBUG
X
X#ifdef BSD4_3
X# define C_SWITCH_SYSTEM -systype bsd43
X# define LD_SWITCH_SYSTEM -systype bsd43
X# define LIBS_SYSTEM -lmld
X#else
X# define C_SWITCH_SYSTEM -I/usr/include/bsd
X# define LIBS_SYSTEM -lmld -lbsd
X#endif
X
X#ifndef BSD4_3
X  /* FIONREAD is defined, but does not appear to work properly
X   * Even if it did, the code in keyboard.c breaks since sigblock
X   * isn't defined.
X   */
X# define BROKEN_FIONREAD
X#endif
END_OF_FILE
if test 6284 -ne `wc -c <'s-riscos.h'`; then
    echo shar: \"'s-riscos.h'\" unpacked with wrong size!
fi
# end of 's-riscos.h'
fi
if test -f 'diff-mips' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'diff-mips'\"
else
echo shar: Extracting \"'diff-mips'\" \(1297 characters\)
sed "s/^X//" >'diff-mips' <<'END_OF_FILE'
Xdiff -c etc/loadst.c.old etc/loadst.c
X*** etc/loadst.c.old	Thu Nov  2 09:54:01 1989
X--- etc/loadst.c	Thu Oct 26 12:59:20 1989
X***************
X*** 159,164 ****
X--- 159,171 ----
X  #endif /* not NLIST_STRUCT */
X  
X    nlist (KERNEL_FILE, nl);
X+ 
X+ #ifdef UMIPS
X+   /* High order bit must be stripped off nlist return values */
X+   for (i = 0; i < sizeof (nl) / sizeof (nl[0]); i++)  {
X+     nl[i].n_value &= 0x7fffffff;
X+   }
X+ #endif /* UMIPS */
X  #endif /* LOAD_AVE_TYPE */
X  
X    while (--argc > 0)
Xdiff -c src/fns.c.old src/fns.c
X*** src/fns.c.old	Thu Nov  2 09:50:56 1989
X--- src/fns.c	Thu Oct 26 12:59:44 1989
X***************
X*** 1210,1215 ****
X--- 1210,1220 ----
X  
X        nlist (KERNEL_FILE, nl);
X  
X+ #ifdef UMIPS
X+       /* Need to strip off the high order bit */
X+       nl[0].n_value &= 0x7fffffff;
X+ #endif
X+ 
X  #ifdef FIXUP_KERNEL_SYMBOL_ADDR
X        if ((nl[0].n_type & N_TYPE) != N_ABS)
X  	nl[0].n_value = (nlp->n_value >> 2) | 0xc0000000;
Xdiff -c src/sysdep.c.old src/sysdep.c
X*** src/sysdep.c.old	Thu Nov  2 09:51:41 1989
X--- src/sysdep.c	Tue Oct 24 15:54:59 1989
X***************
X*** 171,176 ****
X--- 171,180 ----
X  #include <sys/bsdtty.h>
X  #endif 
X  
X+ #ifdef BROKEN_FIONREAD
X+ #undef FIONREAD
X+ #endif
X+ 
X  #include "termhooks.h"
X  #include "termchar.h"
X  #include "termopts.h"
END_OF_FILE
if test 1297 -ne `wc -c <'diff-mips'`; then
    echo shar: \"'diff-mips'\" unpacked with wrong size!
fi
# end of 'diff-mips'
fi
echo shar: End of shell archive.
exit 0
Technical Details
Message-ID: <NEGAARD.89Nov2143202@fungus.aero.org>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu-cs!lll-winken!brutus.cs.uiuc.edu!wuarchive!cs.utexas.edu!samsung!usc!aero!negaard

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,dc1e02e141538777,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1989-11-04 13:39:15 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu-cs!lll-winken!brutus.cs.uiuc.edu!wuarchive!cs.utexas.edu!samsung!usc!aero!negaard
From: negaard@aero.org (Eric Negaard)
Newsgroups: gnu.emacs.bug
Subject: Emacs 18.55 on Mips, RISC/os 4.0
Message-ID: <NEGAARD.89Nov2143202@fungus.aero.org>
Date: 2 Nov 89 22:32:02 GMT
Sender: news@aerospace.aero.org
Distribution: gnu
Organization: The Aerospace Corporation, El Segundo, CA
Lines: 517
Posted: Thu Nov  2 23:32:02 1989