[net.emacs] Emacs for 3B15, 3B2, 3B5, 3B20

narayan@twg-ap.UUCP (Narayan Mohanram) (09/26/86)

Here is a diff listing for version 17.61 (4.3 tape) that now works on
the AT&T 3B class of machines. I got the 3b20 diffs from David Robinson
at caltech.

Define HAVE_PTY only if you have pseudo tty's. You will have to change
the paths obviouly.

I have not included the diffs for crt0.c in the 3b20 (#if u3b) version.
They can be easily got from /usr/src/lib/libc/xx/csu/crt0.s.




Sep 26 11:17 1986  /u/4.3/usr/src/new/emacs/src only and src only Page 1

					    ./CHANGES.3B
					    ./m-3b15.h

Sep 26 11:17 1986  Comparison of /u/4.3/usr/src/new/emacs/src src Page 1


different	./alloc.c
different	./alloca.c
different	./config.h
different	./crt0.c
different	./dired.c
different	./indent.c
different	./lisp.h
different	./malloc.c
different	./marker.c
different	./paths.h
different	./process.c
different	./regex.c
different	./s-usg5.2.2.h
different	./sysdep.c
different	./terminfo.c
different	./unexec.c
different	./ymakefile

Sep 26 11:17 1986  diff of ./alloc.c in /u/4.3/usr/src/new/emacs/src and src Page 1


586a587,590
> #if u3b || u3b2 || u3b5 || u3b15
>   if (XUINT (obj) < (unsigned int) (((char *) pure) + PURESIZE)
>       && XUINT (obj) >= (unsigned int) pure)
> #else
587a592
> #endif /* u3b */
886a892,895
> #if u3b || u3b2 || u3b5 || u3b15
>   if (XUINT (obj) < (unsigned int) (((char *) pure) + PURESIZE)
>       && XUINT (obj) >= (unsigned int) pure)
> #else
887a897
> #endif /* u3b */
908a919,921
> #if u3b15 || u3b5 || u3b2
> 	    XADDRFIX(obj);
> #endif /* u3b15 */
1217a1231,1234
> #if u3b2 || ub35 || u3b15
>   most_negative_fixnum = (1<<29);
>   dont_copy_flag = (1<<30);
> #else /* u3b5 */
1223a1241
> #endif /* u3b15 || u3b2 */


Sep 26 11:17 1986  diff of ./alloca.c in /u/4.3/usr/src/new/emacs/src and src Page 1


26a27,28
> #include "config.h"
> #ifndef HAVE_ALLOCA
173c175
<
---
> #endif /* HAVE_ALLOCA */


Sep 26 11:18 1986  diff of ./config.h in /u/4.3/usr/src/new/emacs/src and src Page 1


1c1
< /* GNU Emacs site configuration file.
---
> /* GNU Emacs site configuration template file.
22,26d21
< /* NOTE:  This is the config file for generic 4.3BSD.
< 	  If you want to make a change to the configuration file which
< 	  is included in the Emacs distribution, the file config.h.dist must
< 	  also be modified.
< */
34c29
< #include "s-bsd4.3.h"
---
> #include "s-usg5.2.2.h"
43c38,41
<     m-dual68.h  for dual 68000's (that run Unisoft port).
---
>     m-tahoe.h   for tahoe machines (s-bsd4.2.h).
>
>     m-dual.h    for dual 68000's (with s-unipl5.2.h).
>     m-nu.h      for TI nu machine (with s-usg5.2.h)
47c45
< #include "m-vax.h"
---
> #include "m-3b15.h"
48a47,49
> /* Load in the conversion definitions if this system
>    needs them and the source file being compiled has not
>    said to inhibit this.  */
50c51,55
< /* define HAVE_X_WINDOWS if you want to use the X window system */
---
> #ifdef SHORTNAMES
> #ifndef NO_SHORTNAMES
> #include "../shortnames/remap.h"
> #endif /* not NO_SHORTNAMES */
> #endif /* SHORTNAMES */
51a57,59
> /* define HAVE_X_WINDOWS if you want to use the X window system
>    for the Vaxstation-100.  */
>
79c87
< #define AMPERSAND_FULL_NAME
---
> #undef AMPERSAND_FULL_NAME

Sep 26 11:18 1986  diff of ./crt0.c in /u/4.3/usr/src/new/emacs/src and src Page 1


357a358,412
> #if u3b5 || u3b15 || u3b2
> 	asm("	.set	_exit,1*8");
>
> 	asm("	.globl	_start");
> 	asm("	.globl	_mcount");
> 	asm("	.globl	environ");
>
> 	asm("	.globl	__fpstart");
> 	asm("	.globl	main");
> 	asm("	.globl	exit");
>
> 	asm("_start:");
> 	/*
> 	 * Push argc
> 	 */
> 	asm("	PUSHW	0(%ap)		# argc");
> 	asm("	MOVAW	4(%ap),%r0");
> 	/*
> 	 * Push argv
> 	 */
> 	asm("	PUSHW	%r0		# argv");
> 	/*
> 	 * Increment the stack to as many as there
> 	 * are argv pointers.
> 	 */
> 	asm(".LL1:");
> 	asm("	TSTW	0(%r0)		# null args term ?");
> 	asm("	je	.LL2");
> 	asm("	ADDW2	&4,%r0");
> 	asm("	jmp	.LL1");
> 	asm(".LL2:");
> 	/*
> 	 * Set up the envp and store it in environ
> 	 */
> 	asm("	MOVAW	4(%r0),%r0");
> 	asm("	MOVW	%r0,environ");
> 	asm("	PUSHW	%r0	");
> 	asm("	CALL	0(%sp),__fpstart");
> 	asm("	CALL	-3*4(%sp),main");
> 	/*
> 	 * Pass the return value to exit()
> 	 */
> 	asm("	PUSHW	%r0");
> 	asm("	CALL	-1*4(%sp),exit");
> 	asm("	MOVW	&4,%r0");
> 	asm("	MOVW	&_exit,%r1");
> 	asm("	GATE");
> 	asm("_mcount:		");
> 	asm("	rsb		");
> 	asm("			");
> 	asm("	.data");
> 	asm("	.align	4");
> 	asm("environ:");
> 	asm("	.word	0");
> #endif /* u3b */

Sep 26 11:18 1986  diff of ./dired.c in /u/4.3/usr/src/new/emacs/src and src Page 1


156c156
<       while (dp = readdir (d))
---
>       while ((dp = readdir (d)) != (struct direct *) 0) /* Compiler Bug */

Sep 26 11:18 1986  diff of ./indent.c in /u/4.3/usr/src/new/emacs/src and src Page 1


272c272
< #ifdef celerity
---
> #if celerity || u3b || u3b2 || u3b5 || u3b15
Sep 26 11:18 1986  diff of ./lisp.h in /u/4.3/usr/src/new/emacs/src and src Page 1


236a237,245
> #if u3b15 || u3b5 || u3b2
> /*
>  * On a 3b15, data space has high order bit on.
>  */
>
> #define VALMASK (((1<<VALBITS) - 1) | (1 << 31))
>
> #else	/* u3b */
>
237a247,249
>
> #endif /* u3b15 */
>
249,250c261,262
< #define XTYPE(a) ((enum Lisp_Type) ((a) >> VALBITS))
< #define XSETTYPE(a, b) ((a)  =  ((a) & VALMASK)  +  ((int)(b) << VALBITS))
---
> #define XTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & 0X7F))
> #define XSETTYPE(a, b) ((a)  =  ((a) & VALMASK)  |  ((int)(b) << VALBITS))
255a268,272
> #if u3b15 || u3b5 || u3b2
> #define XINT(a) (((int_sign_xtnd=(a)) & 0x00800000) \
> 	? (int_sign_xtnd | 0xFF000000) : int_sign_xtnd & 0x00FFFFFF)
> #define XADDRFIX(a)	((a) |= 0X80000000)/* Because of high order */
> #else
256a274,275
> #endif /* u3b15 || u3b5 */
>
259,260c278,279
< #define XSETINT(a, b) ((a) = ((a) & ~VALMASK)  +  ((b) & VALMASK))
< #define XSETUINT(a, b) ((a) = ((a) & ~VALMASK)  +  ((b) & VALMASK))
---
> #define XSETINT(a, b) ((a) = ((a) & ~VALMASK)  |  ((b) & VALMASK))
> #define XSETUINT(a, b) ((a) = ((a) & ~VALMASK)  |  ((b) & VALMASK))
273c292
< #define XSETMARKBIT(a,b) ((a) = ((a) & ~MARKBIT) + (b))
---
> #define XSETMARKBIT(a,b) ((a) = ((a) & ~MARKBIT) | (b))
293c312,313
< #endif
---
> #define TO_XINT(a) ((a).s.val)
> #endif	/* EXPLICIT_SIGN_EXTEND */
449a470
> #if u3b || u3b2 || u3b15 || u3b5
450a472,477
>   { extern int pure[]; \
>     if (XUINT (obj) < (int) ((char *) pure + PURESIZE) \
> 	&& XUINT (obj) >= (int) pure) \
>       pure_write_error (); }
> #else
> #define CHECK_IMPURE(obj) \
453a481
> #endif /* u3b */
821a850,853

Sep 26 11:18 1986  diff of ./lisp.h in /u/4.3/usr/src/new/emacs/src and src Page 2


> #if u3b || u3b2 || u3b15 || u3b5
> extern int int_sign_xtnd;
> extern int char_sign_xtnd;
> #endif

Sep 26 11:19 1986  diff of ./malloc.c in /u/4.3/usr/src/new/emacs/src and src Page 1


124a125,127
> #if u3b || u3b2 || u3b15 || u3b5
> #define getpagesize() 2048
> #else /* u3b */
125a129
> #endif /* u3b */
248c252
<   if (!gotpool)
---
>   if (!gotpool) {
249a254
>   }

Sep 26 11:19 1986  diff of ./marker.c in /u/4.3/usr/src/new/emacs/src and src Page 1


180a181,184
> #if u3b15 || u3b5 || u3b2
>   if (NULL (marker))
> 	return 1;
> #endif


Sep 26 11:19 1986  diff of ./paths.h in /u/4.3/usr/src/new/emacs/src and src Page 1


2c2
< #define PATH_LOADSEARCH ":/usr/new/lib/emacs/lisp"
---
> #define PATH_LOADSEARCH ":/u/narayan/emacs/lisp"
6c6
< #define PATH_EXEC "/usr/new/lib/emacs/etc"
---
> #define PATH_EXEC "/u/narayan/emacs/etc"
12c12
< #define PATH_LOCK "/usr/new/lib/emacs/lock/"
---
> #define PATH_LOCK "/usr/spool/emacs/lock/"
16c16
< #define PATH_SUPERLOCK "/usr/new/lib/emacs/lock/!!!SuperLock!!!"
---
> #define PATH_SUPERLOCK "/usr/spool/emacs/lock/!!!SuperLock!!!"

Sep 26 11:19 1986  diff of ./process.c in /u/4.3/usr/src/new/emacs/src and src Page 1


44c44
< #if defined (USG) && !defined (UNIPLUS)
---
> #if defined (USG) && !defined (UNIPLUS) && !defined(TWG_WINS)



Sep 26 11:19 1986  diff of ./regex.c in /u/4.3/usr/src/new/emacs/src and src Page 1


1035c1035
<       if (p == pend)
---
>       if (p >= pend)


Sep 26 11:19 1986  diff of ./s-usg5.2.2.h in /u/4.3/usr/src/new/emacs/src and src Page 1


61d60
<
68c67
< /* #define HAVE_PTYS */
---
> #define HAVE_PTYS

Sep 26 11:19 1986  diff of ./sysdep.c in /u/4.3/usr/src/new/emacs/src and src Page 1


1275a1276,1278
> #if u3b || u3b15 || u3b2 || u3b5
> int int_sign_xtnd, char_sign_xtnd;
> #endif /* u3b */


Sep 26 11:20 1986  diff of ./terminfo.c in /u/4.3/usr/src/new/emacs/src and src Page 1


25c25
< char UP, BC, PC;
---
> char *UP, *BC, *PC;

Sep 26 11:20 1986  diff of ./unexec.c in /u/4.3/usr/src/new/emacs/src and src Page 1


305a306
> #ifndef COFF
315a317
> #endif /* COFF */
320a323,327
> #ifdef notdef
> 	/*
> 	 * This should really be ifdefed out.
> 	 * It is not portable. and not needed.
> 	 */
323a331
> #endif /* notdef */
519c527
<   lseek (new, (long) text_scnptr, 0);
---
>   (void) lseek (new, (long) text_scnptr, 0);
520a529,555
> #ifndef notdef
>   {	register int size;
> 	size = f_ohdr.tsize;
> 	if ((ret = write(new, ptr, size)) != size)
> 	{
> 	  sprintf (buf,
> 		   "unexec write failure: addr 0x%x, fileno %d, size 0x%x, wrote 0x%x, errno %d",
> 	   ptr, new, size, ret, errno);
> 	  PERROR (buf);
> 	}
> 	size = f_ohdr.dsize;
> 	ptr = (char *)f_ohdr.data_start;
> 	if ((ret = write(new, ptr, size)) != size)
> 	{
> 	  sprintf (buf,
> 		   "unexec write failure: addr 0x%x, fileno %d, size 0x%x, wrote 0x%x, errno %d",
> 	   ptr, new, size, ret, errno);
> 	  PERROR (buf);
> 	}
> 	
>    }
> #else	/* notdef */
> 	/*
> 	 * Should use the above version as it
> 	 * is more portable I think.
> 	 * This assumes that data follows text.
> 	 */
535a571
> #endif /* notdef */



=======================================================================
CHANGES.3B
=======================================================================

lisp.h		Mask values for 3b's are different.
		Changed GCTYPEBITS to be only 5 bits as there are
		only 23 lisp objects. So the 6th bit was used as the
		MARKBIT, and the 7th bit for dont_copy_flag (See alloc.c)

alloc.c		The value most_negative_fixednum was being used as
		both MARKBIT, and highorder bit. So I made this MARKBIT
		It was causing High order bit to be turned off.
		In 3b5/3B15 it is a part of the address field.

		In mark_object: after XSETSTRING we XADDRFIX

regex.c		re_match_2 changed if (p == pend) to if (p >= pend)

alloc.c		Pure Core was being exhausted. So I fixed some GC to
		trace objects only inside the PURE array

unexec.c	Fixed how core was being dumped to be more portable.
		Took data_start, and text_start from the original a.out

marker.c	In marker_position() return 1 if object passed is not
		Lisp_Marker (Could be Qnil).


===============================================================================
m-3b15.h also m-3b5.h and m-3b2.h
===============================================================================
/* m- file for 3b.
   Copyright (C) 1985 Richard M. Stallman.

This file is part of GNU Emacs.

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.  No author or distributor
accepts responsibility to anyone for the consequences of using it
or for whether it serves any particular purpose or works at all,
unless he says so in writing.  Refer to the GNU Emacs General Public
License for full details.

Everyone is granted permission to copy, modify and redistribute
GNU Emacs, but only under the conditions described in the
GNU Emacs General Public License.   A copy of this license is
supposed to have been given to you along with GNU Emacs so you
can know your rights and responsibilities.  It should be in a
file named COPYING.  Among other things, the copyright notice
and this notice must be preserved on all copies.  */


/* The following three symbols give information on
 the size of various data types.  */

#define SHORTBITS 16		/* Number of bits in a short */

#define INTBITS 32		/* Number of bits in an int */

#define LONGBITS 32		/* Number of bits in a long */

/* lowest numbered byte is least significant. */

#define BIG_ENDIAN

/* Define how to take a char and sign-extend into an int.
   On machines where char is signed, this is a no-op.  */

#define SIGN_EXTEND_CHAR(c) ((char_sign_xtnd=(c)) & 0x80 ? \
	char_sign_xtnd | 0xffffff00 : char_sign_xtnd)
#define EXPLICIT_SIGN_EXTEND


/* Use type int rather than a union, to represent Lisp_Object */

#define NO_UNION_TYPE

/* USG systems I know of running on Vaxes do not actually
   support the load average, so disable it for them.  */

/* Data type of load average, as read out of kmem.  */

#define LOAD_AVE_TYPE long	/* For the TWG TCP/IP */

/* Convert that into an integer that is 100 for a load average of 1.0  */

#define LOAD_AVE_CVT(x) ((int) ((x)))


/* sysV has alloca in the PW library.  */

#define LIB_STANDARD -lPW -lc
#define HAVE_ALLOCA

/* Define VIRT_ADDR_VARIES because the virtual addresses of
   pure and impure space as loaded can vary, and even their
   relative order cannot be relied on.  */

/* #define VIRT_ADDR_VARIES */

#if u3b15 || u3b5 || u3b2
/*
 * Can only use bits 29 thru 25 for Lisp object types
 * High order bit should be on for Data.
 */
#define GCTYPEBITS 5
#endif /* u3b5 */
-- 

Narayan Mohanram

Phone:		415-962 7170
ARPANET	 	twg-ap!narayan@lll-tis-b.ARPA
Usenet		{attunix, ihnp4}!amdahl!twg-ap!narayan
USnail		The Wollongong Group
		1129 San Antonio Road
		Palo Alto, CA 94303. USA



	=========================================================
	||	If you can't lick it, try some whipped cream	||
	=========================================================