Subject: Patches for NetBSD, developed on PC532, but compatible generally
To: None <phil@cs.wwu.edu>
From: Julian H Stacey <Julian.H.Stacey@regent.e-technik.tu-muenchen.de>
List: port-pc532
Date: 08/18/1994 16:52:53
Phil,
(CC port-pc532@sun-lamp.cs.berkeley.edu)
Here are some patches for NetBSD, developed on PC532, 
but hopefully compatible generally for other architectures.
Could you review & perhaps commit those you deem acceptable ? Thanks.

=======
make depend used to blow up cos > 1024 chars in files=.....

*** old/src/lib/libc/Makefile	Sun Aug 14 14:18:53 1994
--- new/src/lib/libc/Makefile	Sun Aug 14 13:57:06 1994
***************
*** 68,71 ****
--- 68,76 ----
  	for i in ${KMSRCS}; do rm -f ${LIBKERN}/arch/${MACHINE_ARCH}/$$i; done
  .endif
  
+ .if (${MACHINE_ARCH} == "ns32k")
+ depend:
+ 	echo patched out depend temporarily
+ 
+ .endif
  .include <bsd.lib.mk>
=======
*** old/src/gnu/usr.bin/gcc2/cc1/Makefile	Wed Aug 17 21:51:56 1994
--- new/src/gnu/usr.bin/gcc2/cc1/Makefile	Wed Aug 17 22:06:30 1994
***************
*** 6,9 ****
--- 6,19 ----
  SRCS=		c-parse.c c-lang.c c-lex.c c-pragma.c c-decl.c \
  		c-typeck.c c-convert.c c-aux-info.c c-iterate.c
  
+ .if ${MACHINE} == "pc532"
+ .if ${MACHINE_ARCH} == "ns32k"
+ install:
+ 	@echo "WARNING NetBSD uses gcc2.4.5, but its cc1 is no good for PC532"
+ 	@echo "Please manually make gcc-2.6.0 somewhere and install its cc1"
+ 	@# It's essential not to install a bad 2.4.5 cc1 as this generates
+ 	@# bad kernels (that create apparent 4 gig files etc).
+ .endif
+ .endif
+ 
  .include <../Makefile.cc1>
=======
There is no point on systems without loads of disc, 
of forcing the source tree to contain docs for other architectures,
which if the dirs are removed, will cause the make to break.
=======
*** old/src/share/man/man4/Makefile	Thu Aug  4 11:07:00 1994
--- new/src/share/man/man4/Makefile	Thu Aug 18 00:31:17 1994
***************
*** 5,10 ****
  	inet.0 ip.0 iso.0 lkm.0 lo.0 netintro.0 ns.0 nsip.0 null.0 pty.0 \
  	route.0 spp.0 tb.0 tcp.0 termios.0 tp.0 udp.0 unix.0
  MLINKS=	netintro.4 networking.4
! SUBDIR=	man4.hp300 man4.i386 man4.mac68k man4.tahoe man4.vax man4.sparc
  
  .include <bsd.prog.mk>
--- 5,28 ----
  	inet.0 ip.0 iso.0 lkm.0 lo.0 netintro.0 ns.0 nsip.0 null.0 pty.0 \
  	route.0 spp.0 tb.0 tcp.0 termios.0 tp.0 udp.0 unix.0
  MLINKS=	netintro.4 networking.4
! 
! .if ${MACHINE_ARCH} == "hp300"
! SUBDIR= man4.hp300
! .endif
! .if ${MACHINE_ARCH} == "i386"
! SUBDIR= man4.i386
! .endif
! .if ${MACHINE_ARCH} == "mac68k"
! SUBDIR= man4.mac68k
! .endif
! .if ${MACHINE_ARCH} == "tahoe"
! SUBDIR= man4.tahoe
! .endif
! .if ${MACHINE_ARCH} == "vax"
! SUBDIR= man4.vax
! .endif
! .if ${MACHINE_ARCH} == "sparc"
! SUBDIR= man4.sparc
! .endif
  
  .include <bsd.prog.mk>
=======
*** old/src/share/man/man8/Makefile	Fri Jun 17 10:13:00 1994
--- new/src/share/man/man8/Makefile	Thu Aug 18 00:38:31 1994
***************
*** 2,8 ****
  #	$Id: Makefile,v 1.6 1994/06/16 18:51:19 deraadt Exp $
  
  MAN8=	adduser.0 compat_sunos.0 intro.0 rc.0 sticky.0 yp.0
! SUBDIR=	man8.amiga man8.hp300 man8.i386 man8.mac68k man8.sparc\
! 	man8.tahoe man8.vax
  
  .include <bsd.prog.mk>
--- 2,28 ----
  #	$Id: Makefile,v 1.6 1994/06/16 18:51:19 deraadt Exp $
  
  MAN8=	adduser.0 compat_sunos.0 intro.0 rc.0 sticky.0 yp.0
! 
! .if ${MACHINE_ARCH} == "amiga"
! SUBDIR=	man8.amiga
! .endif
! .if ${MACHINE_ARCH} == "hp300"
! SUBDIR=	man8.hp300
! .endif
! .if ${MACHINE_ARCH} == "i386"
! SUBDIR=	man8.i386
! .endif
! .if ${MACHINE_ARCH} == "mac68k"
! SUBDIR=	man8.mac68k
! .endif
! .if ${MACHINE_ARCH} == "sparc"
! SUBDIR=	man8.sparc
! .endif
! .if ${MACHINE_ARCH} == "tahoe"
! SUBDIR=	man8.tahoe
! .endif
! .if ${MACHINE_ARCH} == "vax"
! SUBDIR=	man8.vax
! .endif
  
  .include <bsd.prog.mk>
=======
*** old/src/lib/libc/gen/Makefile.inc	Thu Jan  1 06:04:44 1970
--- new/src/lib/libc/gen/Makefile.inc	Thu Jan  1 06:08:52 1970
***************
*** 7,13 ****
  SRCS+=	alarm.c assert.c clock.c confstr.c ctermid.c ctime.c ctype_.c \
  	daemon.c devname.c difftime.c \
  	directory.c disklabel.c err.c errlst.c errno.c exec.c fnmatch.c \
! 	frexp.c fstab.c ftok.c fts.c \
  	getbsize.c getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \
  	gethostname.c getloadavg.c getlogin.c getmntinfo.c getnetgrent.c \
  	getpagesize.c getpass.c getpwent.c getsubopt.c getttyent.c \
--- 7,13 ----
  SRCS+=	alarm.c assert.c clock.c confstr.c ctermid.c ctime.c ctype_.c \
  	daemon.c devname.c difftime.c \
  	directory.c disklabel.c err.c errlst.c errno.c exec.c fnmatch.c \
! 	fstab.c ftok.c fts.c \
  	getbsize.c getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \
  	gethostname.c getloadavg.c getlogin.c getmntinfo.c getnetgrent.c \
  	getpagesize.c getpass.c getpwent.c getsubopt.c getttyent.c \
***************
*** 26,52 ****
  	waitpid.c
  
  .if   (${MACHINE_ARCH} == "m68k")
! SRCS+=	_setjmp.S alloca.S fabs.S ldexp.S modf.S setjmp.S
  SRCS+=	adddf3.S addsf3.S ashlsi3.S ashrsi3.S cmpdf2.S cmpsf2.S divdf3.S \
  	divsf3.S divsi3.S extendsfdf2.S fixdfsi.S fixunsdfsi.S \
  	floatsidf.S lshlsi3.S lshrsi3.S modsi3.S muldf3.S mulsf3.S mulsi3.S \
  	negdf2.S negsf2.S saveregs.c subdf3.S subsf3.S truncdfsf2.S udivsi3.S \
  	umodsi3.S umulsi3.S
  .elif (${MACHINE_ARCH} == "i386")
! SRCS+=	_setjmp.S alloca.S fabs.S ldexp.c modf.S setjmp.S sigsetjmp.S
  SRCS+=	divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S
  .elif (${MACHINE_ARCH} == "ns32k")
! SRCS+=	__main.c _setjmp.S alloca.S fabs.S frexp.S infinity.c isinf.c
  SRCS+=  ldexp.S modf.S setjmp.S
  .elif (${MACHINE_ARCH} == "tahoe")
  CFLAGS+=-I/sys
! SRCS+=	_setjmp.S alloca.S fabs.S ldexp.S modf.S setjmp.S
  SRCS+=	udiv.S urem.S
  .elif (${MACHINE_ARCH} == "vax")
! SRCS+=	_setjmp.S alloca.S fabs.S ldexp.S modf.S setjmp.S
  SRCS+=	udiv.S urem.S
  .elif (${MACHINE_ARCH} == "sparc")
! SRCS+=	_setjmp.S fabs.S frexp.c infinity.c isnan.c ldexp.c modf.S
  SRCS+=	fixunsdfsi.S mul.S umul.S saveregs.S setjmp.S
  .endif
  
--- 26,52 ----
  	waitpid.c
  
  .if   (${MACHINE_ARCH} == "m68k")
! SRCS+=	_setjmp.S alloca.S fabs.S ldexp.S modf.S setjmp.S frexp.c
  SRCS+=	adddf3.S addsf3.S ashlsi3.S ashrsi3.S cmpdf2.S cmpsf2.S divdf3.S \
  	divsf3.S divsi3.S extendsfdf2.S fixdfsi.S fixunsdfsi.S \
  	floatsidf.S lshlsi3.S lshrsi3.S modsi3.S muldf3.S mulsf3.S mulsi3.S \
  	negdf2.S negsf2.S saveregs.c subdf3.S subsf3.S truncdfsf2.S udivsi3.S \
  	umodsi3.S umulsi3.S
  .elif (${MACHINE_ARCH} == "i386")
! SRCS+=	_setjmp.S alloca.S fabs.S ldexp.c modf.S setjmp.S sigsetjmp.S frexp.c
  SRCS+=	divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S
  .elif (${MACHINE_ARCH} == "ns32k")
! SRCS+=	__main.c _setjmp.S alloca.S fabs.S frexp.S infinity.c isinf.c frexp.S
  SRCS+=  ldexp.S modf.S setjmp.S
  .elif (${MACHINE_ARCH} == "tahoe")
  CFLAGS+=-I/sys
! SRCS+=	_setjmp.S alloca.S fabs.S ldexp.S modf.S setjmp.S frexp.c
  SRCS+=	udiv.S urem.S
  .elif (${MACHINE_ARCH} == "vax")
! SRCS+=	_setjmp.S alloca.S fabs.S ldexp.S modf.S setjmp.S frexp.c
  SRCS+=	udiv.S urem.S
  .elif (${MACHINE_ARCH} == "sparc")
! SRCS+=	_setjmp.S fabs.S frexp.c infinity.c isnan.c ldexp.c modf.S frexp.c
  SRCS+=	fixunsdfsi.S mul.S umul.S saveregs.S setjmp.S
  .endif
=======


THIS FOLLOWING PATCH IS A HORRIBLE TEMPORARY CLUDGE,
It should not be commited to NetBSD sources, but is aimed as
a temporary solution & discussion point.
=======
*** old/src/sys/arch/pc532/dev/scn.c	Mon Jul 11 14:15:32 1994
--- new/src/sys/arch/pc532/dev/scn.c	Mon Jul 11 23:53:20 1994
***************
*** 177,182 ****
--- 177,187 ----
    int out_code;
    int x;
  
+ #ifdef PC532
+ 	data_bits = LC_BITS8 ;
+ 	parity = LC_NONE ;
+ 	stop_bits = LC_STOP1 ;
+ #endif
    /* Get the speed codes. */
    getspeedcode(in_speed,in_code);
    getspeedcode(out_speed,out_code);
=======

--
Julian Stacey,
<stacey@freefall.cdrom.com>	Tel. +49 89 268616  ( TZ=GMT+1 )
Alternates:	<julian@pcsbst.pcs.com>,<jhs@regent.e-technik.tu-muenchen.de>

------------------------------------------------------------------------------