Index: bin/ps/ps.c ================================================================== --- bin/ps/ps.c +++ bin/ps/ps.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)ps.c 5.5 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)ps.c 5.4 (Berkeley) 09/07/85"; #endif not lint #include #include #include @@ -154,11 +154,11 @@ char *psdb = "/etc/psdatabase"; #else char *psdb = PSFILE; #endif -int chkpid = -1; +int chkpid; int aflg, cflg, eflg, gflg, kflg, lflg, nflg, sflg, uflg, vflg, xflg, Uflg; int nchans; /* total # of wait channels */ char *tptr; char *gettty(), *getcmd(), *getname(), *savestr(), *state(); @@ -361,11 +361,11 @@ if (tptr == 0 && gflg == 0 && xflg == 0 && mproc->p_ppid == 1) continue; if (uid != mproc->p_uid && aflg==0) continue; - if (chkpid != -1 && chkpid != mproc->p_pid) + if (chkpid != 0 && chkpid != mproc->p_pid) continue; if (vflg && gflg == 0 && xflg == 0) { if (mproc->p_stat == SZOMB || mproc->p_flag&SWEXIT) continue; Index: bin/rm/rm.c ================================================================== --- bin/rm/rm.c +++ bin/rm/rm.c @@ -1,6 +1,6 @@ -static char *sccsid = "@(#)rm.c 4.18 (Berkeley) 01/06/86"; +static char *sccsid = "@(#)rm.c 4.17 (Berkeley) 11/05/85"; /* * rm - for ReMoving files, directories & trees. */ @@ -55,11 +55,11 @@ fprintf(stderr, "usage: rm [-rif] file ...\n"); exit(1); } } - if (argc < 2 && !fflg) { + if (argc < 2) { fprintf(stderr, "usage: rm [-rif] file ...\n"); exit(1); } while (--argc > 0) Index: bin/stty/stty.1 ================================================================== --- bin/stty/stty.1 +++ bin/stty/stty.1 @@ -1,10 +1,10 @@ .\" Copyright (c) 1983 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)stty.1 6.3 (Berkeley) 01/09/86 +.\" @(#)stty.1 6.2 (Berkeley) 08/13/85 .\" .TH STTY 1 "" .UC 4 .SH NAME stty \- set terminal options @@ -15,27 +15,14 @@ .I Stty sets certain I/O options on the current output terminal, placing its output on the diagnostic output. With no argument, it reports the speed of the terminal and the settings of the options which are different from their defaults. -Use of one of the following options modifies the output as described: -.TP 10 -.B all -All normally used option settings are reported. -.TP 10 -.B everything -Everything +With the argument ``all'', all normally used option settings are reported. +With the argument ``everything'', everything .I stty knows about is printed. -.TP 10 -.B speed -The terminal speed alone is printed on the standard output. -.TP 10 -.B size -The terminal (window) sizes are printed on the standard output, -first rows and then columns. -.sp The option strings are selected from the following set: .TP 10 .B even allow even parity input @@ -202,11 +189,11 @@ .TP 10 .BI brk \ c\fR set break character to .I c (default undefined.) -This character is an additional character causing wakeup. +This character is an extra wakeup causing character. .br .ns .TP 10 .B cr0 cr1 cr2 cr3 .br @@ -281,19 +268,10 @@ .TP 10 .B "50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 exta extb" .br Set terminal baud rate to the number given, if possible. (These are the speeds supported by the DH-11 interface). -.TP 10 -.BI rows \ n\fR -The terminal size is recorded as having -.I n -rows. -.BI columns \ n\fR -The terminal size is recorded as having -.I n -columns. .PP A teletype driver which supports the job control processing of .IR csh (1) and more functionality than the basic driver is fully described in .IR tty (4). Index: bin/stty/stty.c ================================================================== --- bin/stty/stty.c +++ bin/stty/stty.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)stty.c 5.3 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)stty.c 5.2 (Berkeley) 08/13/85"; #endif not lint /* * set teletype modes */ @@ -285,15 +285,10 @@ if (eq("columns")) { if (--argc == 0) goto done; win.ws_col = atoi(*++argv); } - if (eq("size")) { - ioctl(open("/dev/tty", 0), TIOCGWINSZ, &win); - printf("%d %d\n", win.ws_row, win.ws_col); - exit(0); - } for(i=0; speeds[i].string; i++) if(eq(speeds[i].string)) { mode.sg_ispeed = mode.sg_ospeed = speeds[i].speed; goto cont; } Index: games/backgammon/backgammon/Mesgfix ================================================================== --- games/backgammon/backgammon/Mesgfix +++ games/backgammon/backgammon/Mesgfix @@ -1,17 +1,16 @@ -1,5c /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ -. -/Msccsid/c -static char Msccsid[] = "@(#)Mesgfix 5.2 (Berkeley) 01/08/86"; -. -/Last update/!date -mark a + +#ifndef lint +static char sccsid[] = "@(#)Mesgfix 5.1 (Berkeley) 05/29/85"; +#endif not lint + +4!date g/Sun /s//Sunday, / g/Mon /s//Monday, / g/Tue /s//Tuesday, / g/Wed /s//Wednesday, / g/Thu /s//Thursday, / @@ -27,10 +26,10 @@ g/Sep /s//September / g/Oct /s//October / g/Nov /s//November / g/Dec /s//December / g/ /s// / -'as/ ..:..:.. .../,/ -'as/^/ "Last update on / -'as/$/.",/ +4s/ ..:..:.. .../,/ +4s/^/ "Last update on / +4s/$/.",/ w! q Index: games/backgammon/common_source/message.c ================================================================== --- games/backgammon/common_source/message.c +++ games/backgammon/common_source/message.c @@ -1,16 +1,7 @@ -/* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. - */ - -#ifndef lint -static char Msccsid[] = "@(#)Mesgfix 5.1 (Berkeley) 5/29/85"; -static char sccsid[] = "@(#)message.c 4.2 (Berkeley) 01/08/86"; -#endif not lint +static char sccsid[] = " message.c 4.1 82/05/11 "; char *message[] = { - "Last update on Saturday, March 30, 1985.", + "Last update on Tuesday, September 16, 1980.", "Check the file /usr/public/gammon.news for details.", 0 }; Index: include/Makefile ================================================================== --- include/Makefile +++ include/Makefile @@ -1,11 +1,11 @@ # # Copyright (c) 1980 Regents of the University of California. # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # -# @(#)Makefile 5.10 (Berkeley) 86/01/10 +# @(#)Makefile 5.9 (Berkeley) 85/08/08 # # Doing a make install builds /usr/include # # Define SHARED to indicate whether you want # symbolic links to the system source (``symlinks''), @@ -64,23 +64,23 @@ done rm -rf ${DESTDIR}/usr/include/sys ln -s /sys/h ${DESTDIR}/usr/include/sys copies: - -for i in ${SYSDIRS}; do \ + for i in ${SYSDIRS}; do \ rm -rf ${DESTDIR}/usr/include/$$i; \ cd /sys; \ tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \ done rm -rf ${DESTDIR}/usr/include/sys; mkdir ${DESTDIR}/usr/include/sys; chmod 775 ${DESTDIR}/usr/include/sys; - -(cd /sys/h; tar cf - *.h | (cd ${DESTDIR}/usr/include/sys; tar xpfB -)) + (cd /sys/h; tar cf - *.h | (cd ${DESTDIR}/usr/include/sys; tar xpfB -)) tags: cwd=/usr/include; \ for i in ${STD} ${LINKS}; do \ ctags -a -f ${TAGSFILE} $$cwd/$$i; \ done clean: rm -f tags Index: include/arpa/nameser.h ================================================================== --- include/arpa/nameser.h +++ include/arpa/nameser.h @@ -1,11 +1,11 @@ /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)nameser.h 5.9 (Berkeley) 01/08/86 + * @(#)nameser.h 5.7 (Berkeley) 11/01/85 */ /* * Define constants based on rfc883 */ @@ -29,15 +29,15 @@ #define QUERY 0 /* standard query */ #define IQUERY 1 /* inverse query */ #define CQUERYM 2 /* completion query (multiple) */ #define CQUERYU 3 /* completion query (unique) */ /* non standard */ -#define UPDATEA 100 /* add resource record */ -#define UPDATED 101 /* delete resource record */ -#define UPDATEM 102 /* modify resource record */ -#define ZONEINIT 103 /* initial zone transfer */ -#define ZONEREF 104 /* incremental zone referesh */ +#define UPDATEA 11 /* add resource record */ +#define UPDATED 12 /* delete resource record */ +#define UPDATEM 13 /* modify resource record */ +#define ZONEINIT 14 /* initial zone transfer */ +#define ZONEREF 15 /* incremental zone referesh */ /* * Currently defined response codes */ #define NOERROR 0 /* no error */ @@ -45,11 +45,11 @@ #define SERVFAIL 2 /* server failure */ #define NXDOMAIN 3 /* non existent domain */ #define NOTIMP 4 /* not implemented */ #define REFUSED 5 /* query refused */ /* non standard */ -#define NOCHANGE 100 /* update failed to change db */ +#define NOCHANGE 15 /* update failed to change db */ /* * Type values for resources and queries */ #define T_A 1 /* host address */ @@ -64,15 +64,14 @@ #define T_NULL 10 /* null resource record */ #define T_WKS 11 /* well known service */ #define T_PTR 12 /* domain name pointer */ #define T_HINFO 13 /* host information */ #define T_MINFO 14 /* mailbox information */ -#define T_MX 15 /* mail routing information */ /* non standard */ -#define T_UINFO 100 /* user (finger) information */ -#define T_UID 101 /* user ID */ -#define T_GID 102 /* group ID */ +#define T_UINFO 15 /* user (finger) information */ +#define T_UID 16 /* user ID */ +#define T_GID 17 /* group ID */ /* Query type values which do not appear in resource records */ #define T_AXFR 252 /* transfer zone of authority */ #define T_MAILB 253 /* transfer mailbox records */ #define T_MAILA 254 /* transfer mail agent records */ #define T_ANY 255 /* wildcard match */ Index: lib/libc/compat-43/sigvec.2 ================================================================== --- lib/libc/compat-43/sigvec.2 +++ lib/libc/compat-43/sigvec.2 @@ -1,10 +1,10 @@ .\" Copyright (c) 1980 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)sigvec.2 6.3 (Berkeley) 01/08/86 +.\" @(#)sigvec.2 6.2 (Berkeley) 06/30/85 .\" .TH SIGVEC 2 "" .UC 4 .ie t .ds d \(dg .el .ds d \z'|+' @@ -135,12 +135,10 @@ SIGXCPU 24 cpu time limit exceeded (see \fIsetrlimit\fP(2)) SIGXFSZ 25 file size limit exceeded (see \fIsetrlimit\fP(2)) SIGVTALRM 26 virtual time alarm (see \fIsetitimer\fP(2)) SIGPROF 27 profiling timer alarm (see \fIsetitimer\fP(2)) SIGWINCH 28\*b window size change -SIGUSR1 30 user defined signal 1 -SIGUSR2 31 user defined signal 2 .fi .PP The starred signals in the list above cause a core image if not caught or ignored. .PP Index: lib/libc/gen/setjmp.3 ================================================================== --- lib/libc/gen/setjmp.3 +++ lib/libc/gen/setjmp.3 @@ -1,10 +1,10 @@ .\" Copyright (c) 1980 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)setjmp.3 6.2 (Berkeley) 01/09/86 +.\" @(#)setjmp.3 6.1 (Berkeley) 05/15/85 .\" .TH SETJMP 3 "" .UC 4 .SH NAME setjmp, longjmp \- non-local goto @@ -59,24 +59,13 @@ while .I _setjmp and .I _longjmp manipulate only the C stack and registers. -.SH ERRORS -.PP -If the contents of the -.B jmp_buf -are corrupted, or correspond to an environment that has already returned, -.I longjmp -calls the routine -.IR longjmperror . -If -.I longjmperror -returns the program is aborted. -The default version of -.I longjmperror -prints the message ``longjmp botch'' to standard error and returns. -User programs wishing to exit more gracefully can write their own -versions of -.IR longjmperror . .SH "SEE ALSO" sigvec(2), sigstack(2), signal(3) +.SH BUGS +.I Setjmp +does not save current notion of whether the process is +executing on the signal stack. The result is that a +longjmp to some place on the signal stack leaves the +signal stack state incorrect. DELETED lib/libc/gen/setjmperr.c Index: lib/libc/gen/setjmperr.c ================================================================== --- lib/libc/gen/setjmperr.c +++ lib/libc/gen/setjmperr.c @@ -1,23 +0,0 @@ -/* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. - */ - -#ifndef lint -static char sccsid[] = "@(#)setjmperr.c 5.1 (Berkeley) 01/09/86"; -#endif not lint - -#define ERRMSG "longjmp botch\n" - -/* - * This routine is called from longjmp() when an error occurs. - * Programs that wish to exit gracefully from this error may - * write their own versions. - * If this routine returns, the program is aborted. - */ -longjmperror() -{ - - write(2, ERRMSG, sizeof(ERRMSG)); -} Index: lib/libc/gen/signal.3 ================================================================== --- lib/libc/gen/signal.3 +++ lib/libc/gen/signal.3 @@ -1,10 +1,10 @@ .\" Copyright (c) 1980 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)signal.3 6.3 (Berkeley) 01/08/86 +.\" @(#)signal.3 6.2 (Berkeley) 11/06/85 .\" .TH SIGNAL 3C "" .UC 4 .ie t .ds d \(dg .el .ds d \z'|+' @@ -78,12 +78,12 @@ SIGXCPU 24 cpu time limit exceeded (see \fIsetrlimit\fP(2)) SIGXFSZ 25 file size limit exceeded (see \fIsetrlimit\fP(2)) SIGVTALRM 26 virtual time alarm (see \fIsetitimer\fP(2)) SIGPROF 27 profiling timer alarm (see \fIsetitimer\fP(2)) SIGWINCH 28\*b Window size change -SIGUSR1 30 User defined signal 1 -SIGUSR2 31 User defined signal 2 +SIGUSR1 30\*b User defined signal 1 +SIGUSR2 31\*b User defined signal 2 .fi .PP The starred signals in the list above cause a core image if not caught or ignored. .PP DELETED lib/libc/gen/ualarm.3 Index: lib/libc/gen/ualarm.3 ================================================================== --- lib/libc/gen/ualarm.3 +++ lib/libc/gen/ualarm.3 @@ -1,52 +0,0 @@ -.\" Copyright (c) 1980 Regents of the University of California. -.\" All rights reserved. The Berkeley software License Agreement -.\" specifies the terms and conditions for redistribution. -.\" -.\" @(#)@(#)ualarm.3 6.1 (Berkeley) 01/09/86 -.\" -.TH UALARM 3 "" -.UC 6 -.SH NAME -ualarm \- schedule signal after specified time -.SH SYNOPSIS -.nf -.B ualarm(value, interval) -.B unsigned value; -.B unsigned interval; -.fi -.SH DESCRIPTION -.ft B -This is a simplified interface to setitimer(2). -.ft R -.PP -.I Ualarm -causes signal SIGALRM, see -.IR signal (3C), -to be sent to the invoking process -in a number of microseconds given by the -.I value -argument. -Unless caught or ignored, the signal terminates the process. -.PP -If the -.I interval -argument is non-zero, the SIGALRM signal will be sent -to the process every -.I interval -microseconds after the timer expires (e.g. after -.I value -microseconds have passed). -.PP -Because of scheduling delays, -resumption of execution of when the signal is -caught may be delayed an arbitrary amount. -The longest specifiable delay time (on the vax) is 2147483647 microseconds. -.PP -The return value is the amount of time previously remaining in the alarm clock. -.sh BUGS -This routine is expensive to use because it is implemented using -.IR setitimer (2) -and does eight system calls each time it is invoked. -.SH "SEE ALSO" -getitimer(2), setitimer(2), sigpause(2), sigvec(2), signal(3C), sleep(3), -alarm(3), ualarm(3) DELETED lib/libc/gen/usleep.3 Index: lib/libc/gen/usleep.3 ================================================================== --- lib/libc/gen/usleep.3 +++ lib/libc/gen/usleep.3 @@ -1,36 +0,0 @@ -.\" Copyright (c) 1980 Regents of the University of California. -.\" All rights reserved. The Berkeley software License Agreement -.\" specifies the terms and conditions for redistribution. -.\" -.\" @(#)@(#)usleep.3 6.1 (Berkeley) 01/09/86 -.\" -.TH USLEEP 3 "" -.UC 6 -.SH NAME -usleep \- suspend execution for interval -.SH SYNOPSIS -.nf -.B usleep(useconds) -.B unsigned useconds; -.fi -.SH DESCRIPTION -The current process is suspended from execution for the number -of microseconds specified by the argument. -The actual suspension time may be an arbitrary amount longer -because of other activity in the system. -.PP -The routine is implemented by setting an interval timer -and pausing until it occurs. -The previous state of this timer is saved and restored. -If the sleep time exceeds the time to the expiration of the -previous timer, -the process sleeps only until the signal would have occurred, and the -signal is sent 2 system clock ticks later. -.sh BUGS -This routine is expensive to use because it is implemented using -.IR setitimer (2) -and does eight system calls each time it is invoked. -It should be implemented using -.IR select (2). -.SH "SEE ALSO" -setitimer(2), getitimer(2), sigpause(2), ualarm(3), sleep(3), alarm(3) Index: lib/libc/net/SCCS/hosttable/gethostnamadr.c ================================================================== --- lib/libc/net/SCCS/hosttable/gethostnamadr.c +++ lib/libc/net/SCCS/hosttable/gethostnamadr.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)gethostnamadr.c 5.4 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)gethostnamadr.c 5.3 (Berkeley) 12/10/85"; #endif not lint #include #include #include @@ -19,12 +19,10 @@ static struct hostent host; static char *host_aliases[MAXALIASES]; static char hostbuf[BUFSIZ+1]; static char *host_addrs[2]; -int h_errno; - /* * The following is shared with gethostent.c */ extern char *_host_file; DBM *_host_db = (DBM *)NULL; @@ -102,12 +100,10 @@ hp = fetchhost(key); if (!_host_stayopen) { dbm_close(_host_db); _host_db = (DBM *)NULL; } - if ( hp == NULL) - h_errno = HOST_NOT_FOUND; return (hp); } struct hostent * gethostbyaddr(addr, length, type) @@ -126,20 +122,16 @@ && bcmp(hp->h_addr, addr, length) == 0) break; } if (!_host_stayopen) endhostent(); - if ( hp == NULL) - h_errno = HOST_NOT_FOUND; return (hp); } key.dptr = addr; key.dsize = length; hp = fetchhost(key); if (!_host_stayopen) { dbm_close(_host_db); _host_db = (DBM *)NULL; } - if ( hp == NULL) - h_errno = HOST_NOT_FOUND; return (hp); } Index: lib/libc/net/res_debug.c ================================================================== --- lib/libc/net/res_debug.c +++ lib/libc/net/res_debug.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)res_debug.c 5.9 (Berkeley) 01/08/86"; +static char sccsid[] = "@(#)res_debug.c 5.8 (Berkeley) 12/01/85"; #endif not lint #if defined(lint) && !defined(DEBUG) #define DEBUG #endif @@ -266,17 +266,10 @@ cp += sizeof(u_long); fprintf(file,", min=%ld\n", getlong(cp)); cp += sizeof(u_long); break; - case T_MX: - fprintf(file,"\tname = "); - cp = p_cdname(cp, msg, file); - fprintf(file,", preference = %ld",getlong(cp)); - cp += sizeof(u_long); - break; - case T_MINFO: fprintf(file,"\trequests = "); cp = p_cdname(cp, msg, file); fprintf(file,"\n\terrors = "); cp = p_cdname(cp, msg, file); @@ -350,12 +343,10 @@ return("SOA"); case T_MB: /* mailbox domain name */ return("MB"); case T_MG: /* mail group member */ return("MG"); - case T_MX: /* mail routing info */ - return("MX"); case T_MR: /* mail rename name */ return("MR"); case T_NULL: /* null resource record */ return("NULL"); case T_WKS: /* well known service */ Index: lib/libc/net/resolver.3 ================================================================== --- lib/libc/net/resolver.3 +++ lib/libc/net/resolver.3 @@ -1,10 +1,10 @@ .\" Copyright (c) 1985 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)resolver.3 1.3 (Berkeley) 01/07/86 +.\" @(#)resolver.3 1.2 (Berkeley) 10/30/85 .\" .TH RESOLVER 3 "15 November 1985" .UC 4 .SH NAME res_mkquery, res_send, res_init, dn_comp, dn_expand \- resolver routines @@ -171,8 +171,15 @@ .I dnptr is NULL, we don't try to compress names. If .I lastdnptr is NULL, we don't update the list. .SH FILES -/etc/resolv.conf see resolver(5) +resolv.conf Contains the default resolver information read by res_init. +There are two types of records in this file, domain and name server. +The domain record specifies the default domain for the resolver to use. +You can have multiple name server records to designate the name servers +addresses you would like the resolver to try. By using this +file you don't have to have a name server actually running on your system +and you can have a back up name server to try in the event your local server +is not responsive. .SH "SEE ALSO" -named(8), resolver(5), RFC882, RFC883 +named(8), RFC882, RFC883 Index: lib/libc/stdlib/malloc.c ================================================================== --- lib/libc/stdlib/malloc.c +++ lib/libc/stdlib/malloc.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)malloc.c 5.4 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)malloc.c 5.2 (Berkeley) 10/11/85"; #endif not lint /* * malloc.c (Caltech) 2/21/82 * Chris Kingsley, kingsley@cit-20. @@ -80,19 +80,18 @@ */ static u_int nmalloc[NBUCKETS]; #include #endif -#if defined(DEBUG) || defined(RCHECK) +#ifdef DEBUG #define ASSERT(p) if (!(p)) botch("p") -#include static botch(s) char *s; { - fprintf(stderr, "\r\nassertion botched: %s\r\n", s); - (void) fflush(stderr); /* just in case user buffered it */ + + printf("assertion botched: %s\n", s); abort(); } #else #define ASSERT(p) #endif @@ -145,12 +144,10 @@ amt = pagesz; bucket = pagebucket; } while (nbytes > amt + n) { amt <<= 1; - if (amt == 0) - return (NULL); bucket++; } /* * If nothing in hash bucket right now, * request more memory from the system. @@ -180,25 +177,20 @@ } /* * Allocate more memory to the indicated bucket. */ +static morecore(bucket) int bucket; { register union overhead *op; register int sz; /* size of desired block */ - int amt; /* amount to allocate */ - int nblks; /* how many blocks we get */ - - /* - * sbrk_size <= 0 only for big, FLUFFY, requests (about - * 2^30 bytes on a VAX, I think) or for a negative arg. - */ - sz = 1 << (bucket + 3); - if (sz <= 0) - return; + register int amt; /* amount to allocate */ + register int nblks; /* how many blocks we get */ + + sz = 1 << (bucket + 3); if (sz < pagesz) { amt = pagesz; nblks = amt / sz; } else { amt = sz + pagesz; @@ -284,18 +276,19 @@ * free list. First, check the most common * case (last element free'd), then (this failing) * the last ``realloc_srchlen'' items free'd. * If all lookups fail, then assume the size of * the memory block being realloc'd is the - * largest possible (so that all "nbytes" of new - * memory are copied into). Note that this could cause - * a memory fault if the old area was tiny, and the moon - * is gibbous. However, that is very unlikely. + * smallest possible. */ if ((i = findbucket(op, 1)) < 0 && (i = findbucket(op, realloc_srchlen)) < 0) - i = NBUCKETS; +#ifndef RCHECK + i = 0; +#else + i = 1; /* smallest possible w/ RCHECK */ +#endif } onb = 1 << (i + 3); if (onb < pagesz) onb -= sizeof (*op) + RSLOP; else @@ -318,11 +311,11 @@ } else free(cp); } if ((res = malloc(nbytes)) == NULL) return (NULL); - if (cp != res) /* common optimization if "compacting" */ + if (cp != res) /* common optimization */ bcopy(cp, res, (nbytes < onb) ? nbytes : onb); return (res); } /* Index: lib/libc/sys/Xsetregid.2 ================================================================== --- lib/libc/sys/Xsetregid.2 +++ lib/libc/sys/Xsetregid.2 @@ -1,24 +1,20 @@ .\" Copyright (c) 1983 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)Xsetregid.2 6.2 (Berkeley) 01/07/86 +.\" @(#)Xsetregid.2 6.1 (Berkeley) 05/15/85 .\" .TH SETREGID 2 "" .UC 5 .SH NAME setregid \- set real and effective group ID .SH SYNOPSIS -.nf -.ft B -#include -.PP .ft B setregid(rgid, egid) .br -gid_t rgid, egid; +int rgid, egid; .ft R .SH DESCRIPTION The real and effective group ID's of the current process are set to the arguments. Unprivileged users may change the real group Index: lib/libc/sys/getgid.2 ================================================================== --- lib/libc/sys/getgid.2 +++ lib/libc/sys/getgid.2 @@ -1,28 +1,24 @@ .\" Copyright (c) 1983 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)getgid.2 6.2 (Berkeley) 01/07/86 +.\" @(#)getgid.2 6.1 (Berkeley) 05/15/85 .\" .TH GETGID 2 "" .UC 5 .SH NAME getgid, getegid \- get group identity .SH SYNOPSIS -.nf -.ft B -#include -.PP .nf .ft B gid = getgid() -gid_t gid; +int gid; .PP .ft B egid = getegid() -gid_t egid; +int egid; .fi .SH DESCRIPTION .I Getgid returns the real group ID of the current process, .I getegid Index: lib/libc/sys/getuid.2 ================================================================== --- lib/libc/sys/getuid.2 +++ lib/libc/sys/getuid.2 @@ -1,28 +1,24 @@ .\" Copyright (c) 1980 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)getuid.2 6.3 (Berkeley) 01/07/86 +.\" @(#)getuid.2 6.2 (Berkeley) 06/28/85 .\" .TH GETUID 2 "" .UC 4 .SH NAME getuid, geteuid \- get user identity .SH SYNOPSIS -.nf -.ft B -#include -.PP .ft B .nf uid = getuid() -uid_t uid; +int uid; .PP .ft B euid = geteuid() -uid_t euid; +int euid; .fi .SH DESCRIPTION .I Getuid returns the real user ID of the current process, .I geteuid Index: lib/libc/sys/setuid.2 ================================================================== --- lib/libc/sys/setuid.2 +++ lib/libc/sys/setuid.2 @@ -1,33 +1,24 @@ .\" Copyright (c) 1983 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)setuid.2 6.2 (Berkeley) 01/07/86 +.\" @(#)setuid.2 6.1 (Berkeley) 05/15/85 .\" .TH SETUID 3 "" .UC 5 .SH NAME setuid, seteuid, setruid, setgid, setegid, setrgid \- set user and group ID .SH SYNOPSIS .nf -.ft B -#include -.PP -.ft B -.nf -setuid(uid) -seteuid(euid) -setruid(ruid) -uid_t uid, euid, ruid; -.PP -.ft B -.nf -setgid(gid) -setegid(egid) -setrgid(rgid) -gid_t gid, egid, rgid; +.B setuid(uid) +.B seteuid(euid) +.B setruid(ruid) +.PP +.B setgid(gid) +.B setegid(egid) +.B setrgid(rgid) .fi .SH DESCRIPTION .I Setuid .RI ( setgid ) sets both the real and effective Index: lib/libc/sys/socket.2 ================================================================== --- lib/libc/sys/socket.2 +++ lib/libc/sys/socket.2 @@ -1,10 +1,10 @@ .\" Copyright (c) 1983 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)socket.2 6.3 (Berkeley) 01/07/86 +.\" @(#)socket.2 6.2 (Berkeley) 06/30/85 .\" .TH SOCKET 2 "" .UC 5 .SH NAME socket \- create an endpoint for communication @@ -33,11 +33,11 @@ .RS .nf .ta 1.25i 1.75i AF_UNIX (UNIX path names), AF_INET (ARPA Internet addresses), -AF_NS (Xerox Network Systems addresses), and +AF_PUP (Xerox PUP-I Internet addresses), and AF_IMPLINK (IMP \*(lqhost at IMP\*(rq addresses). .fi .RE .PP The socket has the indicated @@ -59,20 +59,14 @@ two-way connection based byte streams with an out-of-band data transmission mechanism. A SOCK_DGRAM socket supports datagrams (connectionless, unreliable messages of a fixed (typically small) maximum length). -A SOCK_SEQPACKET socket may provide a sequenced, reliable, -two-way connection-based data transmission path for datagrams -of fixed maximum length; a consumer may be required to read -an entire packet with each read system call. -This facility is protocol specific, and presently implemented -only for AF_NS. SOCK_RAW sockets provide access to internal network interfaces. The types SOCK_RAW, which is available only to the super-user, and -SOCK_RDM, which is planned, +SOCK_SEQPACKET and SOCK_RDM, which are planned, but not yet implemented, are not described here. .PP The .I protocol specifies a particular protocol to be used with the socket. @@ -126,17 +120,10 @@ idle connection for a extended period (e.g. 5 minutes). A SIGPIPE signal is raised if a process sends on a broken stream; this causes naive processes, which do not handle the signal, to exit. .PP -SOCK_SEQPACKET sockets employ the same system calls -as SOCK_STREAM sockets. The only difference -is that -.IR read (2) -calls will return only the amount of data requested, -and any remaining in the arriving packet will be discarded. -.PP SOCK_DGRAM and SOCK_RAW sockets allow sending of datagrams to correspondents named in .IR send (2) calls. It is also possible to receive datagrams at Index: lib/libc/vax/gen/_setjmp.s ================================================================== --- lib/libc/vax/gen/_setjmp.s +++ lib/libc/vax/gen/_setjmp.s @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint - .asciz "@(#)_setjmp.s 5.3 (Berkeley) 01/09/86" + .asciz "@(#)_setjmp.s 5.2 (Berkeley) 06/05/85" #endif not lint /* * C library -- _setjmp, _longjmp @@ -66,7 +66,15 @@ addl2 $8,sp # compensate for PSL-PC push 4: jmp *4(r1) # done, return.... botch: - calls $0,_longjmperror + pushl $msgend-msg + pushl $msg + pushl $2 + calls $3,_write halt + + .data +msg: .ascii "_longjmp botch\n" +msgend: +reiins: rei Index: lib/libc/vax/gen/setjmp.s ================================================================== --- lib/libc/vax/gen/setjmp.s +++ lib/libc/vax/gen/setjmp.s @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint - .asciz "@(#)setjmp.s 5.4 (Berkeley) 01/09/86" + .asciz "@(#)setjmp.s 5.3 (Berkeley) 08/16/85" #endif not lint /* * C library -- setjmp, longjmp * @@ -85,7 +85,14 @@ pushl r1 # pointer to sigcontext calls $1,_sigreturn # restore previous context # we should never return botch: - calls $0,_longjmperror + pushl $msgend-msg + pushl $msg + pushl $2 + calls $3,_write halt + + .data +msg: .ascii "longjmp botch\n" +msgend: Index: libexec/getty/gettytab.5 ================================================================== --- libexec/getty/gettytab.5 +++ libexec/getty/gettytab.5 @@ -1,10 +1,10 @@ .\" Copyright (c) 1983 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)gettytab.5 6.2 (Berkeley) 01/07/86 +.\" @(#)gettytab.5 6.1 (Berkeley) 05/15/85 .\" .TH GETTYTAB 5 "" .UC 5 .SH NAME gettytab \- terminal configuration data base @@ -54,11 +54,10 @@ ce bool false use crt erase algorithm ck bool false use crt kill algorithm cl str NULL screen clear sequence co bool false console - add \\n after login prompt ds str ^Y delayed suspend character -dx bool false set DECCTLQ ec bool false leave echo \s-2OFF\s0 ep bool false terminal uses even parity er str ^? erase character et str ^D end of text (\s-2EOF\s0) character ev str NULL initial enviroment Index: libexec/getty/gettytab.h ================================================================== --- libexec/getty/gettytab.h +++ libexec/getty/gettytab.h @@ -1,11 +1,11 @@ /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)gettytab.h 5.2 (Berkeley) 01/07/86 + * @(#)gettytab.h 5.1 (Berkeley) 04/29/85 */ /* * Getty description definitions. */ @@ -102,11 +102,10 @@ #define IG gettyflags[15].value #define PS gettyflags[16].value #define HC gettyflags[17].value #define UB gettyflags[18].value #define AB gettyflags[19].value -#define DX gettyflags[20].value int getent(); long getnum(); int getflag(); char *getstr(); Index: libexec/getty/init.c ================================================================== --- libexec/getty/init.c +++ libexec/getty/init.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)init.c 5.2 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)init.c 5.1 (Berkeley) 04/29/85"; #endif not lint /* * Getty table initializations. * @@ -85,8 +85,7 @@ { "ig", 0 }, /* ignore garbage */ { "ps", 0 }, /* do port selector speed select */ { "hc", 1 }, /* don't set hangup on close */ { "ub", 0 }, /* unbuffered output */ { "ab", 0 }, /* auto-baud detect with '\r' */ - { "dx", 0 }, /* set decctlq */ { 0 } }; Index: libexec/getty/subr.c ================================================================== --- libexec/getty/subr.c +++ libexec/getty/subr.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)subr.c 5.4 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)subr.c 5.3 (Berkeley) 10/18/85"; #endif not lint /* * Melbourne getty. */ @@ -187,13 +187,10 @@ f |= ECHO; if (XC) f |= CTLECH; - if (DX) - f |= DECCTQ; - return (f); } struct delayval { unsigned delay; /* delay in ms */ Index: libexec/rlogind/rlogind.c ================================================================== --- libexec/rlogind/rlogind.c +++ libexec/rlogind/rlogind.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1983 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)rlogind.c 5.10 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)rlogind.c 5.9 (Berkeley) 11/08/85"; #endif not lint /* * remote login server: * remuser\0 @@ -197,56 +197,40 @@ int f, p; { char pibuf[1024], fibuf[1024], *pbp, *fbp; register pcc = 0, fcc = 0; int cc; - char cntl; /* * Must ignore SIGTTOU, otherwise we'll stop * when we try and set slave pty's window shape * (our controlling tty is the master pty). */ (void) signal(SIGTTOU, SIG_IGN); send(f, oobdata, 1, MSG_OOB); /* indicate new rlogin */ for (;;) { - int ibits, obits, ebits; + int ibits = 0, obits = 0; - ibits = 0; - obits = 0; if (fcc) obits |= (1<= 0) if (pcc) obits |= (1< #include #include @@ -97,11 +96,11 @@ * Arrange for the first read to lop off enough to * leave the rest of the file a multiple of readsize. * Since readsize can change, this may not always hold during * the pgm run, but since it usually will, leave it here * for i/o efficiency (page/sector boundaries and all that). - * Note: the efficiency gain has never been verified... + * Note: Above statement has never been verified! */ if ((i = off % readsize) == 0) i = readsize; off -= i; Index: old/dbx/check.c ================================================================== --- old/dbx/check.c +++ old/dbx/check.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)check.c 5.2 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)check.c 5.1 (Berkeley) 05/31/85"; #endif not lint static char rcsid[] = "$Header: check.c,v 1.5 84/12/26 10:38:35 linton Exp $"; /* @@ -46,15 +46,11 @@ checkref(p); switch (p->op) { case O_ASSIGN: p1 = p->value.arg[0]; p2 = p->value.arg[1]; - if (varIsSet("$unsafeassign")) { - if (size(p1->nodetype) != size(p2->nodetype)) { - error("incompatible sizes"); - } - } else if (not compatible(p1->nodetype, p2->nodetype)) { + if (not compatible(p1->nodetype, p2->nodetype)) { error("incompatible types"); } break; case O_CATCH: Index: old/dbx/fortran.c ================================================================== --- old/dbx/fortran.c +++ old/dbx/fortran.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)fortran.c 5.3 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)fortran.c 5.2 (Berkeley) 09/05/85"; #endif not lint static char rcsid[] = "$Header: fortran.c,v 1.5 84/12/26 10:39:37 linton Exp $"; /* @@ -25,11 +25,11 @@ #include "mappings.h" #include "process.h" #include "runtime.h" #include "machine.h" -#define isspecial(range) ( \ +#define isfloat(range) ( \ range->symvalue.rangev.upper == 0 and range->symvalue.rangev.lower > 0 \ ) #define isrange(t, name) (t->class == RANGE and istypename(t->type, name)) @@ -178,11 +178,10 @@ switch (s->class) { case CONST: printf("parameter %s = ", symname(s)); - eval(s->symvalue.constval); printval(s); break; case REF: printf(" (dummy argument) "); @@ -289,28 +288,18 @@ fortran_printarray(s); } break; case RANGE: - if (isspecial(s)) { + if (isfloat(s)) { switch (s->symvalue.rangev.lower) { - case sizeof(short): - if (istypename(s->type, "logical*2")) { - printlogical(pop(short)); - } - break; - case sizeof(float): - if (istypename(s->type, "logical")) { - printlogical(pop(long)); - } else { - prtreal(pop(float)); - } + prtreal(pop(float)); break; case sizeof(double): - if (istypename(s->type, "complex")) { + if (istypename(s->type,"complex")) { d2 = pop(float); d1 = pop(float); printf("("); prtreal(d1); printf(","); @@ -330,11 +319,11 @@ prtreal(d2); printf(")"); break; default: - panic("bad size \"%d\" for special", + panic("bad size \"%d\" for real", s->symvalue.rangev.lower); break; } } else { printint(popsmall(s), s); @@ -348,39 +337,26 @@ error("don't know how to print a %s", fortran_classname(s)); /* NOTREACHED */ } } -/* - * Print out a logical - */ - -private printlogical(i) -Integer i; -{ - if (i == 0) { - printf(".false."); - } else { - printf(".true."); - } -} - /* * Print out an int */ private printint(i, t) Integer i; register Symbol t; { - if ( (t->type == t_int) or istypename(t->type, "integer") or + if (istypename(t->type, "logical")) { + printf(((Boolean) i) == true ? "true" : "false"); + } + else if ( (t->type == t_int) or istypename(t->type, "integer") or istypename(t->type,"integer*2") ) { printf("%ld", i); - } else if (istypename(t->type, "addr")) { - printf("0x%lx", i); } else { - error("unknown type in fortran printint"); + error("unkown type in fortran printint"); } } /* * Print out a null-terminated string (pointer to char) Index: old/dbx/runtime.c ================================================================== --- old/dbx/runtime.c +++ old/dbx/runtime.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)runtime.c 5.2 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)runtime.c 5.1 (Berkeley) 05/31/85"; #endif not lint static char rcsid[] = "$Header: runtime.c,v 1.5 84/12/26 10:41:52 linton Exp $"; /* @@ -799,15 +799,11 @@ { Stack *savesp; int argc, args_size; savesp = sp; - if (varIsSet("$unsafecall")) { - argc = unsafe_evalargs(proc, arglist); - } else { - argc = evalargs(proc, arglist); - } + argc = evalargs(proc, arglist); args_size = sp - savesp; setreg(STKP, reg(STKP) - args_size); dwrite(savesp, reg(STKP), args_size); sp = savesp; return argc; @@ -951,32 +947,10 @@ if (formal != nil) { sp = savesp; error("not enough parameters to %s", symname(proc)); } } - return count; -} - -/* - * Evaluate an argument list without concern for matching the formal - * parameters of a function in type or quantity. Useful for functions - * like C's printf(). - */ - -private integer unsafe_evalargs(proc, arglist) -Symbol proc; -Node arglist; -{ - Node p; - Integer count; - - count = 0; - for (p = arglist; p != nil; p = p->value.arg[1]) { - assert(p->op == O_COMMA); - eval(p->value.arg[0]); - ++count; - } return count; } public procreturn(f) Symbol f; Index: old/make/files.c ================================================================== --- old/make/files.c +++ old/make/files.c @@ -1,6 +1,6 @@ -static char *sccsid = "@(#)files.c 4.12 (Berkeley) 86/01/09"; +static char *sccsid = "@(#)files.c 4.11 (Berkeley) 85/08/30"; #include /* UNIX DEPENDENT PROCEDURES */ @@ -225,11 +225,11 @@ cp = varptr("VPATH"); if (*cp->varval == 0) path = "."; else { path = pth; *path = '\0'; - if (strncmp(cp->varval, ".:", 2) != 0) strcpy(pth,".:"); + if (*cp->varval != '.') strcpy(pth,".:"); strcat(pth, cp->varval); } } else { *endir = '\0'; Index: old/make/main.c ================================================================== --- old/make/main.c +++ old/make/main.c @@ -1,6 +1,6 @@ -static char *sccsid = "@(#)main.c 4.8 (Berkeley) 86/01/09"; +static char *sccsid = "@(#)main.c 4.7 (Berkeley) 85/08/30"; # include "defs" /* command make to update programs. Flags: 'd' print out debugging comments 'p' print out a version of the input graph @@ -321,11 +321,11 @@ zznextc = 0; if( yyparse() ) fatal("Description file error"); -if(fin != NULL && fin != stdin) +if(fin != NULL) fclose(fin); return(0); } Index: old/pcc/c2.vax/c21.c ================================================================== --- old/pcc/c2.vax/c21.c +++ old/pcc/c2.vax/c21.c @@ -1,7 +1,7 @@ #ifndef lint -static char sccsid[] = "@(#)c21.c 4.17 01/08/86"; +static char sccsid[] = "@(#)c21.c 4.16 08/22/85"; #endif /* char C21[] = {"@(#)c21.c 1.83 80/10/16 21:18:22 JFR"}; /* sccs ident */ /* * C object code improver-- second part @@ -257,12 +257,12 @@ case 1: pf->subop = WORD; break; case 2: pf->subop = LONG; break; case 3: pf->subop = QUAD; break; } redunm++; nsaddr++; nchange++; - goto std; } + goto std; ashadd: /* at this point, RT2 and RT3 are guaranteed to be simple regs*/ if (shcnt == 1 && equstr(regs[RT2], regs[RT3])) { /* DELETED old/pcc/ccom.tahoe/Makefile Index: old/pcc/ccom.tahoe/Makefile ================================================================== --- old/pcc/ccom.tahoe/Makefile +++ old/pcc/ccom.tahoe/Makefile @@ -1,67 +0,0 @@ -# Makefile 1.1 86/01/11 -# -# Makefile for portable c compiler -# -DESTDIR= -M= ../mip.tahoe -CFLAGS= -O -I${M} -I. -OBJS= rodata.o cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o \ - reader.o local2.o order.o match.o allo.o comm1.o table.o stab.o - -all: ccom alist - -ccom: ${OBJS} - $(CC) $(LDFLAGS) ${OBJS} -o ccom -alist: alist.c - $(CC) -o alist $(CFLAGS) alist.c - -trees.o: $M/manifest macdefs $M/mfile1 $M/trees.c - $(CC) -c $(CFLAGS) $M/trees.c -optim.o: $M/manifest macdefs $M/mfile1 $M/optim.c - $(CC) -c $(CFLAGS) $M/optim.c -pftn.o: $M/manifest macdefs $M/mfile1 $M/pftn.c - $(CC) -c $(CFLAGS) $M/pftn.c -code.o: $M/manifest macdefs $M/mfile1 - $(CC) -c $(CFLAGS) code.c -local.o: $M/manifest macdefs $M/mfile1 - $(CC) -c $(CFLAGS) local.c -stab.o: $M/manifest macdefs $M/mfile1 - $(CC) -c $(CFLAGS) stab.c -scan.o: $M/manifest macdefs $M/mfile1 $M/scan.c - $(CC) -c $(CFLAGS) $M/scan.c -xdefs.o: $M/manifest $M/mfile1 macdefs $M/xdefs.c - $(CC) -c $(CFLAGS) $M/xdefs.c -cgram.o: $M/manifest $M/mfile1 macdefs cgram.c - $(CC) -c $(CFLAGS) cgram.c -rodata.o: rodata.c - $(CC) -c $(CFLAGS) -R rodata.c -rodata.c cgram.c: $M/cgram.y - $(YACC) $M/cgram.y - rm -f rodata.c - ./:yyfix yyexca yyact yypact yypgo yyr1 yyr2 yychk yydef - mv y.tab.c cgram.c -comm1.o: $M/manifest $M/mfile1 $M/common macdefs $M/comm1.c - $(CC) -c $(CFLAGS) $M/comm1.c -table.o: $M/manifest $M/mfile2 mac2defs macdefs table.c - $(CC) -c $(CFLAGS) -R table.c -reader.o: $M/manifest $M/mfile2 mac2defs macdefs $M/reader.c - $(CC) -c $(CFLAGS) $M/reader.c -local2.o: $M/manifest $M/mfile2 mac2defs macdefs - $(CC) -c $(CFLAGS) local2.c -order.o: $M/manifest $M/mfile2 mac2defs macdefs - $(CC) -c $(CFLAGS) order.c -match.o: $M/manifest $M/mfile2 mac2defs macdefs $M/match.c - $(CC) -c $(CFLAGS) $M/match.c -allo.o: $M/manifest $M/mfile2 mac2defs macdefs $M/allo.c - $(CC) -c $(CFLAGS) $M/allo.c -clean: - rm -f *.o ccom cgram.c rodata.c -lintall: - lint -hv -I. -I$M $(CFLAGS) rodata.c cgram.c $M/xdefs.c \ - $M/scan.c $M/pftn.c $M/trees.c $M/optim.c code.c local.c \ - $M/reader.c local2.c order.c $M/match.c $M/allo.c $M/comm1.c table.c - -install: all - -mv ${DESTDIR}/lib/ccom ${DESTDIR}/lib/ccom.old - install -s ccom ${DESTDIR}/lib/ccom - install -s alist ${DESTDIR}/lib/alist DELETED old/pcc/ccom.tahoe/code.c Index: old/pcc/ccom.tahoe/code.c ================================================================== --- old/pcc/ccom.tahoe/code.c +++ old/pcc/ccom.tahoe/code.c @@ -1,504 +0,0 @@ -#ifndef lint -static char sccsid[] = "@(#)code.c 1.1 (Berkeley) 01/11/86"; -#endif - -# include "mfile1" -# include -# include -# include - -int proflg = 0; /* are we generating profiling code? */ -int strftn = 0; /* is the current function one which returns a value */ -int gdebug; -int fdefflag; /* are we within a function definition ? */ -#ifndef STABDOT -char NULLNAME[8]; -#endif -int labelno; - -branch( n ){ - /* output a branch to label n */ - /* exception is an ordinary function branching to retlab: then, return */ - if( n == retlab && !strftn ){ - register TWORD t; - register r; - /* set number of regs in assem comment field */ - /* so optimizers can do a better job */ - r = 0; - if( retstat & RETVAL ){ /* the function rets a val somewhere */ - t = (&stab[curftn])->stype; - t = DECREF(t); - r++; /* it is at least one */ - if(t == DOUBLE) - r++; /* it takes two */ - } else /* the fn does not ret a val */ - r = 2; - printf( " ret#%d\n", r ); - } - else printf( " jbr L%d\n", n ); - } - -int lastloc = { -1 }; - -short log2tab[] = {0, 0, 1, 2, 2, 3, 3, 3, 3}; -#define LOG2SZ 9 - -defalign(n) { - /* cause the alignment to become a multiple of n */ - n /= SZCHAR; - if( lastloc != PROG && n > 1 ) printf( " .align %d\n", n >= 0 && n < LOG2SZ ? log2tab[n] : 0 ); - } - -locctr( l ){ - register temp; - /* l is PROG, ADATA, DATA, STRNG, ISTRNG, or STAB */ - - if( l == lastloc ) return(l); - temp = lastloc; - lastloc = l; - switch( l ){ - - case PROG: - printf( " .text\n" ); - psline(); - break; - - case DATA: - case ADATA: - printf( " .data\n" ); - break; - - case STRNG: - printf( " .data 1\n" ); - break; - - case ISTRNG: - printf( " .data 2\n" ); - break; - - case STAB: - printf( " .stab\n" ); - break; - - default: - cerror( "illegal location counter" ); - } - - return( temp ); - } - -deflab( n ){ - /* output something to define the current position as label n */ - printf( "L%d:\n", n ); - } - -int crslab = 10; - -getlab(){ - /* return a number usable for a label */ - return( ++crslab ); - } - - -efcode(){ - /* code for the end of a function */ - - if( strftn ){ /* copy output (in R2) to caller */ - register NODE *l, *r; - register struct symtab *p; - register TWORD t; - register int i; - - p = &stab[curftn]; - t = p->stype; - t = DECREF(t); - - deflab( retlab ); - - i = getlab(); /* label for return area */ -#ifndef LCOMM - printf(" .data\n" ); - printf(" .align 2\n" ); - printf("L%d: .space %d\n", i, tsize(t, p->dimoff, p->sizoff)/SZCHAR ); - printf(" .text\n" ); -#else - { int sz = tsize(t, p->dimoff, p->sizoff) / SZCHAR; - if (sz % (SZINT/SZCHAR)) - sz += (SZINT/SZCHAR) - (sz % (SZINT/SZCHAR)); - printf(" .lcomm L%d,%d\n", i, sz); - } -#endif - psline(); - printf(" movab L%d,r1\n", i); - - reached = 1; - l = block( REG, NIL, NIL, PTR|t, p->dimoff, p->sizoff ); - l->tn.rval = 1; /* R1 */ - l->tn.lval = 0; /* no offset */ - r = block( REG, NIL, NIL, PTR|t, p->dimoff, p->sizoff ); - r->tn.rval = 0; /* R0 */ - r->tn.lval = 0; - l = buildtree( UNARY MUL, l, NIL ); - r = buildtree( UNARY MUL, r, NIL ); - l = buildtree( ASSIGN, l, r ); - l->in.op = FREE; - ecomp( l->in.left ); - printf( " movab L%d,r0\n", i ); - /* turn off strftn flag, so return sequence will be generated */ - strftn = 0; - } - branch( retlab ); - p2bend(); - fdefflag = 0; - } - -int ftlab1, ftlab2; - -bfcode( a, n ) int a[]; { - /* code for the beginning of a function; a is an array of - indices in stab for the arguments; n is the number */ - register i; - register temp; - register struct symtab *p; - int off; -#ifdef REG_CHAR - char *toreg(); -#endif - char *rname(); - - locctr( PROG ); - p = &stab[curftn]; - printf( " .align 1\n"); - defnam( p ); - temp = p->stype; - temp = DECREF(temp); - strftn = (temp==STRTY) || (temp==UNIONTY); - - retlab = getlab(); - - /* routine prolog */ - - printf( " .word L%d\n", ftnno); - if (gdebug) { -#ifdef STABDOT - pstabdot(N_SLINE, lineno); -#else - pstab(NULLNAME, N_SLINE); - printf("0,%d,LL%d\n", lineno, labelno); - printf("LL%d:\n", labelno++); -#endif - } - ftlab1 = getlab(); - ftlab2 = getlab(); - printf( " jbr L%d\n", ftlab1); - printf( "L%d:\n", ftlab2); - if( proflg ) { /* profile code */ - i = getlab(); - printf(" pushl $L%d\n", i); - printf(" callf $8,mcount\n"); - printf(" .data\n"); - printf(" .align 2\n"); - printf("L%d: .long 0\n", i); - printf(" .text\n"); - psline(); - } - - off = ARGINIT; - - for( i=0; isclass == REGISTER ){ - temp = p->offset; /* save register number */ - p->sclass = PARAM; /* forget that it is a register */ - p->offset = NOOFFSET; - oalloc( p, &off ); -#ifdef REG_CHAR - printf( " %s", toreg(p->stype)) ); -#else - printf(" movl"); -#endif - printf( " %d(fp),%s\n", p->offset/SZCHAR, rname(temp) ); - p->offset = temp; /* remember register number */ - p->sclass = REGISTER; /* remember that it is a register */ -#ifdef REG_CHAR - temp = p->stype; - if( temp==CHAR || temp==SHORT ) - p->stype = INT; - else if( temp==UCHAR || temp==USHORT ) - p->stype = UNSIGNED; -#endif - } - else if( p->stype == STRTY || p->stype == UNIONTY ) { - p->offset = NOOFFSET; - if( oalloc( p, &off ) ) cerror( "bad argument" ); - SETOFF( off, ALSTACK ); - } - else { - if( oalloc( p, &off ) ) cerror( "bad argument" ); - } - - } - fdefflag = 1; - } - -bccode(){ /* called just before the first executable statment */ - /* by now, the automatics and register variables are allocated */ - SETOFF( autooff, SZINT ); - /* set aside store area offset */ - p2bbeg( autooff, regvar ); - } - -ejobcode( flag ){ - /* called just before final exit */ - /* flag is 1 if errors, 0 if none */ - } - -aobeg(){ - /* called before removing automatics from stab */ - } - -aocode(p) struct symtab *p; { - /* called when automatic p removed from stab */ - } - -aoend(){ - /* called after removing all automatics from stab */ - } - -defnam( p ) register struct symtab *p; { - /* define the current location as the name p->sname */ - - if( p->sclass == EXTDEF ){ - printf( " .globl %s\n", exname( p->sname ) ); - } - if( p->sclass == STATIC && p->slevel>1 ) deflab( p->offset ); - else printf( "%s:\n", exname( p->sname ) ); - - } - -bycode( t, i ){ -#ifdef ASSTRINGS -static int lastoctal = 0; -#endif - - /* put byte i+1 in a string */ - -#ifdef ASSTRINGS - - i &= 077; - if ( t < 0 ){ - if ( i != 0 ) printf( "\"\n" ); - } else { - if ( i == 0 ) printf("\t.ascii\t\""); - if ( t == '\\' || t == '"'){ - lastoctal = 0; - printf("\\%c", t); - } - else if ( t < 040 || t >= 0177 ){ - lastoctal++; - printf("\\%o",t); - } - else if ( lastoctal && '0' <= t && t <= '9' ){ - lastoctal = 0; - printf("\"\n\t.ascii\t\"%c", t ); - } - else - { - lastoctal = 0; - putchar(t); - } - if ( i == 077 ) printf("\"\n"); - } -#else - - i &= 07; - if( t < 0 ){ /* end of the string */ - if( i != 0 ) printf( "\n" ); - } - - else { /* stash byte t into string */ - if( i == 0 ) printf( " .byte " ); - else printf( "," ); - printf( "0x%x", t ); - if( i == 07 ) printf( "\n" ); - } -#endif - } - -zecode( n ){ - /* n integer words of zeros */ - OFFSZ temp; - if( n <= 0 ) return; - printf( " .space %d\n", (SZINT/SZCHAR)*n ); - temp = n; - inoff += temp*SZINT; - } - -fldal( t ) unsigned t; { /* return the alignment of field of type t */ - uerror( "illegal field type" ); - return( ALINT ); - } - -fldty( p ) struct symtab *p; { /* fix up type of field p */ - ; - } - -where(c){ /* print location of error */ - /* c is either 'u', 'c', or 'w' */ - /* GCOS version */ - fprintf( stderr, "%s, line %d: ", ftitle, lineno ); - } - - -#ifdef REG_CHAR -/* tbl - toreg() returns a pointer to a char string - which is the correct "register move" for the passed type - */ -struct type_move {TWORD fromtype; char tostrng[8];} toreg_strs[] = - { - CHAR, "cvtbl", - SHORT, "cvtwl", - UCHAR, "movzbl", - USHORT, "movzwl", - 0, "movl" - }; - -char -*toreg(type) - TWORD type; -{ - struct type_move *p; - - for ( p=toreg_strs; p->fromtype != 0; p++) - if (p->fromtype == type) return(p->tostrng); - - /* type not found, must be a word type */ - return(p->tostrng); -} -/* tbl */ -#endif - - -main( argc, argv ) char *argv[]; { -#ifdef BUFSTDERR - char errbuf[BUFSIZ]; - setbuf(stderr, errbuf); -#endif - return(mainp1( argc, argv )); - } - -struct sw heapsw[SWITSZ]; /* heap for switches */ - -genswitch(p,n) register struct sw *p;{ - /* p points to an array of structures, each consisting - of a constant value and a label. - The first is >=0 if there is a default label; - its value is the label number - The entries p[1] to p[n] are the nontrivial cases - */ - register i; - register CONSZ j; - register CONSZ unsigned range; - register dlab, swlab; - - range = p[n].sval-p[1].sval; - - if( range <= 3*n && n>=4 ){ /* implement a direct switch */ - - swlab = getlab(); - dlab = p->slab >= 0 ? p->slab : getlab(); - - /* already in r0 */ - printf( " casel r0,$" ); - printf( CONFMT, p[1].sval ); - printf(",$"); - printf( CONFMT, range); - printf("\n .align 1\nL%d:\n", swlab); - for( i=1,j=p[1].sval; i<=n; j++) { - printf(" .word L%d-L%d\n", (j == p[i].sval ? ((j=p[i++].sval), p[i-1].slab) : dlab), - swlab); - } - - if( p->slab >= 0 ) branch( dlab ); - else printf("L%d:\n", dlab); - return; - - } - - if( n>8 ) { /* heap switch */ - - heapsw[0].slab = dlab = p->slab >= 0 ? p->slab : getlab(); - makeheap(p, n, 1); /* build heap */ - - walkheap(1, n); /* produce code */ - - if( p->slab >= 0 ) - branch( dlab ); - else - printf("L%d:\n", dlab); - return; - } - - /* debugging code */ - - /* out for the moment - if( n >= 4 ) werror( "inefficient switch: %d, %d", n, (int) (range/n) ); - */ - - /* simple switch code */ - - for( i=1; i<=n; ++i ){ - /* already in r0 */ - - printf( " cmpl r0,$" ); - printf( CONFMT, p[i].sval ); - printf( "\n jeql L%d\n", p[i].slab ); - } - - if( p->slab>=0 ) branch( p->slab ); - } - -makeheap(p, m, n) -register struct sw *p; -{ - register int q; - - q = select(m); - heapsw[n] = p[q]; - if( q>1 ) makeheap(p, q-1, 2*n); - if( q m ) break; - l = ((k = i/2 - 1) + 1)/2; - return( l + (m-k < l ? m-k : l)); -} - -walkheap(start, limit) -{ - int label; - - - if( start > limit ) return; - printf( " cmpl r0,$" ); - printf( CONFMT, heapsw[start].sval); - printf("\n jeql L%d\n", heapsw[start].slab); - if( (2*start) > limit ) { - printf(" jbr L%d\n", heapsw[0].slab); - return; - } - if( (2*start+1) <= limit ) { - label = getlab(); - printf(" jgtr L%d\n", label); - } else - printf(" jgtr L%d\n", heapsw[0].slab); - walkheap( 2*start, limit); - if( (2*start+1) <= limit ) { - printf("L%d:\n", label); - walkheap( 2*start+1, limit); - } -} DELETED old/pcc/ccom.tahoe/local.c Index: old/pcc/ccom.tahoe/local.c ================================================================== --- old/pcc/ccom.tahoe/local.c +++ old/pcc/ccom.tahoe/local.c @@ -1,480 +0,0 @@ -#ifndef lint -static char sccsid[] = "@(#)local.c 1.1 (Berkeley) 01/11/86"; -#endif - -# include "mfile1" - -/* this file contains code which is dependent on the target machine */ - -NODE * -clocal(p) register NODE *p; { - - /* this is called to do local transformations on - an expression tree preparitory to its being - written out in intermediate code. - */ - - /* the major essential job is rewriting the - automatic variables and arguments in terms of - REG and OREG nodes */ - /* conversion ops which are not necessary are also clobbered here */ - /* in addition, any special features (such as rewriting - exclusive or) are easily handled here as well */ - - register struct symtab *q; - register NODE *r; - register int o; - register int m, ml; - - switch( o = p->in.op ){ - - case NAME: - if( p->tn.rval < 0 ) { /* already processed; ignore... */ - return(p); - } - q = &stab[p->tn.rval]; - switch( q->sclass ){ - - case AUTO: - case PARAM: - /* fake up a structure reference */ - r = block( REG, NIL, NIL, PTR+STRTY, 0, 0 ); - r->tn.lval = 0; - r->tn.rval = STKREG; - p = stref( block( STREF, r, p, 0, 0, 0 ) ); - break; - - case ULABEL: - case LABEL: - case STATIC: - if( q->slevel == 0 ) break; - p->tn.lval = 0; - p->tn.rval = -q->offset; - break; - - case REGISTER: - p->in.op = REG; - p->tn.lval = 0; - p->tn.rval = q->offset; -#ifdef REG_CHAR - m = p->in.type; - if( m==CHAR || m==SHORT ) - p->in.type = INT; - else if( m==UCHAR || m==USHORT ) - p->in.type = UNSIGNED; -#endif - break; - - } - break; - - case LT: - case LE: - case GT: - case GE: - if( ISPTR( p->in.left->in.type ) || ISPTR( p->in.right->in.type ) ){ - p->in.op += (ULT-LT); - } - break; - - case PCONV: - /* do pointer conversions for char and longs */ - ml = p->in.left->in.type; - if( ( ml==CHAR || ml==UCHAR || ml==SHORT || ml==USHORT ) && p->in.left->in.op != ICON ) break; - - /* pointers all have the same representation; the type is inherited */ - - inherit: - p->in.left->in.type = p->in.type; - p->in.left->fn.cdim = p->fn.cdim; - p->in.left->fn.csiz = p->fn.csiz; - p->in.op = FREE; - return( p->in.left ); - - case SCONV: - m = p->in.type; - ml = p->in.left->in.type; - if(m == FLOAT || m == DOUBLE) { - if(p->in.left->in.op==SCONV && - (ml == FLOAT || ml == DOUBLE) && - p->in.left->in.left->in.type==m) { - p->in.op = p->in.left->in.op = FREE; - return(p->in.left->in.left); - } - if(p->in.left->in.op==FCON) - goto inherit; - break; - } - if(ml == FLOAT || ml == DOUBLE){ - if (p->in.left->in.op == FCON){ - p->in.left->in.op = FREE; - p->in.op = ICON; - p->tn.lval = p->in.left->fpn.dval; - p->tn.rval = NONAME; - return(p); - } - break; - } - /* now, look for conversions downwards */ - - if( p->in.left->in.op == ICON ){ /* simulate the conversion here */ - CONSZ val; - val = p->in.left->tn.lval; - switch( m ){ - case CHAR: - p->in.left->tn.lval = (char) val; - break; - case UCHAR: - p->in.left->tn.lval = val & 0XFF; - break; - case USHORT: - p->in.left->tn.lval = val & 0XFFFFL; - break; - case SHORT: - p->in.left->tn.lval = (short)val; - break; - case UNSIGNED: - p->in.left->tn.lval = val & 0xFFFFFFFFL; - break; - case INT: - p->in.left->tn.lval = (int)val; - break; - } - p->in.left->in.type = m; - } - else { - /* meaningful ones are conversion of int to char, int to short, - and short to char, and unsigned versions thereof */ - if( m==CHAR || m==UCHAR ){ - if( ml!=CHAR && ml!= UCHAR ) break; - } - else if( m==SHORT || m==USHORT ){ - if( ml!=CHAR && ml!=UCHAR && ml!=SHORT && ml!=USHORT ) break; - } - } - - /* clobber conversion */ - if( tlen(p) == tlen(p->in.left) ) goto inherit; - p->in.op = FREE; - return( p->in.left ); /* conversion gets clobbered */ - - case QUEST: /* the right side should be COLON */ - if((r = p->in.right)->in.op == SCONV) { - p->in.right = r->in.left; - p->in.type = r->in.left->in.type; - r->in.left = p; - return(r); - } - return(p); - - case PVCONV: - case PMCONV: - if( p->in.right->in.op != ICON ) cerror( "bad conversion", 0); - p->in.op = FREE; - return( buildtree( o==PMCONV?MUL:DIV, p->in.left, p->in.right ) ); - - case FLD: - /* make sure that the second pass does not make the - descendant of a FLD operator into a doubly indexed OREG */ - - if( p->in.left->in.op == UNARY MUL - && (r=p->in.left->in.left)->in.op == PCONV) - if( r->in.left->in.op == PLUS || r->in.left->in.op == MINUS ) - if( ISPTR(r->in.type) ) { - if( ISUNSIGNED(p->in.left->in.type) ) - p->in.left->in.type = UNSIGNED; - else - p->in.left->in.type = INT; - } - break; - case FORTCALL: /* arg must be FLOAT */ - if((r = p->in.right)->in.type != FLOAT) - p->in.right = clocal(makety(r, FLOAT, 0, FLOAT)); - return(p); - } - - /* if both sides are FLOAT, so is the op */ - if(optype(o)!=LTYPE && p->in.left->in.type==DOUBLE && - (o==UNARY MINUS || optype(o)==BITYPE && p->in.right->in.type==DOUBLE)) { - r = p->in.left; - if(r->in.op==SCONV && r->in.left->in.type==FLOAT) { - if(optype(o)==BITYPE) { - r = p->in.right; - if(r->in.op==SCONV && r->in.left->in.type==FLOAT) { - r->in.op = FREE; - p->in.right = r->in.left; - } else if(r->in.op==FCON) - r->in.type = FLOAT; - else - return(p); - } - r = p->in.left; - p->in.left = r->in.left; - } else if(optype(o)==BITYPE && r->in.op==FCON) { - r = p->in.right; - if(!(r->in.op==SCONV && r->in.left->in.type==FLOAT)) - return(p); - p->in.right = r->in.left; - p->in.left->in.type = FLOAT; - } else - return(p); - if(p->in.type==DOUBLE) { - p->in.type = FLOAT; - r->in.left = p; - return(r); - } else { /* usually logop */ - r->in.op = FREE; - return(p); - } - } - return(p); -} - -andable( p ) NODE *p; { - return(1); /* all names can have & taken on them */ - } - -cendarg(){ /* at the end of the arguments of a ftn, set the automatic offset */ - autooff = AUTOINIT; - } - -cisreg( t ) TWORD t; { /* is an automatic variable of type t OK for a register variable */ - - if( t==INT || t==UNSIGNED || t==LONG || t==ULONG /* tbl */ -#ifdef REG_CHAR - || t==CHAR || t==UCHAR || t==SHORT || t==USHORT /* tbl */ -#endif - || ISPTR(t)) return (1); /* wnj */ - return(0); - } - -NODE * -offcon( off, t, d, s ) OFFSZ off; TWORD t; { - - /* return a node, for structure references, which is suitable for - being added to a pointer of type t, in order to be off bits offset - into a structure */ - - register NODE *p; - - /* t, d, and s are the type, dimension offset, and sizeoffset */ - /* in general they are necessary for offcon, but not on H'well */ - - p = bcon(0); - p->tn.lval = off/SZCHAR; - return(p); - - } - - -static inwd /* current bit offsed in word */; -static CONSZ word /* word being built from fields */; - -incode( p, sz ) register NODE *p; { - - /* generate initialization code for assigning a constant c - to a field of width sz */ - /* we assume that the proper alignment has been obtained */ - /* inoff is updated to have the proper final value */ - /* we also assume sz < SZINT */ - - inwd += sz; - if(inwd > SZINT) cerror("incode: field > int"); - word |= (p->tn.lval&((1L<in.op == FCON ){ - if(p->fpn.dval == 0) { - p->in.op = ICON; - p->tn.rval = NONAME; - return; - } - locctr( DATA ); - defalign( ALDOUBLE ); - deflab( i = getlab() ); -# ifndef SFCON - fincode( p->fpn.dval, p->in.type==DOUBLE ? SZDOUBLE : SZFLOAT); -# else - p->in.type = fincode( p->fpn.dval, 0 ); -# endif - p->tn.lval = 0; - p->tn.rval = -i; - p->in.op = NAME; - } - } -# endif - -fincode( d, sz ) double d; register int sz; { - /* - * output code to initialize space of size sz to the value d - * the proper alignment has been obtained - * inoff is updated to have the proper final value - * this code should be the same for PDP, VAX and Tahoe - * SFCON makes use of value to determine type - only where - * float<->double conversions are ignored. - */ - - register struct sh4 { - unsigned short sh[4]; - } *x; -# ifdef SFCON - register int type; -# else - float f; - - if(sz == SZFLOAT) { /* force rounding */ - f = d; - d = f; - } -# endif - - x = (struct sh4 *)&d; - printf(" .long 0x%04x%04x", x->sh[0], x->sh[1]); -# ifdef SFCON - if(sz==0) - if(x->sh[2]==0 && x->sh[3]==0) { - sz = SZFLOAT; - type = FLOAT; - } else { - sz = SZDOUBLE; - type = DOUBLE; - } -# endif - if(sz == SZDOUBLE) { - printf(", 0x%04x%04x", x->sh[2], x->sh[3]); - printf(" # .double %.17g\n", d); - } else - printf(" # .float %.8g\n", d); - inoff += sz; -# ifdef SFCON - return type; -# endif - } - -cinit( p, sz ) NODE *p; { - /* arrange for the initialization of p into a space of - size sz */ - /* the proper alignment has been opbtained */ - /* inoff is updated to have the proper final value */ - ecode( p ); - inoff += sz; - } - -vfdzero( n ){ /* define n bits of zeros in a vfd */ - - if( n <= 0 ) return; - - inwd += n; - inoff += n; - if( inoff%ALINT ==0 ) { - printf( " .long 0x%08X\n", word ); - word = inwd = 0; - } - } - -char * -exname( p ) char *p; { - /* make a name look like an external name in the local machine */ - -#ifndef FLEXNAMES - static char text[NCHNAM+1]; -#else - static char text[BUFSIZ+1]; -#endif - - register int i; - - text[0] = '_'; -#ifndef FLEXNAMES - for( i=1; *p&&isname ) ); - off = tsize( q->stype, q->dimoff, q->sizoff ); - printf( "%d" /*CONFMT*/, off/SZCHAR ); - printf( "\n" ); - } - - -isitfloat( s ) char *s; { - double atof(); - dcon = atof(s); - return( FCON ); - } - -ecode( p ) NODE *p; { - - /* walk the tree and write out the nodes.. */ - - if( nerrors ) return; - p2tree( p ); - p2compile( p ); - } - -#ifndef ONEPASS -tlen(p) NODE *p; -{ - switch(p->in.type) { - case CHAR: - case UCHAR: - return(1); - - case SHORT: - case USHORT: - return(2); - - case DOUBLE: - return(8); - - default: - return(4); - } - } -#endif DELETED old/pcc/ccom.tahoe/local2.c Index: old/pcc/ccom.tahoe/local2.c ================================================================== --- old/pcc/ccom.tahoe/local2.c +++ old/pcc/ccom.tahoe/local2.c @@ -1,1054 +0,0 @@ -#ifndef lint -static char sccsid[] = "@(#)local2.c 1.1 (Berkeley) 01/11/86"; -#endif - -# include "mfile2" -# include "ctype.h" -# ifdef FORT -int ftlab1, ftlab2; -# endif -/* a lot of the machine dependent parts of the second pass */ - -# define BITMASK(n) ((1L< AUTOINIT ) - printf( " subl3 $%d,fp,sp\n", spoff); - printf( " jbr L%d\n", ftlab2); -#endif - ent_mask = 0; - maxargs = -1; - } - -struct hoptab { int opmask; char * opstring; } ioptab[] = { - - PLUS, "add", - MINUS, "sub", - MUL, "mul", - DIV, "div", - MOD, "div", - OR, "or", - ER, "xor", - AND, "and", - -1, "" }; - -hopcode( f, o ){ - /* output the appropriate string from the above table */ - - register struct hoptab *q; - - if(asgop(o)) - o = NOASG o; - for( q = ioptab; q->opmask>=0; ++q ){ - if( q->opmask == o ){ - if(f == 'E') - printf( "e%s", q->opstring); - else - printf( "%s%c", q->opstring, tolower(f)); - return; - } - } - cerror( "no hoptab for %s", opst[o] ); - } - -char * -rnames[] = { /* keyed to register number tokens */ - - "r0", "r1", - "r2", "r3", "r4", "r5", - "r6", "r7", "r8", "r9", "r10", "r11", - "r12", "fp", "sp", "pc", - }; - -/* output register name and update entry mask */ -char * -rname(r) - register int r; -{ - - ent_mask |= 1<in.type) { - case CHAR: - case UCHAR: - return(1); - - case SHORT: - case USHORT: - return(2); - - case DOUBLE: - return(8); - - default: - return(4); - } -} - -prtype(n) NODE *n; -{ - switch (n->in.type) - { - - case DOUBLE: - printf("d"); - return; - - case FLOAT: - printf("f"); - return; - - case INT: - case UNSIGNED: - printf("l"); - return; - - case SHORT: - case USHORT: - printf("w"); - return; - - case CHAR: - case UCHAR: - printf("b"); - return; - - default: - if ( !ISPTR( n->in.type ) ) cerror("zzzcode- bad type"); - else { - printf("l"); - return; - } - } -} - -zzzcode( p, c ) register NODE *p; { - register int m; - int val; - switch( c ){ - - case 'N': /* logical ops, turned into 0-1 */ - /* use register given by register 1 */ - cbgen( 0, m=getlab(), 'I' ); - deflab( p->bn.label ); - printf( " clrl %s\n", rname(getlr( p, '1' )->tn.rval) ); - deflab( m ); - return; - - case 'P': - cbgen( p->in.op, p->bn.label, c ); - return; - - case 'A': /* assignment and load (integer only) */ - { - register NODE *l, *r; - - if (xdebug) eprint(p, 0, &val, &val); - r = getlr(p, 'R'); - if (optype(p->in.op) == LTYPE || p->in.op == UNARY MUL) { - l = resc; - l->in.type = INT; - } else - l = getlr(p, 'L'); - if(r->in.type==FLOAT || r->in.type==DOUBLE - || l->in.type==FLOAT || l->in.type==DOUBLE) - cerror("float in ZA"); - if (r->in.op == ICON) - if(r->in.name[0] == '\0') { - if (r->tn.lval == 0) { - printf("clr"); - prtype(l); - printf(" "); - adrput(l); - return; - } - if (r->tn.lval < 0 && r->tn.lval >= -63) { - printf("mneg"); - prtype(l); - r->tn.lval = -r->tn.lval; - goto ops; - } -#ifdef MOVAFASTER - } else { - printf("movab"); - printf(" "); - acon(r); - printf(","); - adrput(l); - return; -#endif MOVAFASTER - } - - if (l->in.op == REG) { - if( tlen(l) < tlen(r) ) { - !ISUNSIGNED(l->in.type)? - printf("cvt"): - printf("movz"); - prtype(l); - printf("l"); - goto ops; - } else - l->in.type = INT; - } - if (tlen(l) == tlen(r)) { - printf("mov"); - prtype(l); - goto ops; - } else if (tlen(l) > tlen(r) && ISUNSIGNED(r->in.type)) - printf("movz"); - else - printf("cvt"); - prtype(r); - prtype(l); - ops: - printf(" "); - adrput(r); - printf(","); - adrput(l); - return; - } - - case 'B': /* get oreg value in temp register for shift */ - { - register NODE *r; - if (xdebug) eprint(p, 0, &val, &val); - r = p->in.right; - if( tlen(r) == sizeof(int) && r->in.type != FLOAT ) - printf("movl"); - else { - printf(ISUNSIGNED(r->in.type) ? "movz" : "cvt"); - prtype(r); - printf("l"); - } - return; - } - - case 'C': /* num bytes pushed on arg stack */ - { - extern int gc_numbytes; - extern int xdebug; - - if (xdebug) printf("->%d<-",gc_numbytes); - - printf("call%c $%d", - (p->in.left->in.op==ICON && gc_numbytes<60)?'f':'s', - gc_numbytes+4); - /* dont change to double (here's the only place to catch it) */ - if(p->in.type == FLOAT) - rtyflg = 1; - return; - } - - case 'D': /* INCR and DECR */ - zzzcode(p->in.left, 'A'); - printf("\n "); - - case 'E': /* INCR and DECR, FOREFF */ - if (p->in.right->tn.lval == 1) - { - printf("%s", (p->in.op == INCR ? "inc" : "dec") ); - prtype(p->in.left); - printf(" "); - adrput(p->in.left); - return; - } - printf("%s", (p->in.op == INCR ? "add" : "sub") ); - prtype(p->in.left); - printf("2 "); - adrput(p->in.right); - printf(","); - adrput(p->in.left); - return; - - case 'F': /* masked constant for fields */ - printf("$%d", (p->in.right->tn.lval&((1<in.op == LS || p->in.op == ASG LS) - printf("shll"); - else if(ISUNSIGNED(p->in.left->in.type)) - printf("shrl"); - else - printf("shar"); - return; - - case 'L': /* type of left operand */ - case 'R': /* type of right operand */ - { - register NODE *n; - extern int xdebug; - - n = getlr ( p, c); - if (xdebug) printf("->%d<-", n->in.type); - - prtype(n); - return; - } - - case 'M': /* initiate ediv for mod and unsigned div */ - { - register char *r; - m = getlr(p, '1')->tn.rval; - r = rname(m); - printf("\tclrl\t%s\n\tmovl\t", r); - adrput(p->in.left); - printf(",%s\n", rname(m+1)); - if(!ISUNSIGNED(p->in.type)) { /* should be MOD */ - m = getlab(); - printf("\tjgeq\tL%d\n\tmnegl\t$1,%s\n", m, r); - deflab(m); - } - } - return; - - case 'U': - /* Truncate int for type conversions: - LONG|ULONG -> CHAR|UCHAR|SHORT|USHORT - SHORT|USHORT -> CHAR|UCHAR - increment offset to correct byte */ - { - register NODE *p1; - int dif; - - p1 = p->in.left; - switch( p1->in.op ){ - case NAME: - case OREG: - dif = tlen(p1)-tlen(p); - p1->tn.lval += dif; - adrput(p1); - p1->tn.lval -= dif; - return; - default: - cerror( "Illegal ZU type conversion" ); - return; - } - } - - case 'T': /* rounded structure length for arguments */ - { - int size; - - size = p->stn.stsize; - SETOFF( size, 4); - printf("movab -%d(sp),sp", size); - return; - } - - case 'S': /* structure assignment */ - { - register NODE *l, *r; - register int size; - - if( p->in.op == STASG ){ - l = p->in.left; - r = p->in.right; - - } - else if( p->in.op == STARG ){ /* store an arg into a temporary */ - l = getlr( p, '3' ); - r = p->in.left; - } - else cerror( "STASG bad" ); - - if( r->in.op == ICON ) r->in.op = NAME; - else if( r->in.op == REG ) r->in.op = OREG; - else if( r->in.op != OREG ) cerror( "STASG-r" ); - - size = p->stn.stsize; - - if( size <= 0 || size > 65535 ) - cerror("structure size <0=0 or >65535"); - - switch(size) { - case 1: - printf(" movb "); - break; - case 2: - printf(" movw "); - break; - case 4: - printf(" movl "); - break; - case 8: - printf(" movl "); - upput(r); - printf(","); - upput(l); - printf("\n movl "); - break; - default: - printf(" movab "); - adrput(l); - printf(",r1\n movab "); - adrput(r); - printf(",r0\n movl $%d,r2\n movblk\n", size); - rname(2); - goto endstasg; - } - adrput(r); - printf(","); - adrput(l); - printf("\n"); - endstasg: - if( r->in.op == NAME ) r->in.op = ICON; - else if( r->in.op == OREG ) r->in.op = REG; - - } - break; - - default: - cerror( "illegal zzzcode" ); - } - } - -rmove( rt, rs, t ) TWORD t;{ - printf( " movl %s,%s\n", rname(rs), rname(rt) ); - if(t==DOUBLE) - printf( " movl %s,%s\n", rname(rs+1), rname(rt+1) ); - } - -struct respref -respref[] = { - INTAREG|INTBREG, INTAREG|INTBREG, - INAREG|INBREG, INAREG|INBREG|SOREG|STARREG|STARNM|SNAME|SCON, - INTEMP, INTEMP, - FORARG, FORARG, - INTEMP, INTAREG|INAREG|INTBREG|INBREG|SOREG|STARREG|STARNM, - 0, 0 }; - -setregs(){ /* set up temporary registers */ - fregs = 6; /* tbl- 6 free regs on Tahoe (0-5) */ - } - -szty(t) TWORD t;{ /* size, in registers, needed to hold thing of type t */ - return(t==DOUBLE ? 2 : 1 ); - } - -rewfld( p ) NODE *p; { - return(1); - } - -callreg(p) NODE *p; { - return( R0 ); - } - -base( p ) register NODE *p; { - register int o = p->in.op; - - if( (o==ICON && p->in.name[0] != '\0')) return( 100 ); /* ie no base reg */ - if( o==REG ) return( p->tn.rval ); - if( (o==PLUS || o==MINUS) && p->in.left->in.op == REG && p->in.right->in.op==ICON) - return( p->in.left->tn.rval ); - if( o==OREG && !R2TEST(p->tn.rval) && (p->in.type==INT || p->in.type==UNSIGNED || ISPTR(p->in.type)) ) - return( p->tn.rval + 0200*1 ); - return( -1 ); - } - -offset( p, tyl ) register NODE *p; int tyl; { - - if(tyl > 8) return( -1 ); - if( tyl==1 && p->in.op==REG && (p->in.type==INT || p->in.type==UNSIGNED) ) return( p->tn.rval ); - if( (p->in.op==LS && p->in.left->in.op==REG && (p->in.left->in.type==INT || p->in.left->in.type==UNSIGNED) && - (p->in.right->in.op==ICON && p->in.right->in.name[0]=='\0') - && (1<in.right->tn.lval)==tyl)) - return( p->in.left->tn.rval ); - return( -1 ); - } - -makeor2( p, q, b, o) register NODE *p, *q; register int b, o; { - register NODE *t; - register int i; - NODE *f; - - p->in.op = OREG; - f = p->in.left; /* have to free this subtree later */ - - /* init base */ - switch (q->in.op) { - case ICON: - case REG: - case OREG: - t = q; - break; - - case MINUS: - q->in.right->tn.lval = -q->in.right->tn.lval; - case PLUS: - t = q->in.right; - break; - - case UNARY MUL: - t = q->in.left->in.left; - break; - - default: - cerror("illegal makeor2"); - } - - p->tn.lval = t->tn.lval; -#ifndef FLEXNAMES - for(i=0; iin.name[i] = t->in.name[i]; -#else - p->in.name = t->in.name; -#endif - - /* init offset */ - p->tn.rval = R2PACK( (b & 0177), o, (b>>7) ); - - tfree(f); - return; - } - -canaddr( p ) NODE *p; { - register int o = p->in.op; - - if( o==NAME || o==REG || o==ICON || o==OREG || (o==UNARY MUL && shumul(p->in.left)) ) return(1); - return(0); - } - -shltype( o, p ) register NODE *p; { - return( o== REG || o == NAME || o == ICON || o == OREG || ( o==UNARY MUL && shumul(p->in.left)) ); - } - -flshape( p ) NODE *p; { - register int o = p->in.op; - - if( o==NAME || o==REG || o==ICON || o==OREG || (o==UNARY MUL && shumul(p->in.left)) ) return(1); - return(0); - } - -shtemp( p ) register NODE *p; { - if( p->in.op == STARG ) p = p->in.left; - return( p->in.op==NAME || p->in.op ==ICON || p->in.op == OREG || (p->in.op==UNARY MUL && shumul(p->in.left)) ); - } - -shumul( p ) register NODE *p; { - register int o; - extern int xdebug; - - if (xdebug) { - printf("\nshumul:op=%d,lop=%d,rop=%d", p->in.op, p->in.left->in.op, p->in.right->in.op); - printf(" prname=%s,plty=%d, prlval=%D\n", p->in.right->in.name, p->in.left->in.type, p->in.right->tn.lval); - } - - o = p->in.op; - if(( o == NAME || (o == OREG && !R2TEST(p->tn.rval)) || o == ICON ) - && p->in.type != PTR+DOUBLE) - return( STARNM ); - - return( 0 ); - } - -special( p, shape ) register NODE *p; { - if( shape==SIREG && p->in.op == OREG && R2TEST(p->tn.rval) ) return(1); - else return(0); -} - -adrcon( val ) CONSZ val; { - printf( "$" ); - printf( CONFMT, val ); - } - -conput( p ) register NODE *p; { - switch( p->in.op ){ - - case ICON: - acon( p ); - return; - - case REG: - printf( "%s", rname(p->tn.rval) ); - return; - - default: - cerror( "illegal conput" ); - } - } - -insput( p ) NODE *p; { - cerror( "insput" ); - } - -upput( p ) register NODE *p; { - /* output the address of the second long in the - pair pointed to by p (for DOUBLEs)*/ - CONSZ save; - - if( p->in.op == FLD ){ - p = p->in.left; - } - switch( p->in.op ){ - - case NAME: - case OREG: - save = p->tn.lval; - p->tn.lval += SZLONG/SZCHAR; - adrput(p); - p->tn.lval = save; - return; - - case REG: - printf( "%s", rname(p->tn.rval+1) ); - return; - - default: - cerror( "illegal upper address" ); - } - } - -adrput( p ) register NODE *p; { - register int r; - /* output an address, with offsets, from p */ - - if( p->in.op == FLD ){ - p = p->in.left; - } - switch( p->in.op ){ - - case NAME: - acon( p ); - return; - - case ICON: - /* addressable value of the constant */ - printf( "$" ); - acon( p ); - return; - - case REG: - printf( "%s", rname(p->tn.rval) ); - if(p->in.type == DOUBLE) /* for entry mask */ - (void) rname(p->tn.rval+1); - return; - - case OREG: - r = p->tn.rval; - if( R2TEST(r) ){ /* double indexing */ - register int flags; - - flags = R2UPK3(r); - if( flags & 1 ) printf("*"); - if( p->tn.lval != 0 || p->in.name[0] != '\0' ) acon(p); - if( R2UPK1(r) != 100) printf( "(%s)", rname(R2UPK1(r)) ); - printf( "[%s]", rname(R2UPK2(r)) ); - return; - } - if( r == FP && p->tn.lval > 0 ){ /* in the argument region */ - if( p->in.name[0] != '\0' ) werror( "bad arg temp" ); - printf( CONFMT, p->tn.lval ); - printf( "(fp)" ); - return; - } - if( p->tn.lval != 0 || p->in.name[0] != '\0') acon( p ); - printf( "(%s)", rname(p->tn.rval) ); - return; - - case UNARY MUL: - /* STARNM or STARREG found */ - if( tshape(p, STARNM) ) { - printf( "*" ); - adrput( p->in.left); - } - return; - - default: - cerror( "illegal address" ); - return; - - } - - } - -acon( p ) register NODE *p; { /* print out a constant */ - - if( p->in.name[0] == '\0' ){ - printf( CONFMT, p->tn.lval); - } - else if( p->tn.lval == 0 ) { -#ifndef FLEXNAMES - printf( "%.8s", p->in.name ); -#else - printf( "%s", p->in.name ); -#endif - } - else { -#ifndef FLEXNAMES - printf( "%.8s+", p->in.name ); -#else - printf( "%s+", p->in.name ); -#endif - printf( CONFMT, p->tn.lval ); - } - } - -genscall( p, cookie ) register NODE *p; { - /* structure valued call */ - return( gencall( p, cookie ) ); - } - -genfcall( p, cookie ) register NODE *p; { - register NODE *p1; - register int m; - static char *funcops[6] = { - "sin", "cos", "sqrt", "exp", "log", "atan" - }; - - /* generate function opcodes */ - if(p->in.op==UNARY FORTCALL && p->in.type==FLOAT && - (p1 = p->in.left)->in.op==ICON && - p1->tn.lval==0 && p1->in.type==INCREF(FTN|FLOAT)) { -#ifdef FLEXNAMES - p1->in.name++; -#else - strcpy(p1->in.name, p1->in.name[1]); -#endif - for(m=0; m<6; m++) - if(!strcmp(p1->in.name, funcops[m])) - break; - if(m >= 6) - uerror("no opcode for fortarn function %s", p1->in.name); - } else - uerror("illegal type of fortarn function"); - p1 = p->in.right; - p->in.op = FORTCALL; - if(!canaddr(p1)) - order( p1, INAREG|INBREG|SOREG|STARREG|STARNM ); - m = match( p, INTAREG|INTBREG ); - return(m != MDONE); -} - -/* tbl */ -int gc_numbytes; -/* tbl */ - -gencall( p, cookie ) register NODE *p; { - /* generate the call given by p */ - register NODE *p1, *ptemp; - register int temp, temp1; - register int m; - - if( p->in.right ) temp = argsize( p->in.right ); - else temp = 0; - - if( p->in.op == STCALL || p->in.op == UNARY STCALL ){ - /* set aside room for structure return */ - - if( p->stn.stsize > temp ) temp1 = p->stn.stsize; - else temp1 = temp; - } - - if( temp > maxargs ) maxargs = temp; - SETOFF(temp1,4); - - if( p->in.right ){ /* make temp node, put offset in, and generate args */ - ptemp = talloc(); - ptemp->in.op = OREG; - ptemp->tn.lval = -1; - ptemp->tn.rval = SP; -#ifndef FLEXNAMES - ptemp->in.name[0] = '\0'; -#else - ptemp->in.name = ""; -#endif - ptemp->in.rall = NOPREF; - ptemp->in.su = 0; - genargs( p->in.right, ptemp ); - ptemp->in.op = FREE; - } - - p1 = p->in.left; - if( p1->in.op != ICON ){ - if( p1->in.op != REG ){ - if( p1->in.op != OREG || R2TEST(p1->tn.rval) ){ - if( p1->in.op != NAME ){ - order( p1, INAREG ); - } - } - } - } - -/* tbl - setup gc_numbytes so reference to ZC works */ - - gc_numbytes = temp&(0x3ff); - - p->in.op = UNARY CALL; - m = match( p, INTAREG|INTBREG ); - - return(m != MDONE); - } - -/* tbl */ -char * -ccbranches[] = { - "eql", - "neq", - "leq", - "lss", - "geq", - "gtr", - "lequ", - "lssu", - "gequ", - "gtru", - }; -/* tbl */ - -cbgen( o, lab, mode ) { /* printf conditional and unconditional branches */ - - if(o != 0 && (o < EQ || o > UGT )) - cerror( "bad conditional branch: %s", opst[o] ); - printf( " j%s L%d\n", - o == 0 ? "br" : ccbranches[o-EQ], lab ); - } - -nextcook( p, cookie ) NODE *p; { - /* we have failed to match p with cookie; try another */ - if( cookie == FORREW ) return( 0 ); /* hopeless! */ - if( !(cookie&(INTAREG|INTBREG)) ) return( INTAREG|INTBREG ); - if( !(cookie&INTEMP) && asgop(p->in.op) ) return( INTEMP|INAREG|INTAREG|INTBREG|INBREG ); - return( FORREW ); - } - -lastchance( p, cook ) NODE *p; { - /* forget it! */ - return(0); - } - -optim2( p ) register NODE *p; { -# ifdef ONEPASS - /* do local tree transformations and optimizations */ -# define RV(p) p->in.right->tn.lval - register int o = p->in.op; - register int i; - - /* change unsigned mods and divs to logicals (mul is done in mip & c2) */ - if(optype(o) == BITYPE && ISUNSIGNED(p->in.left->in.type) - && nncon(p->in.right) && (i=ispow2(RV(p)))>=0){ - switch(o) { - case DIV: - case ASG DIV: - p->in.op = RS; - RV(p) = i; - break; - case MOD: - case ASG MOD: - p->in.op = AND; - RV(p)--; - break; - default: - return; - } - if(asgop(o)) - p->in.op = ASG p->in.op; - } -# endif -} - -struct functbl { - int fop; - char *func; -} opfunc[] = { - DIV, "udiv", - ASG DIV, "udiv", - 0 -}; - -hardops(p) register NODE *p; { - /* change hard to do operators into function calls. */ - register NODE *q; - register struct functbl *f; - register int o; - register TWORD t, t1, t2; - - o = p->in.op; - - for( f=opfunc; f->fop; f++ ) { - if( o==f->fop ) goto convert; - } - return; - - convert: - t = p->in.type; - t1 = p->in.left->in.type; - t2 = p->in.right->in.type; - if ( t1 != UNSIGNED && (t2 != UNSIGNED)) return; - - /* need to rewrite tree for ASG OP */ - /* must change ASG OP to a simple OP */ - if( asgop( o ) ) { - q = talloc(); - q->in.op = NOASG ( o ); - q->in.rall = NOPREF; - q->in.type = p->in.type; - q->in.left = tcopy(p->in.left); - q->in.right = p->in.right; - p->in.op = ASSIGN; - p->in.right = q; - zappost(q->in.left); /* remove post-INCR(DECR) from new node */ - fixpre(q->in.left); /* change pre-INCR(DECR) to +/- */ - p = q; - - } - /* turn logicals to compare 0 */ - else if( logop( o ) ) { - ncopy(q = talloc(), p); - p->in.left = q; - p->in.right = q = talloc(); - q->in.op = ICON; - q->in.type = INT; -#ifndef FLEXNAMES - q->in.name[0] = '\0'; -#else - q->in.name = ""; -#endif - q->tn.lval = 0; - q->tn.rval = 0; - p = p->in.left; - } - - /* build comma op for args to function */ - t1 = p->in.left->in.type; - t2 = 0; - if ( optype(p->in.op) == BITYPE) { - q = talloc(); - q->in.op = CM; - q->in.rall = NOPREF; - q->in.type = INT; - q->in.left = p->in.left; - q->in.right = p->in.right; - t2 = p->in.right->in.type; - } else - q = p->in.left; - - p->in.op = CALL; - p->in.right = q; - - /* put function name in left node of call */ - p->in.left = q = talloc(); - q->in.op = ICON; - q->in.rall = NOPREF; - q->in.type = INCREF( FTN + p->in.type ); -#ifndef FLEXNAMES - strcpy( q->in.name, f->func ); -#else - q->in.name = f->func; -#endif - q->tn.lval = 0; - q->tn.rval = 0; - - } - -zappost(p) NODE *p; { - /* look for ++ and -- operators and remove them */ - - register int o, ty; - register NODE *q; - o = p->in.op; - ty = optype( o ); - - switch( o ){ - - case INCR: - case DECR: - q = p->in.left; - p->in.right->in.op = FREE; /* zap constant */ - ncopy( p, q ); - q->in.op = FREE; - return; - - } - - if( ty == BITYPE ) zappost( p->in.right ); - if( ty != LTYPE ) zappost( p->in.left ); -} - -fixpre(p) NODE *p; { - - register int o, ty; - o = p->in.op; - ty = optype( o ); - - switch( o ){ - - case ASG PLUS: - p->in.op = PLUS; - break; - case ASG MINUS: - p->in.op = MINUS; - break; - } - - if( ty == BITYPE ) fixpre( p->in.right ); - if( ty != LTYPE ) fixpre( p->in.left ); -} - -NODE * addroreg(l) NODE *l; - /* OREG was built in clocal() - * for an auto or formal parameter - * now its address is being taken - * local code must unwind it - * back to PLUS/MINUS REG ICON - * according to local conventions - */ -{ - cerror("address of OREG taken"); -} - -# ifndef ONEPASS -main( argc, argv ) char *argv[]; { - return( mainp2( argc, argv ) ); - } -# endif - -myreader(p) register NODE *p; { - walkf( p, hardops ); /* convert ops to function calls */ - canon( p ); /* expands r-vals for fileds */ - walkf( p, optim2 ); - } DELETED old/pcc/ccom.vax/DEBUGS Index: old/pcc/ccom.vax/DEBUGS ================================================================== --- old/pcc/ccom.vax/DEBUGS +++ old/pcc/ccom.vax/DEBUGS @@ -1,56 +0,0 @@ -Copyright (c) 1985 Regents of the University of California. -All rights reserved. The Berkeley software License Agreement -specifies the terms and conditions for redistribution. - - @(#)DEBUGS 5.1 (Berkeley) 01/08/86 - -WHAT THE DEBUG FLAGS MEAN: - -Debug flags preceded with an X are first pass flags; the rest are -second pass flags. - --Xa: Print the actions taken for each operator as parse trees are - assembled, from buildtree(). - --Xb: Extra information from buildtree() on parse tree assembly. May - be used to increase the information from -Xa. - --Xd: Print information about declarations, from many places in pftn.c. - May be repeated to get still more information. - --Xi: Information about initializations, from several places in pftn.c. - --a: From rallo(), print the address of the tree being worked on for - the purpose of allocating registers, and indicate what this - tree's requirements have been determined to be. - --e: Print the expression tree at useful places, e.g. when an - expression appears in the intermediate code file as a - statement, or just before store() is called in codgen(). - --l: Print line number and file name at the end of every statement. - --o: Print the expression tree when order() is called, and whenever - the loop in order() takes us to the top after a rewrite. Also - prints the tree with extra info when a rewrite is forced due - lack of a matching template. - --r: Identify the register being worked on and what's in it and - sometimes why it's being worked on, from rfree(), rbusy() and - reclaim(). - --s: From tshape(), print the address of the given node and the - shape that it's being tested against. The opcode for the node - is also printed. - --t: From ttype(), print the node type and the type template which - the node is being tested against. - --u: Previously used to debug the Sethi-Ullman algorithm, currently - defunct. - --v: Report on multi-level tree matching. Very verbose. - --x: Prints intermediate code instructions in mainp2(); also used to - debug zzzcode(), the routine that does specialized template - interpretation. DELETED old/pcc/ccom.vax/INFO Index: old/pcc/ccom.vax/INFO ================================================================== --- old/pcc/ccom.vax/INFO +++ old/pcc/ccom.vax/INFO @@ -1,188 +0,0 @@ -Copyright (c) 1985 Regents of the University of California. -All rights reserved. The Berkeley software License Agreement -specifies the terms and conditions for redistribution. - - @(#)INFO 5.1 (Berkeley) 01/08/86 - -HOW TO INTERPRET TEMPLATES: - -Goals (represented by 'visit' fields) indicate the shape of what is -produced by using a template: - - Goal Form of result - - FOREFF Can be used for just side effects. Used for things - like initializing data, or gotos. - INAREG Result can end up in a register. - INTAREG Result can end up in a scratch register. - INBREG Result can end up in an index, address or floating - point register -- not used on the VAX. - INTBREG The same except for temporary index registers. - FORCC Condition codes are set. - INTEMP Computes into a temporary location. - FORARG Computes a function argument onto the stack. - FORREW Forces the code generator to rewrite the tree. - -Shapes are restrictions on operands: - - Shape Form of operand - - SANY Anything. - - SAREG A register. - STAREG A temporary register (one that can be stomped on). - SBREG A secondary register -- not used on the VAX. - STBREG Ditto except this a temporary register. - - SCON An int (32-bit or smaller) constant. - SCCON A short (16-bit) constant. - SSCON A char (8-bit) constant. - SZERO The constant 0. - SONE The constant 1. - SMONE The constant -1. - - SCC Condition codes. - - SNAME A constant address; not on the stack or indirect - through a pointer. - - SFLD A bit field. - - SOREG A value whose address is the sum of a register and an - offset. E.g. 8(ap). - SSOREG A 'simple' OREG: not a pointer (e.g. rules out *8(ap)). - SWADD A value with an offset that is larger than a byte. - STARNM A value whose address is at some known address. - An indirect value. E.g. *_a, *8(ap). - STARREG Indirect through a register with auto-increment or - -decrement. - -Types restrict the type of an operand. There are two ways of -representing types in the compiler; one is a specific type that -indicates things like indirection, and the other is used as a template -for the first. To see whether a type matches a template, you call -ttype(). The template variety is what you see in code templates, and -has its own typedef, TWORD. Here are some things you can ask for in -the way of type templates: - - Name What it buys you - - TANY Matches anything 'within reason'. - - TCHAR Chars. - TUCHAR Unsigned chars. - TSHORT Shorts. - TUSHORT Unsigned shorts. - TINT Ints. - TLONG Longs. (VAX ints.) - TULONG Unsigned longs. - TUNSIGNED Any unsigned type. - TWORD An integral type the size of an int, or a pointer. - - TFLOAT Floats. - TDOUBLE Doubles. - - TSTRUCT Structures or unions. - - TPTRTO A pointer. This must be or'ed in with other types; - e.g. TPTRTO|TFLOAT|TDOUBLE matches pointers to floats - or pointers to doubles. Can be multiply indirect. - TPOINT Complex types -- things with stars or brackets or etc. - - WPTR Pointer to anything except structures/unions. - ANYSIGNED Pointers or signed integral types. - ANYUSIGNED Any unsigned integral type. - ANYFIXED Any integral type (excludes floating point or structs). - -The template may request special resources. These are indicated by -things in the needs field of a template: - - Needs Resource wanted - - NAREG Needs a register. Can be multiplied up to 4 times - to get up to 4 registers. - NBREG Ditto for secondary registers (not used on the VAX). - NASL Can share a register with the left operand. - NASR Can share a register with the right operand. - NTEMP Needs stack space. Can be multiplied up to 8 times. - EITHER Don't settle for some of A and some of B. - -The template indicates where the results end up, too. The symbols in the -rewrite field have the following meanings: - - Result Where the result is - - RNULL Don't care about the result -- clobber it. - RLEFT Register associated with the left operand. - RRIGHT Register associated with the right operand. - RESC1 First register requested by 'needs'. - RESC2 Second register requested by 'needs'. - RESC3 Third register requested by 'needs'. - RESCC The condition codes. - RNOP Doesn't make anything -- e.g. initializations, gotos. - -The assembly language templates contain capital letter abbreviations -which are expanded in context to whatever is useful. These -abbreviations may be 1, 2 or 3 characters long; the first character -codes for the length and generally tells what to do. A standard second -or third character often indicates the location of an object in the -following way: - - Modifier Meaning - - L Left operand. - R Right operand - 1, 2, 3 Nth requested register (from 'needs'). - -Below are the various abbreviations; 'n' is used to indicate one of the -standard modifiers: - - Abbreviation Rewrites as - - An Address of operand n -- the most common abbreviation. - Produces register names, externals, almost everything. - Bn Byte offset in a word (? -- not used on VAX). - Cn Only constants may be written this way. - F The rest of the line is ignored if this value is - only being computed for side effects. - H Field shift; used with masks and bit fields. - In Illegal -- not currently used. - L A label. - M Field mask. - N Field mask, complemented. - O[BWLFD] Opcode string; used to rewrite operands of templates - with generic opcodes like add, sub, mul. The modifier - is changed to lower case and appended. For example if - the template is OPFLOAT, the abbreviation is 'OD2' and - the current node's operand is OPMUL, you get 'muld2'. - S Field size. - T Rewriting of the register type is suppressed. I'm not - sure what's going on but here's the explanation: 'The C - language requires intermediate results to change type. - This is inefficient or impossible on some machines; the - "T" command in match supresses this type changing.' - Un Illegal -- not currently used. - Zx Local abbreviations (zzzcode()). The x's are spelled - out below: - ZA Used for straightforward conversions and assignments. - Clever perhaps to excess in its coding. - ZB Gets difficult shapes into register prior to a shift. - ZC Interpolates the argument count in a function call. - ZD Get the value of the operand, then increment or - decrement the original, depending on the opcode. - ZE Increment or decrement the operand. - ZF Produces 'd', 'f' or 'l' depending on whether the - right operand (the node itself, for unary operators) - is double, float or long; used for moves into register. - ZI Produces the appropriate conditional branch. - ZL Opcode type [bwlfd] for the left operand. - ZN Produces a jump and a clear to get logical values - converted into 0 or 1. - ZP Just like ZI. - ZR Opcode type [bwlfd] for the right operand. - ZS Generates a structure assignment. - ZT Rounds up structure lengths for struct arguments. - ZU Subtracts the value of the constant right operand from - 32 and uses that for unsigned right shift offsets. - ZZ Complements the value of the constant right operand of - a bit instruction and produces it. Index: old/pcc/ccom.vax/local2.c ================================================================== --- old/pcc/ccom.vax/local2.c +++ old/pcc/ccom.vax/local2.c @@ -1,7 +1,7 @@ # ifndef lint -static char *sccsid ="@(#)local2.c 1.13 (Berkeley) 01/08/86"; +static char *sccsid ="@(#)local2.c 1.12 (Berkeley) 08/23/85"; # endif # include "pass2.h" # include "ctype.h" # ifdef FORT @@ -306,46 +306,10 @@ r = x; } l->in.type = (ISUNSIGNED(l->in.type) ? UNSIGNED : INT); } - if ((r->in.type == UNSIGNED || r->in.type == ULONG) && - mixtypes(l, r)) { - int label1, label2; - - label1 = getlab(); - label2 = getlab(); - - putstr("movl\t"); - adrput(r); - putchar(','); - adrput(l); - putstr("\n\tbbsc\t$31,"); - adrput(l); - printf(",L%d\n\tcvtl", label1); - prtype(l); - putchar('\t'); - adrput(l); - putchar(','); - adrput(l); - printf("\n\tjbr\tL%d\nL%d:\n\tcvtl", label2, label1); - prtype(l); - putchar('\t'); - adrput(l); - putchar(','); - adrput(l); - putstr("\n\tadd"); - prtype(l); - putstr("2\t$0"); - prtype(l); - putstr("2.147483648e9,"); - adrput(l); - printf("\nL%d:", label2); - - return; - } - if (!mixtypes(l,r)) { if (tlen(l) == tlen(r)) { putstr("mov"); #ifdef FORT if (Oflag) @@ -378,43 +342,10 @@ putchar(','); adrput(l); return; } - case 'G': /* i *= f; asgops with int lhs and float rhs */ - { - register NODE *l, *r, *s; - int rt; - - l = p->in.left; - r = p->in.right; - s = talloc(); - rt = r->in.type; - - s->in.op = SCONV; - s->in.left = l; - s->in.type = rt; - zzzcode(s, 'A'); - putstr("\n\t"); - - hopcode(rt == FLOAT ? 'F' : 'D', p->in.op); - putstr("2\t"); - adrput(r); - putchar(','); - adrput(resc); - putstr("\n\t"); - - s->in.op = ASSIGN; - s->in.left = l; - s->in.right = resc; - s->in.type = l->in.type; - zzzcode(s, 'A'); - - s->in.op = FREE; - return; - } - case 'B': /* get oreg value in temp register for left shift */ { register NODE *r; if (xdebug) eprint(p, 0, &val, &val); r = p->in.right; @@ -1144,13 +1075,10 @@ l->in.type == FLOAT || l->in.type == DOUBLE ) return; #else if( mixtypes(p, l) ) return; #endif - if( l->in.op == PCONV ) - return; - /* Only trust it to get it right if the size is the same */ if( tlen(p) != tlen(l) ) return; /* clobber conversion */ Index: old/pcc/ccom.vax/order.c ================================================================== --- old/pcc/ccom.vax/order.c +++ old/pcc/ccom.vax/order.c @@ -1,7 +1,7 @@ #ifndef lint -static char *sccsid ="@(#)order.c 1.7 (Berkeley) 01/08/86"; +static char *sccsid ="@(#)order.c 1.6 (Berkeley) 04/02/85"; #endif lint # include "pass2.h" int maxargs = { -1 }; @@ -448,11 +448,10 @@ genargs( p ) register NODE *p; { register NODE *pasg; register align; register size; - int count; /* generate code for the arguments */ /* first, do the arguments on the right */ while( p->in.op == CM ){ @@ -471,15 +470,19 @@ } else { /* make it look beautiful... */ p->in.op = UNARY MUL; canon( p ); /* turn it into an oreg */ - for( count = 0; p->in.op != OREG && count < 10; ++count ){ + if( p->in.op != OREG ){ offstar( p->in.left ); canon( p ); + if( p->in.op != OREG ){ + offstar( p->in.left ); + canon( p ); + if( p->in.op != OREG ) cerror( "stuck starg" ); + } } - if( p->in.op != OREG ) cerror( "stuck starg" ); } pasg = talloc(); pasg->in.op = STARG; pasg->in.rall = NOPREF; Index: old/pcc/ccom.vax/table.c ================================================================== --- old/pcc/ccom.vax/table.c +++ old/pcc/ccom.vax/table.c @@ -1,7 +1,7 @@ #ifndef lint -static char *sccsid ="@(#)table.c 1.13 (Berkeley) 01/08/86"; +static char *sccsid ="@(#)table.c 1.12 (Berkeley) 12/10/85"; #endif lint # include "pass2.h" # define WPTR TPTRTO|TINT|TLONG|TFLOAT|TDOUBLE|TPOINT|TUNSIGNED|TULONG @@ -43,11 +43,11 @@ SANY, TFLOAT, NAREG|NASL, RESC1|RESCC, " cvtdf AL,A1\n", SCONV, INTAREG|FORCC, - SAREG|AWD, ANYSIGNED, + SAREG|AWD, ANYSIGNED|TUNSIGNED|TULONG, SANY, TFLOAT, NAREG|NASL, RESC1|RESCC, " cvtZLf AL,TA1\n", SCONV, INTAREG|FORCC, @@ -749,20 +749,10 @@ SAREG|AWD, TFLOAT, SAREG|AWD, TDOUBLE, NAREG, RLEFT|RESC1|RESCC, " cvtfd AL,A1\n OD2 AR,A1\n cvtdf A1,AL\n", -ASG OPFLOAT, INAREG|FOREFF|FORCC, - SAREG|AWD, ANYFIXED, -#ifndef SPRECC - SAREG|AWD, TDOUBLE, /* force FLOAT to register */ -#else - SAREG|AWD, TFLOAT|TDOUBLE, -#endif - NAREG, RLEFT|RESCC, /* usable() knows we need a reg pair */ - " ZG\n", - OPFLOAT, INAREG|INTAREG|FORCC, STAREG, TDOUBLE, SAREG|AWD, TDOUBLE, 0, RLEFT|RESCC, " OD2 AR,AL\n", Index: old/pcc/lint/llibs/llib-lc ================================================================== --- old/pcc/lint/llibs/llib-lc +++ old/pcc/lint/llibs/llib-lc @@ -1,6 +1,6 @@ -/* llib-lc 1.29 86/01/07 */ +/* llib-lc 1.28 85/11/28 */ /* LINTLIBRARY */ #include #include #include #include @@ -41,13 +41,13 @@ int fork() { return(0); } int fsync( f ) { return 0; } int fstat(f, b) struct stat *b; { return(0); } int ftruncate( d, l) off_t l; { return 0;} int getdtablesize() { return 20 ; } -gid_t getegid() { return((gid_t)1); } -uid_t geteuid() { return((uid_t)1); } -gid_t getgid() { return((gid_t)1); } +int getegid() { return(1); } +int geteuid() { return(1); } +int getgid() { return(1); } int getgroups( n, g ) int *n, *g; { return 0; } long gethostid() { return 1L; } int gethostname( n, l ) char *n; int l; { return 0 ;} int getitimer( w, v ) struct itimerval *v; { return 0; } int getpagesize() { return 1; } @@ -58,11 +58,11 @@ int getrlimit( res, rip) struct rlimit *rip; { return 0;} int getrusage( res, rip) struct rusage *rip; { return 0;} int getsockname(s, name, namelen) char *name; int *namelen; { return(0); } int getsockopt( s, level, opt, buf, len ) { return 0;} int gettimeofday( t, z ) struct timeval *t; struct timezone *z; { return 0;} -uid_t getuid() { return((uid_t)1); } +int getuid() { return(1); } int ioctl( d, r, p) char *p; { return 0;} int kill(p, s) { return(0); } int killpg( pg, s) { return 0;} int link(a, b) char *a, *b; { return(0); } int listen( s, b ){ return 0; } @@ -105,12 +105,12 @@ int sethostid( h ) long h; { return 0;} int sethostname( n, l ) char *n; int l; { return 0 ;} int setitimer( w, v, ov ) struct itimerval *v, *ov; { return 0; } int setpgrp( g, pg) { return 0; } int setpriority( w, who, pri ) { return 1;} -int setregid( r, e) gid_t r, e; { return 0; } -int setreuid( r, e) uid_t r, e; { return 0; } +int setregid( r, e){ return 0; } +int setreuid( r, e){ return 0; } int setrlimit( res, rip) struct rlimit *rip; { return 0;} /* VARARGS */ int setsockopt( s, level, opt, buf, len ) char *buf; { return 0;} int settimeofday( t, z ) struct timeval *t; struct timezone *z; { return 0;} int shutdown( s, h ){ return 0;} @@ -218,17 +218,17 @@ int scandir(d, n, s, c) char *d; struct direct *(*n[]); int (*s)(),(*c)(); { return 1; } void seekdir( p, l) DIR *p; long l; {} int setfsent() { return 0; } int setgrent() { return 0; } -int setgid(g) gid_t g; { return(0); } +int setgid(g) { return(0); } int setjmp(e) jmp_buf e; { return(0); } setkey(k) char *k; {} int setlogmask(m) { return(0); } setpwent() {} long * setstate( st ) long *st; { return st; } -int setuid(u) uid_t u; { return(0); } +int setuid(u) { return(0); } sleep(i) unsigned i; {} int srand(s){ return s; } char * strcat(a, b) char *a, *b; { return a; } int strcmp(a, b) char *a, *b; { return(1); } char * strcpy(a, b) char *a, *b; { return a; } Index: old/pcc/lint/lpass1/lint.c ================================================================== --- old/pcc/lint/lpass1/lint.c +++ old/pcc/lint/lpass1/lint.c @@ -1,7 +1,7 @@ #ifndef lint -static char sccsid[] = "@(#)lint.c 1.8 (Berkeley) 01/08/86"; +static char sccsid[] = "@(#)lint.c 1.7 (Berkeley) 10/25/85"; #endif lint # include "pass1.h" # include "lmanifest.h" @@ -649,11 +649,10 @@ /* in addition, any special features (such as rewriting exclusive or) are easily handled here as well */ register o; register unsigned t, tl; - int s; switch( o = p->in.op ){ case SCONV: case PCONV: @@ -697,24 +696,10 @@ case PMCONV: if( p->in.right->in.op != ICON ) cerror( "bad conversion"); p->in.op = FREE; return( buildtree( o==PMCONV?MUL:DIV, p->in.left, p->in.right ) ); - case RS: - case LS: - case ASG RS: - case ASG LS: - if( p->in.right->in.op != ICON ) - break; - s = p->in.right->tn.lval; - if( s < 0 ) - werror( "negative shift" ); - else - if( s >= dimtab[ p->fn.csiz ] ) - werror( "shift greater than size of object" ); - break; - } return(p); } Index: old/pcc/lint/lpass1/macdefs.h ================================================================== --- old/pcc/lint/lpass1/macdefs.h +++ old/pcc/lint/lpass1/macdefs.h @@ -1,6 +1,6 @@ -/* @(#)macdefs.h 1.5 (Berkeley) 01/08/86 */ +/* @(#)macdefs.h 1.4 (Berkeley) 08/28/85 */ #if defined(pdp11) || defined(vax) #define makecc(val,i) lastcon |= val<<(8*i); /* pdp-11 womp next char */ #else #define makecc(val,i) lastcon = i ? (val<<8)|lastcon : val @@ -69,14 +69,13 @@ # define incode(a,s) (inoff += (s)) # define fincode(a,s) (inoff += (s) ) # define vfdzero(n) (inoff += (n)) # define aobeg() # define aoend() -# define econvert(p) # ifndef unix # define NOFORTRAN {extern int pflag; if(pflag) werror( "fortran keyword nonportable" );} # else # define NOFORTRAN { werror( "fortran keyword nonportable" ); } # endif # define LINT Index: old/pcc/mip/allo.c ================================================================== --- old/pcc/mip/allo.c +++ old/pcc/mip/allo.c @@ -1,7 +1,7 @@ #ifndef lint -static char *sccsid ="@(#)allo.c 4.8 (Berkeley) 01/08/86"; +static char *sccsid ="@(#)allo.c 4.7 (Berkeley) 08/22/85"; #endif lint # include "pass2.h" NODE resc[3]; @@ -197,23 +197,16 @@ } else { if( n & NBMASK ) return(0); } /* - * Some special cases that require register pairs... - * Have to check for ==, <=, etc. because the result is type int - * but need a register pair temp if either side is wide. - * For +=, *= etc. where lhs is narrow and rhs is wide, the temp - * register must be wide. + * Have to check for ==, <=, etc. because the result is type INT + * but need a register pair temp if either side is real. */ - if( (n&NAMASK) && - (szty(p->in.type) == 2 || - (logop(p->in.op) && (szty(p->in.left->in.type) == 2 || - szty(p->in.right->in.type) == 2)) || - (asgop(p->in.op) && szty(p->in.right->in.type) == 2 && - szty(p->in.left->in.type) == 1)) - ){ + if( (n&NAMASK) && (szty(p->in.type) == 2 || + logop(p->in.op) && (szty(p->in.left->in.type) == 2 || + szty(p->in.right->in.type) == 2)) ){ /* only do the pairing for real regs */ #ifndef NOEVENODD if( r&01 ) return(0); #endif if( !istreg(r+1) ) return( 0 ); if( busy[r+1] > 1 ) return( 0 ); Index: old/pcc/mip/optim.c ================================================================== --- old/pcc/mip/optim.c +++ old/pcc/mip/optim.c @@ -1,7 +1,7 @@ #ifndef lint -static char *sccsid ="@(#)optim.c 4.7 (Berkeley) 01/08/86"; +static char *sccsid ="@(#)optim.c 4.6 (Berkeley) 08/22/85"; #endif lint # include "pass1.h" # define SWAP(p,q) {sp=p; p=q; q=sp;} @@ -134,11 +134,16 @@ if( (o == MUL || o == ASG MUL) && nncon(p->in.right) && (i=ispow2(RV(p)))>=0){ if( i == 0 ) /* multiplication by 1 */ goto zapright; - /* c2 will turn 'i << 1' into 'i + i' for us */ + if( i == 1 && optype(LO(p)) == LTYPE){ + /* multiplication by 2 */ + p->in.op = (asgop(o) ? ASG PLUS : PLUS); + o = p->in.op; + ncopy(p->in.right, p->in.left); + } else { p->in.op = (asgop(o) ? ASG LS : LS); o = p->in.op; p->in.right->in.type = p->in.right->fn.csiz = INT; RV(p) = i; @@ -174,33 +179,10 @@ o == ASG PLUS || o == ASG MINUS || o == OR || o == ER || o == LS || o == RS ) goto zapright; } - if( o != LS && o != RS ) - break; - /* FALL THROUGH */ - - case ASG RS: - case ASG LS: - if( !ISUNSIGNED(p->in.left->in.type) ) - break; - if( p->in.right->in.op == ICON && - p->in.right->tn.lval < 0 ) { - /* - * Technically negative shifts are illegal - * but we can support them, at least with - * constants; you take potluck with variables. - */ - p->in.right->tn.lval = -p->in.right->tn.lval; - switch( o ){ - case LS: p->in.op = RS; break; - case ASG LS: p->in.op = ASG RS; break; - case RS: p->in.op = LS; break; - case ASG RS: p->in.op = ASG LS; break; - } - } break; case ASG DIV: case DIV: if( nncon( p->in.right ) ){ Index: old/pcc/mip/pftn.c ================================================================== --- old/pcc/mip/pftn.c +++ old/pcc/mip/pftn.c @@ -1,7 +1,7 @@ #ifndef lint -static char *sccsid ="@(#)pftn.c 1.10 (Berkeley) 01/08/86"; +static char *sccsid ="@(#)pftn.c 1.9 (Berkeley) 08/22/85"; #endif lint # include "pass1.h" unsigned int offsz; @@ -765,14 +765,11 @@ } } if( dimtab[s]==0 ) { - if( ty == STRTY ) - uerror( "undefined structure" ); - else - uerror( "unknown size"); + uerror( "unknown size"); return( SZINT ); } return( (unsigned int) dimtab[ s ] * mult ); } @@ -915,15 +912,10 @@ t = DECREF(t); ++d; continue; } else if( t == STRTY ){ - if( dimtab[pstk->in_s] == 0 ){ - uerror( "can't initialize undefined structure" ); - iclass = -1; - return; - } id = dimtab[pstk->in_x]; p = &stab[id]; if( p->sclass != MOS && !(p->sclass&FIELD) ) cerror( "insane structure member list" ); t = p->stype; d = p->dimoff; @@ -988,11 +980,10 @@ switch( iclass ){ case EXTERN: case AUTO: case REGISTER: - case -1: return; } pstk = instack; Index: old/pcc/mip/trees.c ================================================================== --- old/pcc/mip/trees.c +++ old/pcc/mip/trees.c @@ -1,7 +1,7 @@ #ifndef lint -static char *sccsid ="@(#)trees.c 4.10 (Berkeley) 01/08/86"; +static char *sccsid ="@(#)trees.c 4.9 (Berkeley) 08/22/85"; #endif # include "pass1.h" # include @@ -945,11 +945,10 @@ p->in.right = r; return(p); } -#ifndef econvert econvert( p ) register NODE *p; { /* change enums to ints, or appropriate types */ register TWORD ty; @@ -963,11 +962,10 @@ p->fn.csiz = ty; MODTYPE(p->in.type,ty); if( p->in.op == ICON && ty != LONG ) p->in.type = p->fn.csiz = INT; } } -#endif NODE * pconvert( p ) register NODE *p; { /* if p should be changed into a pointer, do so */ @@ -1082,11 +1080,11 @@ tymatch(p) register NODE *p; { /* satisfy the types of various arithmetic binary ops */ /* rules are: - if assignment, type of LHS + if assignment, op, type of LHS if any float or doubles, make double if any longs, make long otherwise, make int if either operand is unsigned, the result is... */ @@ -1124,11 +1122,11 @@ t = DOUBLE; #endif else if( t1==LONG || t2==LONG ) t = LONG; else t = INT; - if( o == ASSIGN || o == CAST || o == RETURN ){ + if( asgop(o) ){ tu = p->in.left->in.type; t = t1; } else { tu = (u && UNSIGNABLE(t))?ENUNSIGN(t):t; @@ -1137,15 +1135,13 @@ /* because expressions have values that are at least as wide as INT or UNSIGNED, the only conversions needed are those involving FLOAT/DOUBLE, and those from LONG to INT and ULONG to UNSIGNED */ - if( t != t1 && ! asgop(o) ) - p->in.left = makety( p->in.left, tu, 0, (int)tu ); + if( t != t1 ) p->in.left = makety( p->in.left, tu, 0, (int)tu ); - if( t != t2 || o==CAST ) - p->in.right = makety( p->in.right, tu, 0, (int)tu ); + if( t != t2 || o==CAST ) p->in.right = makety( p->in.right, tu, 0, (int)tu ); if( asgop(o) ){ p->in.type = p->in.left->in.type; p->fn.cdim = p->in.left->fn.cdim; p->fn.csiz = p->in.left->fn.csiz; Index: old/rogue/machdep.c ================================================================== --- old/rogue/machdep.c +++ old/rogue/machdep.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)machdep.c 5.2 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)machdep.c 5.1 (Berkeley) 05/30/85"; #endif not lint /* * Various installation dependent routines * @@ -48,19 +48,21 @@ * too high (if not defined, it is the same as * CHECKTIME). */ # include -# include "machdep.h" +# include "extern.h" # include # include # include # include # ifdef SCOREFILE +# ifndef LOCK_EX static char *Lockfile = "/tmp/.fredlock"; +# endif # ifndef NUMSCORES # define NUMSCORES 10 # define NUMNAME "Ten" # endif NUMSCORES @@ -170,14 +172,12 @@ { # ifdef TIOCGLTC ioctl(1, TIOCGLTC, &Ltc); Got_ltc = TRUE; Orig_dsusp = Ltc.t_dsuspc; - if (Orig_dsusp == CTRL(Y)) { - Ltc.t_dsuspc = Ltc.t_suspc; - ioctl(1, TIOCSLTC, &Ltc); - } + Ltc.t_dsuspc = Ltc.t_suspc; + ioctl(1, TIOCSLTC, &Ltc); # endif TIOCGLTC } /* * start_score: Index: old/sysline/sysline.c ================================================================== --- old/sysline/sysline.c +++ old/sysline/sysline.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)sysline.c 5.6 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)sysline.c 5.5 (Berkeley) 11/01/85"; #endif not lint /* * sysline - system status display on 25th line of terminal * j.k.foderaro @@ -1183,17 +1183,14 @@ /* the "-1" below is to avoid cursor wraparound problems */ columns = tgetnum("co") - 1; if (window) { strcpy(to_status_line, "\r"); + strcpy(from_status_line, ""); cp = dis_status_line; /* use the clear line sequence */ *cp++ = '\r'; tgetstr("ce", &cp); - if (leftline) - strcpy(from_status_line, dis_status_line + 1); - else - strcpy(from_status_line, ""); } else { cp = to_status_line; tgetstr("ts", &cp); cp = from_status_line; tgetstr("fs", &cp); Index: old/tar/tar.1 ================================================================== --- old/tar/tar.1 +++ old/tar/tar.1 @@ -1,6 +1,6 @@ -.\" @(#)tar.1 6.3 (Berkeley) 01/07/86 +.\" @(#)tar.1 6.2 (Berkeley) 06/07/85 .\" .TH TAR 1 "" .AT 3 .SH NAME tar \- tape archiver @@ -140,12 +140,11 @@ Forces input and output blocking to 20 blocks per record. This option was added so that .I tar can work across a communications channel where the blocking may not be maintained. -.TP 10 -.B C +.PP If a file name is preceded by .BR \-C , then .I tar will perform a Index: sbin/dump/main.c ================================================================== --- sbin/dump/main.c +++ sbin/dump/main.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)main.c 5.2 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)main.c 5.1 (Berkeley) 06/05/85"; #endif not lint #include "dump.h" int notify = 0; /* notify operator flag */ @@ -17,12 +17,10 @@ int ntrec = NTREC; /* # tape blocks in each tape record */ int cartridge = 0; /* Assume non-cartridge tape */ #ifdef RDUMP char *host; #endif -int anydskipped; /* set true in mark() if any directories are skipped */ - /* this lets us avoid map pass 2 in some cases */ main(argc, argv) int argc; char *argv[]; { @@ -223,22 +221,18 @@ TP_BSIZE); clrmap = (char *)calloc(msiz, sizeof(char)); dirmap = (char *)calloc(msiz, sizeof(char)); nodmap = (char *)calloc(msiz, sizeof(char)); - anydskipped = 0; msg("mapping (Pass I) [regular files]\n"); pass(mark, (char *)NULL); /* mark updates esize */ - if (anydskipped) { - do { - msg("mapping (Pass II) [directories]\n"); - nadded = 0; - pass(add, dirmap); - } while(nadded); - } else /* keep the operators happy */ - msg("mapping (Pass II) [directories]\n"); + do { + msg("mapping (Pass II) [directories]\n"); + nadded = 0; + pass(add, dirmap); + } while(nadded); bmapest(clrmap); bmapest(nodmap); if (cartridge) { Index: sbin/dump/traverse.c ================================================================== --- sbin/dump/traverse.c +++ sbin/dump/traverse.c @@ -3,58 +3,59 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)traverse.c 5.3 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)traverse.c 5.2 (Berkeley) 08/05/85"; #endif not lint #include "dump.h" pass(fn, map) - register int (*fn)(); - register char *map; + int (*fn)(); + char *map; { - register int bits; + struct dinode *dp; + int bits; ino_t maxino; maxino = sblock->fs_ipg * sblock->fs_ncg - 1; for (ino = 0; ino < maxino; ) { - if ((ino % NBBY) == 0) { + if((ino % NBBY) == 0) { bits = ~0; - if (map != NULL) + if(map != NULL) bits = *map++; } ino++; - if (bits & 1) - (*fn)(getino(ino)); + if(bits & 1) { + dp = getino(ino); + (*fn)(dp); + } bits >>= 1; } } mark(ip) struct dinode *ip; { - register int f; - extern int anydskipped; + register f; f = ip->di_mode & IFMT; - if (f == 0) + if(f == 0) return; BIS(ino, clrmap); - if (f == IFDIR) + if(f == IFDIR) BIS(ino, dirmap); if ((ip->di_mtime >= spcl.c_ddate || ip->di_ctime >= spcl.c_ddate) && !BIT(ino, nodmap)) { BIS(ino, nodmap); if (f != IFREG && f != IFDIR && f != IFLNK) { esize += 1; return; } est(ip); - } else if (f == IFDIR) - anydskipped = 1; + } } add(ip) register struct dinode *ip; { Index: sbin/ncheck/ncheck.c ================================================================== --- sbin/ncheck/ncheck.c +++ sbin/ncheck/ncheck.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)ncheck.c 5.4 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)ncheck.c 5.3 (Berkeley) 10/08/85"; #endif not lint /* * ncheck -- obtain file names from reading filesystem */ @@ -279,12 +279,11 @@ daddr_t lbn, d; for(;;) { if (dirp->loc >= dirp->ip->di_size) return NULL; - if (blkoff(&sblock, dirp->loc) == 0) { - lbn = lblkno(&sblock, dirp->loc); + if ((lbn = lblkno(&sblock, dirp->loc)) == 0) { d = bmap(lbn); if(d == 0) return NULL; bread(fsbtodb(&sblock, d), dirp->dbuf, dblksize(&sblock, dirp->ip, lbn)); Index: sbin/routed/main.c ================================================================== --- sbin/routed/main.c +++ sbin/routed/main.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1983 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)main.c 5.5 (Berkeley) 01/06/86"; +static char sccsid[] = "@(#)main.c 5.4 (Berkeley) 11/21/85"; #endif not lint /* * Routing Table Management Daemon */ @@ -168,11 +168,11 @@ int domain, type; struct sockaddr_in *sin; { int s, on = 1; - if ((s = socket(domain, type, 0)) < 0) { + if (s = socket(domain, type, 0)) { perror("socket"); syslog(LOG_ERR, "socket: %m"); return (-1); } if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, &on, sizeof (on)) < 0) { Index: sbin/savecore/savecore.c ================================================================== --- sbin/savecore/savecore.c +++ sbin/savecore/savecore.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)savecore.c 5.3 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)savecore.c 5.2 (Berkeley) 09/08/85"; #endif not lint /* * savecore */ @@ -364,17 +364,18 @@ ddev = find_dev(dsb.st_dev, S_IFBLK); dfd = Open(ddev, 0); Lseek(dfd, (long)(SBLOCK * DEV_BSIZE), 0); Read(dfd, (char *)&fs, sizeof fs); close(dfd); - spacefree = freespace(&fs, fs.fs_minfree) * fs.fs_fsize / 1024; - if (spacefree < read_number("minfree")) { + spacefree = fs.fs_cstotal.cs_nbfree * fs.fs_bsize / 1024; + if (read_number("minfree") > spacefree) { fprintf(stderr, "savecore: Dump omitted, not enough space on device\n"); return (0); } - if (freespace(&fs, fs.fs_minfree) < 0) + if (fs.fs_cstotal.cs_nbfree * fs.fs_frag + fs.fs_cstotal.cs_nffree < + fs.fs_dsize * fs.fs_minfree / 100) fprintf(stderr, "Dump performed, but free space threshold crossed\n"); return (1); } Index: share/dict/words ================================================================== --- share/dict/words +++ share/dict/words @@ -1,14 +1,20 @@ +10th +1st +2nd +3rd +4th +5th +6th +7th +8th +9th a -AAA -AAAS -Aarhus Aaron ABA Ababa aback -abacus abalone abandon abase abash abate @@ -80,10 +86,11 @@ abrogate abrupt abscess abscissa abscissae +absence absent absentee absenteeism absentia absentminded @@ -138,10 +145,11 @@ accidental accipiter acclaim acclamation acclimate +acclimatize accolade accommodate accompaniment accompanist accompany @@ -164,16 +172,13 @@ accumulate accuracy accurate accusation accusative -accusatory accuse accustom ace -acerbic -acerbity acetate acetic acetone acetylene ache @@ -220,13 +225,16 @@ actinide actinium actinolite actinometer activate +activation +activism Acton actor actress +Acts actual actuarial actuate acuity acumen @@ -237,22 +245,25 @@ adage adagio Adair Adam adamant +Adams Adamson adapt adaptation adaptive add +added addend addenda addendum addict Addis Addison addition +additional additive addle address addressee Addressograph @@ -259,13 +270,11 @@ adduce Adelaide Adele Adelia Aden -adenine adenoma -adenosine adept adequacy adequate adhere adherent @@ -315,11 +324,10 @@ adopt adoption adoptive adore adorn -adposition adrenal adrenaline Adrian Adriatic Adrienne @@ -332,10 +340,11 @@ adulate adult adulterate adulterous adultery +adulthood advance advantage advantageous advent adventitious @@ -382,20 +391,21 @@ afferent affiance affidavit affiliate affine +affinity affirm affirmation affirmative affix afflict +affluence affluent afford afforest afforestation -affricate affront Afghan Afghanistan aficionado afield @@ -417,11 +427,10 @@ afterlife aftermath afternoon afterthought afterward -afterword again against Agamemnon agate Agatha @@ -453,10 +462,11 @@ agony agouti agrarian agree agreeable +agreed agreeing Agricola agricultural agriculture agrimony @@ -463,11 +473,11 @@ ague Agway ah ahead ahem -Ahmedabad +Ahmadabad ahoy aid Aida aide Aides @@ -506,15 +516,13 @@ airy aisle Aitken ajar Ajax -AK Akers akin Akron -AL ala Alabama Alabamian alabaster alacrity @@ -545,10 +553,11 @@ alchemy Alcmena Alcoa alcohol alcoholic +alcoholism Alcott alcove Aldebaran aldehyde Alden @@ -582,18 +591,18 @@ algebra algebraic Algenib Alger Algeria +Algerian Algiers alginate Algol Algonquin algorithm algorithmic Alhambra -Ali alia alias alibi Alice Alicia @@ -612,11 +621,10 @@ alkali alkaline alkaloid all Allah -Allan allay allegate allege Allegheny allegiant @@ -632,10 +640,11 @@ allergy alleviate alley alleyway alliance +allied alligator Allis Allison alliterate allocable @@ -681,10 +690,11 @@ alphabetic alphanumeric Alpheratz Alphonse alpine +Alps already Alsatian also Alsop Altair @@ -719,11 +729,10 @@ alveolus Alvin alway alyssum am -A&M AMA Amadeus amalgam amalgamate amanita @@ -760,11 +769,13 @@ amen amend amende Amerada America +American Americana +Americanism americium Ames amethyst amethystine Amherst @@ -795,22 +806,21 @@ amoral amorphous amort Amos amount -amp amperage ampere ampersand Ampex amphetamine amphibian amphibious amphibole amphibology -amphioxis ample +amplifier amplify amplitude amply amputate amra @@ -843,11 +853,10 @@ anamorphic anaplasmosis anarch anarchic anarchy -Anastasia anastigmat anastigmatic anastomosis anastomotic anathema @@ -858,10 +867,11 @@ ancestral ancestry anchor anchorage anchorite +anchoritism anchovy ancient ancillary and Andean @@ -874,10 +884,11 @@ Andover Andre Andrea Andrei Andrew +Andrews Andromache Andromeda Andy anecdotal anecdote @@ -897,10 +908,11 @@ Angie angiosperm angle Angles Anglican +Anglicanism angling Anglo Anglophobia Angola Angora @@ -938,11 +950,10 @@ Annale Annalen Annapolis Anne anneal -Annette annex Annie annihilate anniversary annotate @@ -978,11 +989,11 @@ ant antacid Antaeus antagonism antagonist -antarctic +antagonistic Antarctica Antares ante anteater antebellum @@ -1013,27 +1024,25 @@ Antioch antipasto antipathy antiperspirant antiphonal -antipode +antipodes antiquarian antiquary antiquated antique antiquity -antisemite antisemitic +antisemitism antithetic antler Antoine Antoinette Anton Antonio Antony -antonym -Antwerp anus anvil anxiety anxious any @@ -1112,10 +1121,11 @@ Appleton appliance applicable applicant applicate +applied applique apply appoint appointe appointee @@ -1153,11 +1163,10 @@ aquatic aqueduct aqueous Aquila Aquinas -AR Arab arabesque Arabia Arabic Araby @@ -1183,32 +1192,34 @@ archaism archangel archbishop archdiocese archenemy +Archer archery archetype archetypical archfool Archibald Archimedes +arching archipelago architect architectonic architectural architecture archival archive arcing -arclength arcsin arcsine arctan arctangent arctic Arcturus Arden +ardency ardent arduous are area areaway @@ -1218,11 +1229,10 @@ aren't Arequipa Ares Argentina argillaceous -arginine Argive argo argon Argonaut Argonne @@ -1260,11 +1270,11 @@ armament Armata armature armchair Armco -Armenia +Armenian armful armhole armillaria armistice armload @@ -1341,10 +1351,11 @@ ascendant ascension ascent ascertain ascetic +asceticism ascomycetes ascribe ascription aseptic ash @@ -1368,13 +1379,11 @@ ask askance askew asleep asocial -asparagine asparagus -aspartic aspect aspen asperity aspersion asphalt @@ -1411,10 +1420,11 @@ assimilate assist assistant associable associate +associative assonant assort assuage assume assumption @@ -1430,10 +1440,11 @@ asteroid asteroidal asthma astigmat astigmatic +astigmatism ASTM astonish Astor Astoria astound @@ -1451,10 +1462,11 @@ astrophysics astute Asuncion asunder asylum +asymmetric asymmetry asymptote asymptotic asynchronous asynchrony @@ -1463,11 +1475,10 @@ atavism atavistic Atchison ate Athabascan -atheism atheist Athena Athenian Athens athlete @@ -1524,11 +1535,10 @@ Atwood atypic Auberge Aubrey auburn -Auckland auction auctioneer audacious audacity audible @@ -1551,10 +1561,11 @@ augment augmentation augur august Augusta +Augustan Augustine Augustus auk aunt auntie @@ -1562,16 +1573,14 @@ aural Aurelius aureomycin auric Auriga -aurochs aurora Auschwitz auspices auspicious -austenite austere Austin Australia Australis australite @@ -1596,11 +1605,10 @@ automata automate automatic automaton automobile -automorphism automotive autonomic autonomous autonomy autopsy @@ -1622,10 +1630,11 @@ averred averring averse aversion avert +avertive Avery Avesta aviary aviate aviatrix @@ -1657,18 +1666,18 @@ awn awoke awry ax axe +axes axial axiology axiom axiomatic axis axisymmetric axle -axolotl axon aye Ayers Aylesbury azalea @@ -1676,24 +1685,24 @@ azimuth azimuthal Aztec Aztecan azure -AZ b babbitt babble Babcock babe Babel baboon baby +babyhood Babylon +Babylonian babysat babysit babysitting -baccalaureate baccarat Bacchus Bach bachelor bacilli @@ -1747,11 +1756,10 @@ Bahama Bahrein bail Bailey bailiff -bainite Baird bait bake Bakelite Bakersfield @@ -1777,10 +1785,11 @@ balky ball ballad Ballard ballast +balled ballerina ballet balletomane ballfield balloon @@ -1800,11 +1809,10 @@ Bamako Bamberger Bambi bamboo ban -Banach banal banana Banbury band bandage @@ -1829,10 +1837,12 @@ banister banjo bank bankrupt bankruptcy +Banks +banning banquet banshee bantam banter Bantu @@ -1883,10 +1893,11 @@ Barney Barnhard barnstorm barnyard barometer +barometric baron baroness baronet baronial barony @@ -1900,10 +1911,11 @@ barren Barrett barrette barricade barrier +barring Barrington barrow Barry Barrymore Barstow @@ -1915,21 +1927,19 @@ Bartlett Bartok Barton barycentric basal -basalt base baseball baseband baseboard Basel baseline baseman basemen baseplate -basepoint bash bashaw bashful basic basidiomycetes @@ -1957,10 +1967,11 @@ Batchelder bate bateau Bateman bater +Bates bath bathe bathos bathrobe bathroom @@ -1992,10 +2003,11 @@ bawl Baxter bay bayberry Bayda +bayed Bayesian Baylor bayonet Bayonne bayou @@ -2016,11 +2028,10 @@ bearberry beard Beardsley bearish beast -beastie beat beaten beater beatific beatify @@ -2041,18 +2052,20 @@ becalm became because Bechtel beck +Becker becket Beckman beckon Becky become bed bedazzle bedbug +bedding bedfast Bedford bedim bedimmed bedimming @@ -2114,11 +2127,10 @@ behavioral behead beheld behind behold -Beijing beige being Beirut bel Bela @@ -2172,16 +2184,16 @@ bemuse Ben bench benchmark bend +Bender Bendix beneath Benedict Benedictine benediction -Benedikt benefactor benefice beneficent beneficial beneficiary @@ -2203,13 +2215,11 @@ Bentley Benton Benz Benzedrine benzene -Beograd Beowulf -Beresford beplaster bequeath bequest berate Berea @@ -2298,15 +2308,17 @@ betide betoken betony betray betrayal +betrayer betroth betrothal Betsey Betsy Bette +betting bettor Betty between betwixt bevel @@ -2321,11 +2333,10 @@ bey beyond bezel bhoy Bhutan -Bialystok bianco bias biaxial bib bibb @@ -2334,17 +2345,19 @@ bibliography bibliophile bicameral bicarbonate bicep +biceps bichromate bicker biconcave biconnected bicycle bid -bidden +biddable +bidding biddy bide bidiagonal bidirectional bien @@ -2356,15 +2369,12 @@ Bigelow Biggs bigot bigotry biharmonic -bijection -bijective bijouterie bikini -bilabial bilateral bilayer bile bilge bilharziasis @@ -2375,10 +2385,11 @@ billboard billet billiard Billie Billiken +Billings billion billionth billow billy Biltmore @@ -2403,15 +2414,28 @@ Bini binocular binomial binuclear biochemic +biochemist +biochemistry +biograph biography biology +biomass +biomedical +biometric Biometrika biometry +biophysic +biophysical +biophysicist biopsy +bioscience +biosphere +biostatistic +biosynthesize biota biotic biotite bipartisan bipartite @@ -2420,10 +2444,11 @@ biracial birch bird birdbath birdie +birdlike birdseed birdwatch birefringent Birgit Birmingham @@ -2431,11 +2456,10 @@ birthday birthplace birthright biscuit bisect -bisexual bishop bishopric Bismarck Bismark bismuth @@ -2445,11 +2469,10 @@ bistable bistate bit bitch bite -bitnet bitt bitten bittern bitternut bitterroot @@ -2462,10 +2485,11 @@ bivouac biz bizarre Bizet blab +blabbing black blackball blackberry blackbird blackboard @@ -2492,22 +2516,21 @@ blanc blanch Blanchard Blanche bland -blandish blank blanket blare blaspheme blasphemous blasphemy blast -blastula blat blatant blather +blatting Blatz blaze blazon bleach bleak @@ -2550,11 +2573,10 @@ blond blonde blood bloodbath bloodhound -bloodline bloodroot bloodshed bloodshot bloodstain bloodstone @@ -2565,10 +2587,11 @@ Bloomington bloop blossom blot blotch +blotting blouse blow blowfish blown blowup @@ -2594,17 +2617,17 @@ Blum Blumenthal blunder blunt blur +blurring blurry blurt blush bluster blustery blutwurst -Blvd Blythe BMW boa boar board @@ -2619,26 +2642,28 @@ boatswain boatyard bob Bobbie bobbin +bobbing bobble bobby bobcat bobolink Boca bock bode bodhisattva bodice +bodied Bodleian body bodybuilder bodybuilding bodyguard Boeing -Boeotia +Boeotian bog bogey bogeymen bogging boggle @@ -2731,10 +2756,11 @@ bootstrap bootstrapping booty booze bop +bopping borate borax Bordeaux bordello Borden @@ -2758,13 +2784,13 @@ borrow Bosch Bose bosom boson -bosonic boss Boston +Bostonian Boswell botanic botanist botany botch @@ -2788,11 +2814,10 @@ bouncy bound boundary bounty bouquet -Bourbaki bourbon bourgeois bourgeoisie bourn boustrophedon @@ -2818,10 +2843,11 @@ boy boyar Boyce boycott Boyd +boyhood boyish Boyle Boylston BP brace @@ -2909,10 +2935,11 @@ breathtaking breathy breccia bred breech +breeches breed breeze breezy Bremen bremsstrahlung @@ -2966,10 +2993,11 @@ Brighton brilliant Brillouin brim brimful +brimming brimstone Brindisi brindle brine bring @@ -3015,11 +3043,10 @@ bronchiolar bronchiole bronchitis bronchus bronco -Brontosaurus Bronx bronze bronzy brood broody @@ -3032,10 +3059,11 @@ broom broomcorn broth brothel brother +brotherhood brought brouhaha brow browbeaten brown @@ -3058,10 +3086,11 @@ Bruno Brunswick brunt brush brushfire +brushlike brushwork brushy brusque Brussels brutal @@ -3101,10 +3130,11 @@ Budapest Budd Buddha Buddhism Buddhist +budding buddy budge budget budgetary Budweiser @@ -3152,17 +3182,17 @@ bulrush bulwark bum bumble bumblebee +bumming bump bumptious bun bunch Bundestag bundle -Bundoora bundy bungalow bungle bunk bunkmate @@ -3191,10 +3221,11 @@ burglarproof burglary Burgundian Burgundy burial +buried Burke burl burlap burlesque burley @@ -3204,11 +3235,10 @@ Burmese burn Burnett Burnham burnish -burnout Burnside burnt burp Burr burro @@ -3263,22 +3293,24 @@ buttonweed buttress Buttrick butyl butyrate -butyric buxom Buxtehude Buxton buy +buyer buzz Buzzard +buzzer buzzing buzzword buzzy by bye +Byers bygone bylaw byline bypass bypath @@ -3293,11 +3325,10 @@ byway byword Byzantine Byzantium c -CA cab cabal cabana cabaret cabbage @@ -3379,10 +3410,11 @@ Calkins call calla Callaghan Callahan +caller calligraph calligraphy calliope Callisto callous @@ -3389,23 +3421,25 @@ callus calm caloric calorie calorimeter +calorimetric +calorimetry Calumet calumniate calumny Calvary calve Calvert Calvin +Calvinist calypso cam camaraderie camber Cambodia -Cambrian cambric Cambridge Camden came camel @@ -3440,12 +3474,10 @@ canary Canaveral Canberra cancel cancellate -cancelled -cancelling cancer cancerous candela candelabra candid @@ -3467,10 +3499,11 @@ canna cannabis cannel cannery cannibal +canning cannister cannon cannonball cannot canny @@ -3479,11 +3512,10 @@ canon canonic canopy can't cant -Cantabrigian cantaloupe canteen Canterbury canterelle canticle @@ -3514,14 +3546,14 @@ capital capitol Capitoline capitulate capo +capping caprice capricious Capricorn -capsize capstan capstone capsule captain captaincy @@ -3547,29 +3579,24 @@ carbonaceous carbonate Carbondale Carbone carbonic -carbonium carbonyl carborundum carboxy -carboxylic carboy carbuncle -carburetor carcass carcinogen carcinogenic carcinoma card cardamom cardboard cardiac -Cardiff cardinal -cardiod cardiology cardiovascular care careen career @@ -3639,12 +3666,12 @@ carte cartel Cartesian Carthage cartilage -cartilaginous cartographer +cartographic cartography carton cartoon cartridge cartwheel @@ -3717,14 +3744,16 @@ Catherwood catheter cathode cathodic catholic +Catholicism Cathy cation cationic catkin +catlike catnip Catskill catsup cattail cattle @@ -3787,11 +3816,10 @@ Celia cell cellar cellophane cellular -celluloid cellulose Celsius Celtic cement cemetery @@ -3835,26 +3863,25 @@ cerium CERN certain certainty certificate +certified certify certiorari certitude cerulean Cervantes -cervix Cesare cesium cessation cession Cessna cetera Cetus Ceylon Cezanne -cf Chablis Chad Chadwick chafe chaff @@ -3877,10 +3904,11 @@ challenge Chalmers chamber chamberlain chambermaid +Chambers chameleon chamfer chamois chamomile champ @@ -3914,19 +3942,19 @@ chaperon chaperone chaplain Chaplin Chapman +chapping chapter char character characteristic charcoal chard charge chargeable -Charlemagne chariot charisma charismatic charitable charity @@ -3936,10 +3964,11 @@ Charlie Charlotte Charlottesville charm Charon +charring chart Charta Chartres chartreuse chartroom @@ -3954,10 +3983,11 @@ chateau chateaux Chatham Chattanooga chattel +chatting chatty Chaucer chauffeur Chauncey Chautauqua @@ -3982,11 +4012,10 @@ cheer cheerful cheerleader cheery cheese -cheesecake cheesecloth cheesy cheetah chef chelate @@ -3994,21 +4023,19 @@ chemise chemisorb chemisorption chemist chemistry -chemotherapy Chen Cheney chenille cherish Cherokee cherry chert cherub cherubim -Cheryl Chesapeake Cheshire chess chest Chester @@ -4041,11 +4068,13 @@ chigger chignon chilblain child childbirth +childhood childish +childlike children Chile chili chill chilly @@ -4063,16 +4092,18 @@ chinch chinchilla chine Chinese chink +chinning Chinook chinquapin chip chipboard chipmunk Chippendale +chipping chiropractor chirp chisel Chisholm chit @@ -4084,11 +4115,10 @@ chlordane chloride chlorine chloroform chlorophyll -chloroplast chloroplatinate chock chocolate Choctaw choice @@ -4098,15 +4128,15 @@ chokeberry cholera cholesterol cholinesterase chomp -Chomsky choose choosy chop Chopin +chopping choppy choral chorale chord chordal @@ -4133,18 +4163,17 @@ Christiana Christianson Christie Christina Christine +Christlike Christmas Christoffel -Christoph Christopher Christy chromate chromatic -chromatin chromatogram chromatograph chromatography chrome chromic @@ -4165,10 +4194,11 @@ chuckwalla chuff chug chugging chum +chumming chummy chump Chungking chunk chunky @@ -4192,15 +4222,15 @@ cider cigar cigarette cilia ciliate +cimcumvention cinch Cincinnati cinder Cinderella -Cindy cinema cinematic Cinerama cinnabar cinnamon @@ -4232,12 +4262,12 @@ circumstance circumstantial circumvent circumvention circus +cirmcumferential cistern -cit citadel citation cite citizen citizenry @@ -4252,17 +4282,19 @@ civet civic civil civilian clad +cladding cladophora claim claimant Claire clairvoyant clam clamber +clamming clammy clamp clamshell clan clandestine @@ -4270,10 +4302,11 @@ clank clannish clap clapboard Clapeyron +clapping Clara Clare Claremont Clarence Clarendon @@ -4285,10 +4318,11 @@ Clarke clash clasp class classic +classification classificatory classify classmate classroom classy @@ -4351,12 +4385,12 @@ Clint Clinton Clio clip clipboard +clipping clique -clitoris Clive cloak cloakroom clobber clock @@ -4384,33 +4418,33 @@ clothesline clothesman clothesmen clothier Clotho +clotting cloture cloud cloudburst cloudy clout clove clown cloy club +clubbing clubhouse clubroom cluck clue -Cluj clump clumsy clung cluster clutch clutter Clyde Clytemnestra -CO coach coachman coachmen coachwork coadjutor @@ -4471,12 +4505,10 @@ codetermine codeword codfish codicil codify -codomain -codon codpiece Cody coed coeditor coeducation @@ -4510,11 +4542,10 @@ cohere coherent cohesion cohesive Cohn -cohomology cohort cohosh coiffure coil coin @@ -4563,11 +4594,10 @@ collinear Collins collision collocation colloidal -Colloq colloquia colloquial colloquium colloquy collude @@ -4583,10 +4613,11 @@ colony Colorado colorate coloratura colorimeter +colorimetry colossal Colosseum colossi colossus colt @@ -4604,10 +4635,11 @@ comb combat combatant combatted combinate +combinator combinatorial combinatoric combine combustible combustion @@ -4669,11 +4701,10 @@ communion communique commutate commute compact -compactify Compagnie companion companionway company comparative @@ -4811,10 +4842,11 @@ condone conduce conducive conduct conductance +conductive conductor conduit cone coneflower Conestoga @@ -4858,10 +4890,11 @@ confound confrere confront confrontation Confucian +Confucianism Confucius confuse confusion confute congeal @@ -4890,11 +4923,10 @@ conjectural conjecture conjoin conjoint conjugal -conjugacy conjugate conjunct conjuncture conjure Conklin @@ -4957,19 +4989,19 @@ conspicuous conspiracy conspirator conspiratorial conspire +Constance constant Constantine Constantinople constellate consternate constituent constitute constitution -constitutive constrain constraint constrict constrictor construct @@ -5015,10 +5047,11 @@ continua continual continuant continuation continue +continued continuity continuo continuous continuum contort @@ -5128,11 +5161,10 @@ Copperfield copperhead coppery copra coprinus -coproduct copter copy copybook copyright copywriter @@ -5221,11 +5253,10 @@ cortex cortical Cortland corundum coruscate -Corvallis corvette Corvus cos cosec coset @@ -5238,11 +5269,10 @@ cosmopolitan cosmos cosponsor Cossack cost -Costa Costello costume cosy cot cotangent @@ -5256,11 +5286,10 @@ cottonseed cottonwood cottony Cottrell cotty -cotyledon couch cougar cough could couldn't @@ -5272,11 +5301,10 @@ councilwoman councilwomen counsel counselor count -countdown countenance counteract counterargument counterattack counterbalance @@ -5318,11 +5346,10 @@ courthouse courtier Courtney courtroom courtyard -couscous cousin couturier covalent covariant covariate @@ -5364,15 +5391,16 @@ coxcomb coy coyote coypu cozen +cozier cozy CPA -cpu crab crabapple +crabbing crack crackle crackpot cradle craft @@ -5384,14 +5412,16 @@ crag craggy Craig cram Cramer +cramming cramp cranberry Crandall crane +cranelike Cranford crania cranium crank crankcase @@ -5421,10 +5451,11 @@ cream creamery creamy crease create +creating creature creche credent credential credenza @@ -5463,11 +5494,13 @@ crewcut crewel crewman crewmen crib +cribbing cricket +cried crime Crimea criminal crimp crimson @@ -5484,11 +5517,10 @@ criterion critic critique critter croak -Croatia crochet crock crockery Crockett crocodile @@ -5501,18 +5533,18 @@ crone crony crook croon crop +cropping Crosby cross crossarm crossbar crossbill crosscut crosshatch -crosslink crossover crosspoint crossroad crosstalk crosswalk @@ -5555,11 +5587,10 @@ crush Crusoe crust crutch crux -Cruz cry cryogenic cryostat crypt cryptanalysis @@ -5573,12 +5604,10 @@ crystalline crystallite crystallographer crystallography c's -csnet -CT cub Cuba cubbyhole cube cubic @@ -5620,10 +5649,11 @@ cup cupboard cupful Cupid cupidity +cupping cupric cuprous cur curate curb @@ -5680,30 +5710,29 @@ cutler cutlet cutoff cutout cutover -cutset cutthroat +cutting cuttlebone cuttlefish cutworm Cyanamid cyanate cyanic cyanide -cybernetic +cybernetics cycad Cyclades cycle cyclic cyclist cyclone cyclopean Cyclops cyclorama -cyclotomic cyclotron Cygnus cylinder cylindric cynic @@ -5711,33 +5740,30 @@ cypress Cyprian Cypriot Cyprus Cyril -Cyrillic Cyrus cyst -cysteine cytochemistry cytolysis cytoplasm -cytosine -CZ czar czarina -Czech Czechoslovakia Czerniak d dab +dabbing dabble Dacca dachshund dactyl dactylic dad -Dada +Dadaism +Dadaist daddy Dade Daedalus daffodil daffy @@ -5757,20 +5783,20 @@ Dakar Dakota dale Daley Dallas -Dalhousie dally Dalton Daly Dalzell dam damage Damascus damask dame +damming damn damnation Damon damp dampen @@ -5805,13 +5831,11 @@ darken darkle Darlene darling darn -DARPA Darrell -Darry d'art dart Dartmouth Darwin Darwinian @@ -5931,15 +5955,16 @@ decibel decide deciduous decile decimal -decimate decipher decision +decisional decisive deck +Decker declaim declamation declamatory declaration declarative @@ -5951,11 +5976,10 @@ decline declivity decode decolletage decollimate -decolonize decompile decomposable decompose decomposition decompress @@ -5995,11 +6019,10 @@ deface default defeat defecate defect -defector defend defendant defensible defensive defer @@ -6056,11 +6079,10 @@ delegable delegate delete deleterious deletion -Delft Delhi Delia deliberate delicacy delicate @@ -6104,11 +6126,10 @@ demand demarcate demark demean demented -dementia demerit demigod demijohn demiscible demise @@ -6134,15 +6155,13 @@ demur demure demurred demurrer demurring -demystify +demythologize den denature -dendrite -dendritic Deneb Denebola deniable denial denigrate @@ -6156,10 +6175,12 @@ denote denouement denounce dense densitometer +densitometric +densitometry dent dental dentistry Denton denture @@ -6169,12 +6190,12 @@ denunciate Denver deny deodorant deoxyribonucleic -deoxyribose depart +department departure depend dependent depict deplete @@ -6196,11 +6217,13 @@ deprecatory depreciable depreciate depress depressant +depressed depressible +depressing depression depressive depressor deprivation deprive @@ -6266,19 +6289,21 @@ despondent despot despotic dessert dessicate +destabilize destinate destine destiny destitute destroy destruct destructor desuetude desultory +desynchronize detach detail detain d'etat detect @@ -6298,11 +6323,10 @@ detest detestation detonable detonate detour -detoxify detract detractor detriment Detroit deuce @@ -6334,24 +6358,24 @@ Dewey Dewitt dewy dexter dexterity -dextrose dextrous dey Dhabi dharma diabase diabetes diabetic diabolic diachronic -diacritic +diacritical diadem diagnosable diagnose +diagnoses diagnosis diagnostic diagnostician diagonal diagram @@ -6358,15 +6382,15 @@ diagrammatic dial dialect dialectic dialogue -dialup dialysis diamagnetic diamagnetism diameter +diametric diamond Diana Diane Dianne diaper @@ -6403,10 +6427,11 @@ diddle didn't Dido die Diebold +died Diego diehard dieldrin dielectric diem @@ -6417,12 +6442,10 @@ diethylstilbestrol dietician Dietrich diety Dietz -diffeomorphic -diffeomorphism differ different differentiable differential differentiate @@ -6453,10 +6476,11 @@ digression dihedral dilapidate dilatation dilate +dilation dilatory dilemma dilettante diligent dill @@ -6470,10 +6494,11 @@ dimension dimethyl diminish diminution diminutive +dimming dimple din Dinah dine ding @@ -6493,19 +6518,17 @@ diopter diorama diorite dioxide dip -diphtheria diphthong -diploid -diploidy diploma diplomacy diplomat diplomatic dipole +dipping Dirac dire direct director directorate @@ -6515,11 +6538,10 @@ dirge Dirichlet dirt dirty Dis -disaccharide disambiguate disastrous disburse disc discern @@ -6562,11 +6584,10 @@ disparage disparate dispel dispelled dispelling -dispensable dispensary dispensate dispense dispersal disperse @@ -6586,20 +6607,23 @@ disseminate dissension dissertation dissident dissipate +dissociable dissociate +dissonant dissuade distaff distal distant distillate distillery distinct distinguish distort +distortion distraught distribution distributive distributor district @@ -6629,10 +6653,11 @@ dividend divination divine divisible division +divisional divisive divisor divorce divorcee divulge @@ -6666,11 +6691,10 @@ Dodd dodecahedra dodecahedral dodecahedron dodge -dodo Dodson doe doesn't d'oeuvre doff @@ -6695,11 +6719,10 @@ doldrum dole doleful doll dollar -dollop dolly dolomite dolomitic Dolores dolphin @@ -6730,10 +6753,11 @@ Doneck donkey Donna Donnelly Donner +donning donnybrook donor Donovan don't doodle @@ -6764,18 +6788,18 @@ dormant dormitory Dorothea Dorothy Dorset -Dortmund dosage dose dosimeter dossier Dostoevsky dot dote +dotting double Doubleday doubleheader doublet doubleton @@ -6805,13 +6829,15 @@ downdraft Downey downfall downgrade downhill +Downing downplay downpour downright +Downs downside downslope downspout downstairs downstream @@ -6861,10 +6887,11 @@ dread dreadful dreadnought dream dreamboat +dreamlike dreamt dreamy dreary dredge dreg @@ -6875,14 +6902,17 @@ drew Drexel Dreyfuss drib dribble +dried +drier drift drill drink drip +dripping drippy Driscoll drive driven driveway @@ -6896,27 +6926,30 @@ droopy drop drophead droplet dropout +dropping drosophila dross drought drove drown drowse drowsy drub +drubbing drudge drudgery drug drugging drugstore druid drum drumhead drumlin +drumming Drummond drunk drunkard drunken Drury @@ -6924,10 +6957,11 @@ dryad Dryden d's du dual +dualism Duane dub Dubhe dubious dubitable @@ -6984,13 +7018,11 @@ duplex duplicable duplicate duplicity DuPont -Duquesne durable -durance Durango duration Durer duress Durham @@ -7023,11 +7055,11 @@ dwindle Dwyer dyad dyadic dye -dyeing +dyer dying Dyke Dylan dynamic dynamism @@ -7091,11 +7123,10 @@ ebullient eccentric Eccles ecclesiastic echelon -echidna echinoderm echo echoes eclat eclectic @@ -7110,12 +7141,10 @@ economist economy ecosystem ecstasy ecstatic -ectoderm -ectopic Ecuador ecumenic ecumenist Ed Eddie @@ -7144,16 +7173,15 @@ Edmondson Edmonton Edmund Edna EDT -Eduardo educable educate Edward Edwardian -Edwardine +Edwards Edwin Edwina eel eelgrass EEOC @@ -7178,11 +7206,10 @@ effluvia effluvium effort effusive eft -e.g egalitarian Egan egg egghead eggplant @@ -7199,11 +7226,10 @@ eh Ehrlich eider eidetic eigenfunction -eigenspace eigenstate eigenvalue eigenvector eight eighteen @@ -7295,17 +7321,17 @@ elk Elkhart ell Ella Ellen -Elliot Elliott ellipse ellipsis ellipsoid ellipsoidal ellipsometer +ellipsometry elliptic Ellis Ellison Ellsworth Ellwood @@ -7348,18 +7374,16 @@ embark embarrass embassy embattle embed -embeddable embedded embedder embedding embellish ember embezzle -emblem emblematic embodiment embody embolden emboss @@ -7370,18 +7394,16 @@ embrittle embroider embroidery embroil embryo -embryology embryonic emcee emendable emerald emerge emergent -emeriti emeritus Emerson Emery emigrant emigrate @@ -7403,10 +7425,11 @@ Emmanuel Emmett emolument Emory emotion +emotional empathy emperor emphases emphasis emphatic @@ -7414,115 +7437,178 @@ emphysematous empire empiric emplace employ +employed employee +employer +employing emporium empower empress empty emulate emulsify emulsion en +enact enamel +encamp encapsulate +encase encephalitis +enchain +enchant enchantress +encipher +encircle enclave +enclose +enclosure +encode encomia encomium +encompass encore +encounter +encourage encroach +encrust +encrypt encryption encumber encumbrance +encyclical encyclopedic end +endanger +endear endgame Endicott -endoderm endogamous endogamy endogenous -endomorphism endorse endosperm endothelial endothermic endow endpoint +endurance endure enemy energetic energy enervate enfant +enfeeble +Enfield +enforce enforceable enforcible +enfranchise Eng engage Engel +engender engine engineer England Englander Engle Englewood English Englishman Englishmen +engrave +engross +engulf enhance Enid enigma enigmatic +enjoin enjoinder +enjoy +enlarge enlargeable +enlighten +enlist +enliven +enmesh enmity Enoch -enol enormity enormous Enos enough enquire enquiry +enrage +enrapture +enrich Enrico +enroll enrollee ensconce ensemble +enshroud +ensign +enslave +ensnare enstatite +ensue +ensure +entail +entangle entendre enter enterprise entertain enthalpy +enthrall +enthrone enthusiasm enthusiast enthusiastic entice entire entirety +entitle entity +entomb entomology entourage +entrain +entrance entranceway entrant +entrap +entrapping +entreat +entreaty +entree +entrench entrepreneur entrepreneurial entropy +entrust entry +entwine enumerable enumerate enunciable enunciate envelop envelope +envenom enviable envious environ +envisage +envision envoy envy enzymatic enzyme enzymology @@ -7550,19 +7636,17 @@ epigram epigrammatic epigraph epileptic epilogue -epimorphism Epiphany epiphyseal epiphysis episcopal Episcopalian episcopate episode -episodic epistemology epistle epistolatory epitaph epitaxial @@ -7570,11 +7654,10 @@ epithelial epithelium epithet epitome epoch -epochal epoxy epsilon Epsom Epstein equable @@ -7614,18 +7697,16 @@ erbium ERDA ere erect erg -ergative ergodic Eric Erich Erickson Ericsson Erie -Erik Erlenmeyer Ernest Ernestine Ernie Ernst @@ -7636,10 +7717,11 @@ erosion erosive erotic erotica err +errancy errand errant errantry errata erratic @@ -7660,11 +7742,10 @@ escalate escapade escape escapee escheat -Escherichia eschew escort escritoire escrow escutcheon @@ -7693,11 +7774,10 @@ ester Estes Esther estimable estimate -Estonia estop estoppal estrange estuarine estuary @@ -7733,11 +7813,10 @@ Euclidean eucre Eugene Eugenia eugenic -eukaryote Euler Eulerian eulogy Eumenides Eunice @@ -7808,10 +7887,11 @@ evolution evolutionary evolve evzone ewe +Ewing exacerbate exact exaggerate exalt exaltation @@ -7828,10 +7908,11 @@ excellent excelling excelsior except exception +exceptional excerpt excess excessive exchange exchangeable @@ -7851,15 +7932,15 @@ exclusionary exclusive excommunicate excoriate excrescent +excresence excrete excretion excretory excruciate -exculpate exculpatory excursion excursus excusable excuse @@ -8007,12 +8088,11 @@ extort extra extracellular extract extractor -extradite -extradition +extraditable extralegal extramarital extraneous extraordinary extrapolate @@ -8030,20 +8110,21 @@ extrovert extrude extrusion extrusive exuberant -exudate +exudation exude exult exultant exultation Exxon eye eyeball eyebright eyebrow +eyed eyeful eyeglass eyelash eyelet eyelid @@ -8084,11 +8165,10 @@ Fafnir fag Fahey Fahrenheit fail -failsafe failsoft failure fain faint fair @@ -8112,16 +8192,18 @@ falloff fallout fallow Falmouth false +falsehood falsify Falstaff falter fame familial familiar +familiarly familism family famine famish famous @@ -8131,10 +8213,11 @@ fancy fanfare fanfold fang fangled +fanning Fanny fanout fantasia fantasist fantastic @@ -8219,10 +8302,11 @@ Feb febrile February fecund fed +Fedders federal federate Fedora fee feeble @@ -8271,19 +8355,19 @@ fern Fernando fernery ferocious ferocity -Ferreira Ferrer ferret ferric ferris ferrite ferroelectric ferromagnet ferromagnetic +ferromagnetism ferrous ferruginous ferrule ferry fertile @@ -8309,14 +8393,14 @@ fiance fiancee fiasco fiat fib +fibbing fiberboard Fiberglas Fibonacci -fibration fibrin fibrosis fibrous fiche fickle @@ -8330,10 +8414,11 @@ fidget fiducial fief fiefdom field +Fields fieldstone fieldwork fiend fiendish fierce @@ -8362,10 +8447,12 @@ filial filibuster filigree Filipino fill +filled +filler fillet fillip filly film filmdom @@ -8383,12 +8470,12 @@ financial financier finch find fine -finery finesse +finessed finessing finger fingernail fingerprint fingertip @@ -8422,11 +8509,10 @@ Firestone firewall firewood firework firm -firmware first firsthand fiscal Fischbein Fischer @@ -8446,10 +8532,11 @@ fisticuff fit Fitch Fitchburg fitful +fitting Fitzgerald Fitzpatrick Fitzroy five fivefold @@ -8457,11 +8544,10 @@ fixate fixture Fizeau fizzle fjord -FL flabbergast flack flag flagellate flageolet @@ -8485,10 +8571,11 @@ Flanders flange flank flannel flap +flapping flare flash flashback flashlight flashy @@ -8530,10 +8617,11 @@ flex flexible flexural flexure flick +flier flight flimsy flinch fling flint @@ -8540,14 +8628,16 @@ flintlock flinty flip flipflop flippant +flipping flirt flirtation flirtatious flit +flitting Flo float floc flocculate flock @@ -8559,10 +8649,11 @@ floodlight floodlit floor floorboard flop +flopping floppy flora floral Florence Florentine @@ -8586,12 +8677,14 @@ flowery flown Floyd flu flub +flubbing fluctuate flue +fluency fluent fluff fluffy fluid fluke @@ -8621,18 +8714,18 @@ foal foam foamflower foamy fob +fobbing focal foci focus focussed fodder foe fog -Fogarty fogging foggy fogy foible foil @@ -8653,10 +8746,11 @@ followeth folly Fomalhaut fond fondle +fondly font Fontaine Fontainebleau food foodstuff @@ -8727,20 +8821,20 @@ formal formaldehyde formant format formate -formatted formatting formic Formica formidable Formosa formula formulae formulaic formulate +Forrest forsake forsaken forsook forswear Forsythe @@ -8755,13 +8849,12 @@ fortify fortin fortiori fortitude fortnight -fortran +Fortran fortress -fortuitous fortunate fortune forty forum forward @@ -8811,26 +8904,22 @@ frail frailty frambesia frame framework -Fran franc franca France Frances franchise -Francine Francis Franciscan Francisco francium franco -Francoise frangipani frank -Frankel Frankfort Frankfurt frankfurter franklin frantic @@ -8841,10 +8930,11 @@ Frau fraud fraudulent fraught fray +frayed Frazier frazzle freak freakish freckle @@ -8851,25 +8941,29 @@ Fred Freddie Freddy Frederic Frederick +Fredericks Fredericksburg Fredericton Fredholm Fredrickson free freeboot +freed Freedman freedmen freedom freehand freehold freeing freeman freemen Freeport +freer +freest freestone freethink Freetown freeway freewheel @@ -8890,22 +8984,24 @@ freshmen freshwater Fresnel Fresno fret +fretting Freud Freudian Frey Freya friable friar fricative Frick friction +frictional Friday +fried Friedman -Friedrich friend frieze frigate Frigga fright @@ -8942,11 +9038,10 @@ frothy frown frowzy froze frozen -fructose Fruehauf frugal fruit fruitful fruition @@ -8954,11 +9049,10 @@ frustrater frustum fry Frye f's -Ft FTC Fuchs Fuchsia fudge fuel @@ -8983,11 +9077,10 @@ fumigate fun function functionary functor -functorial fund fundamental funeral funereal fungal @@ -9008,10 +9101,11 @@ Furman furnace furnish furniture furrier +furring furrow furry further furthermore furthermost @@ -9031,21 +9125,22 @@ futile future fuzz fuzzy g -GA gab gabardine +gabbing gabble gabbro Gaberones gable Gabon Gabriel Gabrielle gad +gadding gadfly gadget gadgetry gadolinium gadwall @@ -9067,11 +9162,10 @@ gait Gaithersburg gal gala galactic -galactose Galapagos Galatea Galatia galaxy Galbreath @@ -9167,10 +9261,11 @@ gasket gaslight gasoline gasp Gaspee +gassing gassy Gaston gastrointestinal gastronome gastronomy @@ -9220,14 +9315,13 @@ gelatin gelatine gelatinous geld gem -geminate Gemini +gemlike Gemma -gemstone gender gene genealogy genera general @@ -9241,12 +9335,10 @@ Geneva Genevieve genial genie genii -genital -genitive genius Genoa genotype genre gent @@ -9271,11 +9363,13 @@ Geoffrey geographer geography geology geometer +geometric geometrician +geometry geophysical geophysics geopolitic George Georgetown @@ -9310,27 +9404,31 @@ Gestapo gesticulate gesture get getaway +getting Getty Gettysburg geyser Ghana ghastly Ghent gherkin ghetto ghost +ghostlike +ghostly ghoul ghoulish Giacomo giant giantess gibberish gibbet gibbon +Gibbons gibbous Gibbs gibby gibe giblet @@ -9372,10 +9470,11 @@ gingham gingko ginkgo ginmill Ginn +ginning Gino Ginsberg Ginsburg ginseng Giovanni @@ -9409,11 +9508,10 @@ glamorous glamour glance gland glandular -glans glare Glasgow glass glassine glassware @@ -9458,34 +9556,33 @@ glorify glorious glory gloss glossary +glossed glossolalia glossy glottal glottis Gloucester glove glow -glucose glue +glued gluey +gluing glum glut -glutamate -glutamine glutamic glutinous +glutting glutton glyceride glycerin glycerinate glycerine glycerol -glycine -glycogen glycol glyph GM GMT gnarl @@ -9513,16 +9610,18 @@ goddess godfather Godfrey godhead godkin +godlike godmother godparent godsend godson Godwin godwit +goer goes Goethe Goff gog goggle @@ -9550,11 +9649,10 @@ gong Gonzales Gonzalez goober good -goodbye Goode Goodman Goodrich goodwill Goodwin @@ -9588,12 +9686,10 @@ got Gotham Gothic gotten Gottfried -Goucher -Gouda gouge Gould gourd gourmet gout @@ -9602,10 +9698,11 @@ governess governor gown GPO grab +grabbing grace graceful gracious grackle grad @@ -9618,11 +9715,10 @@ Graff graft graham grail grain -grainy grammar grammarian grammatic granary grand @@ -9719,11 +9815,10 @@ greet Greg gregarious Gregg Gregory -gremlin grenade Grendel Grenoble Gresham Greta @@ -9741,10 +9836,11 @@ grievous griffin Griffith grill grille +grilled grillwork grim grimace Grimaldi grime @@ -9751,13 +9847,15 @@ Grimes Grimm grin grind grindstone +grinning grip gripe grippe +gripping grisly grist gristmill Griswold grit @@ -9784,11 +9882,10 @@ ground groundsel groundskeep groundwork group -groupoid grout grove grovel Grover grow @@ -9795,10 +9892,11 @@ growl grown grownup growth grub +grubbing grubby grudge gruesome gruff grumble @@ -9805,14 +9903,12 @@ Grumman grunt gryphon g's GSA -GU Guam guanidine -guanine guano guarantee guaranteeing guaranty guard @@ -9819,11 +9915,10 @@ guardhouse Guardia guardian Guatemala gubernatorial -Guelph Guenther guerdon guernsey guerrilla guess @@ -9835,17 +9930,17 @@ guidance guide guidebook guideline guidepost +guiding guignol guild guildhall guile Guilford guillemot -guillotine guilt guilty guinea guise guitar @@ -9857,11 +9952,11 @@ gullible gully gulp gum gumbo -gumdrop +gumming gummy gumption gumshoe gun Gunderson @@ -9871,10 +9966,11 @@ gunk gunky gunman gunmen gunnery +gunning gunny gunplay gunpowder gunshot gunsling @@ -9894,10 +9990,11 @@ gusty gut Gutenberg Guthrie gutsy +gutting guttural guy Guyana guzzle Gwen @@ -9906,10 +10003,11 @@ gymnasium gymnast gymnastic gymnosperm gyp +gypping gypsite gypsum gypsy gyrate gyrfalcon @@ -9935,10 +10033,11 @@ hackberry Hackett hackle hackmatack hackney +hackneyed hacksaw had Hadamard Haddad haddock @@ -9990,11 +10089,10 @@ hallway halma halo halocarbon halogen -Halpern Halsey Halstead halt halvah halve @@ -10002,13 +10100,15 @@ ham Hamal Hamburg hamburger Hamilton +Hamiltonian hamlet Hamlin hammerhead +hamming hammock Hammond hamper Hampshire Hampton @@ -10043,11 +10143,10 @@ handset handshake handsome handspike handstand -handwaving handwrite handwritten handy handyman handymen @@ -10076,30 +10175,26 @@ hansom Hanson Hanukkah hap haphazard -haploid -haploidy -haplology happen happenstance happy -Hapsburg harangue harass Harbin harbinger Harcourt hard hardbake hardboard hardboiled -hardcopy harden hardhat Hardin +Harding hardscrabble hardtack hardtop hardware hardwood @@ -10114,17 +10209,15 @@ Harley harm harmful Harmon harmonic -harmonica harmonious harmony harness Harold harp -harpoon harpsichord Harpy Harriet Harriman Harrington @@ -10164,18 +10257,16 @@ hath Hathaway hatred Hatteras Hattie -Hattiesburg Haugen haughty haul haulage haunch haunt -Hausdorff Havana have haven haven't Havilland @@ -10192,10 +10283,11 @@ Hayden Haydn Hayes hayfield Haynes +Hays haystack hayward hazard hazardous haze @@ -10217,15 +10309,13 @@ headset headsman headsmen headstand headstone -headstrong headwall headwater headway -headwind heady heal Healey health healthful @@ -10282,20 +10372,18 @@ Heidelberg heigh height heighten Heine -Heinrich Heinz heir heiress Heisenberg held Helen Helena Helene -Helga helical helicopter heliocentric heliotrope helium @@ -10324,10 +10412,11 @@ hematite Hemingway hemisphere hemispheric hemlock +hemming hemoglobin hemolytic hemorrhage hemorrhoid hemosiderin @@ -10339,13 +10428,15 @@ henceforth henchman henchmen Henderson Hendrick +Hendricks Hendrickson henequen Henley +Henning henpeck Henri Henrietta henry hepatica @@ -10383,18 +10474,16 @@ herewith heritable heritage Herkimer Herman -Hermann hermeneutic Hermes hermetic Hermite hermitian Hermosa -Hernandez hero Herodotus heroes heroic heroin @@ -10402,10 +10491,11 @@ heroism heron herpes herpetology Herr +herring herringbone Herschel herself Hershel Hershey @@ -10414,14 +10504,12 @@ hesitant hesitate hesitater Hesperus Hess -Hesse Hessian Hester -heterocyclic heterodyne heterogamous heterogeneity heterogeneous heterosexual @@ -10449,20 +10537,20 @@ hexane hey heyday hi Hiatt -hiatus Hiawatha hibachi Hibbard hibernate Hibernia hick Hickey Hickman hickory +Hicks hid hidalgo hidden hide hideaway @@ -10477,10 +10565,11 @@ hifalutin Higgins high highball highboy +highest highfalutin highhanded highland highlight highroad @@ -10498,11 +10587,10 @@ hillbilly Hillcrest Hillel hillman hillmen -hillock hillside hilltop hilly hilt Hilton @@ -10513,19 +10601,19 @@ hind hindmost hindrance hindsight Hindu +Hinduism Hines hinge Hinman hint hinterland hip +hipping hippo -Hippocrates -Hippocratic hippodrome hippopotamus hippy hipster Hiram @@ -10532,16 +10620,12 @@ hire hireling Hiroshi Hiroshima Hirsch -hirsute his -Hispanic hiss -histamine -histidine histochemic histochemistry histogram histology historian @@ -10554,10 +10638,11 @@ hitch Hitchcock hither hitherto Hitler +hitting hive ho hoagie Hoagland hoagy @@ -10623,11 +10708,10 @@ Holstein holster holt Holyoke holystone -Hom homage home homebound homebuilder homebuilding @@ -10655,15 +10739,13 @@ homologue homology homomorphic homomorphism homonym -homophobia homosexual homotopy homozygous -homunculus Honda hondo Honduras hone honest @@ -10677,14 +10759,12 @@ Honeywell hong honk Honolulu honorarium -honoraria honorary honoree -honorific Honshu hooch hood hoodlum hoof @@ -10703,10 +10783,11 @@ hop hope hopeful Hopkins Hopkinsian +hopping hopple hopscotch Horace Horatio horde @@ -10735,10 +10816,11 @@ horseback horsedom horseflesh horsefly horsehair +horselike horseman horsemen horseplay horsepower horseshoe @@ -10808,17 +10890,17 @@ Hubbell hubbub hubby Huber Hubert -hubris huck huckleberry huckster huddle Hudson hue +hued huff Huffman hug huge hugging @@ -10840,10 +10922,11 @@ humidify humidistat humiliate humility Hummel +humming hummingbird hummock humorous hump humpback @@ -10859,10 +10942,11 @@ Hungarian Hungary hungry hunk hunt +Hunter Huntington Huntley Huntsville Hurd hurdle @@ -10917,11 +11001,10 @@ hydrogen hydrogenate hydrology hydrolysis hydrometer -hydronium hydrophilic hydrophobia hydrophobic hydrosphere hydrostatic @@ -10934,11 +11017,10 @@ hyena hygiene hygrometer hygroscopic hying -Hyman hymen hymn hymnal hyperbola hyperbolic @@ -10948,12 +11030,10 @@ hyphen hyphenate hypnosis hypnotic hypoactive -hypochlorite -hypochlorous hypocrisy hypocrite hypocritic hypocycloid hypodermic @@ -10969,13 +11049,11 @@ hysteresis hysteria hysteric hysteron i -IA iambic -Ian Iberia ibex ibid ibis IBM @@ -10987,30 +11065,28 @@ icebox iceland Icelandic ichneumon icicle -icky +icing icon iconoclasm iconoclast icosahedra icosahedral icosahedron icy I'd -ID Ida Idaho idea ideal ideate idempotent identical identify identity -ideolect ideology idiocy idiom idiomatic idiosyncrasy @@ -11020,11 +11096,10 @@ idle idol idolatry idyll idyllic -i.e IEEE if iffy Ifni igloo @@ -11034,15 +11109,13 @@ ignoble ignominious ignoramus ignorant ignore -Igor ii iii Ike -IL ileum iliac Iliad I'll ill @@ -11067,11 +11140,10 @@ illustrious Ilona Ilyushin I'm image -imagen imagery imaginary imaginate imagine imbalance @@ -11094,11 +11166,10 @@ immense immerse immersion immigrant immigrate -immiscible imminent immobile immobility immoderate immodest @@ -11105,10 +11176,11 @@ immodesty immoral immortal immovable immune +immunization immunoelectrophoresis immutable imp impact impair @@ -11363,10 +11435,11 @@ indeterminable indeterminacy indeterminate index India +Indian Indiana Indianapolis indicant indicate indices @@ -11396,18 +11469,19 @@ indissoluble indistinct indistinguishable indium individual +individualism individuate indivisible Indochina indoctrinate -Indoeuropean indolent indomitable Indonesia +Indonesian indoor indorse indubitable induce inducible @@ -11416,10 +11490,11 @@ inductee inductor indulge indulgent industrial +industrialism industrious industry indwell indy ineducable @@ -11461,10 +11536,11 @@ inextinguishable inextricable infallible infamous infamy +infancy infant infantile infantry infantryman infantrymen @@ -11505,11 +11581,10 @@ inflammable inflammation inflammatory inflate inflater -inflationary inflect inflexible inflict inflow influence @@ -11593,12 +11668,13 @@ Inman inmate inn innards innate +inner innermost -innkeeper +inning innocent innocuous innovate innuendo innumerable @@ -11607,11 +11683,10 @@ inoperative inopportune inordinate inorganic input -inputting inquest inquire inquiry inquisition inquisitive @@ -11656,10 +11731,12 @@ inspiration inspire instable install installation +installment +instance instant instantaneous instantiate instead instep @@ -11723,10 +11800,12 @@ interdict interest interfere interference interferometer +interferometric +interferometry interim interior interject interlude intermediary @@ -11768,13 +11847,21 @@ intolerant intonate intone intoxicant intoxicate +intracity intractable +intradepartment +intramural +intramuscular +intranasal intransigent intransitive +intraoffice +intrastate +intravenous intrepid intricacy intricate intrigue intrinsic @@ -11889,10 +11976,11 @@ irredentism irredentist irreducible irrefutable irregular +irrelevancy irrelevant irremediable irremovable irreparable irreplaceable @@ -11923,11 +12011,10 @@ is Isaac Isaacson Isabel Isabella -Isadore Isaiah isentropic Isfahan Ising isinglass @@ -11946,19 +12033,22 @@ isomer isomorph isomorphic isopleth isotherm +isothermal isotope +isotopic +isotropic isotropy Israel Israeli Israelite +issuance issuant issue Istanbul -Istvan it Italian italic Italy itch @@ -11982,10 +12072,11 @@ ivy ix Izvestia j jab +jabbing Jablonsky jack jackanapes jackass jackboot @@ -11994,18 +12085,20 @@ Jackie jackknife Jackman jackpot Jackson +Jacksonian Jacksonville Jacky JACM Jacob Jacobean Jacobi Jacobian Jacobite +Jacobs Jacobsen Jacobson Jacobus Jacqueline Jacques @@ -12013,19 +12106,19 @@ Jaeger jag jagging jaguar jail -Jaime Jakarta jake jalopy jam Jamaica jamboree James Jamestown +jamming Jan Jane Janeiro Janet jangle @@ -12039,10 +12132,11 @@ Janus Japan Japanese jar jargon +jarring Jarvin Jason jasper jaundice jaunty @@ -12059,10 +12153,11 @@ Jeannie Jed jeep Jeff Jefferson +Jeffersonian Jeffrey Jehovah jejune jejunum jelly @@ -12093,10 +12188,11 @@ jest Jesuit Jesus jet jetliner +jetting jettison Jew jewel Jewell jewelry @@ -12124,10 +12220,11 @@ Joan Joanna Joanne Joaquin job +jobbing jobholder jock jockey jockstrap jocose @@ -12144,10 +12241,11 @@ Johannesburg Johansen Johanson John Johnny +Johns Johnsen Johnson Johnston Johnstown join @@ -12175,10 +12273,11 @@ Joshua Josiah joss jostle jot +jotting joule jounce journal journalese journey @@ -12220,11 +12319,10 @@ Judy jug jugate jugging juggle -Jugoslavia juice juicy juju jujube juke @@ -12256,11 +12354,10 @@ junky Juno junta Jupiter Jura -Jurassic jure juridic jurisdiction jurisprudent jurisprudential @@ -12273,10 +12370,11 @@ Justine Justinian jut jute Jutish +jutting juvenile juxtapose juxtaposition k Kabuki @@ -12309,11 +12407,10 @@ Karachi Karamazov karate Karen Karl -karma Karol Karp karyatid Kaskaskia Kate @@ -12356,10 +12453,11 @@ Kennecott Kennedy kennel Kenneth Kenney +kenning keno Kensington Kent Kenton Kentucky @@ -12369,11 +12467,10 @@ kept kerchief Kermit kern kernel -Kernighan kerosene Kerr kerry kerygma Kessler @@ -12385,16 +12482,18 @@ Kettering kettle Kevin key keyboard +keyed Keyes keyhole Keynes Keynesian keynote keypunch +keys keystone keyword khaki khan Khartoum @@ -12406,12 +12505,12 @@ kickback kickoff kid Kidde kiddie +kidding kidnap -kidnapped kidnapping kidney Kieffer Kiev Kiewit @@ -12419,11 +12518,21 @@ Kikuyu Kilgore kill killdeer killjoy +kilobit +kilobuck +kilobyte +kilogauss +kilohertz kilohm +kilojoule +kiloton +kilovolt +kilowatt +kiloword Kim Kimball Kimberly kimono kin @@ -12457,10 +12566,11 @@ kirk Kirkland Kirkpatrick Kirov kiss +kissing kit Kitakyushu kitchen kitchenette kite @@ -12469,11 +12579,10 @@ kittle kitty kiva kivu Kiwanis -kiwi Klan Klaus klaxon kleenex Klein @@ -12491,22 +12600,25 @@ knelt knew knick Knickerbocker knife +knifelike knight Knightsbridge knit +knitting knives knob knobby knock knockdown knockout knoll knot Knott +knotting knotty know knoweth knowhow knowledge @@ -12522,11 +12634,10 @@ Knudson knurl Knutsen Knutson koala -Kobayashi Koch Kochab Kodachrome kodak Kodiak @@ -12536,26 +12647,22 @@ koinonia kola kolkhoz kombu Kong -Konrad Koppers Koran Korea kosher -Kovacs Kowalewski Kowalski -Kowloon kraft Krakatoa Krakow Kramer Krause kraut -Krebs Kremlin Kresge Krieger Krishna Kristin @@ -12563,11 +12670,10 @@ Krueger Kruger Kruse krypton k's -KS Ku kudo kudzu Kuhn kulak @@ -12574,22 +12680,18 @@ kumquat Kurd Kurt Kuwait kwashiorkor -KY Kyle Kyoto l la lab Laban label -labia -labial labile -lability laboratory laborious labour Labrador labradorite @@ -12601,24 +12703,23 @@ lacewing Lachesis lack lackadaisic lackey -laconic lacquer lacrosse lactate -lactose lacuna lacunae lacustrine lacy lad laden ladle lady ladyfern +ladylike Lafayette lag lager lagging lagoon @@ -12636,20 +12737,19 @@ lake Lakehurst lakeside lam Lamar -Lamarck lamb lambda lambert lame lamellar lament lamentation -laminar laminate +lamming lamp lampblack lamplight lampoon lamprey @@ -12689,10 +12789,11 @@ lapel lapelled lapidary Laplace lappet +lapping lapse Laramie larceny larch lard @@ -12720,19 +12821,19 @@ lase lash lass lasso last -Laszlo latch late latent later latera lateral Lateran laterite +latest latex lath lathe Lathrop Latin @@ -12742,11 +12843,10 @@ latitudinary Latrobe latter lattice latus -Latvia laud laudanum laudatory Lauderdale Laue @@ -12759,10 +12859,11 @@ laundry laura laureate laurel Lauren +Laurence Laurent Laurentian Laurie Lausanne lava @@ -12848,11 +12949,10 @@ leech Leeds leek leer leery -Leeuwenhoek leeward leeway left leftmost leftover @@ -12901,13 +13001,14 @@ lengthwise lengthy lenient Lenin Leningrad +Leninism +Leninist Lennox Lenny -Lenore lens lent Lenten lenticular lentil @@ -12942,14 +13043,13 @@ Lethe Letitia letterhead letterman lettermen +letting lettuce -leucine leukemia -Lev levee level lever leverage Levi @@ -12958,11 +13058,10 @@ Levis levitate Leviticus Levitt levity -levulose levy lew lewd lewis lexical @@ -12998,19 +13097,22 @@ licentious lichen lick licorice lid +lidding lie Liechtenstein +lied lien lieu lieutenant life lifeblood lifeboat lifeguard +lifelike lifelong lifespan lifestyle lifetime LIFO @@ -13039,11 +13141,10 @@ Lillian Lilliputian Lilly lilt lily -lim Lima limb limbic limbo lime @@ -13075,11 +13176,10 @@ linear linebacker lineman linemen linen -lineprinter lineup linger lingerie lingo lingua @@ -13130,11 +13230,10 @@ lithograph lithography lithology lithosphere lithospheric -Lithuania litigant litigate litigious litmus litterbug @@ -13144,14 +13243,12 @@ Litton littoral liturgic liturgy live -liven Livermore Liverpool -Liverpudlian liverwort livery livestock liveth livid @@ -13219,11 +13316,10 @@ logarithmic loge loggerhead logging logic -logician logistic logjam loin loincloth Loire @@ -13267,23 +13363,22 @@ loosestrife loot lop lope Lopez +lopping lopseed lopsided loquacious loquacity -loquat lord -lordosis lore Lorelei Loren -Lorenz Lorinda Lorraine +Los losable lose loss lossy lost @@ -13318,10 +13413,11 @@ low lowboy lowdown Lowe Lowell +lower lowland Lowry loy loyal loyalty @@ -13421,11 +13517,10 @@ luxuriant luxuriate luxurious luxury Luzon -L'vov lycopodium Lydia lye lying Lykes @@ -13437,15 +13532,15 @@ lynch Lynchburg Lynn lynx Lyon +Lyons Lyra lyric -Lysenko +lyricism lysergic -lysine m ma Mabel Mac macabre @@ -13452,19 +13547,19 @@ macaque MacArthur Macassar Macbeth MacDonald -MacDougall mace Macedon Macedonia MacGregor Mach Machiavelli machination machine +machinelike machinery machismo macho macintosh mack @@ -13475,21 +13570,20 @@ Mackinaw mackintosh MacMillan Macon macro -macromolecular macromolecule macrophage macroscopic -macrostructure mad Madagascar madam Madame madcap madden +madding Maddox made Madeira Madeleine Madeline @@ -13515,11 +13609,10 @@ magi magic magician magisterial magistrate -magma magna magnanimity magnanimous magnate magnesia @@ -13555,11 +13648,10 @@ maim main Maine mainland mainline -mainstay mainstream maintain maintenance maitre majestic @@ -13616,11 +13708,10 @@ Malraux malt Malta Maltese Malton -maltose maltreat mambo mamma mammal mammalian @@ -13648,10 +13739,11 @@ mange mangel mangle Manhattan manhole +manhood mania maniac maniacal manic manifest @@ -13665,13 +13757,17 @@ mankind Manley Mann manna mannequin +mannerism +manning manometer +manometric manor manpower +Mans manse manservant Mansfield mansion manslaughter @@ -13695,10 +13791,11 @@ manzanita Mao Maori map maple +mapping mar marathon maraud marble Marc @@ -13719,11 +13816,10 @@ marginal marginalia Margo Marguerite maria -Marianne Marie Marietta marigold marijuana Marilyn @@ -13737,11 +13833,10 @@ Mario Marion marionette marital maritime -marjoram Marjorie Marjory mark market marketeer @@ -13748,10 +13843,11 @@ marketplace marketwise Markham Markov Markovian +Marks marksman marksmen Marlboro Marlborough Marlene @@ -13765,26 +13861,27 @@ marquess Marquette marquis marriage marriageable +married Marrietta +marring Marriott marrow marrowbone marry +Mars Marseilles marsh Marsha marshal Marshall marshland marshmallow -marsupial mart marten -martensite Martha martial Martian martin Martinez @@ -13805,12 +13902,10 @@ masculine maser Maseru mash mask -masochism -masochist mason Masonic Masonite masonry masque @@ -13863,23 +13958,23 @@ matrimony matrix matroid matron Matson -Matsumoto matte Matthew +Matthews +matting mattock mattress Mattson maturate mature maudlin maul Maureen Maurice -Mauricio Maurine Mauritania Mauritius mausoleum mauve @@ -13886,11 +13981,11 @@ maverick Mavis maw mawkish Mawr -max +Max maxim maxima maximal Maximilian maximum @@ -13919,11 +14014,10 @@ McAdams McAllister McBride McCabe McCall -McCallum McCann McCarthy McCarty McCauley McClain @@ -13973,13 +14067,11 @@ McMillan McMullen McNally McNaughton McNeil -McNulty McPherson -MD me mead meadow meadowland meadowsweet @@ -14004,11 +14096,10 @@ mecum medal medallion meddle Medea -Medford media medial median mediate medic @@ -14020,11 +14111,10 @@ mediocre mediocrity meditate Mediterranean medium -medlar medley Medusa meek meet meetinghouse @@ -14038,11 +14128,10 @@ megavolt megawatt megaword megohm Meier -meiosis Meistersinger Mekong Mel melamine melancholy @@ -14087,19 +14176,16 @@ menagerie menarche mend mendacious mendacity -Mendel mendelevium Mendelssohn Menelaus menfolk menhaden menial -meningitis -meniscus Menlo Mennonite menstruate mensurable mensuration @@ -14115,10 +14201,11 @@ mercenary mercer merchandise merchant merciful +mercilessly Merck mercurial mercuric mercury mercy @@ -14147,13 +14234,11 @@ mescal mescaline mesenteric mesh mesmeric -mesoderm meson -Mesopotamia Mesozoic mesquite mess message messenger @@ -14170,11 +14255,10 @@ metallic metalliferous metallography metalloid metallurgic -metallurgist metallurgy metalwork metamorphic metamorphism metamorphose @@ -14189,14 +14273,14 @@ meteoritic meteorology meter methacrylate methane -methanol -methionine method methodic +Methodism +Methodist methodology Methuen Methuselah methyl methylene @@ -14212,22 +14296,21 @@ Metzler mew Mexican Mexico Meyer +Meyers mezzo mi Miami miasma miasmal mica mice Michael Michaelangelo -Michel Michelangelo -Michele Michelin Michelson michigan Mickelson Mickey @@ -14234,10 +14317,11 @@ Micky micro microbial microcosm micrography +microjoule micron Micronesia microscopy mid Midas @@ -14263,17 +14347,15 @@ midshipman midshipmen midspan midst midstream -midterm midway midweek Midwest Midwestern midwife -midwinter midwives mien miff mig might @@ -14310,18 +14392,28 @@ Millard millenarian millenia millennia millennium +miller millet +milliammeter +milliampere Millie +millihenry +millijoule Millikan millinery million millionaire millionth millipede +millisecond +millivolt +millivoltmeter +milliwatt +Mills millstone milord milt Milton Miltonic @@ -14331,11 +14423,10 @@ mimetic Mimi mimic mimicked mimicking -min minaret mince mincemeat mind Mindanao @@ -14343,11 +14434,10 @@ mine minefield mineral mineralogy Minerva -minestrone minesweeper mingle mini miniature minicomputer @@ -14366,11 +14456,10 @@ minnow Minoan minor Minos minot -Minsk Minsky minstrel minstrelsy mint minuend @@ -14395,18 +14484,18 @@ misanthrope misanthropic miscegenation miscellaneous miscellany -miscible mischievous miscreant miser misery misnomer misogynist misogyny +mispronunciation miss misshapen missile mission missionary @@ -14423,26 +14512,23 @@ MIT Mitchell mite miterwort mitigate -mitochondria -mitosis mitral mitre mitt mitten mix mixture mixup Mizar -MN mnemonic -MO moan moat mob +mobbing mobcap Mobil mobile mobility mobster @@ -14485,11 +14571,10 @@ moisture molal molar molasses mold -Moldavia moldboard mole molecular molecule molehill @@ -14520,11 +14605,10 @@ monad monadic monarch monarchic monarchy -Monash monastery monastic monaural Monday monel @@ -14533,11 +14617,10 @@ money moneymake moneywort Mongolia mongoose -monic Monica monies monitor monitory monk @@ -14544,11 +14627,13 @@ monkey monkeyflower monkish Monmouth Monoceros +monochromatic monochromator +monocotyledon monocular monogamous monogamy monolith monologist @@ -14557,11 +14642,10 @@ monomeric monomial Monongahela monopoly monotonous -monotreme monoxide Monroe Monrovia Monsanto monsieur @@ -14592,17 +14676,19 @@ mood moody moon Mooney moonlight +moonlike moonlit moor Moore Moorish moose moot mop +mopping moraine moral morale Moran morass @@ -14627,11 +14713,10 @@ moron morose morpheme morphemic morphine -morphism morphology morphophonemic Morrill morris Morrison @@ -14664,10 +14749,11 @@ mot motel motet moth mother +motherhood motherland motif motion motivate motive @@ -14700,21 +14786,21 @@ Moyer Mozart MPH Mr Mrs -m's Ms -Mt +m's mu much mucilage muck mucosa mucus mud Mudd +mudding muddle muddlehead muddy mudguard mudsling @@ -14741,20 +14827,20 @@ Mullen mulligan mulligatawny mullion multi -multifarious multinomial multiple -multiplet multiplex multiplexor +multipliable multiplicand multiplication multiplicative multiplicity +multiply multitude multitudinous mum mumble Mumford @@ -14812,11 +14898,10 @@ mustachio mustang mustard mustn't musty -mutagen mutandis mutant mutate mutatis mute @@ -14844,11 +14929,10 @@ mynah Mynheer myocardial myocardium myofibril -myoglobin myopia myopic myosin Myra myriad @@ -14865,10 +14949,11 @@ mythic mythology n NAACP nab +nabbing Nabisco Nadine nadir nag Nagasaki @@ -14879,11 +14964,10 @@ nail Nair Nairobi naive naivete -Nakayama naked name nameable nameplate namesake @@ -14897,10 +14981,11 @@ nap napkin Naples Napoleon Napoleonic +napping Narbonne narcissist narcissus narcosis narcotic @@ -14916,17 +15001,17 @@ Nashville Nassau nasturtium nasty Nat -Nate natal Natalie Natchez Nathan Nathaniel nation +nationhood nationwide native NATO natty natural @@ -14952,20 +15037,20 @@ Nazism NBC NBS NC NCAA -NCO NCR ND Ndjamena ne Neal Neanderthal Neapolitan near nearby +nearest nearsighted neat neater neath Nebraska @@ -14986,11 +15071,10 @@ necropsy necrosis necrotic nectar nectareous -nectarine nectary Ned nee need needful @@ -15042,10 +15126,11 @@ Nestor net nether Netherlands netherworld +netting nettle nettlesome network Neumann neural @@ -15082,11 +15167,10 @@ newcomer newel Newell newfound Newfoundland -newline newlywed Newman Newport newsboy newscast @@ -15103,16 +15187,16 @@ newton Newtonian next Nguyen NH -niacin Niagara Niamey nib nibble Nibelung +nibs Nicaragua nice nicety niche Nicholas @@ -15123,11 +15207,10 @@ nick nickel nickname Nicodemus Nicosia -nicotinamide nicotine niece Nielsen Nielson Nietzsche @@ -15171,10 +15254,11 @@ Nineveh ninth Niobe niobium nip +nipping nipple Nippon nirvana nit nitpick @@ -15188,12 +15272,10 @@ nitrous nitty Nixon NJ NM -NNE -NNW no NOAA Noah nob Nobel @@ -15206,29 +15288,25 @@ nobody'd nocturnal nocturne nod nodal +nodding node nodular nodule Noel -Noetherian noise noisemake noisy Nolan Noll nolo -nomad -nomadic nomenclature nominal nominate nominee -nomogram -nomograph non nonce nonchalant nondescript none @@ -15239,11 +15317,10 @@ nook noon noontime noose nor -Nora Nordhoff Nordstrom Noreen Norfolk norm @@ -15281,10 +15358,11 @@ nostalgic Nostradamus Nostrand nostril not +notarize notary notate notch note notebook @@ -15292,14 +15370,12 @@ nothing notice noticeable notify notion -notocord notoriety notorious -Notre Nottingham notwithstanding Nouakchott noun nourish @@ -15343,11 +15419,10 @@ nugatory nugget nuisance null nullify -Nullstellensatz numb numerable numeral numerate numeric @@ -15371,13 +15446,12 @@ nutrient nutrition nutritious nutritive nutshell +nutting nuzzle -NV -NW NY NYC nylon nymph nymphomania @@ -15408,13 +15482,13 @@ obfuscate obfuscatory obituary object objectify +objectivity objector objet -oblate obligate obligatory oblige oblique obliterate @@ -15438,15 +15512,13 @@ obsessive obsidian obsolescent obsolete obstacle -obstetric obstinacy obstinate obstruct -obstruent obtain obtrude obtrusive obverse obviate @@ -15483,11 +15555,10 @@ octahedra octahedral octahedron octal octane -octant octave Octavia octennial octet octile @@ -15530,10 +15601,11 @@ official officialdom officiate officio officious +offing offload offsaddle offset offsetting offshoot @@ -15559,15 +15631,14 @@ oilmen oilseed oily oint OK -okay +Okay Okinawa Oklahoma Olaf -Olav old olden Oldenburg Oldsmobile oldster @@ -15574,29 +15645,27 @@ oldy oleander O'Leary olefin oleomargarine -olfactory Olga oligarchic oligarchy oligoclase oligopoly Olin olive +Oliver Olivetti Olivia olivine Olsen Olson Olympia Olympic Omaha Oman -ombudsman -ombudsperson omega omelet omen omicron ominous @@ -15612,22 +15681,19 @@ once oncology oncoming one Oneida -O'Neill onerous oneself onetime oneupmanship ongoing onion onlooker onlooking only -onomatopoeia -onomatopoeic Onondaga onrush onrushing onset onslaught @@ -15636,11 +15702,10 @@ ontogeny ontology onus onward onyx -oocyte oodles ooze opacity opal opalescent @@ -15653,11 +15718,10 @@ operand operant operate operatic operetta -operon Ophiucus opiate opinion opinionate opium @@ -15674,20 +15738,23 @@ oppressive oppressor opprobrium opt opthalmic +opthalmologic opthalmology optic optima optimal optimism optimist +optimistic optimum option optoacoustic optoisolate +optometric optometrist optometry opulent opus or @@ -15710,10 +15777,11 @@ orchid orchis ordain ordeal order +orderly ordinal ordinance ordinary ordinate ordnance @@ -15744,11 +15812,13 @@ Orlando Orleans ornament ornamentation ornate +ornately ornery +orographic orography Orono orphan orphanage Orpheus @@ -15806,11 +15876,11 @@ Oswald Othello other otherwise otherworld -otiose +otherworldly Otis Ott Ottawa otter Otto @@ -15826,27 +15896,28 @@ out outermost outlandish outlawry outrageous -ouvre ouzel ouzo ova oval ovary ovate oven ovenbird over +overhang overt overture Ovid oviform ow owe Owens +owing owl owly own ox oxalate @@ -15853,11 +15924,10 @@ oxalic oxcart oxen oxeye Oxford -Oxonian oxidant oxidate oxide Oxnard oxygen @@ -15880,10 +15950,11 @@ package Packard packet pact pad +padding paddle paddock paddy padlock padre @@ -15946,27 +16017,25 @@ pan panacea panama pancake Pancho -pancreas -pancreatic panda Pandanus pandemic pandemonium pander Pandora pane panel pang -panhandle panic panicked panicky panicle panjandrum +panning panoply panorama panoramic pansy pant @@ -16020,10 +16089,11 @@ parallelepiped paralysis paramagnet paramagnetic parameter +parametric paramilitary paramount Paramus paranoia paranoiac @@ -16049,10 +16119,11 @@ parentage parental parentheses parenthesis parenthetic +parenthood Pareto pariah parimutuel Paris parish @@ -16061,10 +16132,12 @@ park Parke Parkinson parkish parkland +parklike +Parks parkway parlance parlay parley parliament @@ -16076,19 +16149,21 @@ parolee parquet Parr Parrish parrot +parrotlike parry parse Parsifal parsimonious parsimony parsley parsnip parson parsonage +Parsons part partake Parthenon partial participant @@ -16114,10 +16189,11 @@ passageway Passaic passband passe passenger +passer passerby passion passionate passivate passive @@ -16182,10 +16258,11 @@ patroness Patsy pattern Patterson Patti +patting Patton patty paucity Paul Paula @@ -16216,11 +16293,10 @@ Payne payoff payroll Paz PBS -PDP pea Peabody peace peaceable peaceful @@ -16236,14 +16312,14 @@ Peale peanut pear Pearce pearl -pearlite pearlstone Pearson peasant +peasanthood Pease peat pebble pecan peccary @@ -16268,10 +16344,11 @@ pediatrician pedigree pediment Pedro pee +peed peek peel peep peephole peepy @@ -16309,19 +16386,19 @@ penetrate penguin Penh penicillin peninsula -penis penitent penitential penitentiary penman penmen Penn penna pennant +penning Pennsylvania penny pennyroyal Penrose Pensacola @@ -16328,11 +16405,10 @@ pension pensive pent pentagon pentagonal -pentagram pentane Pentecost pentecostal penthouse penultimate @@ -16345,10 +16421,11 @@ pep peppergrass peppermint pepperoni peppery +pepping peppy Pepsi PepsiCo peptide per @@ -16436,14 +16513,15 @@ Perry persecute persecution persecutory Perseus -perseverant +perseverance persevere Pershing Persia +Persian persiflage persimmon persist persistent person @@ -16489,10 +16567,12 @@ pestilential pestle pet petal Pete +Peter +Peters Petersburg Petersen Peterson petit petite @@ -16504,20 +16584,20 @@ petroglyph petrol petroleum petrology petticoat +petting petty petulant petunia Peugeot pew pewee pewter pfennig Pfizer -phage phagocyte phalanger phalanx phalarope phantasy @@ -16527,11 +16607,10 @@ pharmacology pharmacopoeia pharmacy phase PhD -Ph.D pheasant Phelps phenol phenolic phenomena @@ -16538,11 +16617,10 @@ phenomenal phenomenology phenomenon phenotype phenyl -phenylalanine phi Phil Philadelphia philanthrope philanthropic @@ -16549,11 +16627,11 @@ philanthropy philharmonic Philip Philippine Philistine -Phillip +Phillips philodendron philology philosoph philosophic philosophy @@ -16581,16 +16659,16 @@ phosphor phosphoresce phosphorescent phosphoric phosphorus -phosphorylate photo photogenic photography photolysis photolytic +photometric photometry photon phrase phrasemake phraseology @@ -16701,10 +16779,11 @@ pink pinkie pinkish pinnacle pinnate +pinning pinochle pinpoint pinscher Pinsky pint @@ -16712,15 +16791,15 @@ pinto pinwheel pinxter pion pioneer -Piotr pious pip pipe pipeline +Piper pipette pipsissewa piquant pique piracy @@ -16744,13 +16823,15 @@ pitfall pith pithy pitiable pitiful +pitilessly pitman Pitney Pitt +pitting Pittsburgh Pittsfield Pittston pituitary pity @@ -16759,11 +16840,10 @@ pivotal pixel pixy pizza pizzicato -Pl placate placater place placeable placebo @@ -16773,10 +16853,11 @@ placid plagiarism plagiarist plagioclase plague +plagued plaguey plaid plain Plainfield plaintiff @@ -16792,10 +16873,11 @@ planetary planetesimal planetoid plank plankton +planning planoconcave planoconvex plant plantain plantation @@ -16811,20 +16893,21 @@ plate plateau platelet platen platform +platinize platinum platitude platitudinous Plato platonic Platonism Platonist platoon Platte -platypus +platting plausible play playa playback playboy @@ -16858,25 +16941,29 @@ plethora pleura pleural Plexiglas pliable +pliancy pliant +pliers plight Pliny Pliocene plod +plodding plop +plopping plot +plotting plover plow plowman plowshare pluck plucky plug -plugboard pluggable plugging plum plumage plumb @@ -16886,30 +16973,26 @@ plummet plump plunder plunge plunk -pluperfect plural plus plush plushy Plutarch Pluto -pluton plutonium ply Plymouth plyscore plywood PM pneumatic -pneumococcus pneumonia Po poach -POBox pocket pocketbook pocketful Pocono pod @@ -16927,11 +17010,10 @@ poi poignant Poincare poinsettia point -pointwise poise poison poisonous Poisson poke @@ -16938,10 +17020,11 @@ pokerface pol Poland polar polarimeter +polarimetry Polaris polariscope polariton polarogram polarograph @@ -16954,11 +17037,10 @@ police policeman policemen policy polio -poliomyelitis polis polish Politburo polite politic @@ -16966,15 +17048,14 @@ politicking politico polity Polk polka -polkadot poll Pollard +pollcadot pollen -pollinate pollock polloi pollutant pollute pollution @@ -16981,11 +17062,10 @@ Pollux polo polonaise polonium polopony -polyploidy polygon polygonal polygynous polyhedra polyhedral @@ -16997,11 +17077,11 @@ polymorph polymorphic polynomial Polyphemus polyphony -polysaccharide +polypropylene polytechnic polytope polytypy pomade pomegranate @@ -17037,16 +17117,15 @@ pop pope popish poplar poplin +popping poppy populace popular populate -populism -populist populous porcelain porch porcine porcupine @@ -17079,21 +17158,19 @@ portrayal Portsmouth Portugal Portuguese portulaca -posable pose Poseidon poseur posey posh posit position positive positron -Posner posse posseman possemen possess possession @@ -17121,11 +17198,10 @@ postmortem postmultiply postoperative postorder postpone -postposition postprocess postprocessor postscript postulate posture @@ -17147,10 +17223,11 @@ potion potlatch Potomac potpourri pottery +potting Potts pouch Poughkeepsie poultice poultry @@ -17164,21 +17241,19 @@ powderpuff powdery Powell power powerful -powerhouse +Powers Poynting ppm -PR practicable practical practice practise practitioner Prado -praecox pragmatic pragmatism pragmatist Prague prairie @@ -17189,18 +17264,24 @@ prank praseodymium Pratt Pravda pray +prayer prayerful preach preachy +preamble Precambrian precarious +precaution +precautionary +precede precedent precept precess +precession precinct precious precipice precipitable precipitate @@ -17208,56 +17289,81 @@ precise precision preclude precocious precocity +precursor predatory predecessor predicament predicate predict predictor predilect +predispose +predisposition +predominant +predominate +preeminent preempt preemption preemptive preemptor preen prefab +prefabricate +preface prefatory prefect prefecture prefer preference preferential preferred preferring +prefix pregnant +prehistoric prejudice +prejudicial preliminary prelude +premature +premeditate premier premiere premise premium premonition +premonitory Prentice +preoccupy prep preparation preparative preparatory prepare preponderant preponderate +preposition preposterous +prepping +prerequisite prerogative +presage Presbyterian Prescott +prescribe +prescript prescription prescriptive +presence +present presentation +presentational preservation +preserve preside president presidential press pressure @@ -17265,20 +17371,30 @@ prestige prestigious presto Preston presume +presumed presuming presumption presumptive +presumptuous +presuppose +presupposition +pretend +pretense +pretension pretentious +pretext Pretoria pretty prevail prevalent +prevent prevention preventive +preview previous prexy prey Priam price @@ -17296,10 +17412,11 @@ primary primate prime primeval primitive +primitivism primp primrose prince princess Princeton @@ -17328,10 +17445,11 @@ prizewinning pro probabilist probate probe +probity problem problematic procaine procedural procedure @@ -17349,20 +17467,23 @@ Procter proctor procure Procyon prod +prodding prodigal prodigious prodigy produce producible product +productivity Prof profane profess profession +professional professor professorial proffer proficient profile @@ -17388,29 +17509,25 @@ prohibitive prohibitory project projectile projector -prokaryote Prokofieff prolate proletariat proliferate prolific -proline prolix prologue prolong prolongate prolusion -prom promenade Promethean Prometheus promethium prominent -promiscuity promiscuous promise promote promotion prompt @@ -17450,10 +17567,11 @@ proportionate propos proposal propose proposition +propping proprietary proprietor propriety proprioception proprioceptive @@ -17499,11 +17617,10 @@ protestant protestation prothonotary protocol proton -Protophyta protoplasm protoplasmic prototype prototypic Protozoa @@ -17524,10 +17641,11 @@ provident providential province provincial provision +provisional proviso provocateur provocation provocative provoke @@ -17561,14 +17679,17 @@ psychoanalysis psychoanalyst psychoanalytic psychobiology psychology +psychometric psychometry psychopath psychopathic psychophysic +psychophysical +psychophysics psychophysiology psychopomp psychoses psychosis psychosomatic @@ -17577,11 +17698,10 @@ psychotherapy psychotic psyllium PTA ptarmigan -pterodactyl Ptolemaic Ptolemy pub puberty pubescent @@ -17598,10 +17718,11 @@ pueblo puerile Puerto puff puffball +puffed puffery puffin puffy pug Pugh @@ -17608,11 +17729,10 @@ puissant puke Pulaski Pulitzer pull -pullback pulley Pullman pullover pulmonary pulp @@ -17638,10 +17758,11 @@ Punic punish punitive punk punky +punning punster punt puny pup pupal @@ -17660,11 +17781,10 @@ purgative purgatory purge purify Purina -purine Puritan puritanic purl purloin purple @@ -17675,21 +17795,20 @@ purr purse purslane pursuant pursue +pursuer pursuit purvey purveyor purview pus Pusan Pusey push pushbutton -pushout -pushpin pussy pussycat put putative Putnam @@ -17697,26 +17816,26 @@ putty puzzle PVC Pygmalion pygmy -Pyrrhic +Pyhrric pyknotic Pyle Pyongyang pyracanth pyramid pyramidal pyre Pyrex pyridine -pyrimidine pyrite pyroelectric pyrolyse pyrolysis pyrometer +pyrometry pyrophosphate pyrotechnic pyroxene pyroxenite Pythagoras @@ -17750,10 +17869,11 @@ quahog quail quaint quake Quakeress +qualified qualify qualitative quality qualm quandary @@ -17807,11 +17927,10 @@ quickie quicklime quicksand quicksilver quickstep -quid quiescent quiet quietus quill quillwort @@ -17836,11 +17955,10 @@ quitting quiver Quixote quixotic quiz -quizzes quizzical quo quod quonset quorum @@ -17885,12 +18003,15 @@ radiochemical radiochemistry radiography radiology radiometer +radiometric +radiometry radiophysics radiosonde +radiosterilize radiotherapy radish radium radius radix @@ -17933,10 +18054,11 @@ ram Ramada Raman ramble ramify +ramming Ramo ramp rampage rampant rampart @@ -17958,11 +18080,10 @@ Rangoon rangy Ranier rank Rankin -Rankine rankle ransack ransom rant Raoul @@ -17970,17 +18091,19 @@ rapacious rape Raphael rapid rapier +rapping rapport rapprochement rapt rapture rare rarefy Raritan +rarity rasa rascal rash Rasmussen rasp @@ -17998,11 +18121,10 @@ rationale rattail rattle rattlesnake raucous -Raul ravage rave ravel raven ravenous @@ -18018,20 +18140,20 @@ Raytheon raze razor razorback RCA -Rd R&D re reach reactant reactionary read readout ready Reagan +reagent real realisable realm realtor realty @@ -18051,10 +18173,13 @@ rebut rebuttal rebutted rebutting recalcitrant +recant +recappable +recede receipt receive recent receptacle reception @@ -18079,10 +18204,13 @@ recluse recompense reconcile recondite reconnaissance +record +recoup +recourse recovery recriminate recruit rectangle rectangular @@ -18094,12 +18222,14 @@ rectory recumbent recuperate recur recurred +recurrent recurring recursion +recursive recusant recuse red redact redactor @@ -18106,10 +18236,11 @@ redbird redbud redcoat redden reddish +redeem redemption redemptive redhead Redmond redneck @@ -18119,10 +18250,11 @@ redstart Redstone redtop reduce reducible +reduct redundant redwood reed reedbuck reedy @@ -18141,14 +18273,16 @@ referent referential referral referred referring +refinery reflect reflectance reflector reflexive +reforestation reformatory refract refractometer refractory refrain @@ -18169,29 +18303,28 @@ regiment regimentation Regina Reginald region +regional Regis registrable registrant registrar registration registry regress regression -regressive regret regretful regrettable regretted regretting regular regulate regulatory Regulus -regurgitate rehabilitate rehearsal rehearse Reich Reid @@ -18206,13 +18339,16 @@ reinstate reject rejoice rejoinder relate +relax relaxation +relay releasable relevant +reliable reliant relic relict relief relieve @@ -18256,11 +18392,10 @@ Renault rend render rendezvous rendition -Rene renegotiable renewal Renoir renounce renovate @@ -18340,10 +18475,11 @@ residuum resign resignation resilient resin +resinlike resiny resist resistant resistible resistive @@ -18382,10 +18518,11 @@ restrict restroom result resultant resume +resuming resumption resurgent resurrect resuscitate ret @@ -18412,11 +18549,10 @@ retribution retrieval retrieve retroactive retrofit -retrofitted retrofitting retrograde retrogress retrogressive retrorocket @@ -18424,11 +18560,10 @@ retrovision return Reub Reuben Reuters -rev reveal revel revelation revelatory revelry @@ -18443,10 +18578,11 @@ reversal reverse reversible reversion revert +revertive revery revet revile revisable revisal @@ -18499,22 +18635,21 @@ rhombus rhubarb rhyme rhythm rhythmic -RI rib ribald +ribbing ribbon riboflavin ribonucleic -ribose -ribosome Rica rice rich Richard +Richards Richardson Richfield Richmond Richter rick @@ -18525,26 +18660,25 @@ Rico ricochet rid riddance ridden +ridding riddle ride ridge ridgepole Ridgway ridicule ridiculous Riemann -Riemannian riffle rifle rifleman riflemen rift rig -Riga Rigel rigging Riggs right righteous @@ -18556,10 +18690,11 @@ Riley rill rilly rim rime +rimming rimy Rinehart ring ringlet ringside @@ -18573,10 +18708,11 @@ riparian ripe ripen Ripley ripoff +ripping ripple rise risen risible risk @@ -18596,11 +18732,10 @@ riverside rivet Riviera rivulet Riyadh -RNA roach road roadbed roadblock roadhouse @@ -18611,14 +18746,17 @@ roar roast rob robbery robbin +robbing +Robbins robe Robert Roberta Roberto +Roberts Robertson robin Robinson robot robotics @@ -18631,10 +18769,11 @@ Rockefeller rocket Rockford Rockies Rockland +rocklike Rockwell rocky rococo rod rode @@ -18645,10 +18784,11 @@ Rodriguez roe roebuck Roentgen Roger +Rogers rogue roil roister Roland role @@ -18656,11 +18796,10 @@ rollback rollick Rollins Roman romance -Romania Romano romantic Rome Romeo romp @@ -18696,11 +18835,10 @@ Rosen Rosenberg Rosenblum Rosenthal Rosenzweig -Rosetta rosette Ross roster rostrum rosy @@ -18709,15 +18847,15 @@ rotary rotate ROTC rotenone Roth -Rothschild rotogravure rotor rototill rotten +rotting rotund rotunda rouge rough roughcast @@ -18750,25 +18888,24 @@ Rowley Roy royal royalty Royce -Roxbury RPM r's RSVP Ruanda rub rubbery +rubbing rubbish rubble rubdown Rube Ruben rubicund rubidium -Rubin rubric ruby ruckus rudder ruddy @@ -18785,11 +18922,10 @@ ruffle rufous Rufus rug ruin -ruination ruinous rule rum Rumania rumble @@ -18808,10 +18944,11 @@ rune rung Runge runic runneth +running Runnymede runoff runt runty runway @@ -18842,10 +18979,11 @@ Rutherford ruthless rutile Rutland Rutledge +rutting rutty Rwanda Ryan Rydberg Ryder @@ -18858,13 +18996,11 @@ Sabine sable sabotage sabra sac -saccharine sachem -Sachs sack sacral sacrament Sacramento sacred @@ -18905,17 +19041,19 @@ sail sailboat sailfish sailor saint +sainthood sake Sal Salaam salacious salad salamander salami +salaried salary sale Salem Salerno salesgirl @@ -18936,11 +19074,10 @@ Salle sallow sally salmon salmonberry -salmonella salon saloon saloonkeep salsify salt @@ -18987,10 +19124,11 @@ sandalwood sandbag sandblast Sandburg sanderling +Sanders Sanderson sandhill Sandia sandman sandpaper @@ -19024,10 +19162,11 @@ sapiens sapient sapling saponify sapphire +sapping sappy sapsucker Sara Saracen Sarah @@ -19034,11 +19173,10 @@ Saran Sarasota Saratoga sarcasm sarcastic -sarcophagus sarcoma sardine sardonic Sargent sari @@ -19045,11 +19183,10 @@ sarsaparilla sarsparilla sash sashay Saskatchewan -Saskatoon sassafras sat satan satanic satellite @@ -19117,17 +19254,17 @@ scalar scald scale scallop scalp -scam scamp scan scandal scandalous Scandinavia scandium +scanning scant scanty scapegoat scapula scapular @@ -19137,19 +19274,19 @@ scare scarecrow scarf scarface scarify -Scarlatti scarlet Scarsdale scarves scary scat scathe scatterbrain scattergun +scatting scaup scavenge scenario scene scenery @@ -19212,11 +19349,10 @@ Schuyler Schuylkill Schwab Schwartz Schweitzer -Sci sciatica science scientific scientist scimitar @@ -19259,14 +19395,16 @@ scowl scrabble scraggly scram scramble +scramming Scranton scrap scrapbook scrape +scrapping scratch scratchy scrawl scrawny scream @@ -19291,21 +19429,22 @@ scriptural scripture scriven scroll scrooge -scrotum scrounge scrub +scrubbing scrumptious scruple scrupulosity scrupulous scrutable scrutiny scuba scud +scudding scuff scuffle scull sculpin sculpt @@ -19320,11 +19459,10 @@ scutum Scylla scythe Scythia SD -SE sea seaboard seacoast seafare seafood @@ -19334,19 +19472,19 @@ seal sealant seam seaman seamen -seamstress seamy Sean seance seaport seaquake sear search searchlight +Sears seashore seaside season seasonal seat @@ -19428,15 +19566,15 @@ Selena selenate selenite selenium self -selfadjoint selfish Selfridge Selkirk sell +seller sellout Selma seltzer selves Selwyn @@ -19495,11 +19633,10 @@ septillion septuagenarian septum sepuchral sepulchral -seq sequel sequent sequential sequester sequestration @@ -19508,24 +19645,20 @@ Sequoia sera seraglio serape seraphim -Serbia serenade serendipitous -serendipity serene -serf serge sergeant Sergei serial seriatim series serif -serine serious sermon serology Serpens serpent @@ -19548,10 +19681,11 @@ set setback Seth Seton setscrew +setting settle setup seven sevenfold seventeen @@ -19658,10 +19792,11 @@ sheath sheathe sheave she'd shed +shedding Shedir Sheehan sheen sheep sheepskin @@ -19693,16 +19828,19 @@ Sherrill sherry Sherwin Sherwood shibboleth +shied shield +Shields shift shifty shill Shiloh shim +shimming shimmy shin shinbone shine shingle @@ -19715,10 +19853,11 @@ shiplap Shipley shipman shipmate shipmen +shipping shipshape shipwreck shipyard shire shirk @@ -19728,11 +19867,10 @@ shish shitepoke shiv shiver shivery -Shmuel shoal shock Shockley shod shoddy @@ -19747,10 +19885,11 @@ shoofly shook shoot shop shopkeep +shopping shopworn shore shoreline short shortage @@ -19783,10 +19922,11 @@ showroom showy shrank shrapnel shred +shredding Shreveport shrew shrewd shrewish shriek @@ -19814,15 +19954,17 @@ shuddery shuffle shuffleboard Shulman shun +shunning shunt shut shutdown shutoff shutout +shutting shuttle shuttlecock shy Shylock sial @@ -19872,11 +20014,10 @@ Siegel Siegfried Sieglinda Siegmund Siemens -Siena sienna sierra siesta sieve sift @@ -19931,18 +20072,18 @@ simile similitude simmer Simmons Simon +Simons Simonson simper simple simplectic simpleminded simpleton simplex -simplicial simplicity simplify simplistic simply Simpson @@ -19973,17 +20114,19 @@ sinh sinister sinistral sink sinkhole +sinning sinter sinuous sinus sinusoid sinusoidal Sioux sip +sipping sir sire siren Sirius sis @@ -19993,10 +20136,11 @@ Sistine Sisyphean Sisyphus sit site +sitting situ situate situs siva six @@ -20021,29 +20165,33 @@ sketchpad sketchy skew ski skid +skidding skiddy +skied skiff skill skillet skillful skim +skimming skimp skimpy skin skindive +skinning skinny skip skipjack +skipping Skippy skirmish skirt skit skittle -Skopje skulk skull skullcap skullduggery skunk @@ -20065,30 +20213,33 @@ sladang slag slain slake slam +slamming slander slanderous slang slant slap +slapping slapstick slash slat slate slater +slatting slaughter slaughterhouse Slav slave slavery Slavic slavish -Slavonic slay sled +sledding sledge sledgehammer sleek sleep sleepwalk @@ -20113,12 +20264,14 @@ sling slingshot slip slippage slippery +slipping slit slither +slitting sliver slivery Sloan Sloane slob @@ -20129,37 +20282,39 @@ sloganeer slogging sloop slop slope +slopping sloppy slosh slot sloth slothful slouch slough -Slovakia sloven -Slovenia slow slowdown sludge slug slugging sluggish sluice slum slumber +slumming slump slung slur slurp +slurring slurry sly smack small +smaller Smalley smallish smallpox smalltime smart @@ -20172,10 +20327,11 @@ smirk smith smithereens Smithfield Smithson +Smithsonian smithy smitten smog smoke smokehouse @@ -20201,14 +20357,16 @@ snag snagging snail snake snakebird +snakelike snakeroot snap snapback snapdragon +snapping snappish snappy snapshot snare snark @@ -20222,10 +20380,11 @@ snell snick Snider sniff sniffle +sniffly snifter snigger snip snipe snippet @@ -20247,12 +20406,15 @@ snowfall snowflake snowstorm snowy snub +snubbing snuff +snuffer snuffle +snuffly snug snuggle snuggly snyaptic Snyder @@ -20262,31 +20424,33 @@ soapstone soapsud soapy soar sob +sobbing sober sobriety sobriquet -Soc soccer sociable social societal Societe society socioeconomic sociology +sociometric sociometry sock socket sockeye Socrates Socratic sod soda sodden +sodding sodium sofa soffit Sofia soft @@ -20307,10 +20471,11 @@ soldier soldiery sole solecism solemn +solemnity solenoid solicit solicitation solicitor solicitous @@ -20319,11 +20484,10 @@ solidarity solidify soliloquy solipsism solitary -soliton solitude solo Solomon Solon solstice @@ -20357,11 +20521,10 @@ somewhere sommelier Sommerfeld somnolent son -sonant sonar sonata song songbag songbook @@ -20388,10 +20551,11 @@ sophistry Sophoclean Sophocles sophomore sophomoric +sopping soprano sora sorb sorcery sordid @@ -20407,11 +20571,10 @@ sorry sort sortie sou souffle -sough sought soul soulful sound soundproof @@ -20449,11 +20612,10 @@ soybean spa space spacecraft spacesuit -spacetime spacious spade spaghetti Spain spalding @@ -20461,21 +20623,24 @@ spandrel spangle Spaniard spaniel Spanish +spanning spar spare sparge spark sparkle Sparkman sparky sparling +sparring sparrow sparse Sparta +Spartan spasm spastic spat spate spatial @@ -20484,10 +20649,11 @@ spatula Spaulding spavin spawn spay +spayed speak speakeasy spear spearhead spearmint @@ -20509,11 +20675,15 @@ spectral spectrogram spectrograph spectrography spectrometer +spectrometric +spectrometry spectrophotometer +spectrophotometric +spectrophotometry spectroscope spectroscopic spectroscopy spectrum specular @@ -20563,10 +20733,11 @@ spinal spindle spine spinnaker spinneret +spinning spinodal spinoff spinster spiny spiral @@ -20576,25 +20747,28 @@ Spiro spit spite spiteful spitfire +spitting spittle spitz splash splashy splat splay +splayed spleen spleenwort splendid splenetic splice spline splint splintery split +splitting splotch splotchy splurge splutter spoil @@ -20602,11 +20776,10 @@ Spokane spoke spoken spokesman spokesmen -spokesperson sponge spongy sponsor spontaneity spontaneous @@ -20625,10 +20798,11 @@ sportswriter sportswriting sporty spot spotlight +spotting spotty spouse spout Sprague sprain @@ -20662,10 +20836,11 @@ spunk spur spurge spurious spurn +spurring spurt sputnik sputter spy spyglass @@ -20696,22 +20871,23 @@ Squibb squid squill squint squire +squirehood squirm squirmy squirrel squirt squishy Sri s's -SSE SST -SSW St +St. stab +stabbing stabile stable stableman stablemen staccato @@ -20787,10 +20963,11 @@ Starkey starlet starlight starling Starr +starring start startle startup starvation starve @@ -20799,10 +20976,11 @@ state Staten stater stateroom statesman +statesmanlike statesmen statewide static stationarity stationary @@ -20821,10 +20999,11 @@ Stauffer staunch Staunton stave stay +stayed stead steadfast steady steak steal @@ -20831,12 +21010,10 @@ stealth stealthy steam steamboat steamy -stearate -stearic Stearns steed steel Steele steelmake @@ -20844,21 +21021,20 @@ Steen steep steepen steeple steeplebush -steeplechase steer steeve Stefan -Stegosaurus stein Steinberg Steiner stella stellar stem +stemming stench stencil stenographer stenography stenotype @@ -20865,13 +21041,15 @@ step stepchild Stephanie stephanotis Stephen +Stephens Stephenson stepmother steppe +stepping steprelation stepson stepwise steradian stereo @@ -20879,20 +21057,20 @@ stereoscopy sterile sterling stern sternal -Sternberg Sterno sternum steroid stethoscope Stetson Steuben Steve stevedore Steven +Stevens Stevenson stew steward stewardess Stewart @@ -20927,10 +21105,11 @@ stipend stipple stipulate stir Stirling +stirring stirrup stitch stochastic stock stockade @@ -20941,10 +21120,11 @@ stockroom Stockton stocky stodgy stoic +stoichiometric stoichiometry stoke Stokes stole stolen @@ -20966,10 +21146,11 @@ stopband stopcock stopgap stopover stoppage +stopping stopwatch storage store storehouse storekeep @@ -20984,11 +21165,10 @@ storyteller stout stove stow stowage -stowaway strabismic strabismus straddle strafe straggle @@ -21002,10 +21182,11 @@ strand strange strangle strangulate strap +strapping strata stratagem strategic strategist strategy @@ -21028,11 +21209,10 @@ streetcar strength strengthen strenuous streptococcus -streptomycin stress stressful stretch strewn striate @@ -21039,19 +21219,19 @@ stricken Strickland strict stricture stride -strident strife strike strikebreak string stringent stringy strip stripe +stripping striptease strive striven strobe stroboscopic @@ -21064,27 +21244,32 @@ stronghold strongroom strontium strop strophe +stropping strove struck structural structure struggle strum +strumming strung strut +strutting strychnine Stuart stub +stubbing stubble stubborn stubby stucco stuck stud +studding Studebaker student studio studious study @@ -21096,10 +21281,11 @@ stumpage stumpy stun stung stunk +stunning stunt stupefy stupendous stupid stupor @@ -21120,12 +21306,13 @@ styrene Styrofoam Styx suave sub +subbing subject -subjunctive +subjectivity sublimate subliminal submersible submit submittal @@ -21145,10 +21332,12 @@ substitute substitution substitutionary substrate subsume +subsumed +subsuming subterfuge subterranean subtle subtlety subtly @@ -21167,11 +21356,10 @@ succubus succumb such suck suckling -sucrose suction sud Sudan Sudanese sudden @@ -21198,11 +21386,10 @@ suit suitcase suite suitor sulfa -sulfanilamide sulfate sulfide sulfite sulfonamide sulfur @@ -21217,15 +21404,18 @@ sultan sultry sum sumac Sumatra -Sumeria +Sumerian summand +summarily summary summate +Summers summertime +summing summit summitry summon Sumner sumptuous @@ -21242,19 +21432,18 @@ sundown sundry sunfish sunflower sung -sunglasses sunk sunken sunlight sunlit +sunning sunny Sunnyvale sunrise -sunscreen sunset sunshade sunshine sunshiny sunspot @@ -21274,16 +21463,18 @@ superintendent superior superlative superlunary supernatant +superposable supersede superstition superstitious supervene supervisory supine +supping supplant supple supplementary supplicate supply @@ -21309,12 +21500,10 @@ surfeit surge surgeon surgery surgical -surjection -surjective surmise surmount surname surpass surplus @@ -21334,11 +21523,10 @@ survive survivor Sus Susan Susanne -susceptance susceptible sushi Susie suspect suspend @@ -21356,12 +21544,12 @@ Suzanne suzerain suzerainty Suzuki svelte -SW swab +swabbing swabby swag Swahili swain swallow @@ -21371,12 +21559,14 @@ swamp swampy swan swank swanky +swanlike Swanson swap +swapping swarm swart Swarthmore Swarthout swarthy @@ -21383,10 +21573,11 @@ swastika swat swatch swath swathe +swatting sway Swaziland swear sweat sweatband @@ -21398,11 +21589,10 @@ Swedish Sweeney sweep sweepstake sweet -sweeten sweetheart sweetish swell swelt swelter @@ -21411,10 +21601,11 @@ swerve swift swig swigging swim +swimming swimsuit swindle swine swing swingable @@ -21453,35 +21644,33 @@ syenite Sykes syllabic syllabify syllable -syllabi -syllabus syllogism syllogistic -Sylow sylvan Sylvania Sylvester Sylvia symbiosis symbiotic symbol symbolic +symmetric symmetry sympathetic sympathy -symplectic symphonic symphony symposia symposium symptom symptomatic synagogue synapse +synapses synaptic synchronism synchronous synchrony synchrotron @@ -21490,11 +21679,10 @@ syndicate syndrome synergism synergistic synergy -Synge synod synonym synonymous synonymy synopses @@ -21512,16 +21700,15 @@ syrup syrupy system systematic systemic +systemization systemwide -syzygy -Szilard t -TA tab +tabbing tabernacle table tableau tableaux tablecloth @@ -21557,13 +21744,11 @@ tagging Tahiti Tahoe tail tailgate -tailspin tailor -tailwind taint Taipei Taiwan take taken @@ -21611,18 +21796,21 @@ tango tangy tanh tank tannin +tanning tansy tantalum Tantalus tantamount tantrum Tanya Tanzania tao +Taoist +Taos tap tapa tape taper tapestry @@ -21629,10 +21817,11 @@ tapeworm tapir tapis tappa tappet +tapping tar tara tarantara tarantula Tarbell @@ -21641,10 +21830,11 @@ tariff tarnish tarpaper tarpaulin tarpon +tarring tarry Tarrytown tart tartar Tartary @@ -21659,10 +21849,11 @@ tasting tasty tat tate tater +tatting tattle tattler tattletale tattoo tatty @@ -21679,11 +21870,10 @@ tax taxation taxi taxicab taxied -taxiway taxonomy taxpayer taxpaying Taylor tea @@ -21709,16 +21899,16 @@ teat tech technetium technic technician -Technion technique technology tectonic tecum -Ted +ted +tedding Teddy tedious tedium tee teeing @@ -21734,20 +21924,21 @@ Tegucigalpa Teheran Tehran tektite Tektronix -Tel telecommunicate teleconference Teledyne Telefunken telegram telegraph telegraphy telekinesis telemeter +telemetric +telemetry teleology teleost telepathic telepathy telephone @@ -21764,10 +21955,11 @@ teletypewrite televise television Telex tell +teller tellurium temerity temper tempera temperance @@ -21806,10 +21998,11 @@ tenon tenor tense tensile tension +tensional tensor tenspot tent tentacle tentative @@ -21867,11 +22060,11 @@ testy tetanus tete tether tetrachloride -tetrafluoride +tetrafluouride tetragonal tetrahedra tetrahedral tetrahedron tetravalent @@ -21906,12 +22099,10 @@ theatric Thebes thee theft their -theism -theist Thelma them thematic theme themselves @@ -21952,12 +22143,27 @@ therewith thermal thermionic thermistor thermo +thermocouple +thermodynamic +thermoelastic +thermoelectric Thermofax +thermometer +thermometric +thermometry +thermomigrate +thermonuclear +thermopile +thermoplastic +thermopower +thermosetting +thermostable thermostat +thermostatic thesaurus these theses Theseus thesis @@ -21982,10 +22188,11 @@ Thimbu thin thine thing think +thinning thinnish thiocyanate thiouracil third thirst @@ -22022,20 +22229,18 @@ though thought thoughtful thousand thousandth -thrall thrash thread threadbare threat threaten three threefold threesome -threonine thresh threshold threw thrice thrift @@ -22044,10 +22249,11 @@ thrips thrive throat throaty throb +throbbing throes thrombosis throne throng throttle @@ -22056,15 +22262,17 @@ throughput throw throwback thrown thrum +thrumming thrush thrust Thruway Thuban thud +thudding thug thuggee Thule thulium thumb @@ -22072,21 +22280,17 @@ thump thunder thunderclap thunderflower thunderous -thundershower thunderstorm Thurman Thursday thus thwack thwart thy -thyme -thymine -thymus thyratron thyroglobulin thyroid thyroidal thyronine @@ -22106,12 +22310,14 @@ tidal tidbit tide tideland tidewater +tidings tidy tie +tied Tientsin tier Tiffany tift tiger @@ -22138,27 +22344,28 @@ Timex timid Timon timothy tin -Tina tincture tinder tine tinfoil tinge tingle tinker tinkle +tinning tinsel tint tintype tiny Tioga tip tipoff Tipperary +tipping tipple tippy tipsy tiptoe tirade @@ -22177,26 +22384,23 @@ title titmouse titrate titular Titus -TN TNT to toad toady toast tobacco Tobago -Toby toccata today today'll Todd toddle toe -TOEFL toenail toffee tofu tog together @@ -22222,10 +22426,11 @@ toluene Tom tomato tomatoes tomb +tomblike tombstone tome Tomlinson Tommie tommy @@ -22265,12 +22470,12 @@ topic topmost topnotch topocentric topography -topologize topology +topping topple topsoil Topsy tor torah @@ -22355,11 +22560,10 @@ tragedian tragedy tragic tragicomic trail -trailhead trailside train trainee trainman trainmen @@ -22397,11 +22601,10 @@ transference transferor transferral transferred transferring -transfinite transfix transform transformation transfusable transfuse @@ -22446,15 +22649,15 @@ transship transshipping transversal transverse transvestite -Transylvania trap trapezium trapezoid trapezoidal +trapping trash trashy Trastevere trauma traumatic @@ -22481,13 +22684,15 @@ treat treatise treaty treble tree +treelike treetop trefoil trek +trekking trellis tremble tremendous tremor tremulous @@ -22509,11 +22714,10 @@ triangle triangular triangulate Triangulum Trianon -Triassic triatomic tribal tribe tribesman tribesmen @@ -22524,32 +22728,34 @@ tribute Trichinella trichloroacetic trichloroethane trichrome -Triceratops trick trickery trickle trickster tricky trident tridiagonal +tried triennial trifle -trifluoride +trifluouride trig trigonal +trigonometric trigonometry trigram trill trillion trilobite trilogy trim trimer trimester +trimming Trinidad trinitarian trinity trinket trio @@ -22564,10 +22770,11 @@ Triplett triplex triplicate tripod tripoli +tripping triptych trisodium Tristan tristate trisyllable @@ -22598,10 +22805,11 @@ tropic tropopause troposphere tropospheric trot +trotting trouble troubleshoot troublesome trough trounce @@ -22608,10 +22816,11 @@ troupe trouser trout Troutman troy +truancy truant truce truck truculent trudge @@ -22635,11 +22844,10 @@ truth truthful TRW try trypsin -trytophan t's tsar tsarina tsunami TTL @@ -22681,14 +22889,11 @@ tunic Tunis Tunisia tunnel tupelo -tuple turban -turbid -turbidity turbinate turbine turbofan turbojet turbulent @@ -22753,23 +22958,24 @@ twill twin twine twinge twinkle +twinning twirl twirly twist twisty twit twitch twitchy +twitting two twofold Twombly twosome TWX -TX Tyburn tycoon tying Tyler type @@ -22790,11 +22996,10 @@ typographer typography typology tyrannic tyrannicide -Tyrannosaurus tyranny tyrant tyrosine Tyson u @@ -22803,11 +23008,10 @@ UCLA Uganda ugh ugly UK -Ukraine Ukrainian Ulan ulcer ulcerate Ullman @@ -22814,10 +23018,20 @@ Ulster ulterior ultimate ultimatum ultra +ultracentrifuge +ultraconservative +ultrafast +ultramarine +ultramodern +ultrashort +ultrasonic +ultrasound +ultrastructure +ultraviolet Ulysses umber umbilical umbilici umbilicus @@ -22828,10 +23042,11 @@ UN unanimity unanimous unary unbeknownst +unbidden unchristian uncle uncouth unction under @@ -22855,11 +23070,10 @@ uniprocessor unique Uniroyal unison unit -unital unitarian unitary unite unity Univac @@ -22889,10 +23103,11 @@ upholstery upkeep upland uplift upon +upper upperclassman upperclassmen uppercut uppermost upraise @@ -22920,11 +23135,10 @@ uptown uptrend upturn upward upwind -uracil urania uranium Uranus uranyl urban @@ -22935,12 +23149,13 @@ urea uremia urethane urethra urge +urgency urgent -Uri +urging urinal urinary urine Uris urn @@ -22947,14 +23162,12 @@ Ursa Ursula Ursuline Uruguay u's -U.S us USA -U.S.A usable USAF usage USC USC&GS @@ -22971,11 +23184,10 @@ usurer usurious usurp usurpation usury -UT Utah utensil uterine Utica utile @@ -22982,16 +23194,14 @@ utilitarian utility utmost utopia utopian -Utrecht utter utterance uttermost v -VA vacant vacate vacationland vaccinate vaccine @@ -23024,16 +23234,14 @@ valeur Valhalla valiant valid validate -valine Valkyrie Valletta valley Valois -Valparaiso valuate value valve vamp vampire @@ -23043,11 +23251,10 @@ Vancouver vandal Vandenberg Vanderbilt Vanderpoel -vane vanguard vanilla vanish vanity vanquish @@ -23064,14 +23271,11 @@ Varitype varnish vary vascular vase -vasectomy -Vasquez vassal -Vassar vast vat Vatican vaudeville Vaudois @@ -23092,11 +23296,10 @@ vehement vehicle vehicular veil vein -velar Velasquez veldt Vella vellum velocity @@ -23120,11 +23323,10 @@ venial Venice venison venom venomous -venous vent ventilate ventricle venture venturesome @@ -23140,10 +23342,11 @@ verbal verbatim verbena verbiage verbose +verbosity verdant Verde Verdi verdict verge @@ -23167,11 +23370,10 @@ Vernon Verona Veronica versa Versailles -versatec versatile verse version versus vertebra @@ -23197,10 +23399,11 @@ vetch veteran veterinarian veterinary veto +vetting vex vexation vexatious vi via @@ -23211,10 +23414,11 @@ vibrato viburnum vicar vicarious vice +vicelike viceroy Vichy vicinal vicinity vicious @@ -23222,10 +23426,11 @@ Vicksburg Vicky victim victor Victoria +Victorian victorious victory victrola victual Vida @@ -23241,10 +23446,11 @@ view viewpoint vigil vigilant vigilante +vigilantism vignette vigorous vii viii Viking @@ -23272,10 +23478,11 @@ violin Virgil virgin virginal Virginia +Virginian Virgo virgule virile virtual virtue @@ -23294,10 +23501,11 @@ viscometer viscosity viscount viscous vise +viselike Vishnu visible Visigoth vision visionary @@ -23385,19 +23593,18 @@ vow vowel voyage Vreeland v's -VT Vulcan vulgar vulnerable vulpine vulture +vulturelike vying w -WA Waals Wabash WAC wack wacke @@ -23454,17 +23661,19 @@ wallet Wallis wallop wallow wallpaper +Walls wally walnut Walpole walrus Walsh Walt Walter +Walters Waltham Walton waltz wan wand @@ -23487,22 +23696,23 @@ warehouse warehouseman warfare warhead Waring +warlike warm warmhearted warmish warmonger warmth warmup warn warp -warplane warrant warranty warren +warring warrior Warsaw wart wartime warty @@ -23527,11 +23737,10 @@ wastebasket wasteful wasteland wastewater wastrel -Watanabe watch watchband watchdog watchful watchmake @@ -23548,10 +23757,11 @@ waterline Waterloo Waterman watermelon waterproof +Waters watershed waterside Watertown waterway watery @@ -23558,10 +23768,11 @@ Watkins Watson watt wattage wattle +Watts wave waveform wavefront waveguide wavelength @@ -23586,10 +23797,11 @@ wealthy wean weapon weaponry wear +wearied wearisome weary weasel weather weatherbeaten @@ -23597,24 +23809,27 @@ weatherstrip weatherstripping weave web Webb +webbing weber Webster WECo we'd wed +wedding wedge wedlock Wednesday wee weed weedy week weekday weekend +Weeks weep Wehr Wei Weierstrass weigh @@ -23635,10 +23850,11 @@ wellbeing Weller Welles Wellesley wellington +Wells welsh welt Wendell Wendy went @@ -23662,16 +23878,18 @@ Westminster Weston westward wet wetland +wetting we've Weyerhauser whack whale Whalen wham +whamming wharf Wharton wharves what what'd @@ -23712,10 +23930,11 @@ whereupon wherever wherewith whet whether +whetting which whichever whiff whig while @@ -23727,17 +23946,19 @@ whinny whip whiplash Whippany whippet +whipping Whipple whipsaw whir whirl whirligig whirlpool whirlwind +whirring whisk whisper whistle whistleable whit @@ -23755,11 +23976,10 @@ Whitlock Whitman Whitney Whittaker Whittier -whittle whiz whizzing who whoa who'd @@ -23773,25 +23993,26 @@ whom whomsoever whoop whoosh whop +whopping whore whose whosoever whup why -WI Wichita wick wicket wide widen widespread widgeon widget widow +widowhood width widthwise wield wiener Wier @@ -23799,13 +24020,11 @@ wig wigging Wiggins wiggle wiggly -Wightman wigmake -wigwam Wilbur Wilcox wild wildcat wildcatter @@ -23817,29 +24036,31 @@ Wilfred wilful Wilhelm Wilhelmina Wilkes -Wilkie Wilkins Wilkinson will Willa Willard willful William +Williams Williamsburg Williamson Willie Willis Willoughby willow willowy +Wills Wilma Wilmington Wilshire Wilson +Wilsonian wilt wily win wince winch @@ -23853,11 +24074,10 @@ windowpane windowsill windshield Windsor windstorm -windsurf windup windward windy wine winemake @@ -23874,18 +24094,20 @@ Winifred wink winkle Winnetka Winnie +winning Winnipeg Winnipesaukee winnow wino Winslow winsome Winston winter +Winters wintertime Winthrop wintry winy wipe @@ -23924,10 +24146,11 @@ withstand withstood withy witness Witt +witting witty wive wizard wobble woe @@ -23942,12 +24165,12 @@ Wolff Wolfgang wolfish wolve woman +womanhood womb -wombat women won wonder wonderful wonderland @@ -23969,18 +24192,20 @@ Woodlawn woodlot woodpeck woodrow woodruff +Woods woodshed woodside woodward woodwind woodwork woody woodyard wool +woolen woolgather Woolworth Wooster wop Worcester @@ -23988,23 +24213,21 @@ Wordsworth wordy wore work workbench -workbook workday workhorse workload workman +workmanlike workmen workout workpiece -workplace worksheet workshop workspace -workstation worktable world worldwide worm wormy @@ -24029,10 +24252,11 @@ wow wrack wraith wrangle wrap +wrapping wrapup wrath wrathful wreak wreath @@ -24065,12 +24289,10 @@ wrought wry w's Wu Wuhan -WV -WY Wyandotte Wyatt Wyeth Wylie Wyman @@ -24080,11 +24302,11 @@ x Xavier xenon xenophobia xerography -xerox +Xerox Xerxes xi x's xylem xylene @@ -24131,11 +24353,10 @@ Yeats yell yellow yellowish Yellowknife -Yellowstone yelp Yemen yen yeoman yeomanry @@ -24151,12 +24372,10 @@ YMCA yodel Yoder yoga yogi -yoghurt -yogurt yoke yokel Yokohama Yokuts yolk @@ -24187,11 +24406,10 @@ y's ytterbium yttrium Yucatan yucca -yuck Yugoslav Yugoslavia yuh Yuki Yukon @@ -24201,17 +24419,16 @@ YWCA z Zachary zag zagging -Zagreb Zaire Zambia Zan Zanzibar zap -zazen +zapping zeal Zealand zealot zealous zebra @@ -24234,11 +24451,13 @@ zilch Zimmerman zinc zing Zion +Zionism zip +zipping zircon zirconium zloty zodiac zodiacal @@ -24247,13 +24466,10 @@ zombie zone zoo zoology zoom -Zorn Zoroaster Zoroastrian zounds z's -zucchini Zurich -zygote Index: share/man/man5/passwd.5 ================================================================== --- share/man/man5/passwd.5 +++ share/man/man5/passwd.5 @@ -1,6 +1,6 @@ -.\" @(#)passwd.5 6.2 (Berkeley) 01/08/86 +.\" @(#)passwd.5 6.1 (Berkeley) 05/15/85 .\" .TH PASSWD 5 "" .AT 3 .SH NAME passwd \- password file @@ -64,6 +64,8 @@ /etc/passwd .SH "SEE ALSO" getpwent(3), login(1), crypt(3), passwd(1), group(5), chfn(1), finger(1), vipw(8), adduser(8) .SH BUGS +A binary indexed file format should be available for fast access. +.PP User information (name, office, etc.) should be stored elsewhere. DELETED share/man/man5/resolver.5 Index: share/man/man5/resolver.5 ================================================================== --- share/man/man5/resolver.5 +++ share/man/man5/resolver.5 @@ -1,36 +0,0 @@ -.\" @(#)resolver.5 5.2 (Berkeley) 01/07/86 -.\" -.TH RESOLVER 5 "1 January 1986" -.UC 4 -.SH NAME -resolver configuration file -.SH DESCRIPTION -.LP -The resolver configuration file contains information that is read -by the resolver routines the first time they are invoked in a process. -The file is designed to be human readable and contains a list of -name-value pairs which provide various types of resolver information. -.LP -The different configuration options are: -.TP -\fBnameserver\fP -followed by the Internet address (in dot notation) of a nameserver -that the resolver should query. At least one nameserver should be -listed. Up to MAXNS (currently 3) nameservers may be listed, in which -case the resolver library queries tries them in the order listed. -(The algorithm used is to try a nameserver, and if the query times out, -try the next, until out of nameservers, then repeat trying all the nameservers -until a maximum number of retries has been made). -.TP -\fBdomain\fP -followed by a domain name, which is -the default domain to append to names which do not have a dot in them. -This defaults to empty (the root domain). -.LP -The name value pair must appear on a single line, and the keyword -(e.g. \fBnameserver\fP) must start the line. The value follows -the keyword, separated by whitespace. -.SH FILES -.I /etc/resolv.conf -.SH SEE ALSO -gethostent(3n), resolver(3), named(8) DELETED share/me/letterhead.me Index: share/me/letterhead.me ================================================================== --- share/me/letterhead.me +++ share/me/letterhead.me @@ -1,53 +0,0 @@ -.nr _0 \n(c. -.\" This file defines the local letterhead. It should be changed as -.\" necessary for your organization. -.\" This version prints the U.C. letterhead, complete with seal. -.\" Unfortunately, it assumes that you have ditroff and the seal font. -.\" -.\" @(#)letterhead.me 2.2 01/09/86 -.\" %beginstrip% -.nr xx \n(.d -.nr xy \n(.u -.nr xz \n(.f -.lp -.rs -.nr xw \n(.s -.nf -.ie "\*(.T"ip" \ -. ft R -.el \ -. ft cr -.ps 12 -.vs 0.14i -.in 0 -.po 0.4i -.sp |0.5i -UNIVERSITY OF CALIFORNIA, BERKELEY -.sp 0.3i-1v -.ps 7 -\D't 0.013i'\D'l 4.5i 0'\h'0.83i'\D'l 1.85i 0' -.sp 0.13i-1v -\!s5 -\D't 0.024i'\|BERKELEY \v'-0.035i'\D'l 0 0'\v'0.035i' DAVIS \v'-0.035i'\D'l 0 0'\v'0.035i' IRVINE \v'-0.035i'\D'l 0 0'\v'0.035i' LOS ANGELES \v'-0.035i'\D'l 0 0'\v'0.035i' RIVERSIDE \v'-0.035i'\D'l 0 0'\v'0.035i' SAN DIEGO \v'-0.035i'\D'l 0 0'\v'0.035i' SAN FRANCISCO\h'|4.9i'\u\f(slseal\fP\h'|5.475i'\dSANTA BARBARA \v'-0.035i'\D'l 0 0'\v'0.035i' SANTA CRUZ -.sp 0.07i-1v -\D't 0.013i'\D'l 4.5i 0'\h'0.83i'\D'l 1.85i 0' -.sp 0.5i-1v -\|COLLEGE OF ENGINEERING\h'|4.1i'BERKELEY, CALIFORNIA 94720 -\|DEPARTMENT OF ELECTRICAL ENGINEERING -\0\0AND COMPUTER SCIENCES\D't 3u' -\|COMPUTER SCIENCE DIVISION -.ft \n(xz -.ps \n(xw -.if "\$1"d" \ -\{\ -. sp 4p -\h'|4.1i'\*(td -.\} -.if \n(xy .fi -.ie \n(xx>\n(.d \ -. sp |\n(xxu -.el .sp 0.3i -.vs -.in -.po -.nr c. \n(_0 Index: share/me/tmac.orig_me ================================================================== --- share/me/tmac.orig_me +++ share/me/tmac.orig_me @@ -7,21 +7,21 @@ .\"* Eric Allman * .\"* Electronics Research Laboratory * .\"* U.C. Berkeley. * .\"* current address: * .\"* Britton-Lee, Inc. * -.\"* 1919 Addison Street Suite 105 * +.\"* 1919 Addison Street Suite 304 * .\"* Berkeley, California 94704 * .\"* * -.\"* VERSION 2.24 First Release: 11 Sept 1978 * +.\"* VERSION 2.23 First Release: 11 Sept 1978 * .\"* See file \*(||/revisions for revision history * .\"* * .\"* Documentation is available. * .\"* * .\"********************************************************************** .\" -.\" @(#)tmac.orig_me 2.24 01/07/86 +.\" @(#)tmac.orig_me 2.23 06/23/85 .\" %beginstrip% .\" .\" Code on .de commands: .\" *** a user interface macro. .\" &&& a user interface macro which is redefined @@ -712,31 +712,22 @@ .ev .sp \\n(bsu+\\n(.Lv-1v .nr ?k 0 .. .\" *** PREPROCESSOR SUPPORT *** -.\" -.\" EQN -.\" .de EQ \" &&& begin equation .rn EQ @T .so \\*(||/eqn.me .EQ \\$1 \\$2 .rm @T .. -.\" -.\" TBL -.\" .de TS \" &&& begin table .rn TS @W .so \\*(||/tbl.me .TS \\$1 \\$2 .rm @W .. -.\" -.\" REFER -.\" .de ]- \" &&& initialize reference .rn ]- @] .so \\*(||/refer.me .]- .rm @] @@ -753,64 +744,10 @@ .if t .ds .] \v'.4m'\s+2\fP .if n .ds <. " .if t .ds <. . .if n .ds >. . .if t .ds >. " -.\" -.\" IDEAL -.\" -.de IS \" *** start ideal picture -.nr g7 \\n(.u -.ls 1 -.. -.de IF -.if \\n(g7 .fi -.ls -.. -.de IE \" *** end ideal picture -.if \\n(g7 .fi -.ls -.. -.\" -.\" PIC -.\" -.de PS \" *** start picture: $1=height, $2=width in units -.if t \ -. sp 0.3 -.in (\\n(.lu-\\$2u)/2u -.ne \\$1u -.nr g7 \\n(.u -.ls 1 -.. -.de PE \" *** end picture -.ls -.in -.if \\n(g7 .fi -.if t .sp .6 -.. -.\" -.\" GREMLIN -.\" -.de GS \" *** start gremlin picture -.nr g7 (\\n(.lu-\\n(g1u)/2u -.if "\\$1"L" .nr g7 \\n(.iu -.if "\\$1"R" .nr g7 \\n(.lu-\\n(g1u -.in \\n(g7u -.nr g7 \\n(.u -.ls 1 -.nf -.ne \\n(g2u -.. -.de GE \" *** end gremlin picture -.GF -.if t .sp .6 -.. -.de GF \" *** finish gremlin picture; stay at top -.ls -.in -.if \\n(g7 .fi -.. .\" *** FONT AIDS *** .de sz \" *** set point size and vertical spacing .ps \\$1 .vs \\n(.su*\\n($ru \" default vs at pointsize + 20% .bd S B \\n(.su/3u @@ -849,11 +786,11 @@ .de q \" *** enter quoted word \&\\*(lq\\$1\\*(rq\\$2 .. .de bi \" *** enter word in bold italics .ft 2 -.ie t \&\k~\\$1\h'|\\n~u+(\\w' 'u/4u)'\\$1\fP\\$2 +.ie t \&\k~\\$1\h'|\\n~u+(\\n(.su/3u)'\\$1\fP\\$2 .el \&\\$1\fP\\$2 .. .de bx \" *** enter boxed word .ie \\n($T \&\f2\\$1\fP\\$2 .el \k~\(br\|\\$1\|\(br\l'|\\n~u\(rn'\l'|\\n~u\(ul'\^\\$2 @@ -1020,13 +957,10 @@ .de lo \" *** pull in the set of local macros .\" all these macros should be named "*X", where X is any letter .so \\*(||/local.me .rm lo .. -.de lh \" *** letterhead -.so \\*(||/letterhead.me -.. .\" *** DATES *** .if \n(mo=1 .ds mo January .if \n(mo=2 .ds mo February .if \n(mo=3 .ds mo March .if \n(mo=4 .ds mo April Index: sys/conf/newvers.sh ================================================================== --- sys/conf/newvers.sh +++ sys/conf/newvers.sh @@ -2,17 +2,17 @@ # # Copyright (c) 1980 Regents of the University of California. # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # -# @(#)newvers.sh 1.7 (Berkeley) 01/09/86 +# @(#)newvers.sh 1.6 (Berkeley) 08/29/85 # if [ ! -r version ] then - /bin/echo 0 > version + echo 0 > version fi touch version v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date` -( /bin/echo "char sccs[] = \"@(#)4.3 BSD #${v}: ${t} (${u}@${h}:${d})\\n\";" ; - /bin/echo "char version[] = \"4.3 BSD UNIX #${v}: ${t}\\n ${u}@${h}:${d}\\n\";" +( echo "char sccs[] = \"@(#)4.3 BSD #${v}: ${t} (${u}@${h}:${d})\\n\";" ; + echo "char version[] = \"4.3 BSD UNIX #${v}: ${t}\\n ${u}@${h}:${d}\\n\";" ) > vers.c -/bin/echo `expr ${v} + 1` > version +echo `expr ${v} + 1` > version Index: sys/kern/uipc_domain.c ================================================================== --- sys/kern/uipc_domain.c +++ sys/kern/uipc_domain.c @@ -1,11 +1,11 @@ /* * Copyright (c) 1982 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)uipc_domain.c 6.9 (Berkeley) 01/08/86 + * @(#)uipc_domain.c 6.8 (Berkeley) 09/16/85 */ #include "param.h" #include "socket.h" #include "protosw.h" @@ -24,16 +24,19 @@ register struct domain *dp; register struct protosw *pr; #ifndef lint ADDDOMAIN(unix); -#ifdef INET +#if defined(INET) || defined(BBNNET) ADDDOMAIN(inet); #endif #ifdef NS ADDDOMAIN(ns); #endif +#ifdef PUP + ADDDOMAIN(pup); +#endif #include "imp.h" #if NIMP > 0 ADDDOMAIN(imp); #endif #endif Index: sys/kern/uipc_socket.c ================================================================== --- sys/kern/uipc_socket.c +++ sys/kern/uipc_socket.c @@ -1,11 +1,11 @@ /* * Copyright (c) 1982 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)uipc_socket.c 6.20 (Berkeley) 01/09/86 + * @(#)uipc_socket.c 6.19 (Berkeley) 12/19/85 */ #include "param.h" #include "systm.h" #include "dir.h" @@ -533,14 +533,12 @@ so->so_state &= ~SS_RCVATMARK; if (tomark && len > tomark) len = tomark; if (len > m->m_len - moff) len = m->m_len - moff; - if ((flags & MSG_PEEK) == 0) { - so->so_rcv.sb_mb = m; - m->m_act = nextrecord; - } + so->so_rcv.sb_mb = m; + m->m_act = nextrecord; splx(s); error = uiomove(mtod(m, caddr_t) + moff, (int)len, UIO_READ, uio); s = splnet(); if (len == m->m_len - moff) { Index: sys/netinet/tcp_input.c ================================================================== --- sys/netinet/tcp_input.c +++ sys/netinet/tcp_input.c @@ -1,11 +1,11 @@ /* * Copyright (c) 1982 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)tcp_input.c 6.18 (Berkeley) 01/07/86 + * @(#)tcp_input.c 6.17 (Berkeley) 12/19/85 */ #include "param.h" #include "systm.h" #include "mbuf.h" @@ -243,14 +243,15 @@ } } tiflags = ti->ti_flags; /* - * Drop TCP and IP headers; TCP options were dropped above. + * Drop TCP and IP headers. */ - m->m_off += sizeof(struct tcpiphdr); - m->m_len -= sizeof(struct tcpiphdr); + off += sizeof (struct ip); + m->m_off += off; + m->m_len -= off; /* * Convert TCP protocol specific fields to host format. */ ti->ti_seq = ntohl(ti->ti_seq); Index: sys/sys/fcntl.h ================================================================== --- sys/sys/fcntl.h +++ sys/sys/fcntl.h @@ -1,26 +1,25 @@ /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)fcntl.h 5.2 (Berkeley) 01/08/86 + * @(#)fcntl.h 5.1 (Berkeley) 05/30/85 */ /* - * Flag values accessible to open(2) and fcntl(2)-- copied from - * . (The first three can only be set by open.) + * Flag values accessible to open(2) and fcntl(2) + * (The first three can only be set by open) */ -#define O_RDONLY 000 /* open for reading */ -#define O_WRONLY 001 /* open for writing */ -#define O_RDWR 002 /* open for read & write */ -#define O_NDELAY FNDELAY /* non-blocking open */ - /* really non-blocking I/O for fcntl */ -#define O_APPEND FAPPEND /* append on each write */ -#define O_CREAT FCREAT /* open with file create */ -#define O_TRUNC FTRUNC /* open with truncation */ -#define O_EXCL FEXCL /* error on create if file exists */ +#define O_RDONLY 0 +#define O_WRONLY 1 +#define O_RDWR 2 +#define O_NDELAY FNDELAY /* Non-blocking I/O */ +#define O_APPEND FAPPEND /* append (writes guaranteed at the end) */ +#define O_CREAT FCREAT /* open with file create */ +#define O_TRUNC FTRUNC /* open with truncation */ +#define O_EXCL FEXCL /* error on create if file exists */ #ifndef F_DUPFD /* fcntl(2) requests */ #define F_DUPFD 0 /* Duplicate fildes */ #define F_GETFD 1 /* Get fildes flags */ Index: sys/sys/systm.h ================================================================== --- sys/sys/systm.h +++ sys/sys/systm.h @@ -1,11 +1,11 @@ /* * Copyright (c) 1982 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)systm.h 6.4 (Berkeley) 01/05/86 + * @(#)systm.h 6.3 (Berkeley) 06/08/85 */ /* * Random set of variables * used by more than one @@ -84,5 +84,7 @@ extern char vmmap[]; /* poor name! */ /* casts to keep lint happy */ #define insque(q,p) _insque((caddr_t)q,(caddr_t)p) #define remque(q) _remque((caddr_t)q) +#define queue(q,p) _queue((caddr_t)q,(caddr_t)p) +#define dequeue(q) _dequeue((caddr_t)q) Index: sys/tahoe/conf/Makefile.tahoe ================================================================== --- sys/tahoe/conf/Makefile.tahoe +++ sys/tahoe/conf/Makefile.tahoe @@ -1,34 +1,39 @@ -# @(#)Makefile.tahoe 1.2 (Berkeley) 01/05/86 +# makefile.tahoe 1.2 85/04/22 +# makefile.tahoe 6.3 9/25/83 # -# Makefile for 4.3 BSD +# Makefile for 4.2 BSD # # This makefile is constructed from a machine description: # config machine # Most changes should be made in the machine description # /sys/conf/``machineid'' # after which you should do # config machineid # Generic makefile changes should be made in -# /sys/conf/Makefile +# /sys/conf/makefile # after which config should be rerun for all machines. # # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING # # -DTRACE compile in kernel tracing hooks # -DQUOTA compile in file system quotas # -DSWABIPS compile in code to byte swap ip packets on 3Mb/s Ethernet # -C2= /lib/c2 -LD= /bin/ld -TOUCH= touch -f -c -INDIR= ../tahoe/inline -INLINE= ${INDIR}/inline - -INCLUDES= -I. -I../h -COPTS= ${INCLUDES} ${IDENT} -DKERNEL +DESTDIR= +AS=/bin/as +CC=/bin/cc +LD=/bin/ld +INCLDIR=${DESTDIR}/usr/include +LIBDIR=${DESTDIR}/lib +ULIBDIR=${DESTDIR}/usr/lib + +LCC=/bin/cc +TOUCH= touch -c + +COPTS= ${IDENT} -DKERNEL CFLAGS= -O ${COPTS} %OBJS %CFILES @@ -38,77 +43,73 @@ clean: rm -f eddep *vmunix tags *.o locore.i [a-tv-z]*.s \ errs linterrs makelinks lint: /tmp - @lint -hbxn -I. -DGENERIC ${COPTS} ${PARAM} ../tahoe/Locore.c \ - ${CFILES} ../tahoe/swapgeneric.c ioconf.c param.c | \ + @lint -hbxn -I. -DGENERIC ${COPTS} ../machine/Locore.c \ + ${CFILES} ../machine/swapgeneric.c ioconf.c | \ grep -v 'struct/union .* never defined' | \ grep -v 'possible pointer alignment problem' -../tahoe/symbols.sort: ../tahoe/symbols.raw - grep -v '^#' ../tahoe/symbols.raw \ - | sed 's/^ //' | sort -u > ../tahoe/symbols.sort - -${INLINE}: ${INDIR}/inline.h ${INDIR}/langpats.c -${INLINE}: ${INDIR}/libcpats.c ${INDIR}/machdep.c -${INLINE}: ${INDIR}/machpats.c ${INDIR}/main.c - cd ${INDIR}; make - -locore.o: assym.s ../tahoe/scb.s ../tahoe/locore.s \ - vbglue.s ../tahoe/mtpr.h ../tahoe/trap.h ../tahoe/psl.h \ - ../tahoe/pte.h ../tahoe/cp.h ../tahoe/mem.h - cat assym.s ../tahoe/scb.s ../tahoe/locore.s \ - vbglue.s > locore.c +../machine/symbols.sort: ../machine/symbols.raw + grep -v '^#' ../machine/symbols.raw \ + | sed 's/^ //' | sort -u > ../machine/symbols.sort + +locore.o: assym.s ../machine/scb.s ../machine/locore.s \ + ubglue.s ../machine/mtpr.h ../machine/trap.h ../machine/psl.h \ + ../machine/pte.h ../machine/cp.h ../machine/mem.h + cat assym.s ../machine/scb.s ../machine/locore.s \ + ubglue.s > locore.c ${CC} -E -I. -DLOCORE ${COPTS} locore.c > locore.i @echo 'as -o locore.o locore.i' @${AS} -o locore.o locore.i @rm locore.i # the following is necessary because autoconf.o depends on #if GENERIC -autoconf.o: Makefile +autoconf.o tu.o: makefile # depend on network configuration -af.o : Makefile +af.o : makefile # depend on maxusers -assym.s machdep.o: Makefile +assym.s: makefile -assym.s: ../h/param.h ../tahoe/pte.h ../h/buf.h ../h/vmparam.h \ - ../h/vmmeter.h ../h/dir.h ../h/cmap.h ../h/map.h ../tahoevba/vbavar.h \ +assym.s: ../h/param.h ../machine/pte.h ../h/buf.h ../h/vmparam.h \ + ../h/vmmeter.h ../h/dir.h ../h/cmap.h ../h/map.h ../vba/vbavar.h \ ../h/proc.h ../h/msgbuf.h - ${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} ../tahoe/genassym.c; ./a.out >assym.s; rm -f a.out + ${LCC} -I/DIST/usr/include ${IDENT} ${PARAM} ../machine/genassym.c; ./a.out >assym.s; rm -f a.out -../h/param.h: ../tahoe/machparam.h ../h/signal.h ../h/types.h +../h/param.h: ../machine/param.h ../h/signal.h ../h/types.h ${TOUCH} ../h/param.h ../h/tty.h: ../h/ttychars.h ../h/ttydev.h ${TOUCH} ../h/tty.h ../h/ioctl.h: /usr/include/sgtty.h ../h/ttychars.h ../h/ttydev.h ${TOUCH} ../h/ioctl.h -../h/user.h: ../tahoe/pcb.h ../h/dmap.h ../h/time.h ../h/resource.h \ +../h/user.h: ../machine/pcb.h ../h/dmap.h ../h/time.h ../h/resource.h \ /usr/include/errno.h ${TOUCH} ../h/user.h ../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h ${TOUCH} ../h/vm.h -../h/vmparam.h: ../tahoe/vmparam.h +../h/vmparam.h: ../machine/vmparam.h ${TOUCH} ../h/vmparam.h -depend: - -if [ ! -f assym.s ]; then touch assym.s; fi - ${CC} -M ${COPTS} ${CFILES} | \ - sed -e ':loop' \ - -e 's/\.\.\/[^ /]*\/\.\./../' \ - -e 't loop' | \ +depend: + grep '^#include' ${CFILES} | grep -v '<' | \ + sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ + -e 's/\.c/.o/' \ + -e 's,../[a-zA-Z]*/,,' | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' > makedep + echo '$$r makedep' >>eddep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep echo '$$r makedep' >>eddep echo 'w' >>eddep - cp Makefile Makefile.bak - ex - Makefile < eddep + cp makefile makefile.bak + ed - makefile < eddep rm eddep makedep + links: egrep '#if' ${CFILES} | sed -f ../conf/defines | \ sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ @@ -120,29 +121,28 @@ tags: /usr/ucb/ctags ${CFILES} print: - @pr -f Makefile ../sys/TODO linterrs + @pr -f makefile ../sys/TODO linterrs @/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF @(size vmunix *.o) | pr -f -h sizes @ls -ls | pr -f @cd ../h; ls -ls | pr -f ; pr -f *.m *.h @echo 'once upon a time ...' - @cd ../tahoe; pr -f Locore.c scb.s locore.s - @cd ${INDIR}; make print + @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s @pr -f ${CFILES} -ioconf.o: ioconf.c ../h/param.h ../tahoe/pte.h ../h/buf.h ../h/map.h \ - ../h/vm.h ../tahoevba/vbavar.h +ioconf.o: ioconf.c ../h/param.h ../machine/pte.h ../h/buf.h ../h/map.h \ + ../h/vm.h ../vba/vbavar.h param.c: ../conf/param.c rm -f param.c cp ../conf/param.c . -param.o: param.c Makefile +param.o: param.c makefile ${CC} -I. -c ${CFLAGS} ${PARAM} param.c %RULES # DO NOT DELETE THIS LINE -- make depend uses it Index: sys/tahoe/if/if_ace.c ================================================================== --- sys/tahoe/if/if_ace.c +++ sys/tahoe/if/if_ace.c @@ -1,39 +1,39 @@ -/* if_ace.c 1.2 86/01/05 */ +/* if_ace.c 1.1 85/07/21 */ /* * ACC VERSAbus Ethernet controller */ #include "ace.h" #if NACE > 0 #include "../machine/pte.h" -#include "param.h" -#include "systm.h" -#include "mbuf.h" -#include "buf.h" -#include "protosw.h" -#include "socket.h" -#include "vmmac.h" -#include "ioctl.h" -#include "errno.h" -#include "vmparam.h" +#include "../h/param.h" +#include "../h/systm.h" +#include "../h/mbuf.h" +#include "../h/buf.h" +#include "../h/protosw.h" +#include "../h/socket.h" +#include "../h/vmmac.h" +#include "../h/ioctl.h" +#include "../h/errno.h" +#include "../h/vmparam.h" #include "../net/if.h" #include "../net/netisr.h" #include "../net/route.h" #include "../netinet/in.h" #include "../netinet/in_systm.h" -#include "../netinet/in_var.h" #include "../netinet/ip.h" #include "../netinet/ip_var.h" #include "../netinet/if_ether.h" +#include "../netpup/pup.h" #include "../tahoe/mtpr.h" #include "../tahoeif/if_acereg.h" -#include "../tahoevba/vbavar.h" +#include "../vba/vbavar.h" #define LONET 124 /* * Configuration table, for 2 units (should be defined by config) @@ -41,13 +41,13 @@ #define ACEVECTOR 0x90 long acestd[] = { 0x0ff0000, 0xff0100 }; /* controller */ extern char ace0utl[], ace1utl[]; /* dpm */ char *acemap[]= { ace0utl, ace1utl }; -extern struct pte ACE0map[], ACE1map[]; -struct pte *ACEmap[] = { ACE0map, ACE1map }; -caddr_t ACEmapa[] = { (caddr_t)0xfff80000, (caddr_t)0xfff90000 }; +extern long ACE0map[], ACE1map[]; +long *ACEmap[] = { ACE0map, ACE1map }; +long ACEmapa[] = { 0xfff80000, 0xfff90000 }; /* station address */ char ace_station[6] = { ~0x8, ~0x0, ~0x3, ~0x0, ~0x0, ~0x1 }; /* multicast hash table initializer */ char ace_hash[8] = { ~0xF,~0xF,~0xF,~0xF,~0xF,~0xF,~0xF,~0xF }; @@ -102,11 +102,11 @@ #ifdef lint acerint(0); acecint(0); #endif if (badaddr(reg, 2)) return(0); - movow(&addr->csr, CSR_RESET); + movew((short)CSR_RESET, &addr->csr); DELAY(10000); return (sizeof (struct acedevice)); } /* @@ -120,10 +120,11 @@ register short unit = ui->ui_unit; register struct ace_softc *is = &ace_softc[unit]; register struct ifnet *ifp = &is->is_if; register struct acedevice *addr = (struct acedevice *)ui->ui_addr; register short *wp, i; + struct sockaddr_in *sin; ifp->if_unit = unit; ifp->if_name = "ace"; ifp->if_mtu = ETHERMTU; /* @@ -133,19 +134,20 @@ ace_station[5] = ~(unit + 1); acesetetaddr(unit, addr, ace_station); is->is_promiscuous = 0; wp = (short *)addr->hash; for (i = 0; i < 8; i++) - movow(wp++, ace_hash[i]); - movow(&addr->bcastena[0], ~0xffff); - movow(&addr->bcastena[1], ~0xffff); + movew((short)ace_hash[i], wp++); + movew((short)~0xffff, &addr->bcastena[0]); + movew((short)~0xffff, &addr->bcastena[1]); aceclean(unit); + sin = (struct sockaddr_in *)&ifp->if_addr; + sin->sin_family = AF_INET; ifp->if_init = aceinit; ifp->if_output = aceoutput; ifp->if_ioctl = aceioctl; ifp->if_reset = acereset; - ifp->if_flags = IFF_BROADCAST; if_attach(ifp); } acesetetaddr(unit, addr, station_addr) short unit; @@ -157,13 +159,13 @@ struct ace_softc *is = &ace_softc[unit]; wp = (short *)addr->station; cp = station_addr; for (i = 0; i < 6; i++) - movow(wp++, *cp++); + movew((short)*cp++, wp++); wp = (short *)addr->station; - cp = (char *)is->is_addr; + cp = (char *)&is->is_addr; for (i = 0; i < 6; i++) *cp++ = ~(*wp++); } /* @@ -189,48 +191,52 @@ { register struct ace_softc *is = &ace_softc[unit]; register struct vba_device *ui = aceinfo[unit]; register struct acedevice *addr; register struct ifnet *ifp = &is->is_if; + register struct sockaddr_in *sin; register short Csr; - register int s; + register int i, s; - if (ifp->if_addrlist == (struct ifaddr *)0) + sin = (struct sockaddr_in *)&ifp->if_addr; + if (sin->sin_addr.s_addr == 0) /* address still unknown */ return; if ((ifp->if_flags & IFF_RUNNING) == 0) { /* * Reset the controller, initialize the recieve buffers, * and turn the controller on again and set board online. */ addr = (struct acedevice *)ui->ui_addr; s = splimp(); - movow(&addr->csr, CSR_RESET); + movew((short)CSR_RESET, &addr->csr); DELAY(10000); /* * clean up dpm since the controller might * jumble dpm after reset */ aceclean(unit); - movow(&addr->csr, CSR_GO); + movew((short)CSR_GO, &addr->csr); Csr = addr->csr; if (Csr & CSR_ACTIVE) { - movow(&addr->ivct, ACEVECTOR + unit*8); + movew((short)(ACEVECTOR + unit*8), &addr->ivct); Csr |= CSR_IENA | is->is_promiscuous; -#ifdef notdef if (ifp->if_net == LONET) Csr |= CSR_LOOP3; -#endif - movow(&addr->csr, Csr); + movew(Csr, &addr->csr); is->is_flags = 0; is->is_xcnt = 0; - is->is_if.if_flags |= IFF_RUNNING; + is->is_if.if_flags |= IFF_UP|IFF_RUNNING; } splx(s); } - if (is->is_if.if_snd.ifq_head) + + if (is->is_if.if_flags & IFF_UP) { + if_rtinit(&is->is_if, RTF_UP); aceStart(unit); + } + arpwhohas(&is->is_ac, &sin->sin_addr); } /* * Start output on interface. * Get another datagram to send off of the interface queue, @@ -239,26 +245,27 @@ */ acestart(dev) dev_t dev; { register struct tx_segment *txs; - register long len; - register int s; + register long len, x; int unit = ACEUNIT(dev); + struct vba_device *ui = aceinfo[unit]; + register struct acedevice *addr = (struct acedevice *)ui->ui_addr; register struct ace_softc *is = &ace_softc[unit]; struct mbuf *m; - short retries; + short retries, idx; again: txs = (struct tx_segment*)(is->is_dpm + (is->is_txnext << 11)); if (txs->tx_csr & TCS_TBFULL) { is->is_stats.tx_busy++; return; } - s = splimp(); + x = splimp(); IF_DEQUEUE(&is->is_if.if_snd, m); - splx(s); + splx(x); if (m == 0) return; len = aceput(unit, txs->tx_data, m); retries = txs->tx_csr & TCS_RTC; if (retries > 0) @@ -281,11 +288,11 @@ if (++is->is_txnext > SEG_MAX) is->is_txnext = is->is_segboundry; is->is_if.if_opackets++; is->is_xcnt++; len = (len & 0x7fff) | TCS_TBFULL; - movow(txs, len); + movew((short)len, txs); goto again; } /* * Transmit done interrupt. @@ -292,19 +299,21 @@ */ acecint(unit) int unit; { register struct ace_softc *is = &ace_softc[unit]; + struct vba_device *ui = aceinfo[unit]; + register struct acedevice *addr = (struct acedevice *)ui->ui_addr; register struct tx_segment *txseg; - short eostat; + short txidx, eostat; if (is->is_xcnt <= 0) { + txidx = (addr->tseg >> 11) & 0xf; printf("ace%d: stray xmit interrupt, xcnt %d\n", unit, is->is_xcnt); is->is_xcnt = 0; - if (is->is_if.if_snd.ifq_head) - aceStart(unit); + aceStart(unit); return; } is->is_xcnt--; txseg = (struct tx_segment *)((is->is_eoctr << 11) + is->is_dpm); eostat = txseg->tx_csr; @@ -316,12 +325,11 @@ } else is->is_stats.tx_datagrams++; if (++is->is_eoctr >= 16) is->is_eoctr = is->is_segboundry; } - if (is->is_if.if_snd.ifq_head) - aceStart(unit); + aceStart(unit); } /* * Ethernet interface receiver interrupt. * If input error just drop packet. @@ -336,16 +344,15 @@ { register struct ace_softc *is = &ace_softc[unit]; register struct ifqueue *inq; register struct ether_header *ace; register struct rx_segment *rxseg; + struct acedevice *addr = (struct acedevice *)aceinfo[unit]->ui_addr; int len, s, off, resid; struct mbuf *m; short eistat; - if ((is->is_if.if_flags&IFF_RUNNING) == 0) - return; again: rxseg = (struct rx_segment *)((is->is_eictr << 11) + is->is_dpm); eistat = rxseg->rx_csr; if ((eistat & RCS_RBFULL) == 0) return; @@ -375,11 +382,11 @@ len -= sizeof (struct ether_header); #else len -= 14; #endif /* - * Deal with trailer protocol: if type is trailer + * Deal with trailer protocol: if type is PUP trailer * get true type from first 16-bit word past data. * Remember that type was trailer by setting off. */ ace->ether_type = ntohs((u_short)ace->ether_type); #ifdef notdef @@ -387,13 +394,13 @@ ((type)(((caddr_t)(((char *)ace)+sizeof (struct ether_header))+(off)))) #else #define acedataaddr(ace, off, type) \ ((type)(((caddr_t)(((char *)ace)+14)+(off)))) #endif - if (ace->ether_type >= ETHERTYPE_TRAIL && - ace->ether_type < ETHERTYPE_TRAIL+ETHERTYPE_NTRAILER) { - off = (ace->ether_type - ETHERTYPE_TRAIL) * 512; + if (ace->ether_type >= ETHERPUP_TRAIL && + ace->ether_type < ETHERPUP_TRAIL+ETHERPUP_NTRAILER) { + off = (ace->ether_type - ETHERPUP_TRAIL) * 512; if (off >= ETHERMTU) goto setup; /* sanity */ ace->ether_type = ntohs(*acedataaddr(ace, off, u_short *)); resid = ntohs(*(acedataaddr(ace, off+2, u_short *))); if (off + resid > len) @@ -408,35 +415,28 @@ * Pull packet off interface. Off is nonzero if packet * has trailing header; aceget will then force this header * information to be at the front, but we still have to drop * the type and length which are at the front of any trailer data. */ - m = aceget(unit, (u_char *)rxseg->rx_data, len, off); + m = aceget(unit, rxseg->rx_data, len, off); if (m == 0) goto setup; if (off) { m->m_off += 2 * sizeof (u_short); m->m_len -= 2 * sizeof (u_short); } switch (ace->ether_type) { #ifdef INET - case ETHERTYPE_IP: + case ETHERPUP_IPTYPE: schednetisr(NETISR_IP); inq = &ipintrq; break; - case ETHERTYPE_ARP: + case ETHERPUP_ARPTYPE: arpinput(&is->is_ac, m); goto setup; -#endif -#ifdef NS - case ETHERTYPE_NS: - schednetisr(NETISR_NS); - inq = &nsintrq; - break; - #endif default: m_freem(m); goto setup; } @@ -468,56 +468,46 @@ register struct mbuf *m = m0; register struct ether_header *ace; register int off; struct mbuf *mcopy = (struct mbuf *)0; int type, s, error; - u_char edst[6]; + struct ether_addr edst; struct in_addr idst; switch (dst->sa_family) { #ifdef INET case AF_INET: idst = ((struct sockaddr_in *)dst)->sin_addr; - if (!arpresolve(&is->is_ac, m, &idst, edst)) + if (!arpresolve(&is->is_ac, m, &idst, &edst)) return (0); /* if not yet resolved */ - if (!bcmp((caddr_t)edst, (caddr_t)etherbroadcastaddr, - sizeof(edst))) + if (in_lnaof(idst) == INADDR_ANY) mcopy = m_copy(m, 0, (int)M_COPYALL); off = ntohs((u_short)mtod(m, struct ip *)->ip_len) - m->m_len; /* need per host negotiation */ if ((ifp->if_flags & IFF_NOTRAILERS) == 0 && off > 0 && (off & 0x1ff) == 0 && m->m_off >= MMINOFF + 2 * sizeof (u_short)) { - type = ETHERTYPE_TRAIL + (off>>9); + type = ETHERPUP_TRAIL + (off>>9); m->m_off -= 2 * sizeof (u_short); m->m_len += 2 * sizeof (u_short); - *mtod(m, u_short *) = htons((u_short)ETHERTYPE_IP); + *mtod(m, u_short *) = htons((u_short)ETHERPUP_IPTYPE); *(mtod(m, u_short *) + 1) = htons((u_short)m->m_len); goto gottrailertype; } - type = ETHERTYPE_IP; - off = 0; - goto gottype; -#endif -#ifdef NS - case AF_NS: - bcopy((caddr_t)&(((struct sockaddr_ns *)dst)->sns_addr.x_host), - (caddr_t)edst, sizeof (edst)); - if (!bcmp((caddr_t)edst, (caddr_t)&ns_broadhost,sizeof(edst))) - mcopy = m_copy(m, 0, (int)M_COPYALL); - else if (!bcmp((caddr_t)edst, (caddr_t)&ns_thishost, - sizeof(edst))) - return(looutput(&loif, m, dst)); - type = ETHERTYPE_NS; + type = ETHERPUP_IPTYPE; off = 0; goto gottype; #endif case AF_UNSPEC: ace = (struct ether_header *)dst->sa_data; - bcopy((caddr_t)ace->ether_dhost, (caddr_t)edst, sizeof (edst)); +#ifdef notdef + edst = ace->ether_dhost; +#else + bcopy((caddr_t)ace->ether_dhost, (caddr_t)&edst, 6); +#endif type = ace->ether_type; goto gottype; default: printf("ace%d: can't handle af%d\n", @@ -569,13 +559,17 @@ m->m_off -= 14; m->m_len += 14; #endif } ace = mtod(m, struct ether_header *); - bcopy((caddr_t)edst, (caddr_t)ace->ether_dhost, sizeof (edst)); - bcopy((caddr_t)is->is_addr, (caddr_t)ace->ether_shost, - sizeof (is->is_addr)); +#ifdef notdef + ace->ether_dhost = edst; + ace->ether_shost = is->is_addr; +#else + bcopy((caddr_t)&edst, (caddr_t)ace->ether_dhost, 6); + bcopy((caddr_t)&is->is_addr, (caddr_t)ace->ether_shost, 6); +#endif ace->ether_type = htons((u_short)type); /* * Queue message on interface, and start output if interface * not yet active. @@ -616,61 +610,74 @@ * Routine to copy from mbuf chain to transmit buffer on the VERSAbus * If packet size is less than the minimum legal size, * the buffer is expanded. We probably should zero out the extra * bytes for security, but that would slow things down. */ -/*ARGSUSED*/ aceput(unit, txbuf, m) int unit; /* for statistics collection */ - char *txbuf; + u_char *txbuf; struct mbuf *m; { register u_char *bp, *mcp; /* known to be r12, r11 */ register short *s1, *s2; /* known to be r10, r9 */ - register u_int len; + register unsigned len; register struct mbuf *mp; - int total; + int total, idx; total = 0; - bp = (u_char *)txbuf; - for (mp = m; (mp); mp = mp->m_next) { + bp = txbuf; + for (mp = m;(mp); mp = mp->m_next) { len = mp->m_len; if (len == 0) continue; total += len; mcp = mtod(mp, u_char *); if (((int)mcp & 01) && ((int)bp & 01)) { /* source & destination at odd addresses */ - movob(bp++, *mcp++); + /* *bp++ = *mcp++; */ + asm("movob (r11),(r12)"); + bp++, mcp++; --len; } if (len > 1 && (((int)mcp & 01)==0) && (((int)bp & 01)==0)) { - register u_int l; + register int l; s1 = (short *)bp; s2 = (short *)mcp; l = len >> 1; /* count # of shorts */ - while (l-- != 0) - movow(s1++, *s2++); + while (l-- > 0) { + /* *s1++ = *s2++; */ + asm("movow (r9),(r10)"); + s1++, s2++; + } len &= 1; /* # remaining bytes */ bp = (u_char *)s1; mcp = (u_char *)s2; } - while (len-- != 0) - movob(bp++, *mcp++); + while (len-- > 0) { + /* *bp++ = *mcp++; */ + asm("movob (r11),(r12)"); + bp++, mcp++; + } } m_freem(m); return (total); } + +movew(data, to) + short data, *to; +{ + + asm("movow 6(fp),*8(fp)"); +} /* * Routine to copy from VERSAbus memory into mbufs. * * Warning: This makes the fairly safe assumption that * mbufs have even lengths. */ -/*ARGSUSED*/ struct mbuf * aceget(unit, rxbuf, totlen, off0) int unit; /* for statistics collection */ u_char *rxbuf; int totlen, off0; @@ -685,10 +692,12 @@ cp = rxbuf + sizeof (struct ether_header); #else cp = rxbuf + 14; #endif while (totlen > 0) { + register int words; + MGET(m, M_DONTWAIT, MT_DATA); if (m == 0) goto bad; if (off) { len = totlen - off; @@ -784,20 +793,21 @@ aceioctl(ifp, cmd, data) register struct ifnet *ifp; int cmd; caddr_t data; { - register struct ifaddr *ifa = (struct ifaddr *)data; - int s = splimp(), error = 0; + register struct ifreq *ifr = (struct ifreq *)data; + int s, error = 0; + s = splimp(); switch (cmd) { case SIOCSIFADDR: - ifp->if_flags |= IFF_UP; + if (ifp->if_flags & IFF_RUNNING) + if_rtinit(ifp, -1); /* delete previous route */ + acesetaddr(ifp, (struct sockaddr_in *)&ifr->ifr_addr); aceinit(ifp->if_unit); - ((struct arpcom *)ifp)->ac_ipaddr = IA_SIN(ifa)->sin_addr; - arpwhohas((struct arpcom *)ifp, &IA_SIN(ifa)->sin_addr); break; #ifdef notdef case SIOCSETETADDR: { /* set Ethernet station address */ struct vba_device *ui; @@ -806,11 +816,11 @@ ifp->if_flags &= ~IFF_RUNNING | IFF_UP; sin = (struct sockaddr_in *)&ifr->ifr_addr; ui = aceinfo[ifp->if_unit]; addr = (struct acedevice *)ui->ui_addr; - movow(&addr->csr, CSR_RESET); + movew((short)CSR_RESET, &addr->csr); DELAY(10000); /* set station address and copy addr to arp struct */ acesetetaddr(ifp->if_unit, addr, &sin->sin_zero[2]); aceinit(ifp->if_unit); /* Re-initialize */ break; @@ -821,18 +831,33 @@ error = EINVAL; } splx(s); return (error); } + +acesetaddr(ifp, sin) + register struct ifnet *ifp; + register struct sockaddr_in *sin; +{ + + ifp->if_addr = *(struct sockaddr *)sin; + ifp->if_net = in_netof(sin->sin_addr); + ifp->if_host[0] = in_lnaof(sin->sin_addr); + sin = (struct sockaddr_in *)&ifp->if_broadaddr; + sin->sin_family = AF_INET; + sin->sin_addr = if_makeaddr(ifp->if_net, INADDR_ANY); + ifp->if_flags |= IFF_BROADCAST; +} aceclean(unit) int unit; { register struct ace_softc *is = &ace_softc[unit]; + register struct ifnet *ifp = &is->is_if; register struct vba_device *ui = aceinfo[unit]; register struct acedevice *addr = (struct acedevice *)ui->ui_addr; - register short i; + register short i, data; register char *pData1; ioaccess(ACEmap[unit], ACEmapa[unit], ACEBPTE); is->is_dpm = acemap[unit]; /* init dpm */ bzero((char *)is->is_dpm, 16384*2); Index: sys/tahoe/include/clock.h ================================================================== --- sys/tahoe/include/clock.h +++ sys/tahoe/include/clock.h @@ -1,6 +1,6 @@ -/* clock.h 1.2 86/01/05 */ +/* clock.h 4.5 81/02/23 */ #define SECDAY ((unsigned)(24*60*60)) /* seconds per day */ #define SECYR ((unsigned)(365*SECDAY)) /* per common year */ #define YRREF 1970 @@ -7,6 +7,6 @@ #define LEAPYEAR(year) ((year)%4==0) /* good till time becomes negative */ /* * Software clock is software interrupt level 8 */ -#define setsoftclock() mtpr(SIRR, 0x8) +#define setsoftclock() mtpr(0x8, SIRR) DELETED sys/tahoe/include/frame.h Index: sys/tahoe/include/frame.h ================================================================== --- sys/tahoe/include/frame.h +++ sys/tahoe/include/frame.h @@ -1,11 +0,0 @@ -/* frame.h 1.1 86/01/05 */ - -/* - * Definition of the tahoe call frame. - */ -struct frame { - int fr_savpc; /* saved program counter */ - u_int fr_mask:16, /* register save mask */ - fr_removed:16; /* 4*number of arguments + 4 */ - int fr_savfp; /* saved frame pointer */ -}; DELETED sys/tahoe/include/mtpr.h Index: sys/tahoe/include/mtpr.h ================================================================== --- sys/tahoe/include/mtpr.h +++ sys/tahoe/include/mtpr.h @@ -1,35 +0,0 @@ -/* mtpr.h 1.1 86/01/05 */ -/* mtpr.h 4.5 82/11/05 */ - -/* - * TAHOE processor register numbers - */ - -#define SBR 0x0 /* system base register */ -#define SLR 0x1 /* system length register */ -#define P0BR 0x2 /* p0 base register */ -#define P0LR 0x3 /* p0 length register */ -#define P1BR 0x4 /* p1 base register */ -#define P1LR 0x5 /* p1 length register */ -#define P2BR 0x6 /* p2 base register */ -#define P2LR 0x7 /* p2 length register */ -#define IPL 0x8 /* interrupt priority level */ -#define MME 0x9 /* memory management enable */ -#define TBIA 0xa /* translation buffer invalidate all */ -#define TBIS 0xb /* translation buffer invalidate single */ -#define DCK 0xc /* data cache key */ -#define CCK 0xd /* code cache key */ -#define PCBB 0xe /* process control block base */ -#define ISP 0xf /* interrupt stack pointer */ -#define SIRR 0x10 /* software interrupt request */ -#define SISR 0x11 /* software interrupt summary */ -#define SCBB 0x12 /* system control block base */ -#define KSP 0x13 /* kernelack pointer */ -#define USP 0x14 /* user stack pointer */ -#define CPMDCB 0x15 /* CP master DCM pointer */ -#define PACC 0x17 /* purge all code cache */ -#define P1DC 0x18 /* purge one data cache */ -#define PADC 0x19 /* purge all data cache */ -#define HISR 0x1a /* hardware interrupt summery register */ -#define DCR 0x1b /* diagnostic control register */ -#define PDCS 0x1c /* purge data cache slot */ DELETED sys/tahoe/include/param.h Index: sys/tahoe/include/param.h ================================================================== --- sys/tahoe/include/param.h +++ sys/tahoe/include/param.h @@ -1,47 +0,0 @@ -/* param.h 1.1 86/01/05 */ - -/* - * Machine dependent constants for TAHOE. - */ -#define NBPG 1024 /* bytes/page */ -#define PGOFSET (NBPG-1) /* byte offset into page */ -#define PGSHIFT 10 /* LOG2(NBPG) */ - -#define CLSIZE 1 -#define CLSIZELOG2 0 - -#define SSIZE 2 /* initial stack size/NBPG */ -#define SINCR 2 /* increment of stack/NBPG */ -#define UPAGES 6 /* pages of u-area (2 stack pages) */ -#define IOBASE ((caddr_t)0xfff00000) /* base of Versabus address space */ - -#define MAXCKEY 255 /* maximal allowed code key */ -#define MAXDKEY 255 /* maximal allowed data key */ -#define NCKEY (MAXCKEY+1) /* # code keys, including 0 (reserved) */ -#define NDKEY (MAXDKEY+1) /* # data keys, including 0 (reserved) */ - -/* - * Some macros for units conversion - */ -/* Core clicks (1024 bytes) to segments and vice versa */ -#define ctos(x) (x) -#define stoc(x) (x) - -/* Core clicks (1024 bytes) to disk blocks */ -#define ctod(x) (x) -#define dtoc(x) (x) -#define dtob(x) ((x)<> PGSHIFT)) - -/* - * Macros to decode processor status word. - */ -#define USERMODE(ps) (((ps) & PSL_CURMOD) == PSL_CURMOD) -#define BASEPRI(ps) (((ps) & PSL_IPL) == 0) - -#define DELAY(n) { register int N = 3*(n); while (--N > 0); } Index: sys/tahoe/include/pcb.h ================================================================== --- sys/tahoe/include/pcb.h +++ sys/tahoe/include/pcb.h @@ -1,11 +1,11 @@ -/* pcb.h 1.2 86/01/05 */ - /* * TAHOE process control block */ -struct pcb { + +struct pcb +{ int pcb_ksp; /* kernel stack pointer */ int pcb_usp; /* user stack pointer */ int pcb_r0; int pcb_r1; int pcb_r2; @@ -31,11 +31,11 @@ int pcb_p2lr; /* seg 2 length register and pme */ int pcb_ach; /* accumulator - high order longword */ int pcb_acl; /* accumulator - low order longword */ #define ACH pcb_ach #define ACL pcb_acl - int pcb_hfs; /* fp status register */ + int pcb_hfs; /* f.p. status register. */ /* * Software pcb (extension) */ union { float *faddr; /* address of single precision accumulator */ @@ -44,21 +44,23 @@ #define FSAVACC pcb_savacc.faddr #define DSAVACC pcb_savacc.daddr int pcb_szpt; /* number of pages of user page table */ int pcb_cmap2; int *pcb_sswap; - long pcb_sigc[5]; /* sigcode actually 19 bytes */ + short pcb_ckey; /* cache code key (proc index if NPROC<255) */ + short pcb_dkey; /* cache data key */ + int pcb_sigc[4]; }; extern long *user_psl; -#define aston() { \ - u.u_pcb.pcb_psl |= PSL_SFE; \ - if ((int)user_psl != 0) \ - *user_psl |= PSL_SFE; \ -} - -#define astoff() { \ - u.u_pcb.pcb_psl &= ~ PSL_SFE; \ - if ((int)user_psl != 0) \ - *user_psl &= ~PSL_SFE; \ -} +#define aston() \ + { \ + u.u_pcb.pcb_psl |= PSL_SFE; \ + if ((int)user_psl != 0) *user_psl |= PSL_SFE; \ + } + +#define astoff() \ + { \ + u.u_pcb.pcb_psl &= ~ PSL_SFE; \ + if ((int)user_psl != 0) *user_psl &= ~PSL_SFE; \ + } Index: sys/tahoe/include/psl.h ================================================================== --- sys/tahoe/include/psl.h +++ sys/tahoe/include/psl.h @@ -1,10 +1,12 @@ -/* psl.h 1.2 86/01/05 */ + +/* psl.h 4.4 84/01/31 */ /* - * TAHOE processor status longword. + * TAHOE program status longword */ + #define PSL_C 0x00000001 /* carry bit */ #define PSL_V 0x00000002 /* overflow bit */ #define PSL_Z 0x00000004 /* zero bit */ #define PSL_N 0x00000008 /* negative bit */ #define PSL_ALLCC 0x0000000f /* all cc bits - unlikely */ @@ -12,14 +14,13 @@ #define PSL_IV 0x00000020 /* integer overflow enable bit */ #define PSL_FU 0x00000040 /* float underflow enable */ #define PSL_DBL 0x00000080 /* f.p. prescision indicator */ #define PSL_SFE 0x00000100 /* system-forced-exception */ #define PSL_IPL 0x001f0000 /* interrupt priority level */ -#define PSL_PRVMOD 0x00000000 /* previous mode (kernel mode) */ #define PSL_CURMOD 0x01000000 /* current mode (all on is user) */ #define PSL_IS 0x04000000 /* interrupt stack */ #define PSL_TP 0x40000000 /* trace pending */ -#define PSL_MBZ 0xbae0fe00 /* must be zero bits */ +#define PSL_MBZ 0xbae0ffc0 /* must be zero bits */ #define PSL_USERSET (PSL_CURMOD) -#define PSL_USERCLR (PSL_IS|PSL_IPL|PSL_MBZ|PSL_SFE|PSL_DBL|PSL_FU) +#define PSL_USERCLR (PSL_IS|PSL_IPL|PSL_MBZ) Index: sys/tahoe/include/pte.h ================================================================== --- sys/tahoe/include/pte.h +++ sys/tahoe/include/pte.h @@ -1,6 +1,7 @@ -/* pte.h 1.2 86/01/05 */ +/* pte.h 1.1 85/07/21 */ +/* Tahoe version, November 1982 */ /* * Tahoe page table entry * * There are two major kinds of pte's: those which have ever existed (and are @@ -15,14 +16,16 @@ { unsigned int pg_v:1, /* valid bit */ pg_prot:4, /* access control */ pg_fod:1, /* is fill on demand (=0) */ - :1, /* must write back to swap (unused) */ + pg_swapm:1, /* must write back to swap */ pg_nc:1, /* 'uncacheable page' bit */ pg_m:1, /* hardware maintained modified bit */ - pg_u:1, /* hardware maintained 'used' bit */ + /* pg_u:1, /* hardware maintained 'used' bit */ + /* Not implemented in this version */ + pg_vreadm:1, /* modified since vread (ored with _m)*/ pg_pfnum:22; /* core page frame number or 0 */ }; struct hpte { unsigned int @@ -34,26 +37,27 @@ unsigned int pg_v:1, pg_prot:4, pg_fod:1, /* is fill on demand (=1) */ :1, - pg_fileno:1, /* file mapped from or TEXT or ZERO */ - pg_blkno:24; /* file system block number */ + pg_fileno:5, /* file mapped from or TEXT or ZERO */ + pg_blkno:20; /* file system block number */ }; #endif #define PG_V 0x80000000 #define PG_PROT 0x78000000 /* all protection bits (dorit). */ #define PG_FOD 0x04000000 #define PG_SWAPM 0x02000000 #define PG_N 0x01000000 /* Non-cacheable */ #define PG_M 0x00800000 -#define PG_U 0x00400000 /* not currently used */ +/* #define PG_U 0x00400000 /* NOT implemented now !!! */ +#define PG_VREADM 0x00400000 /* Uses 'U' bit location !!! */ #define PG_PFNUM 0x003fffff -#define PG_FZERO 0 -#define PG_FTEXT 1 +#define PG_FZERO (NOFILE) +#define PG_FTEXT (NOFILE+1) #define PG_FMAX (PG_FTEXT) #define PG_NOACC 0 #define PG_KR 0x40000000 #define PG_KW 0x60000000 @@ -62,14 +66,17 @@ #define PG_UW 0x78000000 /* * Pte related macros */ -#define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && (pte)->pg_m) +#define dirty(pte) ((pte)->pg_fod == 0 && (pte)->pg_pfnum && \ + ((pte)->pg_m || (pte)->pg_swapm)) #ifndef LOCORE #ifdef KERNEL +struct pte *vtopte(); + /* utilities defined in locore.s */ extern struct pte Sysmap[]; extern struct pte Usrptmap[]; extern struct pte usrpt[]; extern struct pte Swapmap[]; @@ -76,18 +83,20 @@ extern struct pte Forkmap[]; extern struct pte Xswapmap[]; extern struct pte Xswap2map[]; extern struct pte Pushmap[]; extern struct pte Vfmap[]; +/* +extern struct pte IOmap[]; +*/ extern struct pte VD0map[]; extern struct pte VD1map[]; extern struct pte VD2map[]; extern struct pte VD3map[]; extern struct pte UDmap[]; -extern struct pte CY0map[]; -extern struct pte CY1map[]; +extern struct pte CYmap[]; extern struct pte XYmap[]; extern struct pte mmap[]; extern struct pte msgbufmap[]; extern struct pte camap[]; #endif #endif DELETED sys/tahoe/include/reg.h Index: sys/tahoe/include/reg.h ================================================================== --- sys/tahoe/include/reg.h +++ sys/tahoe/include/reg.h @@ -1,32 +0,0 @@ -/* reg.h 1.1 86/01/05 */ -/* reg.h 4.2 81/02/19 */ -/* - * Location of the users' stored - * registers relative to PSL of 'trap' and 'syscall'. - * Usage is u.u_ar0[XX]. - */ - -#define PS (-1) -#define PC (-2) -/* (-3) */ -/* (-4) */ -#define RACL (-5) -#define RACH (-6) -/* (-7) */ -/* (-8) */ -#define SP (-9) -#define R13 (-10) -#define FP (-10) -#define R12 (-13) -#define R11 (-14) -#define R10 (-15) -#define R9 (-16) -#define R8 (-17) -#define R7 (-18) -#define R6 (-19) -#define R5 (-20) -#define R4 (-21) -#define R3 (-22) -#define R2 (-23) -#define R1 (-24) -#define R0 (-25) DELETED sys/tahoe/include/trap.h Index: sys/tahoe/include/trap.h ================================================================== --- sys/tahoe/include/trap.h +++ sys/tahoe/include/trap.h @@ -1,19 +0,0 @@ -/* trap.h 1.1 86/01/05 */ - -/* first 3 constants known in system C files - don't change */ -#define T_RESADFLT 0 /* reserved addressing */ -#define T_PRIVINFLT 1 /* privileged instruction */ -#define T_RESOPFLT 2 /* reserved operand */ -/* those constants shouldn't change */ -#define T_BPTFLT 3 /* breakpoint instruction */ -#define T_SYSCALL 5 /* system call (kcall) */ -#define T_ARITHTRAP 6 /* arithmetic trap */ -#define T_ASTFLT 7 /* system forced exception */ -#define T_SEGFLT 8 /* segmentation (limit) fault */ -#define T_PROTFLT 9 /* protection fault */ -#define T_TRCTRAP 10 /* trace trap */ -#define T_PAGEFLT 12 /* page fault */ -#define T_TABLEFLT 13 /* page table fault */ -#define T_ALIGNFLT 14 /* alignment fault */ -#define T_KSPNOTVAL 15 /* kernel stack pointer not valid */ -#define T_BUSERR 16 /* bus error */ Index: sys/tahoe/include/vmparam.h ================================================================== --- sys/tahoe/include/vmparam.h +++ sys/tahoe/include/vmparam.h @@ -1,6 +1,7 @@ -/* vmparam.h 1.2 86/01/05 */ +/* vmparam.h 1.3 5/25/85 */ +/* vmparam.h 6.1 83/07/29 */ /* * Machine dependent constants for TAHOE */ /* @@ -8,54 +9,32 @@ * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are * the number of pages from the beginning of the P0 region to the * beginning of the text and from the beginning of the P2 region to the * beginning of the stack respectively. */ + /* number of ptes per page */ #define USRTEXT 0 -#define USRSTACK (0xc0000000-UPAGES*NBPG) /* Start of user stack */ -#define BTOPUSRSTACK (0x300000 - UPAGES) /* btop(USRSTACK) */ +#define USRSTACK (0xC0000000-UPAGES*NBPG) + /* Start of user stack */ #define P2PAGES 0x100000 /* number of pages in P2 region */ #define LOWPAGES 0 #define HIGHPAGES UPAGES /* - * Virtual memory related constants, all in clicks - */ -#define MAXTSIZ (6*CLSIZE*1024) /* max text size */ -#ifndef DFLDSIZ -#define DFLDSIZ (6*1024*1024/NBPG) /* initial data size limit */ -#endif -#ifndef MAXDSIZ -#define MAXDSIZ (19*1024*1024/NBPG) /* max data size */ -#endif -#ifndef DFLSSIZ -#define DFLSSIZ (512*1024/NBPG) /* initial stack size limit */ -#endif -#ifndef MAXSSIZ -#define MAXSSIZ MAXDSIZ /* max stack size */ -#endif - -/* - * Default sizes of swap allocation chunks (see dmap.h). - * The actual values may be changed in vminit() based on MAXDSIZ. - * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024. - */ -#define DMMIN 32 /* smallest swap allocation */ -#define DMMAX 4096 /* largest potential swap allocation */ -#define DMTEXT 1024 /* swap allocation for text */ + * Virtual memory related constants + */ +#define SLOP 32 +#define MAXTSIZ (6*1024-SLOP) /* max text size (clicks) */ +#define MAXDSIZ (19*2048-32-SLOP) /* max data size (clicks) */ +#define MAXSSIZ (19*2048-32-SLOP) /* max stack size (clicks) */ /* * Sizes of the system and user portions of the system page table. */ /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ -#ifdef notdef -#define SYSPTSIZE ((20+MAXUSERS)*NPTEPG) -#define USRPTSIZE (32*NPTEPG) -#else -#define SYSPTSIZE ((128*NPTEPG/2)+(MAXUSERS*NPTEPG/16)) -#define USRPTSIZE (4*NPTEPG) -#endif +#define SYSPTSIZE ((30+MAXUSERS)*NPTEPG/4) +#define USRPTSIZE (2*NPTEPG) /* * The size of the clock loop. */ #define LOOPPAGES (maxfree - firstfree) @@ -82,11 +61,11 @@ * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81), * so we loan each swapped in process memory worth 100$, or just admit * that we don't consider it worthwhile and swap it out to disk which costs * $30/mb or about $0.75. */ -#define SAFERSS 32 /* nominal ``small'' resident set size +#define SAFERSS 16 /* nominal ``small'' resident set size protected against replacement */ /* * DISKRPM is used to estimate the number of paging i/o operations * which one can expect from a single disk controller. @@ -115,36 +94,21 @@ */ #define KLSDIST 3 /* klusters advance/retard for seq. fifo */ /* * Paging thresholds (see vm_sched.c). - * Strategy of 1/19/85: - * lotsfree is 512k bytes, but at most 1/4 of memory + * Strategy of 4/22/81: + * lotsfree is 1/4 of memory free. * desfree is 200k bytes, but at most 1/8 of memory * minfree is 64k bytes, but at most 1/2 of desfree */ -#define LOTSFREE (512 * 1024) #define LOTSFREEFRACT 4 #define DESFREE (200 * 1024) #define DESFREEFRACT 8 #define MINFREE (64 * 1024) #define MINFREEFRACT 2 -/* - * There are two clock hands, initially separated by HANDSPREAD bytes - * (but at most all of user memory). The amount of time to reclaim - * a page once the pageout process examines it increases with this - * distance and decreases as the scan rate rises. - */ -#define HANDSPREAD (2 * 1024 * 1024) - -/* - * The number of times per second to recompute the desired paging rate - * and poke the pagedaemon. - */ -#define RATETOSCHEDPAGING 4 - /* * Believed threshold (in megabytes) for which interleaved * swapping area is desirable. */ #define LOTSOFMEM 2 @@ -151,26 +115,20 @@ /* * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 */ #define mapin(pte, v, pfnum, count, prot) \ - (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) - -/* - * Invalidate a cluster (optimized here for standard CLSIZE). - */ -#if CLSIZE == 1 -#define tbiscl(v) mtpr(TBIS, ptob(v)) -#endif + (*(int *)(pte) = (pfnum) | (prot), mtpr(ptob(v), TBIS)) /* * The following constant is used to initialize the map of the * system page table i/o entries. * It's value should be the highest i/o address used by all the * controllers handled in the system as specified in ubminit * structure in ioconf.c. - */ -#define MAXIOADDR 0xffffee45 -/* number of entries in the system page pable for i/o space */ -#define IOSIZE (((MAXIOADDR - (int)IOBASE+ NBPG-1) >> PGSHIFT)+1) -#define TBUFSIZ 32 /* maximum tape buffer size */ -#define ACEBPTE 32 /* ACC Ethernet (ACE) I/O window */ +*/ +#define MAXIOADDR 0xffffee45 /* highest physical io address */ + +/* Number of entries in the system page pable for i/o space */ +#define IOSIZE (( (MAXIOADDR - IOBASE+ NBPG -1) >> PGSHIFT )+1) +#define TBUFSIZ 10 /* maximum tape buffer size */ +#define ACEBPTE 32 /* ACC Ethernet (ACE) I/O window */ Index: sys/tahoe/inline/langpats.c ================================================================== --- sys/tahoe/inline/langpats.c +++ sys/tahoe/inline/langpats.c @@ -3,22 +3,22 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)langpats.c 1.2 (Berkeley) 01/05/86"; -#endif +static char sccsid[] = "@(#)langpats.c 2.9 (Berkeley) 6/8/85"; +#endif not lint #include "inline.h" /* * Pattern table for kernel specific routines. * These patterns are based on the old asm.sed script. */ struct pats language_ptab[] = { -#if defined(vax) +#ifdef vax { "0,_spl0\n", " mfpr $18,r0\n\ mtpr $0,$18\n" }, { "0,_spl1\n", @@ -245,164 +245,13 @@ movl (sp)+,r5\n\ cmpl r0,r5\n\ bgequ 1f\n\ movl r5,r0\n\ 1:\n" }, -#endif - -#if defined(tahoe) - { "4,_spl0\n", -" mfpr $8,r0\n\ - mtpr $0,$8\n" }, - - { "4,_spl1\n", -" mfpr $8,r0\n\ - mtpr $0x11,$8\n" }, - - { "4,_spl3\n", -" mfpr $8,r0\n\ - mtpr $0x13,$8\n" }, - - { "4,_spl7\n", -" mfpr $8,r0\n\ - mtpr $0x17,$8\n" }, - - { "4,_spl8\n", -" mfpr $8,r0\n\ - mtpr $0x18,$8\n" }, - - { "4,_splimp\n", -" mfpr $8,r0\n\ - mtpr $0x18,$8\n" }, - - { "4,_splsoftclock\n", -" mfpr $18,r0\n\ - mtpr $0x8,$8\n" }, - - { "4,_splnet\n", -" mfpr $8,r0\n\ - mtpr $0xc,$8\n" }, - - { "4,_splbio\n", -" mfpr $8,r0\n\ - mtpr $0x18,$8\n" }, - - { "4,_spltty\n", -" mfpr $8,r0\n\ - mtpr $0x18,$8\n" }, - - { "4,_splclock\n", -" mfpr $8,r0\n\ - mtpr $0x18,$8\n" }, - - { "4,_splhigh\n", -" mfpr $8,r0\n\ - mtpr $0x18,$8\n" }, - - { "8,_splx\n", -" movl (sp)+,r1\n\ - mfpr $8,r0\n\ - mtpr r1,$8\n" }, - - { "8,_mfpr\n", -" movl (sp)+,r1\n\ - mfpr r1,r0\n" }, - - { "12,_mtpr\n", -" movl (sp)+,r1\n\ - movl (sp)+,r0\n\ - mtpr r0,r1\n" }, - -#ifdef notdef - { "8,_uncache\n", -" movl (sp)+,r1\n\ - mtpr r1,$0x1c\n" }, -#endif - - { "4,_setsoftclock\n", -" mtpr $0x8,$0x10\n" }, - - { "8,_fuibyte\n", -" callf $8,_fubyte\n" }, - - { "8,_fuiword\n", -" callf $8,_fuword\n" }, - - { "12,_suibyte\n", -" callf $12,_subyte\n" }, - - { "12,_suiword\n", -" callf $12,_suword\n" }, - - { "8,_setjmp\n", -" movl (sp)+,r1\n\ - clrl r0\n\ - movab (fp),(r1)\n\ - addl2 $4,r1\n\ - movab 1(pc),(r1)\n" }, - - { "8,_ffs\n", -" movl (sp)+,r1\n\ - ffs r1,r0\n\ - bgeq 1f\n\ - mnegl $1,r0\n\ -1:\n\ - incl r0\n" }, - - { "12,__insque\n", -" movl (sp)+,r0\n\ - movl (sp)+,r1\n\ - insque (r0),(r1)\n" }, - - { "8,__remque\n", -" movl (sp)+,r1\n\ - remque (r1)\n" }, - - { "12,_imin\n", -" movl (sp)+,r0\n\ - movl (sp)+,r1\n\ - cmpl r0,r1\n\ - bleq 1f\n\ - movl r1,r0\n\ -1:\n" }, - - { "12,_imax\n", -" movl (sp)+,r0\n\ - movl (sp)+,r1\n\ - cmpl r0,r1\n\ - bgeq 1f\n\ - movl r1,r0\n\ -1:\n" }, - - { "12,_min\n", -" movl (sp)+,r0\n\ - movl (sp)+,r1\n\ - cmpl r0,r1\n\ - blequ 1f\n\ - movl r1,r0\n\ -1:\n" }, - - { "12,_max\n", -" movl (sp)+,r0\n\ - movl (sp)+,r1\n\ - cmpl r0,r1\n\ - bgequ 1f\n\ - movl r1,r0\n\ -1:\n" }, - - { "12,__movow\n", -" movl (sp)+,r1\n\ - movl (sp)+,r0\n\ - movow r0,(r1)\n" }, - - { "12,__movob\n", -" movl (sp)+,r1\n\ - movl (sp)+,r0\n\ - movob r0,(r1)\n" }, -#endif - -#if defined(mc68000) -/* someday... */ -#endif +#endif vax + +#ifdef mc68000 +/* someday... */ +#endif mc68000 { "", "" } }; Index: sys/tahoe/inline/libcpats.c ================================================================== --- sys/tahoe/inline/libcpats.c +++ sys/tahoe/inline/libcpats.c @@ -3,21 +3,21 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)libcpats.c 1.2 (Berkeley) 01/05/86"; -#endif +static char sccsid[] = "@(#)libcpats.c 1.3 (Berkeley) 6/8/85"; +#endif not lint #include "inline.h" /* * Pattern table for the C library. */ struct pats libc_ptab[] = { -#if defined(vax) +#ifdef vax { "1,_fgetc\n", " sobgeq *(sp),1f\n\ calls $1,__filbuf\n\ jbr 2f\n\ 1:\n\ @@ -41,13 +41,13 @@ movl r5,r1\n\ 1:\n\ locc $0,$65535,(r1)\n\ jeql 1b\n\ subl3 r5,r1,r0\n" }, -#endif +#endif vax -#if defined(mc68000) +#ifdef mc68000 /* someday... */ -#endif +#endif mc68000 { "", "" } }; Index: sys/tahoe/inline/machdep.c ================================================================== --- sys/tahoe/inline/machdep.c +++ sys/tahoe/inline/machdep.c @@ -3,12 +3,12 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)machdep.c 1.2 (Berkeley) 01/05/86"; -#endif +static char sccsid[] = "@(#)machdep.c 1.6 (Berkeley) 6/8/85"; +#endif not lint #include #include #include "inline.h" @@ -15,11 +15,11 @@ /* * The routines and tables in this file must be rewritten * for each new machine that this program is ported to. */ -#if defined(vax) +#ifdef vax /* * Instruction stop table. * All instructions that implicitly modify any of the temporary * registers, change control flow, or implicitly loop must be * listed in this table. It is used to find the end of a basic @@ -69,64 +69,11 @@ if (bcmp(cp, "calls\t$", 7) == 0) return (cp + 7); return (0); } -#endif - -#if defined(tahoe) -/* - * Instruction stop table. - * All instructions that implicitly modify any of the temporary - * registers, change control flow, or implicitly loop must be - * listed in this table. It is used to find the end of a basic - * block when scanning backwards through the instruction stream - * trying to merge the inline expansion. - */ -struct inststoptbl inststoptable[] = { -/* control */ - { "bbssi" }, { "bcc" }, { "bcs" }, { "beql" }, { "beqlu" }, - { "bgeq" }, { "bgequ" }, { "bgtr" }, { "bgtru" }, { "bleq" }, - { "blequ" }, { "blss" }, { "blssu" }, { "bneq" }, { "bnequ" }, - { "brb" }, { "brw" }, { "bvc" }, { "bvs" }, { "jmp" }, -/* jump versions of control */ - { "jbc" }, { "jbs" }, { "jeql" }, { "jeqlu" }, - { "jgeq" }, { "jgequ" }, { "jgtr" }, { "jgtru" }, { "jleq" }, - { "jlequ" }, { "jlss" }, { "jlssu" }, { "jneq" }, { "jnequ" }, - { "jcc" }, { "jcs" }, { "jvc" }, { "jvs" }, { "jbr" }, -/* multiple registers */ - { "loadr" }, -/* bit field */ - { "bbc" }, { "bbs" }, -/* character string and block move */ - { "cmps2" }, { "cmps3" }, { "movblk" }, { "movs2" }, { "movs3" }, -/* procedure call */ - { "callf" }, { "calls" }, { "ret" }, -/* loop control */ - { "aobleq" }, { "aoblss" }, { "casel" }, -/* privileged and miscellaneous */ - { "bpt" }, { "halt" }, { "kcall" }, { "ldpctx" }, { "rei" }, - { "svpctx" }, - { "" } -}; - -/* - * Check to see if a line is a candidate for replacement. - * Return pointer to name to be looked up in pattern table. - */ -char * -doreplaceon(cp) - char *cp; -{ - - if (bcmp(cp, "callf\t$", 7) == 0) - return (cp + 7); - return (0); -} -#endif - -#if defined(vax) || defined(tahoe) + /* * Find the next argument to the function being expanded. */ nextarg(argc, argv) int argc; @@ -143,11 +90,11 @@ } /* * Determine whether the current line pushes an argument. */ -ispusharg(argc, argv) + ispusharg(argc, argv) int argc; char *argv[]; { if (argc < 2) @@ -165,15 +112,15 @@ */ modifies(argc, argv) int argc; char *argv[]; { + /* + * For the VAX all we care about are r0 to r5 + */ register char *lastarg = argv[argc - 1]; - /* - * For the VAX or TAHOE all we care about are r0 to r5 - */ if (lastarg[0] == 'r' && isdigit(lastarg[1]) && lastarg[2] == '\0') return (lastarg[1] - '0'); return (-1); } @@ -237,13 +184,13 @@ int numargs; { return; } -#endif +#endif vax -#if defined(mc68000) +#ifdef mc68000 /* * Instruction stop table. * All instructions that implicitly modify any of the temporary * registers, change control flow, or implicitly loop must be * listed in this table. It is used to find the end of a basic @@ -407,6 +354,6 @@ * CHECK FOR LABEL * CHECK THAT INSTRUCTION IS A POP */ fgets(line[bufhead], MAXLINELEN, stdin); } -#endif +#endif mc68000 Index: sys/tahoe/inline/machpats.c ================================================================== --- sys/tahoe/inline/machpats.c +++ sys/tahoe/inline/machpats.c @@ -3,21 +3,21 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)machpats.c 1.2 (Berkeley) 01/05/86"; -#endif +static char sccsid[] = "@(#)machpats.c 1.4 (Berkeley) 6/8/85"; +#endif not lint #include "inline.h" /* - * Pattern table for special instructions. + * Pattern table for special VAX instructions. */ struct pats machine_ptab[] = { -#if defined(vax) +#ifdef vax { "3,_blkcpy\n", " movl (sp)+,r1\n\ movl (sp)+,r3\n\ jbr 2f\n\ 1:\n\ @@ -124,45 +124,13 @@ insque (r4),(r5)\n" }, { "1,_remque\n", " movl (sp)+,r5\n\ remque (r5),r0\n" }, -#endif - -#if defined(tahoe) - { "16,_blkcpy\n", -" movl (sp)+,r0\n\ - movl (sp)+,r1\n\ - movl (sp)+,r2\n\ - movblk\n" }, - - { "16,_bcopy\n", -" movl (sp)+,r0\n\ - movl (sp)+,r1\n\ - movl (sp)+,r2\n\ - movblk\n" }, - - { "12,_bzero\n", -" movl (sp)+,r1\n\ - movl (sp)+,r2\n\ - movab 1f,r0\n\ - movs3\n\ - .data\n\ -1: .byte 0\n\ - .text\n" }, - - { "12,_blkclr\n", -" movl (sp)+,r1\n\ - movl (sp)+,r2\n\ - movab 1f,r0\n\ - movs3\n\ - .data\n\ -1: .byte 0\n\ - .text\n" }, -#endif - -#if defined(mc68000) -/* someday... */ -#endif +#endif vax + +#ifdef mc68000 +/* someday... */ +#endif mc68000 { "", "" } }; Index: sys/tahoe/inline/main.c ================================================================== --- sys/tahoe/inline/main.c +++ sys/tahoe/inline/main.c @@ -6,15 +6,15 @@ #ifndef lint char copyright[] = "@(#) Copyright (c) 1984 Regents of the University of California.\n\ All rights reserved.\n"; -#endif +#endif not lint #ifndef lint -static char sccsid[] = "@(#)main.c 1.2 (Berkeley) 01/05/86"; -#endif +static char sccsid[] = "@(#)main.c 1.8 (Berkeley) 6/8/85"; +#endif not lint #include #include #include "inline.h" Index: sys/tahoe/math/Kaddd.s ================================================================== --- sys/tahoe/math/Kaddd.s +++ sys/tahoe/math/Kaddd.s @@ -1,9 +1,9 @@ -/* Kaddd.s 1.3 86/01/05 */ +/* Kaddd.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "SYS.h" /* * _Kaddd(acc_most,acc_least,op_most,op_least,hfs) */ Index: sys/tahoe/math/Kaddf.s ================================================================== --- sys/tahoe/math/Kaddf.s +++ sys/tahoe/math/Kaddf.s @@ -1,9 +1,9 @@ -/* Kaddf.s 1.3 86/01/05 */ +/* Kaddf.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "SYS.h" /* * _Kaddf(acc_most,acc_least,op_most,op_least,hfs) */ .text Index: sys/tahoe/math/Katanf.s ================================================================== --- sys/tahoe/math/Katanf.s +++ sys/tahoe/math/Katanf.s @@ -1,8 +1,8 @@ -/* Katanf.s 1.3 86/01/05 */ +/* Katanf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" .text ENTRY(Katanf, 0) tstl 4(fp) # if (arg > 0) jleq 1f @@ -18,11 +18,12 @@ callf $16,satan lnf r0 stf r0 ret # return(-satan(-arg)); -ASENTRY(satan, R2|R3) + .align 1 +satan: .word R3|R2 subl3 $60,fp,sp cmpd2 4(fp),_sq2m1 # if (arg < sq2m1) jgeq 1f pushl 12(fp) # hfs pushl 8(fp) @@ -73,11 +74,12 @@ ldd _pio2; pushd callf $24,_Ksubd ldd r0; cvdf; stf r0 ret -ASENTRY(xatan, 0) + .align 1 +xatan: .word 0 subl3 $68,fp,sp pushl 12(fp) # hfs ldd 4(fp); pushd; pushd callf $24,_Kmuld # argsq = arg*arg; ldd r0 Index: sys/tahoe/math/Kcmpd.s ================================================================== --- sys/tahoe/math/Kcmpd.s +++ sys/tahoe/math/Kcmpd.s @@ -1,8 +1,8 @@ -/* Kcmpd.s 1.3 86/01/05 */ +/* Kcmpd.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" /* * cmpd(hi1, lo1, hi2, lo2) * register hi1, hi2; * register unsigned lo1, lo2; Index: sys/tahoe/math/Kcmpf.s ================================================================== --- sys/tahoe/math/Kcmpf.s +++ sys/tahoe/math/Kcmpf.s @@ -1,8 +1,8 @@ -/* Kcmpf.s 1.3 86/01/05 */ +/* Kcmpf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" /* * cmpf(o1, o2) * register o1, o2; *{ Index: sys/tahoe/math/Kcvtdl.s ================================================================== --- sys/tahoe/math/Kcvtdl.s +++ sys/tahoe/math/Kcvtdl.s @@ -1,10 +1,10 @@ -/* Kcvtdl.s 1.3 86/01/05 */ +/* Kcvtdl.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" .text .globl _Kcvtdl .globl _Kcvtdu Index: sys/tahoe/math/Kcvtfl.s ================================================================== --- sys/tahoe/math/Kcvtfl.s +++ sys/tahoe/math/Kcvtfl.s @@ -1,9 +1,9 @@ -/* Kcvtfl.s 1.3 86/01/05 */ +/* Kcvtfl.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "SYS.h" .text ENTRY(Kcvtfl, R5|R4|R3|R2) clrl r1 clrl r4 # r4 - negative flag. Index: sys/tahoe/math/Kcvtld.s ================================================================== --- sys/tahoe/math/Kcvtld.s +++ sys/tahoe/math/Kcvtld.s @@ -1,10 +1,10 @@ -/* Kcvtld.s 1.3 86/01/05 */ +/* Kcvtld.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" .text ENTRY(Kcvtld, R5|R4|R3|R2) clrl r4 # r4 - negative flag. clrl r2 # r2 - exponent. Index: sys/tahoe/math/Kcvtlf.s ================================================================== --- sys/tahoe/math/Kcvtlf.s +++ sys/tahoe/math/Kcvtlf.s @@ -1,10 +1,10 @@ -/* Kcvtlf.s 1.3 86/01/05 */ +/* Kcvtlf.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" .text ENTRY(Kcvtlf, R5|R4|R3|R2) clrl r1 clrl r4 # r4 - negative flag. Index: sys/tahoe/math/Kdivd.s ================================================================== --- sys/tahoe/math/Kdivd.s +++ sys/tahoe/math/Kdivd.s @@ -1,10 +1,10 @@ -/* Kdivd.s 1.3 86/01/05 */ +/* Kdivd.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" #define HIDDEN 23 # here we count from 0 not from 1 as in fp.h .text ENTRY(Kdivd, R9|R8|R7|R6|R5|R4|R3|R2) Index: sys/tahoe/math/Kdivf.s ================================================================== --- sys/tahoe/math/Kdivf.s +++ sys/tahoe/math/Kdivf.s @@ -1,10 +1,10 @@ -/* Kdivf.s 1.3 86/01/05 */ +/* Kdivf.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" #define HIDDEN 23 # here we count from 0 not from 1 as in fp.h .text ENTRY(Kdivf, R9|R8|R7|R6|R5|R4|R3|R2) Index: sys/tahoe/math/Kexpf.s ================================================================== --- sys/tahoe/math/Kexpf.s +++ sys/tahoe/math/Kexpf.s @@ -1,8 +1,8 @@ -/* Kexpf.s 1.3 86/01/05 */ +/* Kexpf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" .text ENTRY(Kexpf, R4|R3) subl3 $88,fp,sp tstl 4(fp) Index: sys/tahoe/math/Kfnorm.s ================================================================== --- sys/tahoe/math/Kfnorm.s +++ sys/tahoe/math/Kfnorm.s @@ -1,10 +1,10 @@ -/* Kfnorm.s 1.3 86/01/05 */ +/* Kfnorm.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" .text ENTRY(Kfnorm, R6|R5|R4|R3|R2) # clrl r1 movl r0,r4 # copy to temporary. Index: sys/tahoe/math/Kfp_exp.s ================================================================== --- sys/tahoe/math/Kfp_exp.s +++ sys/tahoe/math/Kfp_exp.s @@ -1,10 +1,10 @@ -/* Kfp_exp.s 1.3 86/01/05 */ +/* Kfp_exp.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" ENTRY(Kfpover, 0) movl $HUGE0,r0 movl $HUGE1,r1 ret Index: sys/tahoe/math/Kfp_mvtoacc.s ================================================================== --- sys/tahoe/math/Kfp_mvtoacc.s +++ sys/tahoe/math/Kfp_mvtoacc.s @@ -1,9 +1,9 @@ -/* Kfp_mvtoacc.s 1.3 86/01/05 */ +/* Kfp_mvtoacc.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "SYS.h" /* * mvtofacc(value, acc_addr) * * move value to floating point accumulator Index: sys/tahoe/math/Kfrexpd.s ================================================================== --- sys/tahoe/math/Kfrexpd.s +++ sys/tahoe/math/Kfrexpd.s @@ -1,8 +1,8 @@ -/* Kfrexpd.s 1.3 86/01/05 */ +/* Kfrexpd.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" .text ENTRY(Kfrexpd, 0) subl3 $60,fp,sp clrl -60(fp) Index: sys/tahoe/math/Kfrexpf.s ================================================================== --- sys/tahoe/math/Kfrexpf.s +++ sys/tahoe/math/Kfrexpf.s @@ -1,8 +1,8 @@ -/* Kfrexpf.s 1.3 86/01/05 */ +/* Kfrexpf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" .text ENTRY(Kfrexpf, 0) subl3 $60,fp,sp clrl -60(fp) # j=0; Index: sys/tahoe/math/Kldexpf.s ================================================================== --- sys/tahoe/math/Kldexpf.s +++ sys/tahoe/math/Kldexpf.s @@ -1,10 +1,8 @@ -/* Kldexpf.s 1.3 86/01/05 */ +/* Kldexpf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" +#include "SYS.h" /* @(*)Kldexpf.s 4.2 (Berkeley) 12/21/80 * Tahoe 2/2/83 * * float Kldexpf (op_most, op_least, exp, hfs) @@ -17,10 +15,13 @@ * not modified if no error occurs, so if you intend to test it * after you use Kldexpf, you had better set it to something * other than ERANGE first (zero is a reasonable value to use). */ +#include "fp.h" +#include "Kfp.h" + .text ENTRY(Kldexpf, R2) movl 4(fp),r0 /* Fetch "value" */ movl 8(fp),r1 Index: sys/tahoe/math/Klogf.s ================================================================== --- sys/tahoe/math/Klogf.s +++ sys/tahoe/math/Klogf.s @@ -1,8 +1,8 @@ -/* Klogf.s 1.3 86/01/05 */ +/* Klogf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" .text ENTRY(Klogf, R5|R4|R3|R2) subl3 $88,fp,sp clrl 8(fp) Index: sys/tahoe/math/Kmodf.s ================================================================== --- sys/tahoe/math/Kmodf.s +++ sys/tahoe/math/Kmodf.s @@ -1,9 +1,9 @@ -/* Kmodf.s 1.3 86/01/05 */ +/* Kmodf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" -#include "../tahoemath/fp.h" +#include "SYS.h" +#include "fp.h" /* * float Kmodf (value, iptr, hfs) * float value, *iptr; * int hfs; Index: sys/tahoe/math/Kmuld.s ================================================================== --- sys/tahoe/math/Kmuld.s +++ sys/tahoe/math/Kmuld.s @@ -1,10 +1,10 @@ -/* Kmuld.s 1.3 86/01/05 */ +/* Kmuld.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" #define HIDDEN 23 /* here we count from 0 not from 1 as in fp.h */ /* * _Kmuld(acc_most,acc_least,op_most,op_least,hfs) Index: sys/tahoe/math/Kmulf.s ================================================================== --- sys/tahoe/math/Kmulf.s +++ sys/tahoe/math/Kmulf.s @@ -1,10 +1,10 @@ -/* Kmulf.s 1.3 86/01/05 */ +/* Kmulf.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" #define HIDDEN 23 /* here we count from 0 not from 1 as in fp.h */ /* * _Kmulf(acc_most,acc_least,op_most,op_least,hfs) Index: sys/tahoe/math/Knegd.s ================================================================== --- sys/tahoe/math/Knegd.s +++ sys/tahoe/math/Knegd.s @@ -1,10 +1,10 @@ -/* Knegd.s 1.3 86/01/05 */ +/* Knegd.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" .text ENTRY(Knegd, 0) andl3 $EXPMASK,4(fp),r0 /* check for reserved operand,zero. */ beql retzero Index: sys/tahoe/math/Knegf.s ================================================================== --- sys/tahoe/math/Knegf.s +++ sys/tahoe/math/Knegf.s @@ -1,10 +1,10 @@ -/* Knegf.s 1.3 86/01/05 */ +/* Knegf.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" .text ENTRY(Knegf, 0) clrl r1 andl3 $EXPMASK,4(fp),r0 /* check for reserved operand,zero. */ Index: sys/tahoe/math/Ksfnorm.s ================================================================== --- sys/tahoe/math/Ksfnorm.s +++ sys/tahoe/math/Ksfnorm.s @@ -1,10 +1,10 @@ -/* Ksfnorm.s 1.3 86/01/05 */ +/* Ksfnorm.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" /* * Ksfnorm(hfs) */ .text Index: sys/tahoe/math/Ksfp_exp.s ================================================================== --- sys/tahoe/math/Ksfp_exp.s +++ sys/tahoe/math/Ksfp_exp.s @@ -1,10 +1,10 @@ -/* Ksfp_exp.s 1.3 86/01/05 */ +/* Ksfp_exp.s 1.2 86/01/03 */ -#include "../tahoemath/fp.h" -#include "../tahoemath/Kfp.h" -#include "../tahoe/SYS.h" +#include "fp.h" +#include "Kfp.h" +#include "SYS.h" ENTRY(Ksfpover, 0) movl $HUGE0,r0 movl $HUGE1,r1 ret Index: sys/tahoe/math/Ksinfcosf.s ================================================================== --- sys/tahoe/math/Ksinfcosf.s +++ sys/tahoe/math/Ksinfcosf.s @@ -1,8 +1,8 @@ -/* Ksinfcosf.s 1.3 86/01/05 */ +/* Ksinfcosf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" .text ENTRY(Kcosf, 0) tstl 4(fp) # if (arg < 0) jgeq L23 Index: sys/tahoe/math/Ksqrtf.s ================================================================== --- sys/tahoe/math/Ksqrtf.s +++ sys/tahoe/math/Ksqrtf.s @@ -1,8 +1,8 @@ -/* Ksqrtf.s 1.3 86/01/05 */ +/* Ksqrtf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" .text ENTRY(Ksqrtf, 0) subl3 $76,fp,sp tstl 4(fp) # if (arg <= 0.) { Index: sys/tahoe/math/Ksubd.s ================================================================== --- sys/tahoe/math/Ksubd.s +++ sys/tahoe/math/Ksubd.s @@ -1,8 +1,8 @@ -/* Ksubd.s 1.3 86/01/05 */ +/* Ksubd.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" /* * double * Ksubd(d1,d2) * double d1,d2; Index: sys/tahoe/math/Ksubf.s ================================================================== --- sys/tahoe/math/Ksubf.s +++ sys/tahoe/math/Ksubf.s @@ -1,8 +1,8 @@ -/* Ksubf.s 1.3 86/01/05 */ +/* Ksubf.s 1.2 86/01/03 */ -#include "../tahoe/SYS.h" +#include "SYS.h" /* * _Ksubf(acc_most,acc_least,op_most,op_least,hfs) * * subf(d1,d2) DELETED sys/tahoe/math/fpe.c Index: sys/tahoe/math/fpe.c ================================================================== --- sys/tahoe/math/fpe.c +++ sys/tahoe/math/fpe.c @@ -1,147 +0,0 @@ -/* fpe.c 1.1 86/01/03 */ - -#include "../tahoe/psl.h" -#include "../tahoe/reg.h" -#include "../tahoe/pte.h" -#include "../tahoe/mtpr.h" -#include "../tahoemath/Kfp.h" - -#include "param.h" -#include "systm.h" -#include "dir.h" -#include "user.h" -#include "proc.h" -#include "seg.h" -#include "acct.h" -#include "kernel.h" - -/* - * Floating point emulation support. - */ -extern float Kcvtlf(), Kaddf(), Ksubf(), Kmulf(), Kdivf(); -extern double Kcvtld(), Kaddd(), Ksubd(), Kmuld(), Kdivd(); -extern float Ksinf(), Kcosf(), Katanf(), Klogf(), Ksqrtf(), Kexpf(); - -#define OP(dop) ((dop) &~ 01) /* precision-less version of opcode */ -#define isdouble(op) ((op) & 01) /* is opcode double or float */ - -struct fpetab { - int fpe_op; /* base opcode emulating */ - float (*fpe_ffunc)(); /* float version of op */ - double (*fpe_dfunc)(); /* double version of op */ -} fpetab[] = { - { OP(CVLD), Kcvtlf, Kcvtld }, - { OP(ADDD), Kaddf, Kaddd }, - { OP(SUBD), Ksubf, Ksubd }, - { OP(MULD), Kmulf, Kmuld }, - { OP(DIVD), Kdivf, Kdivd }, - { SINF, Ksinf, 0 }, - { COSF, Kcosf, 0 }, - { ATANF, Katanf, 0 }, - { LOGF, Klogf, 0 }, - { SQRTF, Ksqrtf, 0 }, - { EXPF, Kexpf, 0 }, -}; -#define NFPETAB (sizeof (fpetab) / sizeof (fpetab[0])) - -/* - * Emulate the FP opcode. Update psl as necessary. - * If OK, set opcode to 0, else to the FP exception #. - * Not all parameter longwords are relevant, depends on opcode. - * - * The entry mask is set by locore.s so ALL registers are saved. - * This enables FP opcodes to change user registers on return. - */ -/* WARNING!!!! THIS CODE MUST NOT PRODUCE ANY FLOATING POINT EXCEPTIONS */ -/*ARGSUSED*/ -fpemulate(hfsreg, acc_most, acc_least, dbl, op_most, op_least, opcode, pc, psl) -{ - int r0, r1; /* must reserve space */ - register int *locr0 = ((int *)&psl)-PS; - register struct fpetab *fp; - int hfs = 0; /* returned data about exceptions */ - int type; /* opcode type, FLOAT or DOUBLE */ - union { float ff; int fi; } f_res; - union { double dd; int di[2]; } d_res; - -#ifdef lint - r0 = 0; r0 = r0; r1 = 0; r1 = r1; -#endif - type = isdouble(opcode) ? DOUBLE : FLOAT; - for (fp = fpetab; fp < &fpetab[NFPETAB]; fp++) - if ((opcode & 0xfe) == fp->fpe_op) - break; - if (type == DOUBLE) { - if (fp->fpe_dfunc == 0) - fp = &fpetab[NFPETAB]; - else - locr0[PS] &= ~PSL_DBL; - } - if (fp >= &fpetab[NFPETAB]) { - opcode = DIV0_EXC; /* generate SIGILL - XXX */ - return; - } - switch (type) { - - case DOUBLE: - d_res.dd = (*fp->fpe_dfunc)(acc_most, acc_least, op_most, - op_least, &hfs); - if (d_res.di[0] == 0 && d_res.di[1] == 0) - locr0[PS] |= PSL_Z; - if (d_res.di[0] < 0) - locr0[PS] |= PSL_N; - break; - - case FLOAT: - f_res.ff = (*fp->fpe_ffunc)(acc_most, acc_least, op_most, - op_least, &hfs); - if (f_res.fi == 0) - locr0[PS] |= PSL_Z; - if (f_res.fi == 0) - locr0[PS] |= PSL_N; - break; - } - if (hfs & HFS_OVF) { - locr0[PS] |= PSL_V; /* turn on overflow bit */ -#ifdef notdef - if (locr0[PS] & PSL_IV) { /* overflow enabled? */ -#endif - opcode = OVF_EXC; - u.u_error = (hfs & HFS_DOM) ? EDOM : ERANGE; - return; -#ifdef notdef - } -#endif - } else if (hfs & HFS_UNDF) { - if (locr0[PS] & PSL_FU) { /* underflow enabled? */ - opcode = UNDF_EXC; - u.u_error = (hfs & HFS_DOM) ? EDOM : ERANGE; - return; - } - } else if (hfs & HFS_DIVZ) { - opcode = DIV0_EXC; - return; - } else if (hfs & HFS_DOM) - u.u_error = EDOM; - else if (hfs & HFS_RANGE) - u.u_error = ERANGE; - switch (type) { - - case DOUBLE: - if (hfs & (HFS_OVF|HFS_UNDF)) { - d_res.dd = 0.0; - locr0[PS] |= PSL_Z; - } - mvtodacc(d_res.di[0], d_res.di[1], &acc_most); - break; - - case FLOAT: - if (hfs & (HFS_OVF|HFS_UNDF)) { - f_res.ff = 0.0; - locr0[PS] |= PSL_Z; - } - mvtofacc(f_res.ff, &acc_most); - break; - } - opcode = 0; -} Index: sys/tahoe/stand/udc.h ================================================================== --- sys/tahoe/stand/udc.h +++ sys/tahoe/stand/udc.h @@ -1,6 +1,6 @@ -/* udc.h 1.2 86/01/05 */ +/* udc.h 1.1 85/07/21 */ struct UDPAC { /* UDC command packet */ char _stx ; char _pkid ; char _pksiz ; /* 21 bytes */ @@ -87,10 +87,10 @@ #define IN5 0xffffb02c int dummy; extern char vmem[][16*NBPG]; -#define IOaddr(off) (caddr_t)((int)vmem + ((off) & 0x0fffff)) +#define IOaddr(off) (char *)((int)vmem + ((off) & 0x0fffff)) int iospace_mapped; -#define scope_out(x) if(iospace_mapped) movob(IOaddr(OUT/**/x),0) +#define scope_out(x) if(iospace_mapped) movob (0, IOaddr(OUT/**/x)) #define scope_in(x) if(iospace_mapped) dummy = *IOaddr(IN/**/x) Index: sys/tahoe/tahoe/Locore.c ================================================================== --- sys/tahoe/tahoe/Locore.c +++ sys/tahoe/tahoe/Locore.c @@ -1,58 +1,56 @@ -/* Locore.c 1.2 86/01/05 */ - -#include "../tahoe/mtpr.h" -#include "../tahoe/trap.h" -#include "../tahoe/psl.h" -#include "../tahoe/pte.h" -#include "../tahoe/cp.h" -#include "../tahoe/mem.h" -#include "../tahoemath/fp.h" - -#include "param.h" -#include "systm.h" -#include "dir.h" -#include "user.h" -#include "vm.h" -#include "ioctl.h" -#include "tty.h" -#include "proc.h" -#include "buf.h" -#include "msgbuf.h" -#include "mbuf.h" -#include "protosw.h" -#include "domain.h" -#include "map.h" +/* Locore.c 1.1 85/07/21 */ + +#include "dz.h" +#include "mba.h" +#include "uba.h" + +#include "../machine/pte.h" + +#include "../h/param.h" +#include "../h/systm.h" +#include "../h/dir.h" +#include "../h/user.h" +#include "../h/vm.h" +#include "../h/tty.h" +#include "../h/proc.h" +#include "../h/buf.h" +#include "../h/msgbuf.h" +#include "../h/mbuf.h" +#include "../h/protosw.h" +#include "../h/domain.h" + +#include "../vax/nexus.h" +#include "../vaxuba/ubavar.h" +#include "../vaxuba/ubareg.h" /* * Pseudo file for lint to show what is used/defined in locore.s. */ struct scb scb; +int (*UNIvec[128])(); +#if NUBA > 1 +int (*UNI1vec[128])(); +#endif struct rpb rpb; -int dumpflag; -int intstack[3*NBPG]; +int intstack[3*128]; + int masterpaddr; /* p_addr of current process on master cpu */ + struct user u; -int icode[8]; -int szicode = sizeof (icode); -/* - * Variables declared for savecore, or - * implicitly, such as by config or the loader. - */ -char version[] = "4.2 BSD UNIX ...."; -int etext; doadump() { dumpsys(); } +Xmba3int() { } +Xmba2int() { } +Xmba1int() { } +Xmba0int() { } + lowinit() { - caddr_t cp; extern int dumpmag; - extern int rthashsize; - extern int arptab_size; - extern int dk_ndrive; extern struct domain unixdomain; #ifdef PUP extern struct domain pupdomain; #endif #ifdef INET @@ -60,16 +58,10 @@ #endif #include "imp.h" #if NIMP > 0 extern struct domain impdomain; #endif -#ifdef NS - extern struct domain nsdomain; -#endif - extern int nport; - extern short *swsize; - extern int *swpf; /* cpp messes these up for lint so put them here */ unixdomain.dom_next = domains; domains = &unixdomain; #ifdef PUP @@ -82,18 +74,11 @@ #endif #if NIMP > 0 impdomain.dom_next = domains; domains = &impdomain; #endif -#ifdef NS - nsdomain.dom_next = domains; - domains = &nsdomain; -#endif dumpmag = 0; /* used only by savecore */ - rthashsize = rthashsize; /* used by netstat, etc. */ - arptab_size = arptab_size; /* used by arp command */ - dk_ndrive = dk_ndrive; /* used by vmstat, iostat, etc. */ /* * Pseudo-uses of globals. */ lowinit(); @@ -100,56 +85,67 @@ intstack[0] = intstack[1]; rpb = rpb; scb = scb; maxmem = physmem = freemem = 0; u = u; + fixctlrmask(); main(0); - swsize = swsize; /* XXX */ - swpf = swpf; /* XXX */ - nport = nport; /* XXX */ + Xustray(); /* * Routines called from interrupt vectors. */ - buserror((caddr_t)0); panic("Machine check"); printf("Write timeout"); - rawintr(); -#ifdef INET - ipintr(); + (*UNIvec[0])(); +#if NUBA > 1 + (*UNI1vec[0])(); #endif -#ifdef NS - nsintr(); -#endif + ubaerror(0, (struct uba_hd *)0, 0, 0, (struct uba_regs *)0); cnrint(0); cnxint(0); + consdin(); + consdout(); +#if NDZ > 0 + dzdma(); +#endif +#if NMBA > 0 + mbintr(0); +#endif hardclock((caddr_t)0, 0); softclock((caddr_t)0, 0); - fpemulate(0, 0, 0, 0, 0, 0, 0, 0, 0); - trap(0, 0, 0, 0, 0, 0, (unsigned)0, 0, 0); - syscall(0, 0, 0, 0, 0, 0, (unsigned)0, 0, 0); + trap(0, 0, (unsigned)0, 0, 0); + syscall(0, 0, (unsigned)0, 0, 0); + ipintr(); + rawintr(); if (vmemall((struct pte *)0, 0, (struct proc *)0, 0)) return; /* use value */ - if (zmemall((int (*)())0, 0) == (caddr_t)0) - return; /* use value */ + machinecheck((caddr_t)0); + memerr(); boothowto = 0; -/* the following are not currently used but will soon */ - if (rmget((struct map *)0, 0, 0) == 0) - return; - cp = calloc(0); cfreemem(cp, 0); -/* end not currently used */ - dumpflag = 0; dumpflag = dumpflag; -#if !defined(GPROF) - cp = (caddr_t)&etext; +} + +consdin() { } +consdout() { } +#if NDZ > 0 +dzdma() { dzxint((struct tty *)0); } #endif -} + +int catcher[256]; +int cold = 1; + +Xustray() { } struct pte Sysmap[6*NPTEPG]; -caddr_t Sysbase; -struct pte VMEMmap[1]; -int vmembeg, vmemend; +char Sysbase[6*NPTEPG*NBPG]; +int umbabeg; +struct pte Nexmap[16][16]; +struct nexus nexus[MAXNNEXUS]; +struct pte UMEMmap[MAXNUBA][512]; +char umem[MAXNUBA][512*NBPG]; +int umbaend; struct pte Usrptmap[USRPTSIZE]; struct pte usrpt[USRPTSIZE*NPTEPG]; struct pte Forkmap[UPAGES]; struct user forkutl; struct pte Xswapmap[UPAGES]; @@ -160,80 +156,42 @@ struct user swaputl; struct pte Pushmap[UPAGES]; struct user pushutl; struct pte Vfmap[UPAGES]; struct user vfutl; -#include "fsd.h" -#if NVD > 0 -struct pte VD0map[MAXBPTE+1]; -char vd0utl[1]; -#endif -#if NVD > 1 -struct pte VD1map[MAXBPTE+1]; -char vd1utl[1]; -#endif -#if NVD > 2 -struct pte VD2map[MAXBPTE+1]; -char vd2utl[1]; -#endif -#if NVD > 3 -struct pte VD3map[MAXBPTE+1]; -char vd3utl[1]; -#endif -#include "cy.h" -#if NCY > 0 -struct pte CY0map[TBUFSIZ+1]; -char cy0utl[1]; -#endif -#if NCY > 1 -struct pte CY1map[TBUFSIZ+1]; -char cy1utl[1]; -#endif -#include "ace.h" -#if NACE > 0 -struct pte ACE0map[1], ACE1map[1]; -char ace0utl[1], ace1utl[1]; -#endif -struct pte CMAP1[1], CMAP2[1]; -caddr_t CADDR1, CADDR2; +struct pte CMAP1; +char CADDR1[NBPG]; +struct pte CMAP2; +char CADDR2[NBPG]; struct pte mmap[1]; -char vmmap[1]; -struct pte msgbufmap[3*NBPG]; -struct msgbuf msgbuf; -struct pte camap[16]; -int cabase, calimit; +char vmmap[NBPG]; struct pte Mbmap[NMBCLUSTERS/CLSIZE]; struct mbuf mbutl[NMBCLUSTERS*CLBYTES/sizeof (struct mbuf)]; +struct pte msgbufmap[CLSIZE]; +struct msgbuf msgbuf; +struct pte camap[32]; +int cabase; +#ifdef unneeded +char caspace[32*NBPG]; +#endif +int calimit; /*ARGSUSED*/ badaddr(addr, len) caddr_t addr; int len; { return (0); } -#if NCY > 0 -/*ARGSUSED*/ -badcyaddr(addr) caddr_t addr; { return (0); } -#endif -/*ARGSUSED*/ -ovbcopy(from, to, len) caddr_t from, to; unsigned len; { } -copyinstr(udaddr, kaddr, maxlength, lencopied) - caddr_t udaddr, kaddr; u_int maxlength, *lencopied; -{ *kaddr = *udaddr; *lencopied = maxlength; return (0); } -copyoutstr(kaddr, udaddr, maxlength, lencopied) - caddr_t kaddr, udaddr; u_int maxlength, *lencopied; -{ *kaddr = *udaddr; *lencopied = maxlength; return (0); } -copystr(kfaddr, kdaddr, maxlength, lencopied) - caddr_t kfaddr, kdaddr; u_int maxlength, *lencopied; -{ *kdaddr = *kfaddr; *lencopied = maxlength; return (0); } -/*ARGSUSED*/ -copyin(udaddr, kaddr, n) caddr_t udaddr, kaddr; u_int n; { return (0); } -/*ARGSUSED*/ -copyout(kaddr, udaddr, n) caddr_t kaddr, udaddr; u_int n; { return (0); } + +/*ARGSUSED*/ +copyin(udaddr, kaddr, n) caddr_t udaddr, kaddr; unsigned n; { return (0); } + +/*ARGSUSED*/ +copyout(kaddr, udaddr, n) caddr_t kaddr, udaddr; unsigned n; { return (0); } + +/*ARGSUSED*/ +setjmp(lp) label_t *lp; { return (0); } /*ARGSUSED*/ longjmp(lp) label_t *lp; { /*NOTREACHED*/ } -/*ARGSUSED*/ -savectx(lp) label_t *lp; { return (0); } - /*ARGSUSED*/ setrq(p) struct proc *p; { } /*ARGSUSED*/ remrq(p) struct proc *p; { } @@ -243,85 +201,85 @@ /*ARGSUSED*/ resume(pcbpf) unsigned pcbpf; { } /*ARGSUSED*/ fubyte(base) caddr_t base; { return (0); } + /*ARGSUSED*/ subyte(base, i) caddr_t base; { return (0); } + +/*ARGSUSED*/ +suibyte(base, i) caddr_t base; { return (0); } + /*ARGSUSED*/ fuword(base) caddr_t base; { return (0); } + +/*ARGSUSED*/ +fuiword(base) caddr_t base; { return (0); } + /*ARGSUSED*/ suword(base, i) caddr_t base; { return (0); } /*ARGSUSED*/ -copyseg(udaddr, pf) - caddr_t udaddr; unsigned pf; -{ CMAP1[0] = CMAP1[0]; CADDR1[0] = CADDR1[0]; } +suiword(base, i) caddr_t base; { return (0); } + +/*ARGSUSED*/ +copyseg(udaddr, pf) caddr_t udaddr; unsigned pf; { + CMAP1 = CMAP1; CADDR1[0] = CADDR1[0]; +} /*ARGSUSED*/ -clearseg(pf) unsigned pf; { CMAP2[0] = CMAP2[0]; CADDR2[0] = CADDR2[0]; } +clearseg(pf) unsigned pf; { CMAP2 = CMAP2; CADDR2[0] = CADDR2[0]; } /*ARGSUSED*/ useracc(udaddr, bcnt, rw) caddr_t udaddr; unsigned bcnt; { return (0); } /*ARGSUSED*/ kernacc(addr, bcnt, rw) caddr_t addr; unsigned bcnt; { return (0); } -/*ARGSUSED*/ -addupc(pc, prof, counts) int pc; struct uprof *prof; int counts; { } - -/*ARGSUSED*/ -scanc(size, cp, table, mask) - unsigned size; char *cp, table[]; int mask; -{ return (0); } - -/*ARGSUSED*/ -skpc(mask, size, cp) int mask; char *cp; unsigned size; { return (0); } - -#ifdef notdef -/*ARGSUSED*/ -locc(mask, size, cp) int mask; char *cp; unsigned size; { return (0); } -#endif - /* - * Routines expanded by inline. + * Routines handled by asm.sed script. */ -#ifdef notdef -fuibyte(base) caddr_t base; { return (fubyte(base)); } -#endif -fuiword(base) caddr_t base; { return (fuword(base)); } -suibyte(base, i) caddr_t base; { return (subyte(base, i)); } -suiword(base, i) caddr_t base; { return (suword(base, i)); } - -/*ARGSUSED*/ -setjmp(lp) label_t *lp; { return (0); } - -/*ARGSUSED*/ -_insque(p, q) caddr_t p, q; { } -/*ARGSUSED*/ -_remque(p) caddr_t p; { } - -/*ARGSUSED*/ -bcopy(from, to, len) caddr_t from, to; unsigned len; { } -/*ARGSUSED*/ -bzero(base, count) caddr_t base; unsigned count; { } -/*ARGSUSED*/ -blkclr(base, count) caddr_t base; unsigned count; { } - -/*ARGSUSED*/ + /*VARARGS1*/ -mtpr(reg, v) int reg; { } +/*ARGSUSED*/ +mtpr(reg, value) int reg, value; { } + /*ARGSUSED*/ mfpr(reg) int reg; { return (0); } + +spl0() { } +spl4() { return (0); } +spl5() { return (0); } +spl6() { return (0); } +spl7() { return (0); } + +/*ARGSUSED*/ +splx(s) int s; { } + +/*ARGSUSED*/ +bcopy(from, to, count) caddr_t from, to; unsigned count; { ; } + +/*ARGSUSED*/ +bzero(base, count) caddr_t base; unsigned count; { ; } + /*ARGSUSED*/ -_movow(dst, v) u_short *dst, v; { } +bcmp(s1, s2, count) caddr_t s1, s2; unsigned count; { return (0); } + /*ARGSUSED*/ -_movob(dst, v) u_char *dst, v; { } +scanc(size, cp, table, mask) +unsigned size; caddr_t cp, table; int mask; { return (0); } /*ARGSUSED*/ -ffs(v) long v; { return (0); } +ffs(i) { return (0); } + +ntohs(s) u_short s; { return ((int)s); } + +htons(s) u_short s; { return ((int)s); } -imin(a, b) int a, b; { return (a < b ? a : b); } -imax(a, b) int a, b; { return (a > b ? a : b); } -unsigned min(a, b) u_int a, b; { return (a < b ? a : b); } -unsigned max(a, b) u_int a, b; { return (a > b ? a : b); } +/* + * Variables declared for savecore, or + * implicitly, such as by config or the loader. + */ +char version[] = "4.2 BSD UNIX ...."; +char etext; DELETED sys/tahoe/tahoe/SYS.h Index: sys/tahoe/tahoe/SYS.h ================================================================== --- sys/tahoe/tahoe/SYS.h +++ sys/tahoe/tahoe/SYS.h @@ -1,30 +0,0 @@ -/* SYS.h 1.1 86/01/05 */ - -/* - * Macros used to define entry points - * in assembly language routines. - */ -#if defined(GPROF) || defined(PROF) -#define ENTRY(name, regs) \ - .globl _/**/name; .align 2; _/**/name: .word regs; callf $0,mcount -#define ASENTRY(name, regs) \ - .globl name; .align 2; name: .word regs; callf $0,mcount -#else -#define ENTRY(name, regs) \ - .globl _/**/name; .align 2; _/**/name: .word regs -#define ASENTRY(name, regs) \ - .globl name; .align 2; name: .word regs -#endif -#define R0 0x0001 -#define R1 0x0002 -#define R2 0x0004 -#define R3 0x0008 -#define R4 0x0010 -#define R5 0x0020 -#define R6 0x0040 -#define R7 0x0080 -#define R8 0x0100 -#define R9 0x0200 -#define R10 0x0400 -#define R11 0x0800 -#define R12 0x1000 Index: sys/tahoe/tahoe/autoconf.c ================================================================== --- sys/tahoe/tahoe/autoconf.c +++ sys/tahoe/tahoe/autoconf.c @@ -1,6 +1,6 @@ -/* autoconf.c 1.2 86/01/05 */ +/* autoconf.c 1.1 85/07/21 */ /* * Setup the system to run on the current machine. * * Configure() is called at boot time and initializes the vba @@ -7,24 +7,23 @@ * device tables and the memory controller monitoring. Available * devices are determined (from possibilities mentioned in ioconf.c), * and the drivers are initialized. * */ -#include "../tahoe/pte.h" -#include "../tahoe/mem.h" -#include "../tahoe/mtpr.h" - -#include "param.h" -#include "systm.h" -#include "map.h" -#include "buf.h" -#include "dk.h" -#include "vm.h" -#include "conf.h" -#include "dmap.h" - -#include "../tahoevba/vbavar.h" + +#include "../machine/pte.h" +#include "../h/param.h" +#include "../h/systm.h" +#include "../h/map.h" +#include "../h/buf.h" +#include "../h/dk.h" +#include "../h/vm.h" +#include "../h/conf.h" +#include "../h/dmap.h" +#include "../machine/mem.h" +#include "../machine/mtpr.h" +#include "../vba/vbavar.h" /* * The following several variables are related to * the configuration process, and are used in initializing * the machine. @@ -35,23 +34,23 @@ * Determine mass storage configuration for a machine. */ configure() { register int *ip; - extern caddr_t Sysbase; + extern char Sysbase[]; - printf("vba%d at %x\n", numvba-1, IOBASE); - vbafind(numvba-1, (char *)vmem,(struct pte *)VMEMmap); + printf("vba%d at 0x%x\n", numvba, IOBASE); + vbafind((char *)vmem,(struct pte *)VMEMmap); /* * Write protect the scb. It is strange * that this code is here, but this is as soon * as we are done mucking with it, and the * write-enable was done in assembly language * to which we will never return. */ ip = (int *)&Sysmap[2]; *ip &= ~PG_PROT; *ip |= PG_KR; - mtpr(TBIS, Sysbase+2*NBPG); + mtpr(Sysbase+0x800, TBIS); #if GENERIC setconf(); #endif swapconf(); } @@ -59,21 +58,23 @@ /* * Make the controllers accessible at physical address phys * by mapping kernel ptes starting at pte. */ -ioaccess(pte, iobase, n) + +ioaccess(pte,iobase,iosize) register struct pte *pte; - caddr_t iobase; - register int n; + register caddr_t iobase; + register int iosize; { + register int i = iosize; /* number of ptes to map */ register unsigned v = btop(iobase); do *(int *)pte++ = PG_V|PG_KW|v++; - while (--n > 0); - mtpr(TBIA, 0); + while (--i > 0); + mtpr(0, TBIA); } /* * Find devices on the BUS. @@ -82,12 +83,11 @@ * slave initialization routine. */ int iospace_mapped = 0; -vbafind(vban, vumem, memmap) - int vban; +vbafind(vumem, memmap) char *vumem; struct pte *memmap; { register struct vba_device *ui; register struct vba_ctlr *um; @@ -98,43 +98,44 @@ /* * Make the controllers accessible at physical address phys * by mapping kernel ptes starting at pte. */ - ioaccess(memmap, IOBASE, (int)IOSIZE); + ioaccess(memmap,IOBASE,IOSIZE); iospace_mapped = 1; #define vbaddr(off) (u_short *)((int)vumem + ((off) & 0x0fffff)) + /* * Check each VERSAbus mass storage controller. * For each one which is potentially on this vba, * see if it is really there, and if it is record it and * then go looking for slaves. */ for (um = vbminit; udp = um->um_driver; um++) { - if (um->um_vbanum != vban && um->um_vbanum != '?') + if (um->um_vbanum != numvba && um->um_vbanum != '?') continue; addr = (long)um->um_addr; reg = vbaddr(addr); i = (*udp->ud_probe)(reg); if (i == 0) continue; - printf("%s%d at vba%d csr %x\n", - udp->ud_mname, um->um_ctlr, vban, addr); + printf("%s%d at csr 0x%x\n", + udp->ud_mname, um->um_ctlr, addr); um->um_alive = 1; - um->um_vbanum = vban; + um->um_vbanum = numvba; um->um_addr = (caddr_t)reg; udp->ud_minfo[um->um_ctlr] = um; for (ui = vbdinit; ui->ui_driver; ui++) { if (ui->ui_driver != udp || ui->ui_alive || ui->ui_ctlr != um->um_ctlr && ui->ui_ctlr != '?' || - ui->ui_vbanum != vban && ui->ui_vbanum != '?') + ui->ui_vbanum != numvba && ui->ui_vbanum != '?') continue; if ((*udp->ud_slave)(ui, reg)) { ui->ui_alive = 1; ui->ui_ctlr = um->um_ctlr; - ui->ui_vbanum = vban; + ui->ui_vbanum = numvba; ui->ui_addr = (caddr_t)reg; ui->ui_physaddr = (caddr_t)IOBASE + (addr&0x0fffff); if (ui->ui_dk && dkn < DK_NDRIVE) ui->ui_dk = dkn++; else @@ -152,24 +153,24 @@ } /* * Now look for non-mass storage peripherals. */ for (ui = vbdinit; udp = ui->ui_driver; ui++) { - if (ui->ui_vbanum != vban && ui->ui_vbanum != '?' || + if (ui->ui_vbanum != numvba && ui->ui_vbanum != '?' || ui->ui_alive || ui->ui_slave != -1) continue; addr = (long)ui->ui_addr; reg = vbaddr(addr); if (badaddr((caddr_t)reg, 2)) continue; i = (*udp->ud_probe)(reg); if (i == 0) continue; - printf("%s%d at vba%d csr %x\n", - ui->ui_driver->ud_dname, ui->ui_unit, vban, addr); + printf("%s%d at csr 0x%x\n", + ui->ui_driver->ud_dname, ui->ui_unit, addr); ui->ui_alive = 1; - ui->ui_vbanum = vban; + ui->ui_vbanum = numvba; ui->ui_addr = (caddr_t)reg; ui->ui_physaddr = (caddr_t)IOBASE + (addr&0x0fffff); ui->ui_dk = -1; /* ui_type comes from driver */ udp->ud_dinfo[ui->ui_unit] = ui; @@ -176,11 +177,14 @@ (*udp->ud_attach)(ui); } } -#define MAXDUMP (8*1024) +#define DMMIN 32 +#define DMMAX 1024 +#define DMTEXT 1024 +#define MAXDUMP (10*2048) /* * Configure swap space and related parameters. */ swapconf() { @@ -196,6 +200,14 @@ } if (dumplo == 0 && bdevsw[major(dumpdev)].d_psize) dumplo = (*bdevsw[major(dumpdev)].d_psize)(dumpdev) - MAXDUMP; if (dumplo < 0) dumplo = 0; + if (dmmin == 0) + dmmin = DMMIN; + if (dmmax == 0) + dmmax = DMMAX; + if (dmtext == 0) + dmtext = DMTEXT; + if (dmtext > dmmax) + dmtext = dmmax; } Index: sys/tahoe/tahoe/clock.c ================================================================== --- sys/tahoe/tahoe/clock.c +++ sys/tahoe/tahoe/clock.c @@ -1,6 +1,6 @@ -/* clock.c 1.2 86/01/05 */ +/* clock.c 1.1 85/07/22 */ #include "../h/param.h" #include "../h/time.h" #include "../h/kernel.h" #include "../tahoe/clock.h" Index: sys/tahoe/tahoe/conf.c ================================================================== --- sys/tahoe/tahoe/conf.c +++ sys/tahoe/tahoe/conf.c @@ -1,13 +1,14 @@ -/* conf.c 1.2 86/01/05 */ - -#include "param.h" -#include "systm.h" -#include "buf.h" -#include "ioctl.h" -#include "tty.h" -#include "conf.h" +/* conf.c 1.3 85/04/25 */ +/* conf.c 6.1 83/07/29 */ + +#include "../h/param.h" +#include "../h/systm.h" +#include "../h/buf.h" +#include "../h/ioctl.h" +#include "../h/tty.h" +#include "../h/conf.h" int nulldev(); int nodev(); /* #include "ud.h" */ @@ -78,11 +79,11 @@ 0, 0 }, }; int nblkdev = sizeof (bdevsw) / sizeof (bdevsw[0]); int cnopen(),cnclose(),cnread(),cnwrite(),cnioctl(); -extern struct tty cons; +struct tty cons[]; #include "vx.h" #if NVX == 0 #define vxopen nodev #define vxclose nodev @@ -177,18 +178,16 @@ #define efswrite nodev #define efsioctl nodev #define efsreset nodev #endif -int logopen(),logclose(),logread(),logioctl(),logselect(); - int ttselect(), seltrue(); struct cdevsw cdevsw[] = { cnopen, cnclose, cnread, cnwrite, /*0*/ - cnioctl, nulldev, nulldev, &cons, + cnioctl, nulldev, nulldev, cons, ttselect, nodev, vxopen, vxclose, vxread, vxwrite, /*1*/ vxioctl, vxstop, vxreset, vx_tty, ttselect, nodev, syopen, nulldev, syread, sywrite, /*2*/ @@ -228,13 +227,13 @@ bstioctl, nodev, nulldev, 0, nodev, nodev, iiopen, iiclose, nulldev, nulldev, /*14*/ iiioctl, nulldev, nulldev, 0, seltrue, nodev, - logopen, logclose, logread, nodev, /*15*/ - logioctl, nodev, nulldev, 0, - logselect, nodev, + nodev, nodev, nulldev, nulldev, /*15*/ + nodev, nodev, nulldev, 0, + nodev, nodev, nodev, nodev, nulldev, nulldev, /*16*/ nodev, nodev, nulldev, 0, nodev, nodev, nodev, nodev, nulldev, nulldev, /*17*/ nodev, nodev, nulldev, 0, Index: sys/tahoe/tahoe/cons.c ================================================================== --- sys/tahoe/tahoe/cons.c +++ sys/tahoe/tahoe/cons.c @@ -1,6 +1,6 @@ -/* cons.c 1.2 86/01/05 */ +/* cons.c 1.1 85/07/21 */ /* Minor device 0 is the CP itself. /* No real read/writes can be done to him. /* Minor 1 is the console terminal. /* Minor 2 is the remote line trminal. /**/ @@ -7,96 +7,100 @@ /* * Tahoe console processor driver * */ -#include "param.h" -#include "conf.h" -#include "dir.h" -#include "ioctl.h" -#include "user.h" -#include "proc.h" -#include "tty.h" -#include "uio.h" -#include "callout.h" -#include "systm.h" - -#include "../tahoe/cp.h" -#include "../tahoe/mtpr.h" - -int cnrestart(); -int timeout(); - -struct tty cons; -struct tty CPtty; -struct tty RLtty; -struct tty *constty[3] = { &CPtty, &cons, &RLtty }; -struct consoftc { - char cs_lastc; /* last char sent */ - int cs_flags; -#define CSF_ACTIVE 0x1 /* timeout active */ -#define CSF_RETRY 0x2 /* try again at a later time */ -} consoftc[3]; +#include "../h/param.h" +#include "../h/conf.h" +#include "../h/dir.h" +#include "../h/ioctl.h" +#include "../h/user.h" +#include "../h/tty.h" +#include "../h/uio.h" +#include "../h/callout.h" +#include "../h/systm.h" +#include "../machine/cp.h" +#include "../machine/mtpr.h" + +#define FALSE 0 +#define TRUE 1 + +int cnrestart() ; +int timeout() ; + +struct tty cons[3]; /* One for each unit on CP */ +struct cons_info { + char last_one; /* Last char sent - possibly repeat + * If zero, timeout has nothing to do + */ + int active_timeout; /* There is an active timeout for this line + * Set by 'cnputc' when a timeout is initiated. + * Reset by the routine called at timeout. + */ + int try_later; /* If true, timeout has nothing to do. + * Set by 'cnputc' every time a char is sent. + * Reset by the timeout arrival. If next time + * the timeout comes it's zero, then it may + * have something to do. + */ + } cons_info[3]; struct cpdcb_o consout[3] = { - /* unit, cmd,count, buf */ - { (char)(CPTAKE | CPDONE),0, 0 }, - { (char)(CPTAKE | CPDONE),0, 0 }, - { (char)(CPTAKE | CPDONE),0, 0 } -}; + /* unit, cmd,count, buf */ + {(char)(CPTAKE | CPDONE),0, 0 }, + {(char)(CPTAKE | CPDONE),0, 0 }, + {(char)(CPTAKE | CPDONE),0, 0 } + }; struct cpdcb_i consin[3] = { - /* unit, cmd,count, buf */ - { (char)(CPTAKE | CPDONE),0, 0 }, - { (char)(CPTAKE | CPDONE),0, 0 }, - { (char)(CPTAKE | CPDONE),0, 0 } -}; + /* unit, cmd,count, buf */ + {(char)(CPTAKE | CPDONE),0, 0 }, + {(char)(CPTAKE | CPDONE),0, 0 }, + {(char)(CPTAKE | CPDONE),0, 0 } + }; struct cphdr *lasthdr; int cnstart(); int ttrstrt(); char partab[]; -/*ARGSUSED*/ cnopen(dev, flag) - dev_t dev; +dev_t dev; { register struct cpdcb_i *cin; register struct tty *tp; - int unit = minor(dev); + register int timo; - if (unit > CPREMOT) - return (EEXIST); - tp = constty[unit]; + if (minor(dev) > CPREMOT) + return EEXIST; + tp = &cons[minor(dev)]; if (tp->t_state&TS_XCLUDE && u.u_uid != 0) - return (EBUSY); + return EBUSY; if (lasthdr != (struct cphdr *)0) { - register int timo; - timo = 10000; - uncache(&lasthdr->cp_unit); - while ((lasthdr->cp_unit&CPTAKE) == 0 && --timo) - uncache(&lasthdr->cp_unit); - } - cin = &consin[unit]; - cin->cp_hdr.cp_unit = unit; - cin->cp_hdr.cp_comm = CPREAD; + uncache((char *)&lasthdr->cp_unit); + while ((lasthdr->cp_unit & CPTAKE)==0 && --timo ) + uncache((char *)&lasthdr->cp_unit); + } /* Here we give up waiting */ + cin = &consin[minor(dev)]; + cin->cp_hdr.cp_unit = (char)(minor(dev)); + cin->cp_hdr.cp_comm = (char)CPREAD; cin->cp_hdr.cp_count = 1; /* Get ready for input */ - mtpr(CPMDCB, cin); + mtpr (cin, CPMDCB); lasthdr = (struct cphdr *)cin; tp->t_oproc = cnstart; tp->t_dev = dev; if ((tp->t_state&TS_ISOPEN) == 0) { ttychars(tp); tp->t_state = TS_ISOPEN|TS_CARR_ON; tp->t_flags = EVENP|ECHO|XTABS|CRMOD; } - return ((*linesw[tp->t_line].l_open)(dev, tp)); + (*linesw[tp->t_line].l_open)(dev, tp); } cnclose(dev) - dev_t dev; +dev_t dev; { - register struct tty *tp = constty[minor(dev)]; + register struct tty *tp = &cons[minor(dev)]; (*linesw[tp->t_line].l_close)(tp); ttyclose(tp); } @@ -103,21 +107,21 @@ /*ARGSUSED*/ cnread(dev, uio) dev_t dev; struct uio *uio; { - struct tty *tp = constty[minor(dev)]; + register struct tty *tp = &cons[minor(dev)]; return ((*linesw[tp->t_line].l_read)(tp, uio)); } /*ARGSUSED*/ cnwrite(dev, uio) dev_t dev; struct uio *uio; { - struct tty *tp = constty[minor(dev)]; + register struct tty *tp = &cons[minor(dev)]; return ((*linesw[tp->t_line].l_write)(tp, uio)); } /* @@ -124,91 +128,91 @@ * Got a console receive interrupt - * the console processor wants to give us a character. * Catch the character, and see who it goes to. */ cnrint(dev) - dev_t dev; +dev_t dev; { register int c, timo; register struct tty *tp; - int unit; - if (intenable == 0) - return; - unit = minor(dev); + if (intenable == 0) return; /* make sure we dont take it from cache */ - uncache(&consin[unit].cpi_buf[0]); - c = consin[unit].cpi_buf[0]; + uncache((char *)&consin[minor(dev)].cpi_buf[0]); + c = consin[minor(dev)].cpi_buf[0]; /* /* Wait about 5 milli for last CPMDCB to be read by CP, /* otherwise give up /**/ timo = 10000; - uncache(&lasthdr->cp_unit); - while ((lasthdr->cp_unit&CPTAKE) == 0 && --timo) - uncache(&lasthdr->cp_unit); - uncache(&lasthdr->cp_unit); - if (lasthdr->cp_unit&CPTAKE) { - consin[unit].cp_hdr.cp_unit = unit; + uncache((char *)&lasthdr->cp_unit); + while ((lasthdr->cp_unit & CPTAKE)==0 && --timo ) + uncache((char *)&lasthdr->cp_unit); + uncache((char *)&lasthdr->cp_unit); + if (lasthdr->cp_unit & CPTAKE) + { + consin[minor(dev)].cp_hdr.cp_unit = (char)(minor(dev)); /* This resets status bits */ - mtpr(CPMDCB, &consin[unit]); /* Ready for new character */ - lasthdr = (struct cphdr *)&consin[unit]; - tp = constty[unit]; + mtpr (&consin[minor(dev)], CPMDCB); /* Ready for new character */ + lasthdr = (struct cphdr *)&consin[minor(dev)]; + tp = &cons[minor(dev)]; (*linesw[tp->t_line].l_rint)(c, tp); } } cnioctl(dev, cmd, addr, flag) - dev_t dev; - caddr_t addr; +dev_t dev; +caddr_t addr; { - register struct tty *tp = constty[minor(dev)]; + register struct tty *tp = &cons[minor(dev)]; register error; error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr); if (error >= 0) return error; if ((error = ttioctl(tp, cmd, addr, flag)) < 0) error = ENOTTY; - else if (cmd == TIOCSETP || cmd == TIOCSETN) + else if(cmd==TIOCSETP || cmd==TIOCSETN) cnparams(tp); - return (error); + return error; } int consintr = 1; /* * Got a console transmission interrupt - * the console processor wants another character. */ cnxint(dev) - dev_t dev; +dev_t dev; { register struct tty *tp; - register int unit; + register int line_no; - if (intenable == 0 || consintr == 0) - return; - unit = minor(dev); -#ifdef CPPERF - scope_in(unit == CPCONS ? 1 : 2); + if (intenable == 0 || consintr == 0) return; +#ifdef CPPERF + if (minor(dev)==CPCONS) scope_in(1); + else scope_in(2); #endif - tp = constty[unit]; + line_no = minor(dev); + tp = &cons[line_no]; tp->t_state &= ~TS_BUSY; - consoftc[unit].cs_lastc = (char)0; + cons_info[line_no].last_one = (char)0; if (tp->t_line) (*linesw[tp->t_line].l_start)(tp); else cnstart(tp); } cnstart(tp) - register struct tty *tp; +register struct tty *tp; { - register c, s; + register c; + register s; #ifdef CPPERF - scope_in(minor(tp->t_dev) == CPCONS ? 3 : 4); + if (minor(tp->t_dev)==CPCONS) scope_in(3); + else scope_in(4); #endif s = spl8(); if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP)) goto out; if (tp->t_outq.c_cc <= TTLOWAT(tp)) { @@ -224,116 +228,111 @@ } if (tp->t_outq.c_cc == 0) goto out; c = getc(&tp->t_outq) & 0xff; if (tp->t_flags&(RAW|LITOUT)) - cnputchar(c, tp); - else if (c <= 0177) - cnputchar((c | (partab[c]&0200))&0xff, tp); + cnputc(c,tp); + else if (c<=0177) + cnputc ((c | (partab[c]&0200))&0xff,tp); else { timeout(ttrstrt, (caddr_t)tp, (c&0177)); tp->t_state |= TS_TIMEOUT; goto out; } tp->t_state |= TS_BUSY; -out: + out: splx(s); } -cnputc(c) - char c; -{ - - if (c == '\n') - cnputchar('\r', (struct tty *)0); - cnputchar(c, (struct tty *)0); -} - /* * Print a character on console. */ -cnputchar(c,tp) - register char c; - register struct tty *tp; +cnputc(c,tp) +register char c; +register struct tty *tp; { - register timo, unit; + register timo , line_no, s; register struct cpdcb_o *current; /* tp == 0 only in system error messages */ if (tp == 0) { current = &consout[CPCONS]; - unit = CPCONS; - if (lasthdr == 0) /* not done anythig yet */ + line_no = CPCONS; + if(lasthdr == 0) /* not done anythig yet */ lasthdr = (struct cphdr *)current; c |= partab[c&0177]&0200; - } else { + } + else { current = &consout[minor(tp->t_dev)]; - unit = minor(tp->t_dev); + line_no = minor(tp->t_dev); } timo = 30000; /* * Try waiting for the console tty to come ready, * otherwise give up after a reasonable time. * make sure we dont test this bit in cache! */ - uncache(¤t->cp_hdr.cp_unit); - while ((current->cp_hdr.cp_unit&CPDONE) == 0 && --timo) - uncache(¤t->cp_hdr.cp_unit); - current->cp_hdr.cp_comm = CPWRITE; + uncache((char *)¤t->cp_hdr.cp_unit); + while ((current->cp_hdr.cp_unit & CPDONE) == 0 && --timo ) + uncache((char *)¤t->cp_hdr.cp_unit); + current->cp_hdr.cp_comm = (char)CPWRITE; current->cp_hdr.cp_count = 1; - current->cp_buf[0] = c & 0xff; + current->cp_buf[0] = (char)(c & 0xff); timo = 10000; /* * Try waiting for the console tty to come ready, * otherwise give up after a reasonable time. */ - uncache(&lasthdr->cp_unit); - while ((lasthdr->cp_unit&CPTAKE) == 0 && --timo) - uncache(&lasthdr->cp_unit); + uncache((char *)&lasthdr->cp_unit); + while ((lasthdr->cp_unit & CPTAKE)==0 && --timo ) + uncache((char *)&lasthdr->cp_unit); /* Reset done bit */ - current->cp_hdr.cp_unit = (char)unit; + current->cp_hdr.cp_unit = (char)line_no; lasthdr = (struct cphdr *)current; #ifdef CPPERF - if (intenable != 0) - scope_in(5); -#endif - consoftc[unit].cs_lastc = c; - if ((consoftc[unit].cs_flags&CSF_ACTIVE) == 0 && clk_enable) { - consoftc[unit].cs_flags |= CSF_ACTIVE; - timeout(cnrestart, (caddr_t)tp, 10); - } - consoftc[unit].cs_flags |= CSF_RETRY; /* wait some more */ - mtpr(CPMDCB, current); + if (intenable != 0) scope_in(5); +#endif + cons_info[line_no].last_one = c; + if ( !cons_info[line_no].active_timeout && clk_enable) { + cons_info[line_no].active_timeout = TRUE; + timeout (cnrestart, (caddr_t)tp, 10); + } + cons_info[line_no].try_later = TRUE; /* For timeout-means wait some more */ + mtpr (current, CPMDCB); } /* * Restart (if necessary) transfer to CP line. * This way, lost 'transmit' interrupts don't break the chain. */ -cnrestart(tp) - struct tty *tp; -{ - register struct consoftc *cs; - - cs = &consoftc[tp == 0 ? CPCONS : minor(tp->t_dev)]; - if (cs->cs_flags&CSF_RETRY) { - cs->cs_flags &= ~CSF_RETRY; - timeout(cnrestart, (caddr_t)tp, 10); - return; - } - cs->cs_flags &= ~CSF_ACTIVE; - if (cs->cs_lastc != (char)0) - cnputchar(cs->cs_lastc, tp); +cnrestart (tp) +struct tty *tp; +{ + register line_no, s; + + if (tp == 0) { + line_no = CPCONS; + } else + line_no = minor(tp->t_dev); + if (cons_info[line_no].try_later) { + cons_info[line_no].try_later = FALSE; + timeout (cnrestart, (caddr_t)tp, 10); + } + else { + cons_info[line_no].active_timeout = FALSE; + if (cons_info[line_no].last_one != (char)0) + cnputc (cons_info[line_no].last_one, tp); + } } /* * Set line parameters */ cnparams(tp) - register struct tty *tp; +register struct tty *tp; { - register timo; + register timo ; register struct cpdcb_o *current; register struct cpdcb_i *cin; current = &consout[minor(tp->t_dev)]; timo = 30000; @@ -340,39 +339,40 @@ /* * Try waiting for the console tty to come ready, * otherwise give up after a reasonable time. * make sure we dont test this bit in cache! */ - uncache(¤t->cp_hdr.cp_unit); - while ((current->cp_hdr.cp_unit&CPDONE) == 0 && --timo) - uncache(¤t->cp_hdr.cp_unit); - current->cp_hdr.cp_comm = CPSTTY; + uncache((char *)¤t->cp_hdr.cp_unit); + while ((current->cp_hdr.cp_unit & CPDONE) == 0 && --timo ) + uncache((char *)¤t->cp_hdr.cp_unit); + current->cp_hdr.cp_comm = (char)CPSTTY; current->cp_hdr.cp_count = 4; current->cp_buf[0] = tp->t_ispeed; /* the rest are defaults */ current->cp_buf[1] = 0; /* no parity */ - current->cp_buf[2] = 0; /* stop bits */ - current->cp_buf[3] = 8; /* data bits */ + current->cp_buf[2] = 0; /* stop bits */ + current->cp_buf[3] = 8; /* data bits */ timo = 10000; /* * Try waiting for the console tty to come ready, * otherwise give up after a reasonable time. */ - uncache(&lasthdr->cp_unit); - while ((lasthdr->cp_unit&CPTAKE) == 0 && --timo) - uncache(&lasthdr->cp_unit); + uncache((char *)&lasthdr->cp_unit); + while ((lasthdr->cp_unit & CPTAKE)==0 && --timo ) + uncache((char *)&lasthdr->cp_unit); /* Reset done bit */ current->cp_hdr.cp_unit = (char)minor(tp->t_dev); lasthdr = (struct cphdr *)current; - mtpr(CPMDCB, current); + mtpr (current, CPMDCB); timo = 10000; - uncache(&lasthdr->cp_unit); - while ((lasthdr->cp_unit&CPTAKE) == 0 && --timo) - uncache(&lasthdr->cp_unit); + uncache((char *)&lasthdr->cp_unit); + while ((lasthdr->cp_unit & CPTAKE)==0 && --timo ) + uncache((char *)&lasthdr->cp_unit); cin = &consin[minor(tp->t_dev)]; - cin->cp_hdr.cp_unit = minor(tp->t_dev); - cin->cp_hdr.cp_comm = CPREAD; + cin->cp_hdr.cp_unit = (char)(minor(tp->t_dev)); + cin->cp_hdr.cp_comm = (char)CPREAD; cin->cp_hdr.cp_count = 1; /* Get ready for input */ - mtpr(CPMDCB, cin); + mtpr (cin, CPMDCB); lasthdr = (struct cphdr *)cin; + } DELETED sys/tahoe/tahoe/cp.h Index: sys/tahoe/tahoe/cp.h ================================================================== --- sys/tahoe/tahoe/cp.h +++ sys/tahoe/tahoe/cp.h @@ -1,47 +0,0 @@ -/* cp.h 1.1 86/01/05 */ -/* Console Processor Interface */ -/* Tahoe version, Nov. 1982 */ - -/****************************************/ -/* */ -/* Reduced DCB layout for byte */ -/* communication. */ -/* */ -/****************************************/ - -#define CPBUFLEN 200 /* Output buffer length */ -#ifndef LOCORE -struct cphdr -{ - char cp_unit; /* Done bit & unit # */ - char cp_comm; /* Command */ - short cp_count; /* Counter (when relevant) */ -}; - -struct cpdcb_o /* Output structure */ -{ - struct cphdr cp_hdr; - char cp_buf[CPBUFLEN]; /* Buffer for output or 'stty' */ -}; - -struct cpdcb_i /* Structure for input */ -{ - struct cphdr cp_hdr; - char cpi_buf[4]; /* Buffer for input */ -}; -#endif - -#define CPDONE 0x80 /* 'Done' bit in cp_unit */ -#define CPTAKE 0x40 /* CP 'ack' to this cpdcb */ - - /* Values for 'unit' */ -#define CPUNIT 0 /* The CP itself */ -#define CPCONS 1 /* Console line */ -#define CPREMOT 2 /* Remote line */ - - /* Values for 'command' */ -#define CPRESET 0 -#define CPWRITE 1 -#define CPREAD 2 -#define CPSTTY 3 -#define CPBOOT 4 DELETED sys/tahoe/tahoe/genassym.c Index: sys/tahoe/tahoe/genassym.c ================================================================== --- sys/tahoe/tahoe/genassym.c +++ sys/tahoe/tahoe/genassym.c @@ -1,96 +0,0 @@ -#ifndef lint -static char sccsid[] = "@(#)genassym.c 1.2 (Berkeley) 01/05/86"; -#endif - -#include "../tahoe/pte.h" - -#include "param.h" -#include "vmmeter.h" -#include "vmparam.h" -#include "buf.h" -#include "dir.h" -#include "user.h" -#include "cmap.h" -#include "map.h" -#include "proc.h" -#include "text.h" -#include "mbuf.h" -#include "msgbuf.h" - -main() -{ - register struct user *u = (struct user *)0; - register struct proc *p = (struct proc *)0; - register struct vmmeter *vm = (struct vmmeter *)0; - register struct pcb *pcb = (struct pcb *)0; - - printf("#ifdef LOCORE\n"); - printf("#define\tU_PROCP %d\n", &u->u_procp); - printf("#define\tP_LINK %d\n", &p->p_link); - printf("#define\tP_RLINK %d\n", &p->p_rlink); - printf("#define\tP_XLINK %d\n", &p->p_xlink); - printf("#define\tP_ADDR %d\n", &p->p_addr); - printf("#define\tP_PRI %d\n", &p->p_pri); - printf("#define\tP_STAT %d\n", &p->p_stat); - printf("#define\tP_WCHAN %d\n", &p->p_wchan); - printf("#define\tP_TSIZE %d\n", &p->p_tsize); - printf("#define\tP_SSIZE %d\n", &p->p_ssize); - printf("#define\tP_P0BR %d\n", &p->p_p0br); - printf("#define\tP_SZPT %d\n", &p->p_szpt); - printf("#define\tP_TEXTP %d\n", &p->p_textp); - printf("#define\tP_FLAG %d\n", &p->p_flag); - printf("#define\tP_DKEY %d\n", &p->p_dkey); - printf("#define\tP_CKEY %d\n", &p->p_ckey); - printf("#define\tSSLEEP %d\n", SSLEEP); - printf("#define\tSRUN %d\n", SRUN); - printf("#define\tV_SWTCH %d\n", &vm->v_swtch); - printf("#define\tV_TRAP %d\n", &vm->v_trap); - printf("#define\tV_SYSCALL %d\n", &vm->v_syscall); - printf("#define\tV_INTR %d\n", &vm->v_intr); - printf("#define\tNBPG %d\n", NBPG); - printf("#define\tPGSHIFT %d\n", PGSHIFT); - printf("#define\tUPAGES %d\n", UPAGES); - printf("#define\tCLSIZE %d\n", CLSIZE); - printf("#define\tSYSPTSIZE %d\n", SYSPTSIZE); - printf("#define\tUSRPTSIZE %d\n", USRPTSIZE); - printf("#define\tIOSIZE %d\n", IOSIZE); - printf("#define\tMAXBPTE %d\n", MAXBPTE); - printf("#define\tTBUFSIZ %d\n", TBUFSIZ); - printf("#define\tACEBPTE %d\n", ACEBPTE); - printf("#define\tMSGBUFPTECNT %d\n", btoc(sizeof (struct msgbuf))); - printf("#define\tNMBCLUSTERS %d\n", NMBCLUSTERS); - printf("#define\tPCB_KSP %d\n", &pcb->pcb_ksp); - printf("#define\tPCB_USP %d\n", &pcb->pcb_usp); - printf("#define\tPCB_R0 %d\n", &pcb->pcb_r0); - printf("#define\tPCB_R1 %d\n", &pcb->pcb_r1); - printf("#define\tPCB_R2 %d\n", &pcb->pcb_r2); - printf("#define\tPCB_R3 %d\n", &pcb->pcb_r3); - printf("#define\tPCB_R4 %d\n", &pcb->pcb_r4); - printf("#define\tPCB_R5 %d\n", &pcb->pcb_r5); - printf("#define\tPCB_R6 %d\n", &pcb->pcb_r6); - printf("#define\tPCB_R7 %d\n", &pcb->pcb_r7); - printf("#define\tPCB_R8 %d\n", &pcb->pcb_r8); - printf("#define\tPCB_R9 %d\n", &pcb->pcb_r9); - printf("#define\tPCB_R10 %d\n", &pcb->pcb_r10); - printf("#define\tPCB_R11 %d\n", &pcb->pcb_r11); - printf("#define\tPCB_R12 %d\n", &pcb->pcb_r12); - printf("#define\tPCB_R13 %d\n", &pcb->pcb_r13); - printf("#define\tPCB_FP %d\n", &pcb->pcb_fp); - printf("#define\tPCB_PC %d\n", &pcb->pcb_pc); - printf("#define\tPCB_PSL %d\n", &pcb->pcb_psl); - printf("#define\tPCB_P0BR %d\n", &pcb->pcb_p0br); - printf("#define\tPCB_P0LR %d\n", &pcb->pcb_p0lr); - printf("#define\tPCB_P1BR %d\n", &pcb->pcb_p1br); - printf("#define\tPCB_P1LR %d\n", &pcb->pcb_p1lr); - printf("#define\tPCB_P2BR %d\n", &pcb->pcb_p2br); - printf("#define\tPCB_P2LR %d\n", &pcb->pcb_p2lr); - printf("#define\tPCB_ACH %d\n", &pcb->pcb_ach); - printf("#define\tPCB_ACL %d\n", &pcb->pcb_acl); - printf("#define\tPCB_HFS %d\n", &pcb->pcb_hfs); - printf("#define\tPCB_SAVACC %d\n", &pcb->pcb_savacc); - printf("#define\tPCB_SZPT %d\n", &pcb->pcb_szpt); - printf("#define\tPCB_CMAP2 %d\n", &pcb->pcb_cmap2); - printf("#define\tPCB_SSWAP %d\n", &pcb->pcb_sswap); - printf("#define\tPCB_SIGC %d\n", pcb->pcb_sigc); - printf("#endif\n"); -} Index: sys/tahoe/tahoe/in_cksum.c ================================================================== --- sys/tahoe/tahoe/in_cksum.c +++ sys/tahoe/tahoe/in_cksum.c @@ -1,12 +1,13 @@ -/* in_cksum.c 1.2 86/01/05 */ +/* in_cksum.c 6.1 83/07/29 */ #include "../h/types.h" #include "../h/mbuf.h" #include "../netinet/in.h" #include "../netinet/in_systm.h" +#if defined(tahoe) /* * Checksum routine for Internet Protocol family headers. * * This routine is very heavily used in the network * code and should be modified for each CPU to be as fast as possible. @@ -32,12 +33,15 @@ register u_short *w; register int sum = 0; register int mlen = 0; for (;m && len; m = m->m_next) { - if (m->m_len == 0) + + if (m->m_len == 0) { continue; + } + w = mtod(m, u_short *); if (mlen == -1) { /* * The first byte of this mbuf is the continuation * of a word spanning between this mbuf and the @@ -48,10 +52,11 @@ * mbuf. */ u.c[1] = *(u_char *)w; sum += u.s; ADDCARRY(sum); + w = (u_short *)((char *)w + 1); mlen = m->m_len - 1; len--; } else mlen = m->m_len; @@ -62,28 +67,32 @@ /* * add by words. */ while ((mlen -= 2) >= 0) { + if ((int)w & 0x1) { /* word is not aligned */ u.c[0] = *(char *)w; u.c[1] = *((char *)w+1); sum += u.s; w++; - } else + } + else { sum += *w++; + } ADDCARRY(sum); } - if (mlen == -1) + if (mlen == -1) { /* * This mbuf has odd number of bytes. * There could be a word split betwen * this mbuf and the next mbuf. * Save the last byte (to prepend to next mbuf). */ u.c[0] = *(u_char *)w; + } } if (len) printf("cksum: out of data\n"); if (mlen == -1) { /* The last mbuf has odd # of bytes. Follow the @@ -90,7 +99,136 @@ standard (the odd byte is shifted left by 8 bits) */ u.c[1] = 0; sum += u.s; ADDCARRY(sum); } +done: return (~sum & 0xffff); } +#endif + +#if defined(vax) + +/* + * Checksum routine for Internet Protocol family headers (VAX Version). + * + * This routine is very heavily used in the network + * code and should be modified for each CPU to be as fast as possible. + */ + +in_cksum(m, len) + register struct mbuf *m; + register int len; +{ + register u_short *w; /* on Tahoe, known to be r10 */ + register int sum = 0; /* on Tahoe, known to be r9 */ + register int mlen = 0; + + for (;;) { + /* + * Each trip around loop adds in + * word from one mbuf segment. + */ + w = mtod(m, u_short *); + if (mlen == -1) { + /* + * There is a byte left from the last segment; + * add it into the checksum. Don't have to worry + * about a carry-out here because we make sure + * that high part of (32 bit) sum is small below. + */ + sum += *(u_char *)w << 8; + w = (u_short *)((char *)w + 1); + mlen = m->m_len - 1; + len--; + } else + mlen = m->m_len; + m = m->m_next; + if (len < mlen) + mlen = len; + len -= mlen; + /* + * Force to long boundary so we do longword aligned + * memory operations. + */ + if (((int)w&0x1) && mlen >= 1) { + sum += *(u_char *)w++; + mlen -= 1; + } + if (((int)w&0x2) && mlen >= 2) { + sum += *w++; + mlen -= 2; + } + /* + * Do as much of the checksum as possible 32 bits at at time. + * In fact, this loop is unrolled to make overhead from + * branches &c small. + * + * We can do a 16 bit ones complement sum 32 bits at a time + * because the 32 bit register is acting as two 16 bit + * registers for adding, with carries from the low added + * into the high (by normal carry-chaining) and carries + * from the high carried into the low on the next word + * by use of the adwc instruction. This lets us run + * this loop at almost memory speed. + * + * Here there is the danger of high order carry out, and + * we carefully use adwc. + */ + while ((mlen -= 32) >= 0) { +#undef ADD + asm("clrl r0"); /* clears carry */ +#define ADD asm("adwc (r10),r9;addl2 $4,r10; "); + ADD; ADD; ADD; ADD; ADD; ADD; ADD; ADD; + asm("adwc $0,r9"); + } + mlen += 32; + while ((mlen -= 8) >= 0) { + asm("clrl r0"); + ADD; ADD; + asm("adwc $0,r9"); + } + mlen += 8; + /* + * Now eliminate the possibility of carry-out's by + * folding back to a 16 bit number (adding high and + * low parts together.) Then mop up trailing words + * and maybe an odd byte. + */ + { asm("shal $-16,r9,r0; addw2 r0,r9"); + asm("adwc $0,r9; movzwl r9,r9"); } + while ((mlen -= 2) >= 0) { + asm("movzwl (r10),r0;addl2 $4,r10; addl2 r0,r9"); + } + if (mlen == -1) { + sum += *(u_char *)w; + } + if (len == 0) + break; + /* + * Locate the next block with some data. + * If there is a word split across a boundary we + * will wrap to the top with mlen == -1 and + * then add it in shifted appropriately. + */ + for (;;) { + if (m == 0) { + printf("cksum: out of data\n"); + goto done; + } + if (m->m_len) + break; + m = m->m_next; + } + } +done: + /* + * Add together high and low parts of sum + * and carry to get cksum. + * Have to be careful to not drop the last + * carry here. + */ + { asm("shal $-16,r9,r0; addw2 r0,r9; adwc $0,r9"); + asm("mcoml r9,r9; movzwl r9,r9"); } + return (sum); +} +#endif Index: sys/tahoe/tahoe/locore.s ================================================================== --- sys/tahoe/tahoe/locore.s +++ sys/tahoe/tahoe/locore.s @@ -1,23 +1,24 @@ -/* locore.s 1.2 86/01/05 */ +/* locore.s 1.7 85/05/15 */ #include "../tahoe/mtpr.h" #include "../tahoe/trap.h" #include "../tahoe/psl.h" #include "../tahoe/pte.h" #include "../tahoe/cp.h" #include "../tahoe/mem.h" -#include "../tahoe/SYS.h" -#include "../tahoemath/fp.h" +#include "../tahoe/fp.h" -#include "errno.h" -#include "syscall.h" -#include "cmap.h" +#include "../h/errno.h" .set HIGH,0x1f # mask for total disable .set BERVEC,0x80 # offset into scb of the bus error vector .set RESTVEC,0x8 # offset into scb of the restart vector + .set MAXPHYSMEM,8*1024*1024-1 # max physical memory + # while we work on CMD/32M ! + # look at vmsched.c to see why. + .set MEMUNIT,64*1024 # minimum memory increment .set NISP,3 # number of interrupt stack pages .set SYSTEM,0xC0000000 # virtual address of system start .set PPAGES,0x100000 # Number of possible pages in P0,P1, etc. @@ -31,17 +32,17 @@ #define _ACBL(_limit,_add,_index,_displ) \ addl2 _add,_index; \ cmpl _index,_limit; \ bgeq _displ -#define MOVC3(_srcaddr,_dstaddr,_len) \ +#define MOVC3(_len,_srcaddr,_dstaddr) \ movl _srcaddr,r0; \ movl _dstaddr,r1; \ movl _len,r2; \ movblk -/* keep address of psl if coming from user mode */ +/* Keep address of psl if coming from user mode */ #define CHECK_SFE(_delta) \ bitl $PSL_CURMOD,_delta(sp); \ jeql 1f; \ moval _delta(sp),_user_psl; \ 1: @@ -55,111 +56,62 @@ /* * Restart stack. Used on power recovery or panic. * Takes a core-dump and then halts. */ .globl _rsstk + +_rsstk: .space 1024-8 .globl pwfl_stk -_rsstk: - .space 1024-8 -pwfl_stk: - .space 4 -dumpflag: - .space 4 +pwfl_stk: .space 4 +dumpflag: .space 4 .globl _intstack _intstack: .space NISP*NBPG eintstack: -/* - * Power failure storage block and - * macros for saving and restoring. - */ -#define POWERFAIL(id,longs) \ - .globl pwfl_/**/id \ -pwfl_/**/id: .space longs*4 .data - POWERFAIL(r0, 14) # r0-r13 - POWERFAIL(sp, 1) # r14 - POWERFAIL(SCBB, 1) # system control block base - POWERFAIL(SBR, 1) # system pte base - POWERFAIL(SLR, 1) # system pte length - POWERFAIL(P0BR, 1) # p0 pte base - POWERFAIL(P0LR, 1) # p0 pte length - POWERFAIL(P1BR, 1) # p1 pte base - POWERFAIL(P1LR, 1) # p1 pte length - POWERFAIL(P2BR, 1) # p2 pte base - POWERFAIL(P2LR, 1) # p2 pte length - POWERFAIL(IPL, 1) # interrupt priority level - POWERFAIL(DCK, 1) # data cache key - POWERFAIL(CCK, 1) # code cache key - POWERFAIL(PCBB, 1) # process control block base - POWERFAIL(ISP, 1) # interrupt stack pointer - POWERFAIL(KSP, 1) # kernel mode stack pointer - POWERFAIL(USP, 1) # user mode stack pointer - POWERFAIL(MME, 1) # memory management enable - POWERFAIL(PSL, 1) # processor status longword - -/* - * Save current state in power fail storage block. - */ -#define SAVEpwfl() \ - movpsl pwfl_PSL # Keeps all flags, etc. \ - storer $0x3fff,pwfl_r0 # Saves r0-r13 \ - moval 0(sp),pwfl_sp # Saves sp (=r14) \ - mfpr $SBR,pwfl_SBR # Save all re_loadable registers \ - mfpr $SLR,pwfl_SLR \ - mfpr $P0BR,pwfl_P0BR \ - mfpr $P0LR,pwfl_P0LR \ - mfpr $P1BR,pwfl_P1BR \ - mfpr $P1LR,pwfl_P1LR \ - mfpr $P2BR,pwfl_P2BR \ - mfpr $P2LR,pwfl_P2LR \ - mfpr $IPL,pwfl_IPL \ - mfpr $MME,pwfl_MME \ - mfpr $DCK,pwfl_DCK \ - mfpr $CCK,pwfl_CCK \ - mfpr $PCBB,pwfl_PCBB \ - mfpr $ISP,pwfl_ISP \ - mfpr $SCBB,pwfl_SCBB \ - mfpr $KSP,pwfl_KSP \ - mfpr $USP,pwfl_USP - -/* - * Restore state saved in power fail block and - * jmp to location specified after (possibly) - * enabling memory management. - */ -#define RESTOREpwfl(loc) \ - loadr $0x3fff,pwfl_r0 # Restore r0-r13 \ - movl pwfl_sp,sp # Restore sp (=r14) \ - mtpr pwfl_SCBB,$SCBB \ - mtpr pwfl_SBR,$SBR # Restore all re_loadable registers \ - mtpr pwfl_SLR,$SLR \ - mtpr pwfl_P0BR,$P0BR \ - mtpr pwfl_P0LR,$P0LR \ - mtpr pwfl_P1BR,$P1BR \ - mtpr pwfl_P1LR,$P1LR \ - mtpr pwfl_P2BR,$P2BR \ - mtpr pwfl_P2LR,$P2LR \ - mtpr pwfl_IPL,$IPL \ - mtpr pwfl_DCK,$DCK \ - mtpr pwfl_CCK,$CCK \ - mtpr pwfl_PCBB,$PCBB \ - mtpr pwfl_ISP,$ISP \ - mtpr pwfl_KSP,$KSP \ - mtpr pwfl_USP,$USP \ -\ - bicpsw $0xff # Restore PSW. \ - bispsw pwfl_PSL+2 # Set original bits back (just in case..) \ -# now go to mapped mode \ -# Have to change PC to system addresses \ - mtpr $1,$PACC # Thoroughly clean up caches. \ - mtpr $1,$PADC \ - mtpr $1,$TBIA \ - mtpr pwfl_MME,$MME # Restore MME. Last thing to be done. \ - jmp loc + .globl pwfl_r0 +pwfl_r0: .space 14*4 # Enough for r0 - r13 + .globl pwfl_sp +pwfl_sp: .long 0x12345678 # r14 + .globl pwfl_SCBB +pwfl_SCBB: .long 0x12345678 + .globl pwfl_SBR +pwfl_SBR: .long 0x12345678 + .globl pwfl_SLR +pwfl_SLR: .long 0x12345678 + .globl pwfl_P0BR +pwfl_P0BR: .long 0x12345678 + .globl pwfl_P0LR +pwfl_P0LR: .long 0x12345678 + .globl pwfl_P1BR +pwfl_P1BR: .long 0x12345678 + .globl pwfl_P1LR +pwfl_P1LR: .long 0x12345678 + .globl pwfl_P2BR +pwfl_P2BR: .long 0x12345678 + .globl pwfl_P2LR +pwfl_P2LR: .long 0x12345678 + .globl pwfl_IPL +pwfl_IPL: .long 0x12345678 + .globl pwfl_DCK +pwfl_DCK: .long 0x12345678 + .globl pwfl_CCK +pwfl_CCK: .long 0x12345678 + .globl pwfl_PCBB +pwfl_PCBB: .long 0x12345678 + .globl pwfl_ISP +pwfl_ISP: .long 0x12345678 + .globl pwfl_KSP +pwfl_KSP: .long 0x12345678 + .globl pwfl_USP +pwfl_USP: .long 0x12345678 + .globl pwfl_MME +pwfl_MME: .long 0x12345678 + .globl pwfl_PSL +pwfl_PSL: .long 0x12345678 /* * Do a dump. * Called by auto-restart. * May be called manually. @@ -166,17 +118,46 @@ */ .align 2 .text .globl _Xdoadump .globl _doadump -_Xdoadump: # CP comes here after power fail - RESTOREpwfl(*0f) # restore state +_Xdoadump: # CP brings Tahoe here on power recovery + loadr $0x3fff,pwfl_r0 # Restore r0 - r13 + movl pwfl_sp,sp # Restore sp ( = r14 ) + mtpr pwfl_SCBB,$SCBB + mtpr pwfl_SBR,$SBR # Restore all re_loadable registers + mtpr pwfl_SLR,$SLR + mtpr pwfl_P0BR,$P0BR + mtpr pwfl_P0LR,$P0LR + mtpr pwfl_P1BR,$P1BR + mtpr pwfl_P1LR,$P1LR + mtpr pwfl_P2BR,$P2BR + mtpr pwfl_P2LR,$P2LR + mtpr pwfl_IPL,$IPL + mtpr pwfl_DCK,$DCK + mtpr pwfl_CCK,$CCK + mtpr pwfl_PCBB,$PCBB + mtpr pwfl_ISP,$ISP + mtpr pwfl_KSP,$KSP + mtpr pwfl_USP,$USP + + bicpsw $0xff # Restore PSW. + bispsw pwfl_PSL+2 # Set original bits back (just in case..) +/* now go to mapped mode */ +/* Have to change PC to system addresses */ + mtpr $1,$PACC # Thoroughly clean up caches. + mtpr $1,$PADC + mtpr $1,$TBIA + mtpr pwfl_MME,$MME # Restore MME. Last thing to be done. + jmp *$0f _doadump: .word 0 -0: mtpr $HIGH,$IPL -#define _rsstkmap _Sysmap+12 # powerfail storage, scb, rsstk, int stack - andl2 $~PG_PROT,_rsstkmap +#define _rsstkmap _Sysmap+12 + # Tahoe storage, scb, rsstk, interrupt stack +0: + mtpr $HIGH,$IPL + andl2 $0!PG_PROT,_rsstkmap orl2 $PG_KW,_rsstkmap # Make dump stack r/w tstl dumpflag # dump only once! bneq 1f movl $1,dumpflag mtpr $0,$TBIA @@ -187,157 +168,136 @@ /* * Interrupt vector routines */ .globl _waittime + #define SCBVEC(name) \ .align 2; \ .globl _X/**/name; \ _X/**/name -#define PANIC(msg) \ - clrl _waittime; pushab 1f; callf $8,_panic; 1: .asciz msg -#define PRINTF(n,msg) \ - pushab 1f; callf $(n+2)*4,_printf; MSG(msg) -#define MSG(msg) .data; 1: .asciz msg; .text -/* - * r0-r2 are saved across all faults and interrupts. - * Routines below and those hidden in ubglue.s (device - * interrupts) invoke the PUSHR/POPR macros to execute - * this. Also, certain stack frame offset calculations - * (such as in hardclock) understand this, using the - * REGSPC definition (and FPSPC defined below). - * Finally, many routines, including those expanded - * inline depend on this! Should probably save all - * live C compiler temp registers to eliminate potentially - * grievous problems caused by incorrect register save masks. - */ -#define REGSPC (3*4) -#define PUSHR pushl r0; pushl r1; pushl r2; -#define POPR movl (sp)+,r2; movl (sp)+,r1; movl (sp)+,r0; - -/* - * Floating point state is saved across faults and - * interrupts. The state occupies 4 longwords on - * the stack: - * precision indicator (single = 0/double = 1) - * double representation of accumulator - * save accumulator status flag (pcb_savacc) - */ -#define FPSPC (4*4) - -#define SAVE_FPSTAT(_delta) \ - bitl $PSL_DBL,_delta(sp); \ - beql 1f; \ - pushl $1; \ - pushd; \ - jmp 2f; \ -1: pushl $0; \ - pushl $0; \ - stf -(sp); \ -2: tstl _u+PCB_SAVACC; \ - bneq 3f; \ - moval 0(sp),_u+PCB_SAVACC; \ - orl2 $2,8(sp);\ -3: pushl $0; - -#define REST_FPSTAT \ - tstl (sp)+; \ - bitl $2,8(sp);\ - beql 1f;\ - movl $0,_u+PCB_SAVACC; \ -1: bitl $1,8(sp); \ - beql 2f; \ - ldd (sp); \ - jmp 3f; \ -2: ldf (sp); \ -3: moval 12(sp),sp; - -#define REST_ACC \ - tstl _u+PCB_SAVACC; \ - beql 2f; \ - movl _u+PCB_SAVACC,r1; \ - andl3 $(EXPMASK|SIGNBIT),(r1),-(sp); \ - cmpl $0x80000000,(sp)+; \ - bneq 3f; \ - clrl (r1); \ -3: bitl $1,8(r1); \ - beql 1f; \ - ldd (r1); \ - jmp 2f; \ -1: ldf (r1); \ -2: ; - - .data -nofault: .space 4 # bus error non-local goto label - - .text +#define PANIC(msg) clrl _waittime; pushab 1f; \ + callf $8,_panic; 1: .asciz msg +#define PRINTF(n,msg) pushab 1f; callf $(n+2)*4,_printf; MSG(msg) +#define MSG(msg) .data; 1: .asciz msg; .text + + # these registers are not restored by the C-compiler. +#define PUSHR pushl r0; pushl r1; +#define POPR movl (sp)+, r1; movl (sp)+, r0; + # mask for error code on stack. + +#define SAVE_FPSTAT(_delta) bitl $PSL_DBL,_delta(sp); \ + beql 1f; \ + pushl $1; \ + pushd; \ + jmp 2f; \ + 1: pushl $0; \ + pushl $0; \ + stf -(sp); \ + 2: tstl _u+PCB_SAVACC; \ + bneq 3f; \ + moval 0(sp),_u+PCB_SAVACC; \ + orl2 $2,8(sp);\ + 3: pushl $0; + +#define REST_FPSTAT tstl (sp)+; \ + bitl $2,8(sp);\ + beql 1f;\ + movl $0,_u+PCB_SAVACC; \ + 1: bitl $1,8(sp); \ + beql 2f; \ + ldd (sp); \ + jmp 3f; \ + 2: ldf (sp); \ + 3: moval 12(sp),sp; + +#define REST_ACC tstl _u+PCB_SAVACC; \ + beql 2f; \ + movl _u+PCB_SAVACC,r1; \ + andl3 $(EXPMASK|SIGNBIT),(r1),-(sp); \ + cmpl $0x80000000,(sp)+; \ + bneq 3f; \ + clrl (r1); \ + 3: bitl $1,8(r1); \ + beql 1f; \ + ldd (r1); \ + jmp 2f; \ + 1: ldf (r1); \ + 2: ; + +#define PUSHBPAR pushab 6*4(sp) /* Push address of buserr paramters */ +#define BPAR1 28 /* Offset to first hardware parameter */ + SCBVEC(buserr): CHECK_SFE(12) - SAVE_FPSTAT(12) - pushl r0 # must save - andl3 24(sp),$ERRCD,r0 # grab pushed MER value - cmpl r0,$APE # address parity error? + SAVE_FPSTAT(12); + PUSHR + andl3 BPAR1(sp),$ERRCD,r0 + jeql go_on + cmpl r0,$APE jneq 1f - halt -1: cmpl r0,$VBE # versabus error? - jneq 2f - halt -2: - movl (sp)+,r0 # restore r0 and... - bitl $PSL_CURMOD,4*4+3*4(sp) # check if happened in user mode? - jeql 3f # yes, then shift stack up for trap... - movl 12(sp),16(sp) # sorry, no space for which-buss... - movl 8(sp),12(sp) - movl 4(sp),8(sp) - movl 0(sp),4(sp) - movl $T_BUSERR,0(sp) # push trap type code and... - jbr alltraps # ...merge with all other traps -3: # kernel mode, check to see if... - tstl nofault # ...doing peek/poke? - jeql 4f # nofault set? if so, jump to it... - movl nofault,4*4+2*4(sp) # ...setup for non-local goto - clrl nofault - jbr 5f -4: - PUSHR - pushab 7*4(sp) # address of bus error parameters + halt # Address parity error !!! +1: cmpl r0,$VBE + jneq go_on + halt # Versabus error !!! +go_on: + PUSHBPAR # Pointer to parameters callf $8,_buserror POPR -5: - REST_FPSTAT - movab 8(sp),sp # remove bus error parameters + REST_FPSTAT; + movab 8(sp),sp # Remove hardware parameters rei -SCBVEC(powfail): # We should be on interrupt stack now. - SAVEpwfl() # save machine state +SCBVEC(powfail): # We should be on interrupt stack now. + movpsl pwfl_PSL # Keeps all flags, etc. + storer $0x3fff,pwfl_r0 # Saves r0 - r13 + moval 0(sp),pwfl_sp # Saves sp ( = r14 ) + mfpr $SBR,pwfl_SBR # Save all re_loadable registers + mfpr $SLR,pwfl_SLR + mfpr $P0BR,pwfl_P0BR + mfpr $P0LR,pwfl_P0LR + mfpr $P1BR,pwfl_P1BR + mfpr $P1LR,pwfl_P1LR + mfpr $P2BR,pwfl_P2BR + mfpr $P2LR,pwfl_P2LR + mfpr $IPL,pwfl_IPL + mfpr $MME,pwfl_MME + mfpr $DCK,pwfl_DCK + mfpr $CCK,pwfl_CCK + mfpr $PCBB,pwfl_PCBB + mfpr $ISP,pwfl_ISP + mfpr $SCBB,pwfl_SCBB + mfpr $KSP,pwfl_KSP + mfpr $USP,pwfl_USP moval _Xdoadump-SYSTEM,_scb+RESTVEC halt SCBVEC(stray): - PUSHR; PRINTF(0, "stray interrupt\n"); POPR; + PUSHR; PRINTF(0, "******* Undefined interrupt *******\n"); POPR; rei #include "../net/netisr.h" .globl _netisr SCBVEC(netintr): CHECK_SFE(4) SAVE_FPSTAT(4) PUSHR + bbc $NETISR_RAW,_netisr,1f - andl2 $~(1< for rei */ +/* :-->| Last PC |/ */ +/* | +---------------+ */ +/* :___|__* SP |\ */ +/* +---------------+ | */ +/* | sigmask | | */ +/* +---------------+ > cleaned by kcall $139 (sigcleanup) */ +/* :-->| u.u_onstack | | */ +/* | +---------------+ | */ +/* :___|_* copy of SCP |/ */ +/* | +---------------+ */ +/* | | Process' r0 | */ +/* | +---------------+ */ +/* | | Process' r1 | */ +/* | +---------------+ */ +/* | | Handler addr. |\ */ +/* | +---------------+ | */ +/* :___|_* SCP | | */ +/* +---------------+ > cleaned by ret from calls */ +/* | u.u_code | | */ +/* +---------------+ | */ +/* | signal number|/ */ +/* +---------------+ */ +/* */ +/* * Stack when entering sigcode; setup by sendsig(); */ +/* */ + .align 2 +sigcode: # When the process executes this code + # (located in its u. structure), it + # is in user mode ! + calls $4*4+4,*12(sp) # 4 words popped from stack when this call returns + movl (sp)+,r1 + movl (sp)+,r0 + kcall $139 # Signal cleanup + rei # From user mode to user mode ! /* * Primitives */ @@ -774,117 +777,105 @@ * badaddr(addr, len) * see if access addr with a len type instruction causes a machine check * len is length of access (1=byte, 2=short, 4=long) * r0 = 0 means good(exists); r0 =1 means does not exist. */ -ENTRY(badaddr, R3|R4) + .globl _badaddr +_badaddr: + .word 0x1c # Keep r4,r3,r2 mfpr $IPL,r1 mtpr $HIGH,$IPL movl _scb+BERVEC,r2 movl 4(fp),r3 movl 8(fp),r4 movab 9f,_scb+BERVEC bbc $0,r4,1f; tstb (r3) 1: bbc $1,r4,1f; tstw (r3) 1: bbc $2,r4,1f; tstl (r3) -1: clrl r0 +1: clrl r0 # made it w/o machine checks 2: movl r2,_scb+BERVEC mtpr r1,$IPL ret .align 2 -9: # catch buss error (if it comes) +9: # Here we catch buss error (if it comes) andl3 4(sp),$ERRCD,r0 cmpl r0,$APE jneq 1f - halt # address parity error + halt # Address parity error !!! 1: cmpl r0,$VBE jneq 1f halt # Versabus error 1: movl $1,r0 # Anything else = bad address movab 8(sp),sp # discard buss error trash movab 2b,(sp) # new program counter on stack. rei + /* * badcyaddr(addr) * see if access tape master controller addr causes a bus error * r0 = 0: no error; r0 = 1: timeout error. */ -ENTRY(badcyaddr, 0) + .globl _badcyaddr +_badcyaddr: + .word 0x0c # Keep r3,r2 mfpr $IPL,r1 mtpr $HIGH,$IPL - clrl r2 - movab 2f,nofault + movl _scb+BERVEC,r2 + clrl r3 + movab 9f,_scb+BERVEC movob $-1, *4(fp) -1: aobleq $1000, r2, 1b - clrl nofault # made it w/o bus error - clrl r0 - jbr 3f -2: movl $1,r0 -3: mtpr r1,$IPL - ret - -/* - * peek(addr) - * fetch word and catch any bus error - */ -ENTRY(peek, 0) - mfpr $IPL,r1 - mtpr $0x18,$IPL # not reentrant - movl 4(fp),r2 - movab 1f,nofault - movw (r2),r0 - clrl nofault - andl2 $0xffff,r0 - jbr 2f -1: movl $-1,r0 # bus error -2: mtpr r1,$IPL - ret - -/* - * poke(addr, val) - * write word and catch any bus error - */ -ENTRY(poke, R3) - mfpr $IPL,r1 - mtpr $0x18,$IPL # not reentrant - movl 4(fp),r2 - movl 8(fp),r3 - clrl r0 - movab 1f,nofault - movw r3,(r2) - clrl nofault - jbr 2f -1: movl $-1,r0 # bus error -2: mtpr r1,$IPL - ret - -/* - * Copy a potentially overlapping block of memory. - * - * ovbcopy(src, dst, count) - * caddr_t src, dst; unsigned count; - */ -ENTRY(ovbcopy, R3|R4) +1: aobleq $1000, r3, 1b + clrl r0 # made it w/o machine checks +2: movl r2,_scb+BERVEC + mtpr r1,$IPL + ret + + .align 2 +9: # Here we catch buss error (if it comes) + andl3 4(sp),$ERRCD,r0 + cmpl r0,$APE + jneq 1f + halt # Address parity error !!! +1: cmpl r0,$VBE + jneq 1f + halt # Versabus error +1: + movl $1,r0 # Anything else = timeout + movab 8(sp),sp # discard buss error trash + movab 2b,(sp) # new program counter on stack. + rei + +_bcopy: .globl _bcopy + .word 0x4 # save r2 + # Called by ovbcopy(from,dst,len) + movl 4(fp),r0 + movl 8(fp),r1 + movl 12(fp),r2 + movblk + ret + +_ovbcopy: .globl _ovbcopy + .word 0x001c movl 4(fp),r0 movl 8(fp),r1 movl 12(fp),r2 cmpl r0,r1 - bgtru 1f # normal forward case - beql 2f # equal, nothing to do - addl2 r2,r0 # may be overlapping + bgtru 1f # normal forward case + beql 2f # equal, nothing to do + addl2 r2,r0 # may be overlapping cmpl r0,r1 bgtru 3f - subl2 r2,r0 # normal forward case + subl2 r2,r0 # normal forward case 1: movblk 2: ret 3: - addl2 r2,r1 # overlapping, must do backwards + addl2 r2,r1 # overlapping, must do backwards subl3 r0,r1,r3 movl r2,r4 jbr 5f 4: subl2 r3,r0 @@ -902,243 +893,118 @@ subl2 r2,r1 movblk ret /* - * Copy a null terminated string from the user address space into - * the kernel address space. - * - * copyinstr(fromaddr, toaddr, maxlength, &lencopied) - */ -ENTRY(copyinstr, R3|R4|R5) - movl 12(fp),r5 # r5 = max length - jlss 8f - movl 4(fp),r0 # r0 = user address - movl r0,r3 # r3 = copy of src for null byte test - andl3 $(NBPG*CLSIZE-1),r0,r2 # r2 = bytes on first page - subl3 r2,$(NBPG*CLSIZE),r2 - movl 8(fp),r1 # r1 = kernel address -1: - cmpl r5,r2 # r2 = min(bytes on page, length left); - jgeq 2f - movl r5,r2 -2: - prober $1,(r0),r2 # bytes accessible? - jeql 8f - subl2 r2,r5 # update bytes left count - addl2 r2,r3 # calculate src+count - movs3 # copy in next piece - subl3 r0,r3,r2 # null byte found? - jneq 3f - movl $(NBPG*CLSIZE),r2 # check next page - tstl r5 # run out of space? - jneq 1b - movl $ENOENT,r0 # set error code and return - jbr 9f -3: - tstl 16(fp) # return length? - beql 4f - subl3 r5,12(fp),r5 # actual len = maxlen - unused pages - subl2 r2,r5 # - unused on this page - addl3 $1,r5,*16(fp) # + the null byte -4: - clrl r0 - ret -8: - movl $EFAULT,r0 -9: - tstl 16(fp) - beql 1f - subl3 r5,12(fp),*16(fp) -1: - ret - -/* - * Copy a null terminated string from the kernel - * address space to the user address space. - * - * copyoutstr(fromaddr, toaddr, maxlength, &lencopied) - */ -ENTRY(copyoutstr, R3|R4|R5) - movl 12(fp),r5 # r5 = max length - jlss 8b - movl 4(fp),r0 # r0 = kernel address - movl r0,r3 # r3 = copy of src for null byte test - movl 8(fp),r1 # r1 = user address - andl3 $(NBPG*CLSIZE-1),r1,r2 # r2 = bytes on first page - subl3 r2,$(NBPG*CLSIZE),r2 -1: - cmpl r5,r2 # r2 = min(bytes on page, length left); - jgeq 2f - movl r5,r2 -2: - probew $1,(r1),r2 # bytes accessible? - jeql 8b - subl2 r2,r5 # update bytes left count - addl2 r2,r3 # calculate src+count -#ifdef notdef - movs3 # copy out next piece -#else - tstl r2 - beql 6f -4: - movb (r0),(r1) - beql 5f - incl r0 - incl r1 - decl r2 - bneq 4b - jbr 6f -5: - incl r1 - decl r2 -6: -#endif - subl3 r0,r3,r2 # null byte found? - jneq 3b - movl $(NBPG*CLSIZE),r2 # check next page - tstl r5 # run out of space? - jneq 1b - movl $ENOENT,r0 # set error code and return - jbr 9b - -/* - * Copy a null terminated string from one point to another in - * the kernel address space. - * - * copystr(fromaddr, toaddr, maxlength, &lencopied) - */ -ENTRY(copystr, R3|R4|R5) - movl 12(fp),r5 # r5 = max length - jlss 8b - movl 4(fp),r0 # r0 = src address - movl r0,r3 # r3 = copy of src for null byte test - movl 8(fp),r1 # r1 = dest address -1: - movzwl $65535,r2 # r2 = bytes in first chunk - cmpl r5,r2 # r2 = min(bytes in chunk, length left); - jgeq 2f - movl r5,r2 -2: - subl2 r2,r5 # update bytes left count - addl2 r2,r3 # calculate src+count - movs3 # copy next piece - subl3 r0,r3,r2 # null byte found? - jneq 3b - tstl r5 # run out of space? - jneq 1b - movl $ENOENT,r0 # set error code and return - jbr 9b - -/* - * Copy a block of data from the user address space into - * the kernel address space. - * - * copyin(fromaddr, toaddr, count) - */ -ENTRY(copyin, 0) - movl 12(fp),r0 # copy length - blss 9f - movl 4(fp),r1 # copy user address - cmpl $(CLSIZE*NBPG),r0 # probing one page or less ? - bgeq 2f # yes -1: - prober $1,(r1),$(CLSIZE*NBPG) # bytes accessible ? - beql 9f # no - addl2 $(CLSIZE*NBPG),r1 # incr user address ptr - _ACBL($(CLSIZE*NBPG+1),$(-CLSIZE*NBPG),r0,1b) # reduce count and loop -2: - prober $1,(r1),r0 # bytes accessible ? - beql 9f # no - MOVC3(4(fp),8(fp),12(fp)) - clrl r0 - ret -9: - movl $EFAULT,r0 - ret - -/* - * Copy a block of data from the kernel - * address space to the user address space. - * - * copyout(fromaddr, toaddr, count) - */ -ENTRY(copyout, 0) - movl 12(fp),r0 # get count - blss 9b - movl 8(fp),r1 # get user address - cmpl $(CLSIZE*NBPG),r0 # can do in one probew? - bgeq 2f # yes -1: - probew $1,(r1),$(CLSIZE*NBPG) # bytes accessible? - beql 9b # no - addl2 $(CLSIZE*NBPG),r1 # increment user address - _ACBL($(CLSIZE*NBPG+1),$(-CLSIZE*NBPG),r0,1b) # reduce count and loop -2: - probew $1,(r1),r0 # bytes accessible? - beql 9b # no - MOVC3(4(fp),8(fp),12(fp)) + * bzero (base, count) + * zero out a block starting at 'base', size 'count'. + */ +_bzero: + .globl _bzero + .word 0x4 + movl $1f,r0 # r0 = null source string + movl 4(fp),r1 # r1 = destination address + movl 8(fp),r2 # r2 = count + movs3 + ret +1: + .byte 0 + + +_copyin: .globl _copyin # the _Copyin subroutine in VAX + # became _copyin procedure for TAHOE + .word 0x0004 + movl 12(fp),r0 # copy length + blss ersb + movl 4(fp),r1 # copy user address + cmpl $NBPG,r0 # probing one page or less ? + bgeq cishort # yes +ciloop: + prober $1,(r1),$NBPG # bytes accessible ? + beql ersb # no + addl2 $NBPG,r1 # incr user address ptr + _ACBL ($NBPG+1,$-NBPG,r0,ciloop) # reduce count and loop +cishort: + prober $1,(r1),r0 # bytes accessible ? + beql ersb # no + MOVC3 (12(fp),4(fp),8(fp)) + clrl r0 + ret + +ersb: + movl $EFAULT,r0 + ret + +_copyout: .globl _copyout # the _Copyout subroutine in VAX + # became _copyout procedure for TAHOE + .word 0x04 + movl 12(fp),r0 # get count + blss ersb + movl 8(fp),r1 # get user address + cmpl $NBPG,r0 # can do in one probew? + bgeq coshort # yes +coloop: + probew $1,(r1),$NBPG # bytes accessible? + beql ersb # no + addl2 $NBPG,r1 # increment user address + _ACBL ($NBPG+1,$-NBPG,r0,coloop) # reduce count and loop +coshort: + probew $1,(r1),r0 # bytes accessible? + beql ersb # no + MOVC3 (12(fp),4(fp),8(fp)) clrl r0 ret /* * non-local goto's */ -#ifdef notdef -ENTRY(setjmp, 0) - movl 4(fp),r0 - movl (fp),(r0); addl2 $4,r0 # save fp - movl -8(fp),(r0) # save pc - clrl r0 - ret -#endif - -ENTRY(longjmp, 0) - movl 4(fp),r0 - movl (r0),newfp; addl2 $4,r0 # must save parameters in memory - movl (r0),newpc # as all regs may be clobbered. -1: - cmpl fp,newfp # are we there yet? - bgequ 2f # yes - moval 1b,-8(fp) # redirect return pc to us! - ret # pop next frame -2: - beql 3f # did we miss our frame? - pushab 4f # yep ?!? - callf $8,_panic -3: - movl newpc,r0 # all done, just return - jmp (r0) # to setjmp `ret' - - .data -newpc: .space 4 -newfp: .space 4 -4: .asciz "longjmp" - -/* - * setjmp that saves all registers as the call frame may not - * be available to recover them in the usual manner by longjmp. - * Called before swapping out the u. area, restored by resume() - * below. - */ -ENTRY(savectx, 0) - movl 4(fp),r2 - storer $0x1ff8,(r2); addl2 $40,r2 # r3-r12 - movl (fp),(r2); addl2 $4,r2 # fp - movab 8(fp),(r2); addl2 $4,r2 # sp - movl -8(fp),(r2) # pc - clrl r0 - ret + .globl _setjmp # the _Setjmp subroutine in VAX + # became _setjmp procedure for TAHOE +_setjmp: + .word 0x0 + movl 4(fp),r2 + storer $0x1ff8,(r2) + addl2 $40,r2 + movl (fp),(r2) + addl2 $4,r2 + movab 8(fp),(r2) + addl2 $4,r2 + movl -8(fp),(r2) + clrl r0 + ret + + .globl _longjmp # the _Longjmp subroutine in VAX + # became _longjmp procedure for TAHOE +_longjmp: + .word 0x0000 + movl 4(fp),r2 +_Longjmp: # called from swtch + loadr $0x3ff8,(r2) + addl2 $44,r2 + movl (r2),r1 + addl2 $4,r2 + movab (sp),r0 + cmpl r1,r0 # must be a pop + bgequ lj2 + pushab lj1 + callf $8,_panic +lj2: + movl r1,sp + jmp *(r2) + +lj1: .asciz "longjmp" + .globl _whichqs .globl _qs .globl _cnt .globl _noproc .comm _noproc,4 .globl _runrun .comm _runrun,4 + /* * The following primitives use the fancy TAHOE instructions. * _whichqs tells which of the 32 queues _qs * have processes in them. setrq puts processes into queues, remrq * removes them from queues. The running process is on no queue, @@ -1150,11 +1016,13 @@ /* * setrq(p), using fancy TAHOE instructions. * * Call should be made at spl8(), and p->p_stat should be SRUN */ -ENTRY(setrq, 0) + .globl _setrq +_setrq: + .word 0x4 movl 4(fp),r0 tstl P_RLINK(r0) ## firewall: p->p_rlink must be 0 beql set1 ## pushab set3 ## callf $8,_panic ## @@ -1173,11 +1041,13 @@ /* * remrq(p), using fancy TAHOE instructions * * Call should be made at spl8(). */ -ENTRY(remrq, 0) + .globl _remrq +_remrq: + .word 0x0 movl 4(fp),r0 movzbl P_PRI(r0),r1 shar $2,r1,r1 bbs r1,_whichqs,rem1 pushab rem3 # it wasn't recorded to be on its q @@ -1192,25 +1062,41 @@ clrl P_RLINK(r0) ## for firewall checking ret rem3: .asciz "remrq" + .globl __insque +__insque: + .word 0 + insque *4(fp), *8(fp) + ret + + + .globl __remque +__remque: + .word 0 + remque *4(fp) + ret + /* * Masterpaddr is the p->p_addr of the running process on the master * processor. When a multiprocessor system, the slave processors will have * an array of slavepaddr's. */ .globl _masterpaddr .data -_masterpaddr: .long 0 +_masterpaddr: + .long 0 .text sw0: .asciz "swtch" /* - * swtch(), using fancy tahoe instructions + * swtch(), using fancy TAHOE instructions */ -ENTRY(swtch, 0) + .globl _swtch +_swtch: + .word 0x0 movl (fp),fp # prepare for rei movl (sp),4(sp) # saved pc tstl (sp)+ movpsl 4(sp) movl $1,_noproc @@ -1241,81 +1127,83 @@ bneq sw1b ## clrl P_RLINK(r2) ## movl *P_ADDR(r2),r0 movl r0,_masterpaddr shal $PGSHIFT,r0,r0 # r0 = pcbb(p) -#ifdef notdef - mfpr $PCBB,r1 # resume of current proc is easy - cmpl r0,r1 - beql res0 -#endif +/* mfpr $PCBB,r1 # resume of current proc is easy + * cmpl r0,r1 + */ beql res0 incl _cnt+V_SWTCH brb swresume - /* fall into... */ +/* fall into... */ +/* + * global cache key used if cant use proc index as key + * (e.g. NPROC>=255) + * otherwise used for temporary storage of key + */ + .data + .globl _globkey +_globkey: + .long 0 .globl _prevpcb -_prevpcb: .long 0 +_prevpcb: + .long 0 .text /* * resume(pf) */ -ENTRY(resume, 0) - shal $PGSHIFT,4(fp),r0 # r0 = pcbb(pf) + .globl _resume +_resume: + .word 0x0 + shal $PGSHIFT,4(fp),r0 # r0 = pcbb(p) movl (fp),fp # prepare for rei movl (sp)+,4(sp) # saved pc tstl (sp)+ movpsl 4(sp) swresume: - mtpr $0x18,$IPL # no interrupts, please + mtpr $0x18,$IPL # no interrupts, please movl _CMAP2,_u+PCB_CMAP2 # yech REST_ACC # restore original accumulator svpctx mtpr r0,$PCBB ldpctx movl _u+PCB_CMAP2,_CMAP2 # yech mtpr $_CADDR2,$TBIS res0: - PUSHR; - movl _u+U_PROCP,r2 # r2 = u.u_procp - tstl P_CKEY(r2) # does proc have code key? - bneq 1f - callf $4,_getcodekey # no, give him one - movl r0,P_CKEY(r2) -1: - movl _u+U_PROCP,r2 # r2 = u.u_procp - tstl P_DKEY(r2) # does proc have data key? - bneq 1f - callf $4,_getdatakey # no, give him one - movl r0,P_DKEY(r2) -1: - mtpr P_CKEY(r2),$CCK # set code cache key - mtpr P_DKEY(r2),$DCK # set data cache key - POPR tstl _u+PCB_SSWAP - bneq res1 - rei -res1: # longjmp to saved context + beql res1 movl _u+PCB_SSWAP,r2 clrl _u+PCB_SSWAP - loadr $0x3ff8,(r2); addl2 $44,r2 # restore r3-r13 (r13=fp) - movl (r2),r1; addl2 $4,r2 # fetch previous sp ... - movab (sp),r0 # ... and current sp and - cmpl r1,r0 # check for credibility, - bgequ 1f # if further up stack ... - pushab 2f; callf $8,_panic # ... panic - /*NOTREACHED*/ -1: # sp ok, complete return - movl r1,sp # restore sp - movl (r2),(sp) # return address - movl $PSL_PRVMOD,4(sp) # kernel mode, ipl 0 + movab _Longjmp,(sp) + clrl 4(sp) # PSL = kernel mode, IPL=0 +res1: +#ifdef GLOBKEY + aoblss $256,_globkey,res2 # define new cache key + mtpr $0,$PACC # out of keys, purge all + mtpr $0,$PADC + movl $1,_globkey +res2: + mtpr _globkey,$CCK +#else +res3: + movzwl _u+PCB_CKEY,_globkey + mtpr _globkey,$CCK +res4: + movzwl _u+PCB_DKEY,_globkey +#endif + mtpr _globkey,$DCK rei -2: .asciz "ldctx" /* * {fu,su},{byte,word} */ -ENTRY(fuword, 0) + .globl _fuiword + .globl _fuword +_fuiword: +_fuword: + .word 0x0 movl 4(fp), r1 prober $1,(r1),$4 # check access beql fserr # page unreadable bitl $1,r1 # check byte alignment bneq 2f # odd, do byte-word-byte @@ -1340,17 +1228,25 @@ ret fserr: mnegl $1,r0 ret -ENTRY(fubyte, 0) + .globl _fuibyte + .globl _fubyte +_fuibyte: +_fubyte: + .word 0x0 prober $1,*4(fp),$1 beql fserr movzbl *4(fp),r0 ret -ENTRY(suword, 0) + .globl _suiword + .globl _suword +_suiword: +_suword: + .word 0x0 movl 4(fp), r0 probew $1,(r0),$4 # check access beql fserr # page unwritable bitl $1,r0 # check byte alignment bneq 1f # odd byte boundary @@ -1369,11 +1265,15 @@ movl 8(fp),(r0) 3: clrl r0 ret -ENTRY(subyte, 0) + .globl _suibyte + .globl _subyte +_suibyte: +_subyte: + .word 0x0 probew $1,*4(fp),$1 beql fserr movb 11(fp),*4(fp) clrl r0 ret @@ -1380,22 +1280,26 @@ /* * Copy 1 relocation unit (NBPG bytes) * from user virtual address to physical address */ -ENTRY(copyseg, 0) +_copyseg: .globl _copyseg + .word 0x4 orl3 $PG_V|PG_KW,8(fp),_CMAP2 mtpr $_CADDR2,$TBIS # invalidate entry for copy - MOVC3(4(fp),$_CADDR2,$NBPG) + MOVC3 ($NBPG,4(fp),$_CADDR2) ret /* - * Clear a page of memory. The page frame is specified. + * clearseg(physical_page_number); * - * clearseg(pf); + * zero out physical memory + * specified in relocation units (NBPG bytes) + * This routine was optimized for speed on Tahoe. */ -ENTRY(clearseg, 0) +_clearseg: .globl _clearseg + .word 0 orl3 $PG_V|PG_KW,4(fp),_CMAP1 # Maps to virtual addr CADDR1 mtpr $_CADDR1,$TBIS movl $255,r0 # r0 = limit clrl r1 # r1 = index of cleared long 1: @@ -1402,44 +1306,46 @@ clrl _CADDR1[r1] aobleq r0,r1,1b ret /* - * Check user mode read/write access. - * - * useracc(addr, count, mode) - * caddr_t addr; int count, mode; - * mode = 0 write access - * mode = 1 read access + * if ( useracc(address, count, mode) ) .... + * Check address. + * Given virtual address, byte count, and rw flag + * returns 0 on no access. + * Note : it is assumed that on all calls to this routine, + * mode=0 means write access, mode=1 means read access. */ -ENTRY(useracc, 0) +_useracc: .globl _useracc + .word 0x4 movl $1,r2 # r2 = 'user mode' for probew/probew probes: movl 4(fp),r0 # get va movl 8(fp),r1 # count tstl 12(fp) # test for read access ? bneq userar # yes - cmpl $(CLSIZE*NBPG),r1 # can we do it in one probe ? + cmpl $NBPG,r1 # can we do it in one probe ? bgeq uaw2 # yes uaw1: - probew r2,(r0),$(CLSIZE*NBPG) + probew r2,(r0),$NBPG beql uaerr # no access - addl2 $(CLSIZE*NBPG),r0 - _ACBL($(CLSIZE*NBPG+1),$(-CLSIZE*NBPG),r1,uaw1) + addl2 $NBPG,r0 + _ACBL($NBPG+1,$-NBPG,r1,uaw1) uaw2: probew r2,(r0),r1 beql uaerr movl $1,r0 ret + userar: - cmpl $(CLSIZE*NBPG),r1 + cmpl $NBPG,r1 bgeq uar2 uar1: - prober r2,(r0),$(CLSIZE*NBPG) + prober r2,(r0),$NBPG beql uaerr - addl2 $(CLSIZE*NBPG),r0 - _ACBL($(CLSIZE*NBPG+1),$(-CLSIZE*NBPG),r1,uar1) + addl2 $NBPG,r0 + _ACBL($NBPG+1,$-NBPG,r1,uar1) uar2: prober r2,(r0),r1 beql uaerr movl $1,r0 ret @@ -1446,99 +1352,51 @@ uaerr: clrl r0 ret /* - * Check kernel mode read/write access. - * - * kernacc(addr, count, mode) - * caddr_t addr; int count, mode; - * mode = 0 write access - * mode = 1 read access + * if ( kernacc(address, count, mode) ) .... + * Check address. + * Given virtual address, byte count, and rw flag + * returns 0 on no access. + * Same as useracc routine but checks for kernel access rights. */ -ENTRY(kernacc, 0) + +_kernacc: .globl _kernacc + .word 0x4 clrl r2 # r2 = 0 means kernel mode probe. jbr probes # Dijkstra would get gastric distress here. /* * addupc - increment some histogram counter * in the profiling buffer * - * addupc(pc, prof, delta) - * long pc; short delta; struct uprof *prof; + * addupc(pc, prof, counts) + * long pc , counts; Only least significant word of 'counts' is added. + * struct uprof *prof; * * struct uprof { # profile arguments * short *r_base; # buffer base * unsigned pr_size; # buffer size * unsigned pr_off; # pc offset * unsigned pr_scale; # pc scaling * } */ -ENTRY(addupc, 0) - movl 8(fp),r2 # r2 points to structure - subl3 8(r2),4(fp),r0 # r0 = PC - lowpc - jlss 9f # PC < lowpc , out of range ! - shrl $1,r0,r0 # the unit is words - shrl $1,12(r2),r1 # ditto for scale + .globl _addupc +_addupc: + .word 4 + movl 8(fp),r2 # r2 points to structure + subl3 8(r2),4(fp),r0 # r0 = PC - lowpc + jlss 9f # PC < lowpc , out of range ! + shrl $1,r0,r0 # the unit is words + shrl $1,12(r2),r1 # ditto for scale emul r1,r0,$0,r0 shrq $14,r0,r0 - tstl r0 # too big + tstl r0 # too big jneq 9f - cmpl r1,4(r2) # Check buffer overflow + cmpl r1,4(r2) # Check buffer overflow jgequ 9f probew $1,*0(r2)[r1],$2 # counter accessible? jeql 9f - shrl $1,r1,r1 # make r1 word index + shrl $1,r1,r1 # make r1 word index addw2 14(fp),*0(r2)[r1] 9: ret - -/* - * scanc(size, cp, table, mask) - */ -ENTRY(scanc, R3|R4) - movl 8(fp),r0 # r0 = cp - addl3 4(fp),r0,r2 # end = &cp[size] - movl 12(fp),r1 # r1 = table - movb 19(fp),r4 # r4 = mask - decl r0 # --cp - jbr 0f # just like Fortran... -1: # do { - movzbl (r0),r3 - bitb r4,(r1)[r3] # if (table[*cp] & mask) - jneq 2f # break; -0: aoblss r2,r0,1b # } while (++cp < end); -2: - subl3 r0,r2,r0; ret # return (end - cp); - -/* - * skpc(mask, size, cp) - */ -ENTRY(skpc, 0) - movl 12(fp),r0 # r0 = cp - addl3 8(fp),r0,r1 # r1 = end = &cp[size]; - movb 7(fp),r2 # r2 = mask - decl r0 # --cp; - jbr 0f -1: # do - cmpb (r0),r2 # if (*cp != mask) - jneq 2f # break; -0: aoblss r1,r0,1b # while (++cp < end); -2: - subl3 r0,r1,r0; ret # return (end - cp); - -#ifdef notdef -/* - * locc(mask, size, cp) - */ -ENTRY(locc, 0) - movl 12(fp),r0 # r0 = cp - addl3 8(fp),r0,r1 # r1 = end = &cp[size] - movb 7(fp),r2 # r2 = mask - decl r0 # --cp; - jbr 0f -1: # do - cmpb (r0),r2 # if (*cp == mask) - jeql 2f # break; -0: aoblss r1,r0,1b # while (++cp < end); -2: - subl3 r0,r1,r0; ret # return (end - cp); -#endif Index: sys/tahoe/tahoe/machdep.c ================================================================== --- sys/tahoe/tahoe/machdep.c +++ sys/tahoe/tahoe/machdep.c @@ -1,51 +1,57 @@ -/* machdep.c 1.2 86/01/05 */ - -#include "../tahoe/reg.h" -#include "../tahoe/pte.h" -#include "../tahoe/psl.h" - -#include "param.h" -#include "systm.h" -#include "dir.h" -#include "user.h" -#include "kernel.h" -#include "map.h" -#include "vm.h" -#include "proc.h" -#include "buf.h" -#include "reboot.h" -#include "conf.h" -#include "inode.h" -#include "file.h" -#include "text.h" -#include "clist.h" -#include "callout.h" -#include "cmap.h" -#include "mbuf.h" -#include "msgbuf.h" -#include "quota.h" - +/* machdep.c 1.4 85/05/15 */ + +#include "../machine/reg.h" +#include "../machine/pte.h" +#include "../machine/psl.h" + +#include "../h/param.h" +#include "../h/systm.h" +#include "../h/dir.h" +#include "../h/user.h" +#include "../h/nami.h" +#include "../h/kernel.h" +#include "../h/map.h" +#include "../h/vm.h" +#include "../h/proc.h" +#include "../h/buf.h" +#include "../h/reboot.h" +#include "../h/conf.h" +#include "../h/inode.h" +#include "../h/file.h" +#include "../h/text.h" +#include "../h/clist.h" +#include "../h/callout.h" +#include "../h/cmap.h" +#include "../h/mbuf.h" +#include "../h/msgbuf.h" +#include "../h/quota.h" #include "../tahoe/mem.h" #include "../tahoe/mtpr.h" #include "../tahoe/cp.h" -#include "../tahoevba/vbavar.h" +#include "../vba/vbavar.h" +int icode[] = { + 0xf9af19f9, /* pushab argp */ + 0xaf09dd02, /* pushab file */ + 0xe96e5dcf, /* pushl $2 */ + 0x0b11fe2f, /* movab (sp),fp */ + 0x6574632f, /* kcall $exec */ + 0x696e6974, /* here:brb here */ + 0x00000000, /*.file:.ascii "/etc/" */ + 0x00000014, /* args:.ascii "init\0" */ + 0x00000000, /* .align 2 */ + /* argp:.long args, 0 */ +}; +int szicode = sizeof(icode); + /* * Declare these as initialized data so we can patch them. */ -int nswbuf = 0; -#ifdef NBUF -int nbuf = NBUF; -#else int nbuf = 0; -#endif -#ifdef BUFPAGES -int bufpages = BUFPAGES; -#else +int nswbuf = 0; int bufpages = 0; -#endif /* * Machine-dependent startup code */ startup(firstaddr) @@ -52,137 +58,72 @@ int firstaddr; { register int unixsize; register unsigned i; register struct pte *pte; - int mapaddr, j; + register int mapaddr, j; register caddr_t v; - int maxbufs, base, residual; + register int maxbufs, base, residual; extern char etext; /* * Initialize error message buffer (at end of core). */ maxmem -= btoc(sizeof (struct msgbuf)); pte = msgbufmap; for (i = 0; i < btoc(sizeof (struct msgbuf)); i++) *(int *)pte++ = PG_V | PG_KW | (maxmem + i); - mtpr(TBIA, 1); + mtpr(1,TBIA); /* * Good {morning,afternoon,evening,night}. */ printf(version); - printf("real mem = %d\n", ctob(physmem)); - - /* - * Allocate space for system data structures. - * The first available real memory address is in "firstaddr". - * The first available kernel virtual address is in "v". - * As pages of kernel virtual memory are allocated, "v" is incremented. - * As pages of memory are allocated and cleared, - * "firstaddr" is incremented. - * An index into the kernel page table corresponding to the - * virtual memory address maintained in "v" is kept in "mapaddr". - */ - v = (caddr_t)(0xc0000000 | (firstaddr * NBPG)); -#define valloc(name, type, num) \ - (name) = (type *)v; v = (caddr_t)((name)+(num)) -#define valloclim(name, type, num, lim) \ - (name) = (type *)v; v = (caddr_t)((lim) = ((name)+(num))) - valloclim(inode, struct inode, ninode, inodeNINODE); - valloclim(file, struct file, nfile, fileNFILE); - valloclim(proc, struct proc, nproc, procNPROC); - valloclim(text, struct text, ntext, textNTEXT); - valloc(cfree, struct cblock, nclist); - valloc(callout, struct callout, ncallout); - valloc(swapmap, struct map, nswapmap = nproc * 2); - valloc(argmap, struct map, ARGMAPSIZE); - valloc(kernelmap, struct map, nproc); - valloc(mbmap, struct map, nmbclusters/4); - valloc(nch, struct nch, nchsize); -#ifdef QUOTA - valloclim(quota, struct quota, nquota, quotaNQUOTA); - valloclim(dquot, struct dquot, ndquot, dquotNDQUOT); -#endif + printf("real mem = %d\n", ctob(maxmem)); /* * Determine how many buffers to allocate. - * Use 10% of memory for the first 2 Meg, 5% of the remaining - * memory. Insure a minimum of 16 buffers. + * Use 10% of memory, with min of 16. * We allocate 1/2 as many swap buffer headers as file i/o buffers. */ + maxbufs = ((SYSPTSIZE * NBPG) - (5 * (int)(&etext - 0xc0000000))) / + MAXBSIZE; if (bufpages == 0) - if (physmem < (2 * 1024 * 1024)) - bufpages = physmem / 10 / CLSIZE; - else - bufpages = - ((2 * 1024 * 1024) / 5 + physmem / 5) / CLSIZE; + bufpages = (physmem * NBPG) / 10 / CLBYTES; if (nbuf == 0) { nbuf = bufpages / 2; if (nbuf < 16) nbuf = 16; + if (nbuf > maxbufs) + nbuf = maxbufs; } + if (bufpages > nbuf * (MAXBSIZE / CLBYTES)) + bufpages = nbuf * (MAXBSIZE / CLBYTES); if (nswbuf == 0) { nswbuf = (nbuf / 2) &~ 1; /* force even */ if (nswbuf > 256) nswbuf = 256; /* sanity */ } - valloc(swbuf, struct buf, nswbuf); - - /* - * Now the amount of virtual memory remaining for buffers - * can be calculated, estimating needs for the cmap. - */ - ncmap = (maxmem*NBPG - ((int)v &~ 0xc0000000)) / - (CLBYTES + sizeof(struct cmap)) + 2; - maxbufs = ((SYSPTSIZE * NBPG) - - ((int)(v + ncmap * sizeof(struct cmap)) - 0xc0000000)) / - (MAXBSIZE + sizeof(struct buf)); - if (maxbufs < 16) - panic("sys pt too small"); - if (nbuf > maxbufs) { - printf("SYSPTSIZE limits number of buffers to %d\n", maxbufs); - nbuf = maxbufs; - } - if (bufpages > nbuf * (MAXBSIZE / CLBYTES)) - bufpages = nbuf * (MAXBSIZE / CLBYTES); - valloc(buf, struct buf, nbuf); - - /* - * Allocate space for core map. - * Allow space for all of phsical memory minus the amount - * dedicated to the system. The amount of physical memory - * dedicated to the system is the total virtual memory of - * the system thus far, plus core map, buffer pages, - * and buffer headers not yet allocated. - * Add 2: 1 because the 0th entry is unused, 1 for rounding. - */ - ncmap = (maxmem*NBPG - ((int)(v + bufpages*CLBYTES) &~ 0xc0000000)) / - (CLBYTES + sizeof(struct cmap)) + 2; - valloclim(cmap, struct cmap, ncmap, ecmap); - - /* - * Clear space allocated thus far, and make r/w entries - * for the space in the kernel map. - */ - unixsize = btoc((int)v &~ 0xc0000000); - while (firstaddr < unixsize) { - *(int *)(&Sysmap[firstaddr]) = PG_V | PG_KW | firstaddr; - clearseg((unsigned)firstaddr); - firstaddr++; - } - - /* - * Now allocate buffers proper. They are different than the above - * in that they usually occupy more virtual memory than physical. - */ - v = (caddr_t) ((int)(v + PGOFSET) &~ PGOFSET); + + /* + * Allocate space for system data structures. + * The first available real memory address is in "firstaddr". + * As pages of memory are allocated, "firstaddr" is incremented. + * The first available kernel virtual address is in "v". + * As pages of kernel virtual memory are allocated, "v" is incremented. + * An index into the kernel page table corresponding to the + * virtual memory address maintained in "v" is kept in "mapaddr". + */ + mapaddr = firstaddr; + v = (caddr_t)(0xc0000000 | (firstaddr * NBPG)); +#define valloc(name, type, num) \ + (name) = (type *)(v); (v) = (caddr_t)((name)+(num)) +#define valloclim(name, type, num, lim) \ + (name) = (type *)(v); (v) = (caddr_t)((lim) = ((name)+(num))) valloc(buffers, char, MAXBSIZE * nbuf); base = bufpages / nbuf; residual = bufpages % nbuf; - mapaddr = firstaddr; for (i = 0; i < residual; i++) { for (j = 0; j < (base + 1) * CLSIZE; j++) { *(int *)(&Sysmap[mapaddr+j]) = PG_V | PG_KW | firstaddr; clearseg((unsigned)firstaddr); firstaddr++; @@ -195,15 +136,55 @@ clearseg((unsigned)firstaddr); firstaddr++; } mapaddr += MAXBSIZE / NBPG; } + valloc(buf, struct buf, nbuf); + valloc(swbuf, struct buf, nswbuf); + valloclim(inode, struct inode, ninode, inodeNINODE); + valloclim(file, struct file, nfile, fileNFILE); + valloclim(proc, struct proc, nproc, procNPROC); + valloclim(text, struct text, ntext, textNTEXT); + valloc(cfree, struct cblock, nclist); + valloc(callout, struct callout, ncallout); + valloc(swapmap, struct map, nswapmap = nproc * 2); + valloc(argmap, struct map, ARGMAPSIZE); + valloc(kernelmap, struct map, nproc); + valloc(mbmap, struct map, nmbclusters/4); + valloc(nch, struct nch, nchsize); +#ifdef QUOTA + valloclim(quota, struct quota, nquota, quotaNQUOTA); + valloclim(dquot, struct dquot, ndquot, dquotNDQUOT); +#endif + /* + * Now allocate space for core map + * Allow space for all of phsical memory minus the amount + * dedicated to the system. The amount of physical memory + * dedicated to the system is the total virtual memory of + * the system minus the space in the buffers which is not + * allocated real memory. + */ + ncmap = (physmem*NBPG - ((int)v &~ 0xc0000000) + + (nbuf * MAXBSIZE - bufpages * CLBYTES)) / + (NBPG*CLSIZE + sizeof (struct cmap)); + valloclim(cmap, struct cmap, ncmap, ecmap); + if ((((int)(ecmap+1))&~0xc0000000) > SYSPTSIZE*NBPG) + panic("sys pt too small"); - unixsize = btoc((int)v &~ 0xc0000000); + /* + * Clear allocated space, and make r/w entries + * for the space in the kernel map. + */ + unixsize = btoc((int)(ecmap+1) &~ 0xc0000000); + for (i = mapaddr; i < unixsize; i++) { + *(int *)(&Sysmap[i]) = PG_V | PG_KW | firstaddr; + clearseg((unsigned)firstaddr); + firstaddr++; + } if (firstaddr >= physmem - 8*UPAGES) panic("no memory"); - mtpr(TBIA, 1); /* After we just cleared it all! */ + mtpr(1,TBIA); /* * Initialize callouts */ callfree = callout; @@ -225,11 +206,10 @@ rminit(kernelmap, (long)USRPTSIZE, (long)1, "usrpt", nproc); rminit(mbmap, (long)((nmbclusters - 1) * CLSIZE), (long)CLSIZE, "mbclusters", nmbclusters/4); intenable = 1; /* Enable interrupts from now on */ - /* * Configure the system. */ configure(); } @@ -241,185 +221,177 @@ * time as represented by the arguments. * If there is a pending clock interrupt * which has not been serviced due to high * ipl, return error code. */ -/*ARGSUSED*/ vmtime(otime, olbolt, oicr) register int otime, olbolt, oicr; { - - return (((time.tv_sec-otime)*60 + lbolt-olbolt)*16667); + return(((time.tv_sec-otime)*60 + lbolt-olbolt)*16667); } #endif /* * Send an interrupt to process. * * Stack is set up to allow sigcode stored - * in u. to call routine, followed by kcall - * to sigreturn routine below. After sigreturn - * resets the signal mask, the stack, and the - * frame pointer, it returns to the user - * specified pc, psl. + * in u. to call routine, followed by chmk + * to sigcleanup routine below. After sigcleanup + * resets the signal mask and the stack, it + * returns to user who then unwinds with the + * rei at the bottom of sigcode. */ sendsig(p, sig, mask) int (*p)(), sig, mask; { - register struct sigcontext *scp; + register struct sigcontext *scp; /* know to be r12 */ register int *regs; register struct sigframe { int sf_signum; int sf_code; struct sigcontext *sf_scp; int (*sf_handler)(); - int sf_regs[6]; /* r0-r5 */ + int r1; + int r0; struct sigcontext *sf_scpcopy; - } *fp; + } *fp; /* known to be r10 */ int oonstack; regs = u.u_ar0; oonstack = u.u_onstack; - /* - * Allocate and validate space for the signal handler - * context. Note that if the stack is in P0 space, the - * call to grow() is a nop, and the useracc() check - * will fail if the process has not already allocated - * the space with a `brk'. - */ + scp = (struct sigcontext *)regs[SP] - 1; if (!u.u_onstack && (u.u_sigonstack & sigmask(sig))) { - scp = (struct sigcontext *)u.u_sigsp - 1; + fp = (struct sigframe *)u.u_sigsp - 1; u.u_onstack = 1; } else - scp = (struct sigcontext *)regs[SP] - 1; - fp = (struct sigframe *)scp - 1; - if ((int)fp <= USRSTACK - ctob(u.u_ssize)) + fp = (struct sigframe *)scp - 1; + /* + * Must build signal handler context on stack to be returned to + * so that rei instruction in sigcode will pop ps and pc + * off correct stack. The remainder of the signal state + * used in calling the handler must be placed on the stack + * on which the handler is to operate so that the calls + * in sigcode will save the registers and such correctly. + */ + if (!oonstack && (int)fp <= USRSTACK - ctob(u.u_ssize)) grow((unsigned)fp); - if (useracc((caddr_t)fp, sizeof (*fp) + sizeof (*scp), 1) == 0) { - /* - * Process has trashed its stack; give it an illegal - * instruction to halt it in its tracks. - */ - u.u_signal[SIGILL] = SIG_DFL; - sig = sigmask(SIGILL); - u.u_procp->p_sigignore &= ~sig; - u.u_procp->p_sigcatch &= ~sig; - u.u_procp->p_sigmask &= ~sig; - psignal(u.u_procp, SIGILL); - return; - } - /* - * Build the argument list for the signal handler. - */ + ; +#ifndef lint + asm("probew $1,(r10),$7*4"); + asm("jeql bad"); +#else + if (useracc((caddr_t)fp, sizeof (struct sigframe), 1)) + goto bad; +#endif + if (!u.u_onstack && (int)scp <= USRSTACK - ctob(u.u_ssize)) + grow((unsigned)scp); + ; /* Avoid asm() label botch */ +#ifndef lint + asm("probew $1,(r12),$5*4"); + asm("beql bad"); +#else + if (useracc((caddr_t)scp, sizeof (struct sigcontext), 1)) + goto bad; +#endif fp->sf_signum = sig; if (sig == SIGILL || sig == SIGFPE) { fp->sf_code = u.u_code; u.u_code = 0; } else fp->sf_code = 0; fp->sf_scp = scp; fp->sf_handler = p; + fp->r1 = regs[R1]; /* These are not saved by the C compiler */ + fp->r0 = regs[R0]; /* - * Build the callf argument frame to be used to call sigreturn. + * Duplicate the pointer to the sigcontext structure. + * This one doesn't get popped by the ret, and is used + * by sigcleanup to reset the signal state on inward return. */ fp->sf_scpcopy = scp; - /* - * Build the signal context to be used by sigreturn. - */ + /* sigcontext goes on previous stack */ scp->sc_onstack = oonstack; scp->sc_mask = mask; - scp->sc_sp = regs[SP]; - scp->sc_fp = regs[FP]; + /* setup rei */ + scp->sc_sp = (int)&scp->sc_pc; scp->sc_pc = regs[PC]; scp->sc_ps = regs[PS]; regs[SP] = (int)fp; regs[PC] = (int)u.u_pcb.pcb_sigc; -} - -/* - * System call to cleanup state after a signal - * has been taken. Reset signal mask and - * stack state from context left by sendsig (above). - * Return to previous pc and psl as specified by - * context left by sendsig. Check carefully to - * make sure that the user has not modified the - * psl to gain improper priviledges or to cause - * a machine fault. - */ -sigreturn() -{ - struct a { - struct sigcontext *sigcntxp; - }; - register struct sigcontext *scp; - register int *regs = u.u_ar0; - - scp = ((struct a *)(u.u_ap))->sigcntxp; - if (useracc((caddr_t)scp, sizeof (*scp), 0) == 0) { - u.u_error = EINVAL; - return; - } - if ((scp->sc_ps & (PSL_MBZ|PSL_IPL|PSL_IS)) != 0 || - (scp->sc_ps & (PSL_PRVMOD|PSL_CURMOD)) != (PSL_PRVMOD|PSL_CURMOD)) { - u.u_error = EINVAL; - return; - } - u.u_eosys = JUSTRETURN; - u.u_onstack = scp->sc_onstack & 01; - u.u_procp->p_sigmask = scp->sc_mask &~ - (sigmask(SIGKILL)|sigmask(SIGCONT)|sigmask(SIGSTOP)); - regs[FP] = scp->sc_fp; - regs[SP] = scp->sc_sp; - regs[PC] = scp->sc_pc; - regs[PS] = scp->sc_ps; -} - -/* XXX - BEGIN 4.2 COMPATIBILITY */ -/* - * Compatibility with 4.2 kcall $139 used by longjmp() - */ -osigcleanup() -{ - register struct sigcontext *scp; - register int *regs = u.u_ar0; - - scp = (struct sigcontext *)fuword((caddr_t)regs[SP]); - if ((int)scp == -1) - return; - if (useracc((caddr_t)scp, 3 * sizeof (int), 0) == 0) - return; - u.u_onstack = scp->sc_onstack & 01; - u.u_procp->p_sigmask = scp->sc_mask &~ - (sigmask(SIGKILL)|sigmask(SIGCONT)|sigmask(SIGSTOP)); - regs[SP] = scp->sc_sp; -} -/* XXX - END 4.2 COMPATIBILITY */ + return; + +asm("bad:"); +bad: + /* + * Process has trashed its stack; give it an illegal + * instruction to halt it in its tracks. + */ + u.u_signal[SIGILL] = SIG_DFL; + sig = sigmask(SIGILL); + u.u_procp->p_sigignore &= ~sig; + u.u_procp->p_sigcatch &= ~sig; + u.u_procp->p_sigmask &= ~sig; + psignal(u.u_procp, SIGILL); +} + +/* + * Routine to cleanup state after a signal + * has been taken. Reset signal mask and + * stack state from context left by sendsig (above). + * Pop these values in preparation for rei which + * follows return from this routine. + */ +sigcleanup() +{ + register struct sigcontext *scp; /* known as R12 */ + + scp = (struct sigcontext *)fuword((caddr_t)u.u_ar0[SP]); + if ((int)scp == -1) + return; +#ifndef lint + ; /* Avoid asm() label botch */ + /* only probe 12 here because that's all we need */ + asm("prober $1,(r12),$12"); + asm("bnequ 1f; ret; 1:"); +#else + if (useracc((caddr_t)scp, sizeof (*scp), 0)) + return; +#endif + u.u_onstack = scp->sc_onstack & 01; + u.u_procp->p_sigmask = + scp->sc_mask &~ (sigmask(SIGKILL)|sigmask(SIGCONT)|sigmask(SIGSTOP)); + u.u_ar0[SP] = scp->sc_sp; +} int waittime = -1; boot(paniced, arghowto) int paniced, arghowto; { - register long dummy; /* r12 is reserved */ + register long dummy; register int howto; /* r11 == how to boot */ register int devtype; /* r10 == major of root dev */ #ifdef lint - howto = 0; devtype = 0; dummy = 0; dummy = dummy; + howto = 0; devtype = 0; printf("howto %d, devtype %d\n", arghowto, devtype); #endif (void) spl1(); howto = arghowto; - if ((howto&RB_NOSYNC) == 0 && waittime < 0 && bfreelist[0].b_forw) { + if ((howto&RB_NOSYNC)==0 && waittime < 0 && bfreelist[0].b_forw) { waittime = 0; update(); printf("syncing disks... "); +#ifdef notdef + DELAY(10000000); +#else { register struct buf *bp; int iter, nbusy, oldnbusy; + printf ("\tBlocks to sync : "); oldnbusy = 0; - for (iter = 0; iter < 1000; iter++) { + for (iter = 0; /* iter < 20 */; iter++) { DELAY(1000); nbusy = 0; for (bp = &buf[nbuf]; --bp >= buf; ) if ((bp->b_flags & (B_BUSY|B_INVAL)) == B_BUSY) nbusy++; @@ -427,21 +399,25 @@ break; if (nbusy != oldnbusy) { printf("%d ", nbusy); oldnbusy = nbusy; } + if (iter >= 100) { + printf (" - disk I/O stopped (?), giving up\n"); + DELAY(10000); + break; + } } - if (iter >= 1000 && nbusy) - printf("- i/o timeout, giving up..."); } - printf("done\n"); +#endif + printf("done\n\n"); } - mtpr(IPL, 0x1f); /* extreme priority */ + splx(0x1f); /* extreme priority */ devtype = major(rootdev); if (howto&RB_HALT) { printf("halting (in tight loop); hit ~h\n\n"); - mtpr(IPL, 0x1f); + mtpr(0x1f,IPL); for (;;) ; } else { if (paniced == RB_PANIC) { doadump(); /* TXDB_BOOT's itsself */ @@ -452,38 +428,43 @@ for (;;) asm("halt"); /*NOTREACHED*/ } -struct cphdr *lasthdr; /* defined in cons.c */ -struct cpdcb_o cpcontrol; + /* * Send the given comand ('c') to the console processor. * Assumed to be one of the last things the OS does before * halting or rebooting. */ -tocons(c) + +struct cphdr *lasthdr; /* Available in "dev/cons.c" */ + +struct cpdcb_o cpcontrol; + +tocons(command) +int command; { + int timeout; cpcontrol.cp_hdr.cp_unit = CPUNIT; - cpcontrol.cp_hdr.cp_comm = (char)c; - if (c != CPBOOT) + cpcontrol.cp_hdr.cp_comm = (char) command; + if (command != CPBOOT) cpcontrol.cp_hdr.cp_count = 1; /* Just for sanity */ else { cpcontrol.cp_hdr.cp_count = 4; *(int *)cpcontrol.cp_buf = 0; /* r11 value for reboot */ } timeout = 100000; /* Delay loop */ - while (timeout-- && (lasthdr->cp_unit&CPDONE) == 0) + while (timeout-- && !(lasthdr->cp_unit & CPDONE)) uncache(&lasthdr->cp_unit); - /* give up, force it to listen */ - mtpr(CPMDCB, vtoph((struct proc *)0, (unsigned)&cpcontrol)); + /* Give up, force it to listen */ + mtpr ( vtoph(0, &cpcontrol), CPMDCB); } -#if CLSIZE != 1 /* * Invalidate single all pte's in a cluster */ tbiscl(v) unsigned v; @@ -491,15 +472,14 @@ register caddr_t addr; /* must be first reg var */ register int i; addr = ptob(v); for (i = 0; i < CLSIZE; i++) { - mtpr(TBIS, addr); + mtpr(addr, TBIS); addr += NBPG; } } -#endif int dumpmag = 0x8fca0101; /* magic number for savecore */ int dumpsize = 0; /* also for savecore */ /* * Doadump comes here after turning off memory management and @@ -536,19 +516,20 @@ default: printf("succeeded\n"); break; } - printf("\n\n"); - DELAY(1000); + printf("Rebooting the system ...\n\n"); tocons(CPBOOT); } + /* * Bus error 'recovery' code. * Print out the buss frame and then give up. * (More information from special registers can be printed here.) + * */ /* * Frame for bus error */ @@ -557,43 +538,53 @@ int memerreg; /* memory error register */ int trp_pc; /* trapped pc */ int trp_psl; /* trapped psl */ }; -char *mem_errcd[8] = { - "Unknown error code 0", - "Address parity error", /* APE */ - "Data parity error", /* DPE */ - "Data check error", /* DCE */ - "Versabus timeout", /* VTO */ - "Versabus error", /* VBE */ - "Non-existent memory", /* NEM */ - "Unknown error code 7", -}; - -buserror(v) - caddr_t v; -{ - register struct buserframe *busef = (struct buserframe *)v; - register long reg; - - printf("bus error, address %x, psl %x\n", - busef->trp_pc, busef->trp_psl); - reg = busef->memerreg; - printf("mear %x %s\n", - ((reg&MEAR)>>16)&0xffff, mem_errcd[reg & ERRCD]); - if (reg&AXE) - printf("adapter external error\n"); - printf("error master: %s\n", reg&ERM ? "versabus" : "tahoe"); - if (reg&IVV) - printf("illegal interrupt vector from ipl %d\n", (reg>>2)&7); - reg = busef->which_bus; - printf("mcbr %x versabus type %x\n", - ((reg&MCBR)>>16)&0xffff, reg & 0xffc3); - if ((busef->memerreg&IVV) == 0) - panic("buserror"); -} +buserror(busef) + caddr_t busef; +{ + register struct buserframe *frameptr; + register long hardreg; + + + frameptr = (struct buserframe *)busef; + printf("bus error at address %x, psl = %x\n", + frameptr->trp_pc,frameptr->trp_psl); + hardreg = frameptr->memerreg; + printf("\tMEAR = %x\n",((hardreg&MEAR)>>16)&0xffff); + switch (hardreg & ERRCD){ + case (APE): printf("\tAdress parity error.Should not reach this point!! \n"); + break; + case (DPE): printf("\tData parity error.\n"); + break; + case (DCE): printf("\tData check error.\n"); + break; + case (VTO): printf("\tVersabus timeout.\n"); + break; + case (VBE): printf("\tVersabus error.Should not reach this point!! \n"); + break; + case (NEM): printf("\tNon existent memory.\n"); + break; + default: printf("\tUnknown error code: %x\n", + hardreg&ERRCD); + } + if (hardreg&AXE) printf("\tAdapter external error\n"); + printf ("\tError master : "); + if (hardreg&ERM) printf("Versabus\n"); + else printf ("Tahoe\n"); + if (hardreg&IVV) + printf("\tIllegal interrupt vector, from ipl %d\n", + (hardreg >> 2) & 7); + + hardreg = frameptr->which_bus; + printf("\tMCBR = %x\n", ((hardreg&MCBR)>>16)&0xffff); + printf("\tVersabus type : %x\n", hardreg&0xffc3); + if (frameptr->memerreg&IVV) return; + panic("buserror"); +} + physstrat(bp, strat, prio) struct buf *bp; int (*strat)(), prio; { @@ -607,20 +598,22 @@ while ((bp->b_flags & B_DONE) == 0) sleep((caddr_t)bp, prio); splx(s); } -/* - * Clear registers on exec - */ -setregs(entry) - u_long entry; -{ - -#ifdef notdef - /* should pass args to init on the stack */ - for (rp = &u.u_ar0[0]; rp < &u.u_ar0[16];) - *rp++ = 0; -#endif - u.u_ar0[FP] = 0; /* bottom of the fp chain */ - u.u_ar0[PC] = entry + 2; -} + +/*ARGSUSED*/ +mtpr (value, regno) +{ + asm("mtpr 4(fp), 8(fp)"); +} + +/*ARGSUSED*/ +int +mfpr (regno) +{ + asm("mfpr 4(fp),r0"); +#ifdef lint + return(0); +#endif +} + Index: sys/tahoe/tahoe/mem.c ================================================================== --- sys/tahoe/tahoe/mem.c +++ sys/tahoe/tahoe/mem.c @@ -1,6 +1,6 @@ -/* mem.c 1.2 86/01/05 */ +/* mem.c 1.1 85/07/21 */ /* * Memory special file */ @@ -14,11 +14,11 @@ #include "../h/systm.h" #include "../h/vm.h" #include "../h/cmap.h" #include "../h/uio.h" -#include "../tahoe/mtpr.h" +#include "../machine/mtpr.h" mmread(dev, uio) dev_t dev; struct uio *uio; { @@ -62,11 +62,11 @@ v = btop(uio->uio_offset); if (v >= physmem) goto fault; *(int *)mmap = v | PG_V | (rw == UIO_READ ? PG_KR : PG_KW); - mtpr(TBIS, vmmap); + mtpr(vmmap, TBIS); o = (int)uio->uio_offset & PGOFSET; c = min((u_int)(NBPG - o), (u_int)iov->iov_len); c = min(c, (u_int)(NBPG - ((int)iov->iov_base&PGOFSET))); error = uiomove((caddr_t)&vmmap[o], (int)c, rw, uio); continue; DELETED sys/tahoe/tahoe/mem.h Index: sys/tahoe/tahoe/mem.h ================================================================== --- sys/tahoe/tahoe/mem.h +++ sys/tahoe/tahoe/mem.h @@ -1,53 +0,0 @@ -/* mem.h 1.1 86/01/05 */ - -/* - * Memory controller registers - * - */ - - -/* - * Some bits definition for MCR - */ - -#define EED 0x01 /* Enable error detection */ -#define EEC 0x02 /* Enable error correction */ -#define WMD 0x04 /* Write memory diagnostic */ -#define RMD 0x08 /* Read memory diagnostic */ -#define INT 0x20 /* Init = power on bit */ -#define CEC 0x40 /* Clear error count */ -#define CME 0x80 /* Clear memory error */ -#define CMEC 0xff00 /* Corrected memory error count (mask) */ - -/* shifts to get the values of MCR fields. */ - -#define EECSHFT 0x01 /* Enable error correction */ -#define WMDSHFT 0x02 /* Write memory diagnostic */ -#define RMDSHFT 0x03 /* Read memory diagnostic */ -#define INTSHFT 0x05 /* Init = power on bit */ -#define CECSHFT 0x06 /* Clear error count */ -#define CMESHFT 0x07 /* Clear memory error */ -#define CMECSHFT 0x08 /* Corrected memory error count (mask) */ -/* - * MER bits - */ - -#define ERRCD 0x07 /* Error code (mask) */ -#define APE 1 /* Address parity error */ -#define DPE 2 /* Data parity error */ -#define DCE 3 /* Data check error */ -#define VTO 4 /* Versabus timeout */ -#define VBE 5 /* Versabus error */ -#define NEM 6 /* Non-existent memory */ - -#define AXE 0x08 /* Adapter external error */ -#define ERM 0x10 /* Error master (0=CPU, 1=Versabus) */ -#define IVV 0x100 /* Illegal Versabus vector */ - -/* - * MCBR bits - */ - -#define MCBR 0xffff0000 -#define MEAR 0xffff0000 - DELETED sys/tahoe/tahoe/rpb.h Index: sys/tahoe/tahoe/rpb.h ================================================================== --- sys/tahoe/tahoe/rpb.h +++ sys/tahoe/tahoe/rpb.h @@ -1,17 +0,0 @@ -/* rpb.h 1.1 86/01/05 */ - -/* - * The restart parameter block, which is a page in (very) low - * core which runs after a crash. Currently, the restart - * procedure takes a dump. - */ -struct rpb { - struct rpb *rp_selfref; /* self-reference */ - int (*rp_dumprout)(); /* routine to be called */ - long rp_checksum; /* checksum of 31 words of dumprout */ - long rp_flag; /* set to 1 when dumprout runs */ -/* the dump stack grows from the end of the rpb page not to reach here */ -}; -#ifdef KERNEL -extern struct rpb rpb; -#endif DELETED sys/tahoe/tahoe/scb.h Index: sys/tahoe/tahoe/scb.h ================================================================== --- sys/tahoe/tahoe/scb.h +++ sys/tahoe/tahoe/scb.h @@ -1,58 +0,0 @@ -/* scb.h 1.1 86/01/05 */ - -/* - * System control block. - */ -struct scb { - int (*scb_vec0)(); /* 000: reserved */ - int (*scb_powfail)(); /* 004: power failure */ - int (*scb_doadump)(); /* 008: power restore */ - int (*scb_vec3)(); /* 00c: reserved */ - int (*scb_vec4)(); /* 010: reserved */ - int (*scb_vec5)(); /* 014: reserved */ - int (*scb_vec6)(); /* 018: reserved */ - int (*scb_hardclock)(); /* 01c: interval timer (clock) */ - int (*scb_vec8)(); /* 020: reserved */ - int (*scb_vec9)(); /* 024: reserved */ - int (*scb_cnrint)(); /* 028: console receive */ - int (*scb_cnxint)(); /* 02c: console transmit */ - int (*scb_rmtrint)(); /* 030: remote line receive */ - int (*scb_rmtxint)(); /* 034: remote line transmit */ - int (*scb_vec14)(); /* 038: reserved */ - int (*scb_vec15)(); /* 03c: reserved */ - int (*scb_softint[15])(); /* 040: software ints (ipl 1f-1) */ - int (*scb_vec31)(); /* 07c: reserved */ - int (*scb_buserr)(); /* 080: bus error */ - int (*scb_vec33)(); /* 084: reserved */ - int (*scb_vec34)(); /* 088: reserved */ - int (*scb_vec35)(); /* 08c: reserved */ - int (*scb_vec36)(); /* 090: reserved */ - int (*scb_vec37)(); /* 094: reserved */ - int (*scb_vec38)(); /* 098: reserved */ - int (*scb_vec39)(); /* 09c: reserved */ - int (*scb_vec40)(); /* 0a0: reserved */ - int (*scb_vec41)(); /* 0a4: reserved */ - int (*scb_vec42)(); /* 0a8: reserved */ - int (*scb_syscall)(); /* 0ac: system call (kcall) */ - int (*scb_privinflt)(); /* 0b0: privileged/reserved inst */ - int (*scb_respoflt)(); /* 0b4: reserved operand */ - int (*scb_resadflt)(); /* 0b8: reserved addressing mode */ - int (*scb_protflt)(); /* 0bc: access control violation */ - int (*scb_transflt)(); /* 0c0: translation not valid */ - int (*scb_kspnotval)(); /* 0c4: kernel stack invalid */ - int (*scb_tracep)(); /* 0c8: trace trap */ - int (*scb_bptflt)(); /* 0cc: breakpoint */ - int (*scb_arithtrap)(); /* 0d0: arithmetic exception */ - int (*scb_alignflt)(); /* 0d4: alignment fault */ - int (*scb_sfexcep)(); /* 0d8: system forced exception */ - int (*scb_fpm)(); /* 0dc: floating point emulation */ - int (*scb_vec56)(); /* 0e0: reserved */ - int (*scb_vec57)(); /* 0e4: reserved */ - int (*scb_vec58)(); /* 0e8: reserved */ - int (*scb_vec59)(); /* 0ec: reserved */ - int (*scb_vec60)(); /* 0f0: reserved */ - int (*scb_vec61)(); /* 0f4: reserved */ - int (*scb_vec62)(); /* 0f8: reserved */ - int (*scb_vec63)(); /* 0fc: reserved */ - int (*scb_devint[192])(); /* 100: device vectors */ -}; DELETED sys/tahoe/tahoe/scb.s Index: sys/tahoe/tahoe/scb.s ================================================================== --- sys/tahoe/tahoe/scb.s +++ sys/tahoe/tahoe/scb.s @@ -1,145 +0,0 @@ -/* scb.s 1.1 86/01/05 */ -/* scb.s TAHOE 4.2 version 84/03/1 */ - -/* - * System control block - */ - - -#define _Xnull 0 -#define STRAY .long _Xstray -#define STRAY8 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY -#define STRAY15 STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY;STRAY8 -#define KS(a) .long _X/**/a -#define IS(a) .long _X/**/a - -_scb: .globl _scb -/* 000 */ STRAY; IS(powfail); IS(doadump); STRAY; -/* 004 */ STRAY; STRAY; STRAY; IS(hardclock); -/* 008 */ STRAY; STRAY; IS(cnrint); IS(cnxint); -/* 00c */ IS(rmtrint); IS(rmtxint); STRAY; STRAY; -/* 010 */ IS(soft15); IS(soft14); IS(soft13); IS(netintr); -/* 014 */ IS(soft11); IS(soft10); IS(soft9); IS(softclock); -/* 018 */ IS(soft7); IS(soft6); IS(soft5); IS(soft4); -/* 01c */ IS(soft3); IS(soft2); IS(soft1); STRAY; -/* 020 */ IS(buserr); STRAY; STRAY; STRAY; -/* 024 */ STRAY; STRAY; STRAY; STRAY; -/* 028 */ STRAY; STRAY; STRAY; KS(syscall); -/* 02c */ KS(privinflt); KS(resopflt); KS(resadflt); KS(protflt); -/* 030 */ KS(transflt); IS(kspnotval); KS(tracep); KS(bptflt); -/* 034 */ KS(arithtrap); KS(alignflt); KS(sfexcep); KS(fpm); -/* 038 */ STRAY; STRAY; STRAY; STRAY; -/* 03c */ STRAY; STRAY; STRAY; STRAY; -#include "vx.h" -#if NVX > 0 -/* 040 */ IS(vackint0); IS(vcmdrsp0); IS(vunsol0); STRAY; -#else -/* 040 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 1 -/* 044 */ IS(vackint1); IS(vcmdrsp1); IS(vunsol1); STRAY; -#else -/* 044 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 2 -/* 048 */ IS(vackint2); IS(vcmdrsp2); IS(vunsol2); STRAY; -#else -/* 048 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 3 -/* 04c */ IS(vackint3); IS(vcmdrsp3); IS(vunsol3); STRAY; -#else -/* 04c */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 4 -/* 050 */ IS(vackint4); IS(vcmdrsp4); IS(vunsol4); STRAY; -#else -/* 050 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 5 -/* 054 */ IS(vackint5); IS(vcmdrsp5); IS(vunsol5); STRAY; -#else -/* 054 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 6 -/* 058 */ IS(vackint6); IS(vcmdrsp6); IS(vunsol6); STRAY; -#else -/* 058 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 7 -/* 05c */ IS(vackint7); IS(vcmdrsp7); IS(vunsol7); STRAY; -#else -/* 05c */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 8 -/* 060 */ IS(vackint8); IS(vcmdrsp8); IS(vunsol8); STRAY; -#else -/* 060 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 9 -/* 064 */ IS(vackint9); IS(vcmdrsp9); IS(vunsol9); STRAY; -#else -/* 064 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 10 -/* 068 */ IS(vackint10); IS(vcmdrsp10); IS(vunsol10); STRAY; -#else -/* 068 */ STRAY; STRAY; STRAY; STRAY; -#endif -#if NVX > 11 -/* 06c */ IS(vackint11); IS(vcmdrsp11); IS(vunsol11); STRAY; -#else -/* 06c */ STRAY; STRAY; STRAY; STRAY; -#endif -/* 070 */ STRAY; STRAY15; -#include "cy.h" -#if NCY > 0 -/* 080 */ IS(cyintr0); STRAY15; -#else -/* 080 */ STRAY; STRAY15; -#endif -#include "ace.h" -#if NACE > 0 -/* 090 */ IS(acecint0); IS(acerint0); STRAY; STRAY; -#else -/* 090 */ STRAY; STRAY; STRAY; STRAY; -#endif -/* 094 */ STRAY; STRAY; STRAY; STRAY; -#if NACE > 1 -/* 098 */ IS(acecint1); IS(acerint1); STRAY; STRAY; -#else -/* 098 */ STRAY; STRAY; STRAY; STRAY; -#endif -/* 09c */ STRAY; STRAY; STRAY; STRAY; -/* 0a0 */ STRAY; STRAY15; -/* 0b0 */ STRAY; STRAY15; -/* 0c0 */ STRAY; STRAY15; -/* 0d0 */ STRAY; STRAY15; -#include "fsd.h" -#if NVD > 0 -/* 0e0 */ IS(vdintr0); -#else -/* 0e0 */ STRAY; -#endif -#if NVD > 1 -/* 0e4 */ IS(vdintr1); -#else -/* 0e4 */ STRAY; -#endif -#if NVD > 2 -/* 0e8 */ IS(vdintr2); -#else -/* 0e8 */ STRAY; -#endif -#if NVD > 3 -/* 0ec */ IS(vdintr3); -#else -/* 0ec */ STRAY; -#endif - -/* 0e4 */ STRAY; STRAY; STRAY; STRAY; -/* 0e8 */ STRAY8; -/* 0f0 */ STRAY; STRAY; STRAY; STRAY; -/* 0f4 */ STRAY; STRAY; STRAY; STRAY; -/* 0f8 */ STRAY; STRAY; STRAY; STRAY; -/* 0fC */ STRAY; STRAY; STRAY; STRAY; Index: sys/tahoe/tahoe/swapgeneric.c ================================================================== --- sys/tahoe/tahoe/swapgeneric.c +++ sys/tahoe/tahoe/swapgeneric.c @@ -1,19 +1,19 @@ -/* swapgeneric.c 1.2 86/01/05 */ +/* swapgeneric.c 1.1 85/07/21 */ #include "../machine/pte.h" -#include "param.h" -#include "conf.h" -#include "buf.h" -#include "vm.h" -#include "systm.h" -#include "reboot.h" - -#include "../tahoe/cp.h" -#include "../tahoe/mtpr.h" -#include "../tahoevba/vbavar.h" +#include "../h/param.h" +#include "../h/conf.h" +#include "../h/buf.h" +#include "../h/vm.h" +#include "../h/systm.h" +#include "../h/reboot.h" + +#include "../machine/cp.h" +#include "../machine/mtpr.h" +#include "../vba/vbavar.h" /* * Generic configuration; all in one */ dev_t rootdev, argdev, dumpdev; @@ -33,11 +33,10 @@ dev_t gc_root; } genericconf[] = { { (caddr_t)&vddriver, "fsd", makedev(1, 0), }, { (caddr_t)&vddriver, "smd", makedev(1, 0), }, { (caddr_t)&vddriver, "xfd", makedev(1, 0), }, - { (caddr_t)&vddriver, "xsd", makedev(1, 0), }, { 0 }, }; setconf() { @@ -65,11 +64,11 @@ unit = name[3] - '0'; goto found; } printf("bad/missing unit number\n"); bad: - printf("use fsd%%d, smd%%d, xfd%%d, or xsd%%d\n"); + printf("use fsd%%d, smd%%d, or xfd%%d\n"); goto retry; } unit = 0; for (gc = genericconf; gc->gc_driver; gc++) { for (ui = vbdinit; ui->ui_driver; ui++) { @@ -95,27 +94,27 @@ rootdev = dumpdev; } getchar() { - char c; + char c; int timo; - extern struct cpdcb_i consin[]; - extern struct cphdr *lasthdr; + extern struct cpdcb_i consin[]; + extern struct cphdr *lasthdr; #define cpin consin[CPCONS] timo = 10000; uncache((char *)&lasthdr->cp_unit); - while ((lasthdr->cp_unit&CPTAKE) == 0 && --timo) - uncache(&lasthdr->cp_unit); + while ((lasthdr->cp_unit & CPTAKE)==0 && --timo ) + uncache((char *)&lasthdr->cp_unit); cpin.cp_hdr.cp_unit = CPCONS; /* Resets done bit */ cpin.cp_hdr.cp_comm = CPREAD; cpin.cp_hdr.cp_count = 1; - mtpr(CPMDCB, &cpin); + mtpr(&cpin, CPMDCB); while ((cpin.cp_hdr.cp_unit & CPDONE) == 0) - uncache(&cpin.cp_hdr.cp_unit); - uncache(&cpin.cpi_buf[0]); + uncache (&cpin.cp_hdr.cp_unit); + uncache (&cpin.cpi_buf[0]); c = cpin.cpi_buf[0] & 0x7f; lasthdr = (struct cphdr *)&cpin; if (c == '\r') c = '\n'; printf("%c", c); /* takes care of interrupts & parity */ DELETED sys/tahoe/tahoe/symbols.raw Index: sys/tahoe/tahoe/symbols.raw ================================================================== --- sys/tahoe/tahoe/symbols.raw +++ sys/tahoe/tahoe/symbols.raw @@ -1,80 +0,0 @@ -# symbols.raw 1.1 86/01/05 - _version -#dmesg - _msgbuf -#iostat - _dk_busy - _dk_time - _dk_xfer - _dk_wds - _tk_nin - _tk_nout - _dk_seek - _cp_time - _dk_mspw -# _io_info -#ps - _proc - _Usrptmap - _usrpt - _text - _nswap - _maxslp - _ccpu - _ecmx - _nproc - _ntext -#pstat - _inode - _text - _proc -# _dz_tty -# _dz_cnt - _cons - _file - _Usrptmap - _usrpt - _nswap - _swapmap -# _dh11 -# _ndh11 -#vmstat - _cp_time - _rate - _total - _deficit - _forkstat - _sum - _firstfree - _maxfree -# _rectime -# _pgintime - _dk_xfer - _boottime -#w - _proc - _swapdev - _Usrptmap - _usrpt - _nswap - _avenrun - _boottime -#netstat - _mbstat - _ipstat - _tcb - _tcpstat - _udb - _udpstat - _rawcb - _Sysmap - _Syssize - _ifnet - _rthost - _rtnet - _icmpstat -#routed - _ifnet -#rwho - _avenrun - _boottime DELETED sys/tahoe/tahoe/sys_machdep.c Index: sys/tahoe/tahoe/sys_machdep.c ================================================================== --- sys/tahoe/tahoe/sys_machdep.c +++ sys/tahoe/tahoe/sys_machdep.c @@ -1,132 +0,0 @@ -/* sys_machdep.c 1.1 86/01/05 */ - -#include "../h/param.h" -#include "../h/systm.h" -#include "../h/dir.h" -#include "../h/user.h" -#include "../h/ioctl.h" -#include "../h/file.h" -#include "../h/proc.h" -#include "../h/uio.h" -#include "../h/kernel.h" -#include "../h/mtio.h" -#include "../h/buf.h" - -#include "../machine/dkio.h" -#include "../machine/pte.h" - -#ifdef TRACE -int nvualarm; - -vtrace() -{ - register struct a { - int request; - int value; - } *uap; - int vdoualarm(); - - uap = (struct a *)u.u_ap; - switch (uap->request) { - - case VTR_DISABLE: /* disable a trace point */ - case VTR_ENABLE: /* enable a trace point */ - if (uap->value < 0 || uap->value >= TR_NFLAGS) - u.u_error = EINVAL; - else { - u.u_r.r_val1 = traceflags[uap->value]; - traceflags[uap->value] = uap->request; - } - break; - - case VTR_VALUE: /* return a trace point setting */ - if (uap->value < 0 || uap->value >= TR_NFLAGS) - u.u_error = EINVAL; - else - u.u_r.r_val1 = traceflags[uap->value]; - break; - - case VTR_UALARM: /* set a real-time ualarm, less than 1 min */ - if (uap->value <= 0 || uap->value > 60 * hz || - nvualarm > 5) - u.u_error = EINVAL; - else { - nvualarm++; - timeout(vdoualarm, (caddr_t)u.u_procp->p_pid, - uap->value); - } - break; - - case VTR_STAMP: - trace(TR_STAMP, uap->value, u.u_procp->p_pid); - break; - } -} - -vdoualarm(arg) - int arg; -{ - register struct proc *p; - - p = pfind(arg); - if (p) - psignal(p, 16); - nvualarm--; -} -#endif - -#ifdef COMPAT -/* - * Note: these tables are sorted by - * ioctl "code" (in ascending order). - */ -int dctls[] = { DKIOCHDR, 0 }; -int fctls[] = { FIOCLEX, FIONCLEX, FIOASYNC, FIONBIO, FIONREAD, 0 }; -int mctls[] = { MTIOCTOP, MTIOCGET, 0 }; -int tctls[] = { - TIOCGETD, TIOCSETD, TIOCHPCL, TIOCMODG, TIOCMODS, - TIOCGETP, TIOCSETP, TIOCSETN, TIOCEXCL, TIOCNXCL, - TIOCFLUSH,TIOCSETC, TIOCGETC, TIOCREMOTE,TIOCMGET, - TIOCMBIC, TIOCMBIS, TIOCMSET, TIOCSTART,TIOCSTOP, - TIOCPKT, TIOCNOTTY,TIOCSTI, TIOCOUTQ, TIOCGLTC, - TIOCSLTC, TIOCSPGRP,TIOCGPGRP,TIOCCDTR, TIOCSDTR, - TIOCCBRK, TIOCSBRK, TIOCLGET, TIOCLSET, TIOCLBIC, - TIOCLBIS, 0 -}; - -/* - * Map an old style ioctl command to new. - */ -mapioctl(cmd) - int cmd; -{ - register int *map, c; - - switch ((cmd >> 8) & 0xff) { - - case 'd': - map = dctls; - break; - - case 'f': - map = fctls; - break; - - case 'm': - map = mctls; - break; - - case 't': - map = tctls; - break; - - default: - return (0); - } - while ((c = *map) && (c&0xff) < (cmd&0xff)) - map++; - if (c && (c&0xff) == (cmd&0xff)) - return (c); - return (0); -} -#endif Index: sys/tahoe/tahoe/trap.c ================================================================== --- sys/tahoe/tahoe/trap.c +++ sys/tahoe/tahoe/trap.c @@ -1,98 +1,106 @@ -/* trap.c 1.4 86/01/09 */ - -#include "../tahoe/psl.h" -#include "../tahoe/reg.h" -#include "../tahoe/pte.h" -#include "../tahoe/mtpr.h" - -#include "param.h" -#include "systm.h" -#include "dir.h" -#include "user.h" -#include "proc.h" -#include "seg.h" -#include "acct.h" -#include "kernel.h" -#define SYSCALLTRACE +/* trap.c 4.10 84/02/09 */ + +#include "../machine/psl.h" +#include "../machine/reg.h" +#include "../machine/pte.h" + +#include "../h/param.h" +#include "../h/systm.h" +#include "../h/dir.h" +#include "../h/user.h" +#include "../h/proc.h" +#include "../h/seg.h" +#include "../machine/trap.h" +#include "../h/acct.h" +#include "../h/kernel.h" +#include "../machine/mtpr.h" #ifdef SYSCALLTRACE #include "../sys/syscalls.c" #endif - -#include "../tahoe/trap.h" +#include "../machine/fp_in_krnl.h" #define USER 040 /* user-mode flag added to type */ -struct sysent sysent[]; -int nsysent; - -char *trap_type[] = { - "Reserved addressing mode", /* T_RESADFLT */ - "Privileged instruction", /* T_PRIVINFLT */ - "Reserved operand", /* T_RESOPFLT */ - "Breakpoint", /* T_BPTFLT */ - 0, - "Kernel call", /* T_SYSCALL */ - "Arithmetic trap", /* T_ARITHTRAP */ - "System forced exception", /* T_ASTFLT */ - "Segmentation fault", /* T_SEGFLT */ - "Protection fault", /* T_PROTFLT */ - "Trace trap", /* T_TRCTRAP */ - 0, - "Page fault", /* T_PAGEFLT */ - "Page table fault", /* T_TABLEFLT */ - "Alignment fault", /* T_ALIGNFLT */ - "Kernel stack not valid", /* T_KSPNOTVAL */ - "Bus error", /* T_BUSERR */ -}; -#define TRAP_TYPES (sizeof (trap_type) / sizeof (trap_type[0])) +struct sysent sysent[]; +int nsysent; /* * Called from the trap handler when a processor trap occurs. */ -/*ARGSUSED*/ trap(sp, type, hfs, accmst, acclst, dbl, code, pc, psl) - unsigned type, code; +unsigned code; { - int r0, r1; /* must reserve space */ + /* Next 2 dummy variables MUST BE the first local */ + /* variables; leaving place for registers 0 and 1 */ + /* which are not preserved by the 'cct' */ + + int dumm1; /* register 1 */ + int dumm0; /* register 0 */ + register dumm3; /* register 12 is the 1'st register variable */ + /* in TAHOE (register 11 in VAX) */ + register int *locr0 = ((int *)&psl)-PS; register int i; register struct proc *p; struct timeval syst; + char *typename; -#ifdef lint - r0 = 0; r0 = r0; r1 = 0; r1 = r1; -#endif syst = u.u_ru.ru_stime; if (USERMODE(locr0[PS])) { type |= USER; u.u_ar0 = locr0; } switch (type) { - default: - printf("trap type %d, code = %x, pc = %x\n", type, code, pc); - type &= ~USER; - if (type < TRAP_TYPES && trap_type[type]) - panic(trap_type[type]); - else - panic("trap"); - /*NOTREACHED*/ - - case T_PROTFLT + USER: /* protection fault */ + default: switch (type) { + case T_RESADFLT: + typename = "reserved addressing mode";break; + case T_PRIVINFLT: + typename = "illegal opcode";break; + case T_RESOPFLT: + typename = "reserved operand";break; + case T_BPTFLT: + typename = "breakpoint";break; + case T_SYSCALL: + typename = "kernel call";break; + case T_ARITHTRAP: + typename = "arithmetic exception";break; + case T_ASTFLT: + typename = "system forced exception";break; + case T_SEGFLT: + typename = "limit fault";break; + case T_PROTFLT: + typename = "illegal access type";break; + case T_TRCTRAP: + typename = "trace trap";break; + case T_PAGEFLT: + typename = "page fault";break; + case T_TABLEFLT: + typename = "page table fault";break; + case T_ALIGNFLT: + typename = "alignment fault";break; + case T_KSPNOTVAL: + typename = "kernel stack not valid";break; + } + printf("System trap (%s), code = %x, pc = %x\n", + typename, code, pc); + panic("trap"); + + case T_PROTFLT + USER: /* protection fault */ i = SIGBUS; break; case T_PRIVINFLT + USER: /* privileged instruction fault */ - case T_RESADFLT + USER: /* reserved addressing fault */ - case T_RESOPFLT + USER: /* resereved operand fault */ - case T_ALIGNFLT + USER: /* unaligned data fault */ + case T_RESADFLT + USER: /* reserved addressing fault */ + case T_RESOPFLT + USER: /* resereved operand fault */ + case T_ALIGNFLT + USER: /* unaligned data fault */ u.u_code = type &~ USER; i = SIGILL; break; - case T_ASTFLT + USER: /* Allow process switch */ + case T_ASTFLT + USER: /* Allow process switch */ case T_ASTFLT: astoff(); if ((u.u_procp->p_flag & SOWEUPC) && u.u_prof.pr_scale) { addupc(pc, &u.u_prof, 1); u.u_procp->p_flag &= ~SOWEUPC; @@ -112,52 +120,36 @@ if (grow((unsigned)locr0[SP]) || grow(code)) goto out; i = SIGSEGV; break; - case T_TABLEFLT: /* allow page table faults in kernel */ - case T_TABLEFLT + USER: /* page table fault */ + case T_TABLEFLT: /* allow page table faults in kernel mode */ + case T_TABLEFLT + USER: /* page table fault */ panic("ptable fault"); - case T_PAGEFLT: /* allow page faults in kernel mode */ - case T_PAGEFLT + USER: /* page fault */ + case T_PAGEFLT: /* allow page faults in kernel mode */ + case T_PAGEFLT + USER: /* page fault */ i = u.u_error; - pagein(code, 0); + if(fastreclaim(code) == 0) + pagein(code, 0); u.u_error = i; if (type == T_PAGEFLT) return; goto out; - case T_BPTFLT + USER: /* bpt instruction fault */ - case T_TRCTRAP + USER: /* trace trap */ + case T_BPTFLT + USER: /* bpt instruction fault */ + case T_TRCTRAP + USER: /* trace trap */ locr0[PS] &= ~PSL_T; i = SIGTRAP; break; - - /* - * For T_KSPNOTVAL and T_BUSERR, can not allow spl to - * drop to 0 as clock could go off and we would end up - * doing an rei to the interrupt stack at ipl 0 (a - * reserved operand fault). Instead, we allow psignal - * to post an ast, then return to user mode where we - * will reenter the kernel on the kernel's stack and - * can then service the signal. - */ case T_KSPNOTVAL: - if (noproc) - panic("ksp not valid"); - /* fall thru... */ case T_KSPNOTVAL + USER: - printf("pid %d: ksp not valid\n", u.u_procp->p_pid); - /* must insure valid kernel stack pointer? */ - psignal(u.u_procp, SIGKILL); - return; - - case T_BUSERR + USER: - u.u_code = code; - psignal(u.u_procp, SIGBUS); - return; + i = SIGKILL; /* There is nothing to do but to kill the + * process.. */ + printf("KSP NOT VALID.\n"); + break; + } psignal(u.u_procp, i); out: p = u.u_procp; if (p->p_cursig || ISSIG(p)) @@ -188,76 +180,81 @@ } curpri = p->p_pri; } #ifdef SYSCALLTRACE -int syscalltrace = 0; +int syscalltrace = 0; #endif /* - * Called from locore when a system call occurs - */ -/*ARGSUSED*/ -syscall(sp, type, hfs, accmst, acclst, dbl, code, pc, psl) - unsigned code; -{ - int r0, r1; /* must reserve space */ - register int *locr0 = ((int *)&psl)-PS; - register caddr_t params; - register int i; + * Called from the trap handler when a system call occurs + */ +syscall(sp, type, hfs, accmst, acclst, dbl, code, pc, psl) +unsigned code; +{ + /* Next 2 dummy variables MUST BE the first local */ + /* variables; leaving place for registers 0 and 1 */ + /* which are not preserved by the 'cct' */ + + int dumm1; /* register 1 */ + int dumm0; /* register 0 */ + register dumm3; /* register 12 is the 1'st register variable */ + /* in TAHOE (register 11 in VAX) */ + + register int *locr0 = ((int *)&psl)-PS; + register caddr_t params; /* known to be r10 below */ + register int i; /* known to be r9 below */ register struct sysent *callp; register struct proc *p; - struct timeval syst; + struct timeval syst; int opc; -#ifdef lint - r0 = 0; r0 = r0; r1 = 0; r1 = r1; -#endif syst = u.u_ru.ru_stime; if (!USERMODE(locr0[PS])) panic("syscall"); u.u_ar0 = locr0; - if (code == 139) { /* 4.2 COMPATIBILTY XXX */ - osigcleanup(); /* 4.2 COMPATIBILTY XXX */ - goto done; /* 4.2 COMPATIBILTY XXX */ + if (code == 139) { /* XXX */ + sigcleanup(); /* XXX */ + goto done; /* XXX */ } params = (caddr_t)locr0[FP] + NBPW; u.u_error = 0; -/* BEGIN GROT */ - /* - * Try to reconstruct pc, assuming code - * is an immediate constant - */ + /*------ DIRTY CODE !!!!!!!!!---------*/ + /* try to reconstruct pc, assuming code is an immediate constant */ opc = pc - 2; /* short literal */ if (code > 0x3f) { - opc--; /* byte immediate */ + opc--; /* byte immediate */ if (code > 0x7f) { - opc--; /* word immediate */ + opc--; /* word immediate */ if (code > 0x7fff) opc -= 2; /* long immediate */ } } -/* END GROT */ + /*------------------------------------*/ callp = (code >= nsysent) ? &sysent[63] : &sysent[code]; if (callp == sysent) { i = fuword(params); params += NBPW; - callp = (code >= nsysent) ? &sysent[63] : &sysent[code]; - } - if ((i = callp->sy_narg * sizeof (int)) && - (u.u_error = copyin(params, (caddr_t)u.u_arg, (u_int)i)) != 0) { - locr0[R0] = u.u_error; - locr0[PS] |= PSL_C; /* carry bit */ - goto done; - } + callp = (code >= nsysent) ? &sysent[63] : &sysent[code]; + } + if (i = callp->sy_narg * sizeof (int)) { + asm("prober $1,(r10),r9"); /* GROT */ + asm("bnequ ok"); /* GROT */ + u.u_error = EFAULT; /* GROT */ + goto bad; /* GROT */ +asm("ok:"); /* GROT */ + bcopy(params,u.u_arg,i); + } + u.u_ap = u.u_arg; + u.u_dirp = (caddr_t)u.u_arg[0]; u.u_r.r_val1 = 0; - u.u_r.r_val2 = locr0[R1]; + u.u_r.r_val2 = locr0[R1]; /*------------ CHECK again */ if (setjmp(&u.u_qsave)) { - if (u.u_error == 0 && u.u_eosys != RESTARTSYS) + if (u.u_error == 0 && u.u_eosys == JUSTRETURN) u.u_error = EINTR; } else { - u.u_eosys = NORMALRETURN; + u.u_eosys = JUSTRETURN; #ifdef SYSCALLTRACE if (syscalltrace) { register int i; char *cp; @@ -273,25 +270,24 @@ if (i) putchar(')', 0); putchar('\n', 0); } #endif - (*callp->sy_call)(); - } - if (u.u_eosys == NORMALRETURN) { - if (u.u_error) { - locr0[R0] = u.u_error; - locr0[PS] |= PSL_C; /* carry bit */ - } else { - locr0[PS] &= ~PSL_C; /* clear carry bit */ - locr0[R0] = u.u_r.r_val1; - locr0[R1] = u.u_r.r_val2; - } - } else if (u.u_eosys == RESTARTSYS) + + (*(callp->sy_call))(); + } + if (u.u_eosys == RESTARTSYS) pc = opc; - /* else if (u.u_eosys == JUSTRETURN) */ - /* nothing to do */ + else if (u.u_error) { +bad: + locr0[R0] = u.u_error; + locr0[PS] |= PSL_C; /* carry bit */ + } else { + locr0[PS] &= ~PSL_C; /* clear carry bit */ + locr0[R0] = u.u_r.r_val1; + locr0[R1] = u.u_r.r_val2; + } done: p = u.u_procp; if (p->p_cursig || ISSIG(p)) psig(); p->p_pri = p->p_usrpri; @@ -326,20 +322,154 @@ * flag error if process won't see signal immediately * Q: should we do that all the time ?? */ nosys() { - if (u.u_signal[SIGSYS] == SIG_IGN || u.u_signal[SIGSYS] == SIG_HOLD) u.u_error = EINVAL; psignal(u.u_procp, SIGSYS); } -#ifdef notdef /* * Ignored system call */ nullsys() { } -#endif + +fpemulate(hfsreg,acc_most,acc_least,dbl,op_most,op_least,opcode,pc,psl) +{ +/* + * Emulate the F.P. 'opcode'. Update psl flags as necessary. + * If all OK, set 'opcode' to 0, else to the F.P. exception #. + * Not all parameter longwords are relevant - depends on opcode. + * + * The entry mask is set so ALL registers are saved - courtesy of + * locore.s. This enables F.P. opcodes to change 'user' registers + * before return. + */ + + /* WARNING!!!! THIS CODE MUST NOT PRODUCE ANY FLOATING POINT EXCEPTIONS. */ + + /* Next 2 dummy variables MUST BE the first local */ + /* variables; leaving place for registers 0 and 1 */ + /* which are not preserved by the 'cct' */ + + int dumm1; /* register 1 */ + int dumm0; /* register 0 */ + register dumm3; /* register 12 is the 1'st register variable */ + /* in TAHOE (register 11 in VAX) */ + + register int *locr0 = ((int *)&psl)-PS; /* R11 */ + int hfs = 0; /* returned data about exceptions */ + float (*f_proc)(); /* fp procedure to be called. */ + double (*d_proc)(); /* fp procedure to be called. */ + int dest_type; /* float or double. */ + union{ + float ff; /* float result. */ + int fi; + }f_res; + union{ + double dd; /* double result. */ + int di[2] ; + }d_res; + extern float Kcvtlf(), Kaddf(), Ksubf(), Kmulf(), Kdivf(); + extern double Kcvtld(), Kaddd(), Ksubd(), Kmuld(), Kdivd(); + extern float Ksinf(), Kcosf(), Katanf(), Klogf(), Ksqrtf(), Kexpf(); + + + + switch(opcode & 0x0FF){ + + case CVLF: f_proc = Kcvtlf; dest_type = FLOAT; + locr0[PS] &= ~PSL_DBL;break; /* clear double bit */ + case CVLD: d_proc = Kcvtld; dest_type = DOUBLE; + locr0[PS] |= PSL_DBL; break; /* turn on double bit */ + case ADDF: f_proc = Kaddf; dest_type = FLOAT; + break; + case ADDD: d_proc = Kaddd; dest_type = DOUBLE; + break; + case SUBF: f_proc = Ksubf; dest_type = FLOAT; + break; + case SUBD: d_proc = Ksubd; dest_type = DOUBLE; + break; + case MULF: f_proc = Kmulf; dest_type = FLOAT; + break; + case MULD: d_proc = Kmuld; dest_type = DOUBLE; + break; + case DIVF: f_proc = Kdivf; dest_type = FLOAT; + break; + case DIVD: d_proc = Kdivd; dest_type = DOUBLE; + break; + case SINF: f_proc = Ksinf; dest_type = FLOAT; + break; + case COSF: f_proc = Kcosf; dest_type = FLOAT; + break; + case ATANF: f_proc = Katanf; dest_type = FLOAT; + break; + case LOGF: f_proc = Klogf; dest_type = FLOAT; + break; + case SQRTF: f_proc = Ksqrtf; dest_type = FLOAT; + break; + case EXPF: f_proc = Kexpf; dest_type = FLOAT; + break; + } + + switch(dest_type){ + + case FLOAT: + f_res.ff = (*f_proc)(acc_most,acc_least,op_most,op_least,&hfs); + + if (f_res.fi == 0 ) locr0[PS] |= PSL_Z; + if (f_res.fi < 0 ) locr0[PS] |= PSL_N; + break; + case DOUBLE: + d_res.dd = (*d_proc)(acc_most,acc_least,op_most,op_least,&hfs); + if ((d_res.di[0] == 0) && (d_res.di[1] == 0)) + locr0[PS] |= PSL_Z; + if (d_res.di[0] < 0 ) locr0[PS] |= PSL_N; + break; + } + + if (hfs & HFS_OVF){ + locr0[PS] |= PSL_V; /* turn on overflow bit */ + /* if (locr0[PS] & PSL_IV) { /* overflow elabled? */ + opcode = OVF_EXC; + u.u_error = (hfs & HFS_DOM) ? EDOM : ERANGE; + return; + /*}*/ + } + else if (hfs & HFS_UNDF){ + if (locr0[PS] & PSL_FU){ /* underflow elabled? */ + opcode = UNDF_EXC; + u.u_error = (hfs & HFS_DOM) ? EDOM : ERANGE; + return; + } + } + else if (hfs & HFS_DIVZ){ + opcode = DIV0_EXC; + return; + } + else if (hfs & HFS_DOM) + u.u_error = EDOM; + else if (hfs & HFS_RANGE) + u.u_error = ERANGE; + + switch(dest_type){ + case FLOAT: + if ((hfs & HFS_OVF) || (hfs & HFS_UNDF)) { + f_res.ff = 0.0; + locr0[PS] |= PSL_Z; + } + mvtofacc(f_res.ff, &acc_most); + break; + case DOUBLE: + if ((hfs & HFS_OVF) || (hfs & HFS_UNDF)) { + d_res.dd = 0.0; + locr0[PS] |= PSL_Z; + } + mvtodacc(d_res.di[0], d_res.di[1], &acc_most); + break; + } + opcode=0; +} DELETED sys/tahoe/tahoe/udiv.s Index: sys/tahoe/tahoe/udiv.s ================================================================== --- sys/tahoe/tahoe/udiv.s +++ sys/tahoe/tahoe/udiv.s @@ -1,25 +0,0 @@ -/* udiv.s 1.1 86/01/05 */ - -#include "../tahoe/SYS.h" -/* - * result = udiv(dividend, divisor) - * - * unsigned long division - */ - .text -ASENTRY(udiv, R2|R3) - bitl $0x80000000,8(fp) # if (divisor & 0x80000000) { - jeql 2f - cmpl 8(fp),4(fp) # if (divisor > dividend) - jlequ 1f - clrl r0 # return (0); - ret -1: # else - movl $1,r0 # return (1); - ret # } -2: - clrl r0 # return (dividend / divisor); - movl 4(fp),r1 - ediv 8(fp),r0,r2,r3 - movl r2,r0 - ret Index: sys/tahoe/tahoe/vm_machdep.c ================================================================== --- sys/tahoe/tahoe/vm_machdep.c +++ sys/tahoe/tahoe/vm_machdep.c @@ -1,21 +1,20 @@ -/* vm_machdep.c 1.2 86/01/05 */ +/* vm_machdep.c 1.1 85/07/21 */ #include "../machine/pte.h" -#include "param.h" -#include "systm.h" -#include "dir.h" -#include "user.h" -#include "proc.h" -#include "cmap.h" -#include "mount.h" -#include "vm.h" -#include "text.h" -#include "kernel.h" - -#include "../tahoe/mtpr.h" +#include "../h/param.h" +#include "../h/systm.h" +#include "../h/dir.h" +#include "../h/user.h" +#include "../h/proc.h" +#include "../h/cmap.h" +#include "../h/mount.h" +#include "../h/vm.h" +#include "../h/text.h" + +#include "../machine/mtpr.h" /* * Set a red zone in the kernel stack after the u. area. */ setredzone(pte, vaddr) @@ -25,11 +24,11 @@ pte += (sizeof (struct user) + NBPG - 1) / NBPG; *(int *)pte &= ~PG_PROT; *(int *)pte |= PG_URKR; if (vaddr) - mtpr(TBIS, vaddr + sizeof (struct user) + NBPG - 1); + mtpr(vaddr + sizeof (struct user) + NBPG - 1, TBIS); } #ifndef mapin mapin(pte, v, pfnum, count, prot) struct pte *pte; @@ -37,11 +36,11 @@ int count, prot; { while (count > 0) { *(int *)pte++ = pfnum | prot; - mtpr(TBIS, ptob(v)); + mtpr(ptob(v), TBIS); v++; pfnum++; count--; } } @@ -59,19 +58,42 @@ #endif /* * Check for valid program size */ -chksize(ts, ids, uds, ss) - register unsigned ts, ids, uds, ss; -{ - - if (ts > maxtsize || - ctob(ids) > u.u_rlimit[RLIMIT_DATA].rlim_cur || - ctob(uds) > u.u_rlimit[RLIMIT_DATA].rlim_cur || - ctob(ids + uds) > u.u_rlimit[RLIMIT_DATA].rlim_cur || - ctob(ss) > u.u_rlimit[RLIMIT_STACK].rlim_cur) { +chksize(ts, ds, ss) + register unsigned ts, ds, ss; +{ + static int maxdmap = 0; + + if (ts > MAXTSIZ || ds > MAXDSIZ || ss > MAXSSIZ) { + u.u_error = ENOMEM; + return (1); + } + /* check for swap map overflow */ + if (maxdmap == 0) { + register int i, blk; + + blk = dmmin; + for (i = 0; i < NDMAP; i++) { + maxdmap += blk; + if (blk < dmmax) + blk *= 2; + } + } + if (ctod(ts) > NXDAD * dmtext || + ctod(ds) > maxdmap || ctod(ss) > maxdmap) { + u.u_error = ENOMEM; + return (1); + } + /* + * Make sure the process isn't bigger than our + * virtual memory limit. + * + * THERE SHOULD BE A CONSTANT FOR THIS. + */ + if (ts + ds + ss + LOWPAGES + HIGHPAGES > btoc(USRSTACK)) { u.u_error = ENOMEM; return (1); } return (0); } @@ -86,15 +108,15 @@ #ifdef lint pte = pte; #endif if (size >= 8) { - mtpr(TBIA, 0); + mtpr(0, TBIA); return; } while (size > 0) { - mtpr(TBIS, a); + mtpr(a, TBIS); a += NBPG; size--; } } @@ -140,30 +162,30 @@ ptaddr = (int *)mfpr(P0BR); for (i = 0; i < u.u_tsize; i++) { ptaddr[i] &= ~PG_PROT; ptaddr[i] |= tprot; } - mtpr(TBIA, 0); + mtpr(0, TBIA); } -#ifdef notdef /* * Rest are machine-dependent */ + getmemc(addr) caddr_t addr; { register int c; struct pte savemap; savemap = mmap[0]; *(int *)mmap = PG_V | PG_KR | btop(addr); - mtpr(TBIS, vmmap); - uncache(&vmmap[(int)addr & PGOFSET]); + mtpr(vmmap, TBIS); + uncache (&vmmap[(int)addr & PGOFSET]); c = *(char *)&vmmap[(int)addr & PGOFSET]; mmap[0] = savemap; - mtpr(TBIS, vmmap); + mtpr(vmmap, TBIS); return (c & 0377); } putmemc(addr, val) caddr_t addr; @@ -170,20 +192,19 @@ { struct pte savemap; savemap = mmap[0]; *(int *)mmap = PG_V | PG_KW | btop(addr); - mtpr(TBIS, vmmap); + mtpr(vmmap, TBIS); *(char *)&vmmap[(int)addr & PGOFSET] = val; - mtpr(PADC, 0); - mtpr(PACC, 0); + mtpr (0, PADC); + mtpr (0, PACC); mmap[0] = savemap; - mtpr(TBIS, vmmap); + mtpr(vmmap, TBIS); } -#endif /* * Move pages from one kernel virtual address to another. * Both addresses are assumed to reside in the Sysmap, * and size must be a multiple of CLSIZE. @@ -199,277 +220,116 @@ fpte = &Sysmap[btop(from - 0xC0000000)]; tpte = &Sysmap[btop(to - 0xC0000000)]; while (size > 0) { *tpte++ = *fpte; *(int *)fpte++ = 0; - mtpr(TBIS, from); - mtpr(TBIS, to); - mtpr(P1DC, to); /* purge !! */ + mtpr(from, TBIS); + mtpr(to, TBIS); + mtpr(to, P1DC); /* purge !! */ from += NBPG; to += NBPG; size -= NBPG; } } -#ifndef vtopte +#ifndef GLOBKEY +ckeyrelease(key) +/* + * release code key + */ +{ + register int ipl,i,j ; + ipl = spl8(); + if (--ckey_cnt[key-1] < 0 ) { /* - * Convert a virtual page - * number to a pte address. - */ -/*VARARGS1*/ -struct pte * -vtopte(p, v) - register struct proc *p; -{ - - if ((v & 0x300000) == 0x300000) - return (struct pte *)(mfpr(SBR) + 0xc0000000 + (v&0xfffff)*4); - if (p == 0) - panic("vtopte (no proc)"); - if (v < p->p_tsize + p->p_dsize) - return (p->p_p0br + v); - return (p->p_p0br + (p->p_szpt*NPTEPG + v - (BTOPUSRSTACK + UPAGES))); + panic ("Code key release"); +*/ + printf("Ckey release, key=%d\n", key); + ckey_cnt[key-1] = 0; + splx(ipl); + } + splx(ipl); +} + + +dkeyrelease(key) +/* + * release data key + */ +{ + if (--dkey_cnt[key-1] != 0 ) panic ("Data key release"); +} + + +int +getcodekey() +/* + * Get a code key + */ +{ + register int i, ipl, first; + + first = 1; + ipl = spl8(); +retry: + for (i=0; i<255; i++) { + if ( (int)ckey_cache[i] == 0) { + ckey_cache[i] = 1; + ckey_cnt[i] = 1; + splx(ipl); + return (i+1); + }; + } + if ( !first) { + splx(ipl); + panic ("Not enough code keys\n"); + } + mtpr (0, PACC); + first = 0; + for (i=0; i<255; i++) + if ( ckey_cnt[i] > 0 ) ckey_cache[i] = 1; + else ckey_cache[i] = 0; + goto retry; +} + +int +getdatakey() +/* + * Get a data key + */ +{ + register int i, ipl, first; + + first = 1; + ipl = spl8(); +retry: + for (i=0; i<255; i++) + if ( (int)dkey_cache[i] == 0) { + dkey_cache[i] = 1; + dkey_cnt[i] = 1; + splx(ipl); + return (i+1); + }; + if ( !first) { + splx(ipl); + panic("Not enough data keys\n"); + } + mtpr (0, PADC); + first = 0; + for (i=0; i<255; i++) + if ( dkey_cnt[i] > 0 ) dkey_cache[i] = 1; + else dkey_cache[i] = 0; + goto retry; } #endif -/* - * Code and data key management routines. - * - * The arrays ckey_cnt and ckey_cache are allways kept in such a way - * that the following invariant holds: - * ckey_cnt > 0 =>'s ckey_cache == 1 - * meaning as long as a code key is used by at least one process, it's - * marked as being 'in the cache'. Of course, the following invariant - * also holds: - * ckey_cache == 0 =>'s ckey_cnt == 0 - * which is just the reciprocal of the 1'st invariant. - * Equivalent invariants hold for the data key arrays. - */ - -/* - * Release a code key. - */ -ckeyrelease(key) - int key; -{ - register int s; - - s = spl8(); - if (--ckey_cnt[key] < 0) { - printf("ckeyrelease: key = %d\n", key); - ckey_cnt[key] = 0; - } - splx(s); -} - -/* - * Release a data key. - */ -dkeyrelease(key) - int key; -{ - register int s; - - s = spl8(); - if (--dkey_cnt[key] != 0) { - printf("dkeyrelease: key = %d\n", key); - dkey_cnt[key] = 0; - } - splx(s); -} - -struct keystats { - long ks_allocs; /* number of keys allocated */ - long ks_free; /* key allocated from free slot */ - long ks_norefs; /* key marked in use, but refcnt 0 */ - long ks_taken; /* key taken from single process */ - long ks_shared; /* key taken from multiple processes */ -}; -struct keystats ckeystats; -struct keystats dkeystats; - -/* - * Get a code key. - */ -getcodekey() -{ - register int i, s, freekey, sharedkey; - register struct proc *p; - - ckeystats.ks_allocs++; - s = spl8(); - freekey = 0; - for (i = 1; i <= MAXCKEY; i++) { - if ((int)ckey_cache[i] == 0) { /* free key, take it */ - ckey_cache[i] = 1, ckey_cnt[i] = 1; - splx(s); - ckeystats.ks_free++; - return (i); - } - if (ckey_cnt[i] == 0) { /* save for potential use */ - if (freekey == 0) - freekey = i; - } else if (ckey_cnt[i] > 1 && i != MAXCKEY) - sharedkey = i; - } - /* - * All code keys were marked as being in cache. - * Moreover, we are assured that sharedkey has a meaningful value, - * since we know that the init process and the shell are around - * and they have shared text! - */ - /* - * If a key was in the cache, but not in use, grab it. - */ - if (freekey != 0) { - /* - * If we've run out of bonified free keys, - * try and free up some other keys to avoid - * future cache purges. - */ - for (i = 1; i <= MAXCKEY; i++) - if (ckey_cnt[i] == 0) - ckey_cache[i] = 0; - ckey_cnt[freekey] = 1, ckey_cache[freekey] = 1; - mtpr(PACC, 0); - splx(s); - ckeystats.ks_norefs++; - return (freekey); - } - - /* - * All keys are marked as in the cache and in use. - * - * Strip some process of their code key. First time, - * 1) Try hard not to do that to kernel processes !! - * 2) Try hard NOT to strip shared text processes of - * their (shared) key, because then they'll run - * with different keys from now on, i.e. less efficient - * cache utilization. - */ - for (p = proc; p < procNPROC; p++) - /* - * Look for a meaningful key but not - * used and not shared text. - */ - if (p->p_ckey && p->p_ckey != MAXCKEY && - ckey_cnt[p->p_ckey] < 2) { - i = p->p_ckey; - p->p_ckey = 0; - ckey_cnt[i] = 1, ckey_cache[i] = 1; - mtpr(PACC, 0); - splx(s); - ckeystats.ks_taken++; - return (i); - } - - /* - * Second time around! - * Highly unlikely situation. It means that all keys are - * allocated AND shared (i.e. we have at least 510 active - * processes). - * Strip some of them. We pick some key (known to be shared - * by several processes) and strip the poor process group. - * At least 2 processes will loose but we gain one key to be reused. - * The way 'shared_key' was produced (above) virtually assures - * us that this key isn't the 'init' group key (1) nor the - * 'shell' group key (2 or 3). It's probably something like 254. - * Could be more straightforward to strip all processes, but it's - * better to invest in one more loop here and keep the cache - * utilization to a maximum. - */ - for (p = proc; p < procNPROC; p++) - if (p->p_ckey == sharedkey) { - p->p_ckey = 0; - ckey_cnt[sharedkey]--; - } - if (ckey_cnt[sharedkey] != 0) { - printf("getcodekey: key = %d cnt = %d\n", - sharedkey, ckey_cnt[sharedkey]); - panic("getcodekey"); - } - ckey_cnt[sharedkey] = 1, ckey_cache[sharedkey] = 1; - mtpr(PACC, 0); - splx(s); - ckeystats.ks_shared++; - return (sharedkey); -} - -/* - * Get a data key. - * - * General strategy: - * 1) Try to find a data key that isn't in the cache. Allocate it. - * 2) If all data keys are in the cache, find one which isn't - * allocated. Clear all status and allocate this one. - * 3) If all of them are allocated, pick some process, strip him - * of the data key and allocate it. We (cold-bloodedly) pick - * one process to be the poor looser because that's the - * easiest way to do it and because this extreme situation - * ( >255 active processes ) is expected to be temporary, - * after which 1) or 2) above should be the usual case. - * The poor looser is the first process which has a data key. - * However, we try to spare known kernel processes and daemons - * (fired at bootstrap time), by searching from proc[LOOSER] and on. - */ -getdatakey() -{ - register int i, s, freekey; - register struct proc *p; - - dkeystats.ks_allocs++; - s = spl8(); - freekey = 0; - for (i = 1; i <= MAXDKEY; i++) { - if ((int)dkey_cache[i] == 0) { /* free key, take it */ - dkey_cache[i] = 1, dkey_cnt[i] = 1; - splx(s); - dkeystats.ks_free++; - return (i); - } - if (dkey_cnt[i] == 0 && freekey == 0) - freekey = i; - } - if (freekey) { - /* - * Try and free up some more keys to avoid - * future allocations causing a cache purge. - */ - for (i = 1; i < MAXDKEY; i++) - if (dkey_cnt[i] == 0) - dkey_cache[i] = 0; - dkey_cnt[freekey] = 1, dkey_cache[freekey] = 1; - mtpr(PADC, 0); - splx(s); - dkeystats.ks_norefs++; - return (freekey); - } - - /* - * Now, we have to take a code from someone. - */ -#define LOOSER 20 - for (p = &proc[LOOSER]; p < procNPROC; p++) - if (p->p_dkey != 0) { - i = p->p_dkey; - p->p_dkey = 0; - dkey_cnt[i] = 1; - dkey_cache[i] = 1; - mtpr(PADC, 0); - splx(s); - dkeystats.ks_taken++; - return (i); - } - panic("getdatakey"); - /*NOTREACHED*/ -} - -/*VARGARGS1*/ -vtoph(p, v) - register struct proc *p; - register unsigned v; -{ - register struct pte *pte; - - pte = vtopte(p, btop(v)); - return ((pte->pg_pfnum << PGSHIFT) + (v & PGOFSET)); -} +/* General (includes system) virtual address to physical */ +vtoph(p, v) +register struct proc *p; +register unsigned v; +{ + register struct pte *thispte; + + thispte = vtopte (p, btop(v)); + return ( (thispte->pg_pfnum << PGSHIFT) + (v & PGOFSET)); +} + Index: sys/tahoe/vba/cy.c ================================================================== --- sys/tahoe/vba/cy.c +++ sys/tahoe/vba/cy.c @@ -1,1810 +1,1084 @@ -/* cy.c 1.2 86/01/05 */ - -#include "cy.h" -#if NCY > 0 -/* - * Cipher Tapemaster driver. - */ -int cydebug = 0; - -#include "../tahoe/mtpr.h" -#include "../tahoe/pte.h" - -#include "param.h" -#include "systm.h" -#include "vm.h" -#include "buf.h" -#include "file.h" -#include "dir.h" -#include "user.h" -#include "proc.h" -#include "signal.h" -#include "uio.h" -#include "ioctl.h" -#include "mtio.h" -#include "errno.h" -#include "cmap.h" - -#include "../tahoevba/vbavar.h" -#include "../tahoevba/cyreg.h" - -#define MAXCONTROLLERS 4 -#define MAX_BLOCKSIZE (TBUFSIZ*NBPG) -#define NUM_UNIT (NCY * 4) - -#define TRUE 1 -#define FALSE 0 - -#define RETRY 1 -#define EXTEND 2 -#define FATAL 3 - -#define MAINTAIN_POSITION 0 -#define DONT_MAINTAIN_POSITION 1 - -#define PROCESSED 0x80000000 -#define SLEEPING 0x80000000 -#define b_cmd av_back /* only unused word in request */ - -extern int cywrite_filemark(), cysearch_fm_forw(), cysearch_fm_back(); -extern int cy_space_forw(), cy_space_back(), cyrewind_tape_ta(); -extern int cyrewind_tape_unl(), cydrive_status(), cyrewind_tape_ov(); -extern int cyraw_read(), cyraw_write(), cybuf_read(), cybuf_write(); -extern int cywait_until_ready(), cywrite_0_fm(), cywrite_1_fm(); -extern int cywrite_2_fm(), cyno_op(), cywrite_eov(); - -static int (*cmd_tbl[15])() = { - cywrite_filemark, -#define DO_W_FM 0 - cysearch_fm_forw, -#define DO_SFMF 1 - cysearch_fm_back, -#define DO_SFMB 2 - cy_space_forw, -#define DO_SPF 3 - cy_space_back, -#define DO_SPB 4 - cyrewind_tape_ta, -#define DO_RWTA 5 - cyrewind_tape_unl, -#define DO_RWUN 6 - cydrive_status, -#define DO_STAT 7 - cyrewind_tape_ov, -#define DO_RWOV 8 - cywait_until_ready, -#define DO_WAIT 9 - cywrite_eov, -#define DO_WEOV 10 - cyraw_read, -#define DO_RRD 11 - cyraw_write, -#define DO_RWT 12 - cybuf_read, -#define DO_BRD 13 - cybuf_write -#define DO_BWT 14 -}; - - -extern int cyprobe(), cyslave(), cyattach(), cydgo(); -extern unsigned cyminsize(); -#if NCY > 0 -extern char cy0utl[]; -#endif -#if NCY > 1 -extern char cy1utl[]; -#endif -static fmt_scp *scp_ptrs[MAXCONTROLLERS] = - { (fmt_scp *)0xc0000c06, (fmt_scp *)0xc0000c16, }; -struct vba_ctlr *cyminfo[NCY]; -struct vba_device *cydinfo[NUM_UNIT]; -struct vba_driver cydriver = { - cyprobe, cyslave, cyattach, cydgo, (long *)scp_ptrs, - "yc", cydinfo, "cy", cyminfo -}; - -/* - * Per-controller data structure. - */ -typedef struct { - struct pte *map; - char *utl; - int (*interupt_path)(); - label_t environ; /* Environment variable for longjmps */ - struct buf *my_request; - struct buf *wakeup_request; - short bs; /* buffer size */ - fmt_ccb ccb; /* Channel control blocks */ - fmt_scb scb; /* System configuration blocks */ - fmt_tpb tpb; /* Tape parameter blocks */ - fmt_tpb last; /* Tape parameter blocks */ - fmt_tpb noop; /* Tape parameter blocks */ - long rawbuf[MAX_BLOCKSIZE/sizeof(long)+1]; -} ctlr_tab; - -extern int cy_normal_path(); -ctlr_tab ctlr_info[NCY] = { -#if NCY > 0 - {CY0map, cy0utl, cy_normal_path}, -#endif -#if NCY > 1 - {CY1map, cy1utl, cy_normal_path}, -#endif -}; - -/* - * Per-drive information. - */ -typedef struct { - int (*cleanup)(); - struct buf u_queue; - struct buf rawbp; - long blkno; - long file_number; - short last_control; - short last_status; - short last_resid; - unsigned long bad_count; - unsigned control_proto: 16; - unsigned error_count : 8; - unsigned open : 1; - unsigned eof : 1; - unsigned bot : 1; - unsigned eot : 1; - char *message; -} unit_tab; -unit_tab unit_info[NUM_UNIT]; - -cyprobe(ctlr_vaddr) - register caddr_t ctlr_vaddr; -{ - static int ctlr = -1; /* XXX */ - - ctlr++; - if (badcyaddr(ctlr_vaddr + 1) || - !cy_init_controller(ctlr_vaddr, ctlr, 1)) - return (0); - return (sizeof (caddr_t)); /* XXX */ -} - -/* - * Initialize the controller after a controller reset or during autoconfigure. - * All of the system control blocks are initialized and the controller is - * asked to configure itself for later use. - * - * If the print value is true cy_first_TM_attention will anounce - * the type of controller we are (Tapemasher) and will print the size - * of the internal controller buffer. - */ -cy_init_controller(ctlr_vaddr, ctlr, print) - register caddr_t ctlr_vaddr; - register int ctlr, print; -{ - register int *pte; - register fmt_scp *SCP; - register fmt_scb *SCB; - register fmt_ccb *CCB; - register ctlr_tab *ci; - - /* - * Initialize the system configuration pointer. - */ - SCP = scp_ptrs[ctlr]; - /* make kernel writable */ - pte = (int *)vtopte((struct proc *)0, btop(SCP)); - *pte &= ~PG_PROT; *pte |= PG_KW; - mtpr(TBIS, SCP); - /* load the correct values in the scp */ - SCP->bus_size = _16_BITS; - load_mbus_addr((caddr_t)&ctlr_info[ctlr].scb, SCP->scb_ptr); - /* put it back to read-only */ - *pte &= ~PG_PROT; *pte |= PG_KR; - mtpr(TBIS, SCP); - - /* - * Init system configuration block. - */ - SCB = &ctlr_info[ctlr].scb; - SCB->fixed_value = 0x3; - /* set pointer to the channel control block */ - load_mbus_addr((caddr_t)&ctlr_info[ctlr].ccb, SCB->ccb_ptr); - - /* - * Initialize the chanel control block. - */ - CCB = &ctlr_info[ctlr].ccb; - CCB->ccw = CLEAR_INTERUPT; - CCB->gate = GATE_OPEN; - /* set pointer to the tape parameter block */ - load_mbus_addr((caddr_t)&ctlr_info[ctlr].tpb, CCB->tpb_ptr); - - /* - * Issue a noop cmd and get the internal buffer size for buffered i/o. - */ - ci = &ctlr_info[ctlr]; - /* set command to be CONFIGURE */ - ci->tpb.cmd = NO_OP; - ci->tpb.control = CW_16bits; - ci->ccb.gate = GATE_CLOSED; - CY_ATTENTION(ctlr_vaddr); /* execute! */ - if (cywait(&ci->ccb) || (ci->tpb.status & CS_ERm)) { - printf("yc%d: time-out during init\n", ctlr); - return (0); - } - ci->tpb.cmd = CONFIG; - ci->tpb.control = CW_16bits; - ci->ccb.gate = GATE_CLOSED; - CY_ATTENTION(ctlr_vaddr); /* execute! */ - if (cywait(&ci->ccb) || (ci->tpb.status & CS_ERm)) { - cyprint_err("Tapemaster configuration failure", - 0, ci->tpb.status); - return (0); - } - uncache(&ci->tpb.count); - ci->bs = MULTIBUS_SHORT(ci->tpb.count); - if (print) - printf("yc%d: %dKb buffer\n", ctlr, ci->bs/1024); - return (1); -} - -/* - * Check to see if a drive is attached to a controller. - * Since we can only tell that a drive is there if a tape is loaded and - * the drive is placed online, we always indicate the slave is present. - */ -cyslave(vi, addr) - struct vba_device *vi; - caddr_t addr; -{ - -#ifdef lint - vi = vi; addr = addr; -#endif - return (1); -} - -cyattach(dev_info) - struct vba_device *dev_info; -{ - register unit_tab *ui = &unit_info[dev_info->ui_unit]; - register struct buf *cq = &dev_info->ui_mi->um_tab; - register struct buf *uq = cq->b_forw; - register struct buf *start_queue = uq; - - /* Add unit to controllers queue */ - if (cq->b_forw == NULL) { - cq->b_forw = &ui->u_queue; - ui->u_queue.b_forw = &ui->u_queue; - } else { - while(uq->b_forw != start_queue) - uq = uq->b_forw; - ui->u_queue.b_forw = start_queue; - uq->b_forw = &ui->u_queue; - } - ui->cleanup = cyno_op; - ui->last_status = 0; - ui->last_control = 0; - ui->file_number = 0; - ui->bad_count = 0; - ui->blkno = 0; - ui->open = FALSE; - ui->bot = TRUE; - ui->eot = FALSE; - ui->eof = FALSE; - ui->message = NULL; -} - -cydgo() -{ - -} - -/* macro to pack the unit number into Tapemaster format */ -#define UNIT(unit) \ - (((cydinfo[unit]->ui_slave & 1) << 11) | \ - ((cydinfo[unit]->ui_slave & 2) << 9) | \ - ((cydinfo[unit]->ui_slave & 4) >> 2)) - -cyopen(dev, flag) - register int flag; - register dev_t dev; -{ - register int unit = CYUNIT(dev); - register unit_tab *ui; - - if (unit >= NUM_UNIT || cydinfo[unit] == 0 || - (ui = &unit_info[unit])->open) - return (ENXIO); - ui->control_proto = UNIT(unit) | CW_INTR | CW_16bits; - ui->blkno = 0; - ui->bad_count = 0; - ui->eof = 0; - ui->open = 1; - cycmd(dev, DO_WAIT, 1); /* wait for tape to rewind */ - if ((ui->last_status&CS_OL) == 0) { /* not on-line */ - ui->open = 0; - return (ENXIO); - } - if ((flag&FWRITE) && (ui->last_status&CS_P)) { - uprintf("cy%d: write protected\n", unit); - ui->open = 0; - return (ENXIO); - } - if (ui->last_status&CS_LP) { - ui->file_number = 0; - ui->bot = 1; - ui->eof = ui->eot = 0; - } - return (0); -} - -cyclose(dev, flag) - register dev_t dev; - register flag; -{ - register int unit = CYUNIT(dev); - register unit_tab *ui = &unit_info[unit]; - - if (ui->last_status&CS_OL) { - if ((flag&FWRITE) && (minor(dev)&T_NOREWIND)) - cycmd(dev, DO_WEOV, 1); - else if ((minor(dev) & T_NOREWIND) == 0) - cycmd(dev, DO_RWOV, 1); - } - if (ui->bad_count != 0) { -#ifdef notdef - ui->bad_count *= 889; - uprintf("cy%d: Warning - %d.%dcm of tape were used for recovering bad spots.\n", unit, ui->bad_count/100, ui->bad_count%100); -#endif - ui->bad_count = 0; - } - ui->open = 0; -} - -/* - * Cycmd is used internally to implement all the ioctl functions. - * We duplicate the code in physio - * that is used for syncronizing the processes (sleep / wakeup) so - * that we can treat our internal command requests exactly like - * regular reads and writes. They get put on the controller queue, - * start processes them and iodone is called to wake us up on completion. - * - * We don't call physio directly because it expects data to be moved - * and has a lot more overhead than we really need. - */ -cycmd(dev, command, count) - register dev_t dev; - register int command, count; -{ - register int unit = CYUNIT(dev); - register unit_tab *ui = &unit_info[unit]; - register struct buf *uq; - int s; - - s = spl3(); - while (ui->rawbp.b_flags & B_BUSY) { - ui->rawbp.b_flags |= B_WANTED; - sleep((caddr_t)&ui->rawbp, PRIBIO+1); - } - splx(s); - /* load the request queue element */ - ui->rawbp.b_error = 0; - ui->rawbp.b_dev = dev; - ui->rawbp.b_cmd = (struct buf *)command; - ui->rawbp.b_bcount = count; - ui->rawbp.b_flags = B_PHYS | B_BUSY; - s = spl3(); - uq = &ui->u_queue; - ui->rawbp.av_forw = NULL; - if (uq->av_forw == NULL) - uq->av_forw = &ui->rawbp; - else - uq->av_back->av_forw = &ui->rawbp; - uq->av_back = &ui->rawbp; - cystart(cydinfo[unit]->ui_mi, &ui->rawbp, s); - - /* wait for operation to complete */ - while ((ui->rawbp.b_flags&B_DONE) == 0) - sleep((caddr_t)&ui->rawbp, PRIBIO); - ui->rawbp.b_flags &= ~(B_PHYS | B_BUSY); - if (ui->rawbp.b_flags & B_WANTED) - wakeup((caddr_t)&ui->rawbp); - return (geterror(&ui->rawbp)); -} - -cystrategy(bp) - register struct buf *bp; -{ - register int unit = CYUNIT(bp->b_dev); - register unit_tab *ui = &unit_info[unit]; - register struct buf *uq; - int s; - - /* check the validity of the request */ - if (bp->b_bcount > MAX_BLOCKSIZE) { - uprintf("cy%d: Maximum block size is %dk!\n", - unit, MAX_BLOCKSIZE/1024); - bp->b_error = EIO; - bp->b_resid = bp->b_bcount; - bp->b_flags |= B_ERROR; - iodone(bp); - return; - } - vbasetup(bp, MAX_BLOCKSIZE); - if (bp->b_flags & B_PHYS) - bp->b_cmd = (struct buf *)(bp->b_flags&B_READ? DO_RRD : DO_RWT); - else - bp->b_cmd = (struct buf *)(bp->b_flags&B_READ? DO_BRD : DO_BWT); - /* place request on queue and start it */ - s = spl3(); - uq = &ui->u_queue; - bp->av_forw = NULL; - if (uq->av_forw == NULL) - uq->av_forw = bp; - else - uq->av_back->av_forw = bp; - uq->av_back = bp; - cystart(cydinfo[unit]->ui_mi, bp, s); -} - -struct buf *cyget_next(); -int cystart_timeout(); -/* - * Cystart is called once for every request that is placed on a - * controller's queue. Start is responsible for fetching requests for - * a controller queue, starting the operation, and waiting for completion, - * and releasing the buf structure back to UNIX or cycmd, before fetching - * the next request. - * - * The controller's queue looks like this: - * - * +---------------------------------------+ - * | | - * +-----------+ | +-----------+ +-----------+ | - * | b_forw |---+-->| b_forw |--~ ~-->| b_forw |--+ - * +-----------+ +-----------+ +-----------+ - * | b_back | | ......... | | ......... | - * +-----------+ +-----------+ +-----------+ - * | ......... | First unit queue Last unit queue - * +-----------+ element element - * head of controller queue - * (cyminfo[ctlr].um_tab) - */ -cystart(vi, bp, s) - register struct vba_ctlr *vi; - register struct buf *bp; -{ - int unit = CYUNIT(bp->b_dev), ctlr = vi->um_ctlr; - register struct buf *next, *cq = &vi->um_tab; - register unit_tab *ui = &unit_info[unit]; - register ctlr_tab *ci = &ctlr_info[ctlr]; - - if (cq->b_active&SLEEPING) { - untimeout(cystart_timeout, (caddr_t)cq); - cystart_timeout(cq); - } - if (cq->b_active) { - sleep((caddr_t)bp, PRIBIO-1); - if (bp->b_flags&PROCESSED) { - if (ui->message) { - uprintf("cy%d: %s\n", unit, ui->message); - ui->message = 0; - } - bp->b_flags &= ~PROCESSED; - iodone(bp); - return; - } - } - cq->b_active = 1; - splx(s); - ci->my_request = bp; - cydo_my_command(ctlr, cq, ci); - if (ui->message) { - uprintf("cy%d: %s\n", unit, ui->message); - ui->message = 0; - } - bp->b_flags &= ~PROCESSED; - iodone(bp); - if ((next = cyget_next(cq)) != NULL) - wakeup((caddr_t)next); - else - cq->b_active = 0; -} - -/* - * Cystart_timeout wakes up the start routine after it's 3 - * second wait time is up or when a new command enters the queue. - * The timer is used to give up the processor while all drives - * on the queue are rewinding and we need to wait for them to be dome. - */ -cystart_timeout(cq) - register struct buf *cq; -{ - - cq->b_active &= ~SLEEPING; - wakeup((caddr_t)cq); -} - -/* - * Cydo_my command scans the request queues once for a - * particular controller and calls the appropriate processing routine - * each time we find a request that can be started. - */ -cydo_my_command(ctlr, cq, ci) - register struct buf *cq; - register ctlr_tab *ci; -{ - register struct buf *next; - - while ((next = cyget_next(cq)) != NULL) { - if (cq->b_forw->b_active&SLEEPING) { - cq->b_active |= SLEEPING; - timeout(cystart_timeout, (caddr_t)cq, 1*60); - sleep((caddr_t)cq, PRIBIO); - continue; - } - if (setjmp(&ctlr_info[ctlr].environ)) - cydone(cq); - else { - register int cmd = (int)next->b_cmd; - - (*cmd_tbl[cmd])(next, cq); - } - if (next->b_flags & PROCESSED) { - if (ci->my_request == next) - break; - wakeup((caddr_t)next); - } - } -} - -struct buf * -cyget_next(cq) - register struct buf *cq; -{ - register struct buf *bp, *uq, *next = NULL; - - cq->b_forw = cq->b_forw->b_forw; - uq = cq->b_forw; - do { - if ((bp = uq->av_forw) != NULL) { - if ((uq->b_active&SLEEPING) == 0) { - cq->b_forw = uq; - return (bp); - } - next = uq; - } - uq = uq->b_forw; - } while(uq != cq->b_forw); - if (next != NULL) { - cq->b_forw = next; - return (next->av_forw); - } - return (NULL); -} - -/* - * Mark the current command on the controller's q completed and remove it. - */ -cydone(cq) - struct buf *cq; -{ - register struct buf *uq = cq->b_forw; - int s; - - uq->av_forw->b_flags |= PROCESSED; - s = spl3(); - if ((uq->av_forw = uq->av_forw->av_forw) == NULL) - uq->av_back = NULL; - splx(s); -} - -/* - * The following routines implement the individual commands. - * - * Each command is responsible for a few things. 1) Each has to keep - * track of special cases that are related to the individual command and - * the previous commands sequence, 2) each is required to call iodone when - * command is actually finished, 3) it must use cyexecute to actually - * start the controller, and 4) they are required to keep the tape in - * a consistant state so that other commands will not be messed up. - */ - -/* - * Read requests from the raw device. - * The special cases are: - * 1) we can not read after a write. (writting defines end of file) - * 2) reading past end of file returns 0 bytes; - */ -cyraw_read(bp, cq) - register struct buf *bp; - struct buf *cq; -{ - int unit = CYUNIT(bp->b_dev); - register unit_tab *ui = &unit_info[unit]; - register ctlr_tab *ci = &ctlr_info[cydinfo[unit]->ui_ctlr]; - int addr, lock_flag, command; - - if (ui->cleanup != cyno_op || ui->eof) { - bp->b_resid = bp->b_bcount; - bp->b_error = ENXIO, bp->b_flags |= B_ERROR; - cydone(cq); - return; - } - if (bp->b_bcount > ci->bs) - command = READ_TA, lock_flag = CW_LOCK; - else - command = READ_BU, lock_flag = 0; - ui->blkno++; - addr = vbastart(bp, (caddr_t)ci->rawbuf, (long *)ci->map, ci->utl); - cyexecute(command, bp->b_bcount, addr, lock_flag, unit, 10, FALSE); - vbadone(bp, (caddr_t)ci->rawbuf, (long *)ci->map, ci->utl); - cydone(cq); -} - -/* - * Write requests from the raw device. - * The special cases are: - * 1) we don't allow writes after end of tape is reached. - */ -cyraw_write(bp, cq) - register struct buf *bp; - struct buf *cq; -{ - int unit = CYUNIT(bp->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - register ctlr_tab *ci = &ctlr_info[cydinfo[unit]->ui_ctlr]; - int addr, lock_flag, command; - - if (ui->eot) { - bp->b_resid = bp->b_bcount; - bp->b_error = ENXIO, bp->b_flags |= B_ERROR; - longjmp(&ci->environ); - } - ui->cleanup = cywrite_2_fm; - if (bp->b_bcount > ci->bs) - command = WRIT_TA, lock_flag = CW_LOCK; - else - command = WRIT_BU, lock_flag = 0; - ui->blkno++; - addr = vbastart(bp, (caddr_t)ci->rawbuf, (long *)ci->map, ci->utl); - cyexecute(command, bp->b_bcount, addr, lock_flag, unit, 10, FALSE); - vbadone(bp, (caddr_t)ci->rawbuf, (long *)ci->map, ci->utl); - cydone(cq); -} - -/* - * Write a filemark on a tape. - */ -cywrite_filemark(bp, cq) - register struct buf *bp; - struct buf *cq; -{ - int unit = CYUNIT(bp->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - - if (bp->b_bcount == 0) { - cydone(cq); - return; - } - bp->b_bcount--; - if (ui->cleanup == cywrite_1_fm) - ui->cleanup = cywrite_0_fm; - if (ui->cleanup == cywrite_2_fm || ui->cleanup == cyno_op) - ui->cleanup = cywrite_1_fm; - ui->file_number++; - ui->eof = 1; - ui->blkno = 0; - cyexecute(WRIT_FM, (long)1, 0, 0, unit, 10, FALSE); -} - -/* -** cysearch_fm_forw is the ioctl to search for a filemark in the -** forward direction on tape. -** -** Since only one device can be active on a given controller at any -** given instant in time, we try to be nice and let onther devices on -** this controller be scheduled after we space over each record. This will -** at least give the apperance of overlapped operations on the controller. -** -** The special cases are: -** 1) if the last command was a write the we can't search. -*/ - -cysearch_fm_forw(request, cq) -register struct buf *request; -register struct buf *cq; -{ - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - register int ctlr = cydinfo[unit]->ui_ctlr; - register ctlr_tab *ci = &ctlr_info[ctlr]; - - if((ui->cleanup != cyno_op) || ui->eot) { - request->b_resid = request->b_bcount; - request->b_error = ENXIO, request->b_flags |= B_ERROR; - longjmp(&ci->environ); - } - if(request->b_bcount && !ui->eot) { - if(!ui->eot) { - ui->blkno++; - cyexecute(SPAC_FM, (long)1, 0, 0, unit, 5, FALSE); - if(!(ui->eof || ui->eot)) - return; - } - request->b_bcount--; - ui->eof = FALSE; - if(!ui->eot) { - ui->file_number++; - ui->blkno = 0; - return; - } - } - if(ui->eot) { - request->b_resid = request->b_bcount; - request->b_flags |= B_ERROR, request->b_error = ENXIO; - } - cydone(cq); -} - - -/* -** cysearch_fm_back is the ioctl to search for a filemark in the -** reverse direction on tape. -** -** Since only one device can be active on a given controller at any -** given instant in time, we try to be nice and let onther devices on -** this controller be scheduled after we space over each record. This will -** at least give the apperance of overlapped operations on the controller. -** -** The special cases are: -** 1) can't search past begining of tape. -** 2) if the lasr operation was a write data then we need to add -** an end of volume record before we start searching. -*/ - -cysearch_fm_back(request, cq) -register struct buf *request; -register struct buf *cq; -{ - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - - if(!ui->bot) { - (*ui->cleanup)(unit, MAINTAIN_POSITION); - if(ui->blkno == 0) - request->b_bcount++; - ui->blkno = 0xffffffff; - if(request->b_bcount && !ui->bot) { - cyexecute(SPAC_FM, (long)1, 0, CW_REV, unit, 6, FALSE); - if(ui->eof) { - ui->eof = FALSE; - ui->file_number--; - request->b_bcount--; - } - return; - } - if(ui->bot) { - ui->file_number = 0; - if(request->b_bcount) { - request->b_resid = request->b_bcount; - request->b_error = ENXIO; - request->b_flags |= B_ERROR; - } - } - else { - request->b_cmd = (struct buf *)DO_SFMF; - request->b_bcount = 1; - return; - } - } - ui->blkno = 0; - ui->eof = FALSE; - cydone(cq); -} - - -/* -** cy_space_forw is used to search forward a given number of records on -** tape. -** -** Since only one device can be active on a given controller at any -** given instant in time, we try to be nice and let onther devices on -** this controller be scheduled after we space over each record. This will -** at least give the apperance of overlapped operations on the controller. -** -** The special cases are: -** 1) we can't space over a filemark. -** 2) if the last command was a write data or filemark we can't space forward. -*/ - -cy_space_forw(request, cq) -register struct buf *request; -register struct buf *cq; -{ - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - register int ctlr = cydinfo[unit]->ui_ctlr; - register ctlr_tab *ci = &ctlr_info[ctlr]; - - if((ui->cleanup != cyno_op) || ui->eof) { - request->b_resid = request->b_bcount; - request->b_error = ENXIO, request->b_flags |= B_ERROR; - longjmp(&ci->environ); - } - if(request->b_bcount) { - ui->blkno++; - cyexecute(SPAC_FM, (long)1, 0, 0, unit, 10, FALSE); - if(!ui->eof && request->b_bcount) { - request->b_bcount--; - return; - } - } - if(ui->eof) { - request->b_resid = request->b_bcount; - request->b_error = ENXIO, request->b_flags |= B_ERROR; - } - cydone(cq); -} - - -/* -** Cy_space_back spaces backward a given number of records. -** -** Since only one device can be active on a given controller at any -** given instant in time, we try to be nice and let onther devices on -** this controller be scheduled after we space over each record. This will -** at least give the apperance of overlapped operations on the controller. -** -** The special cases are: -** 1) we can't space over a filemark. -** 2) we can't space past the beginning of tape. -** 3) if the last operation was a write data then we need to add -** an end of volume record before we start searching. -*/ - -cy_space_back(request, cq) -register struct buf *request; -register struct buf *cq; -{ - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - - if(!ui->bot) { - (*ui->cleanup)(unit, MAINTAIN_POSITION); - if(request->b_bcount+1 && !ui->bot && !ui->eof) { - request->b_bcount--; - ui->blkno--; - cyexecute(SPACE, (long)1, 0, CW_REV, unit, 15, FALSE); - return; - } - if(!ui->bot) { - request->b_bcount = 1; - cy_space_forw(request, cq); - } - ui->eof = FALSE; - } - cydone(cq); -} - -/* - * Rewind tape and wait for completion. - * An overlapped rewind is issued and then we change the command type to - * a wait for ready ioctl. Wait for ready contains the logic to poll - * without blocking anything in the system, until the drive becomes ready or - * drops off line whichever comes first. - */ -/*ARGSUSED*/ -cyrewind_tape_ta(bp, cq) - struct buf *bp, *cq; -{ - - cyrewind_tape(bp, REWD_OV); - bp->b_cmd = (struct buf *)DO_WAIT; -} - -/* - * Do an overlapped rewind and then unload the tape. - * This feature is handled by the individual tape drive and - * in some cases can not be performed. - */ -cyrewind_tape_unl(bp, cq) - struct buf *bp, *cq; -{ - - cyrewind_tape(bp, OFF_UNL); - cydone(cq); -} - -/* - * Do an overlapped rewind. - */ -cyrewind_tape_ov(bp, cq) - struct buf *bp, *cq; -{ - - cyrewind_tape(bp, REWD_OV); - cydone(cq); -} - -/* - * Common code for all rewind commands. - * The special cases are: - * 3) if the last operation was a write data then we need to add - * an end of volume record before we start searching. - */ -cyrewind_tape(bp, cmd) - register struct buf *bp; - int cmd; -{ - register int unit = CYUNIT(bp->b_dev); - register unit_tab *ui = &unit_info[unit]; - - (*ui->cleanup)(unit, DONT_MAINTAIN_POSITION); - ui->blkno = 0; - ui->eof = FALSE; - ui->bot = TRUE; - ui->eot = FALSE; - ui->file_number = 0; - bp->b_resid = 0; - ui->cleanup = cyno_op; - cyexecute(cmd, (long)0, 0, 0, unit, cmd == REWD_OV ? 10 : 10*60, 0); -} - -/* -** Cywait_until_ready is used to wait for rewinds to complete. -** We check the status and if the tape is still rewinding we re-enter ourself -** on the activity queue to give other requests a chance to execute before we -** check the status again. One other thing is that we only want to check -** the status every five seconds. so we set a timer for five seconds and -** check the time left every time we enter this routine. If there is still -** time left then we simply reinsert ourself on the queue again and wait -** until next time .. -*/ -cywait_until_ready(request, cq) -register struct buf *request; -register struct buf *cq; -{ - extern int cywait_timeout(); - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[unit]; - - cyexecute(DRIVE_S, (long)0, 0, 0, unit, 10, FALSE); - if((!(ui->last_status & CS_OL)) || (ui->last_status & CS_RDY)) { - cydone(cq); - return; - } - cq->b_forw->b_active |= SLEEPING; - timeout(cywait_timeout, (caddr_t)cq->b_forw, 2*60); -} - -/* - * Reset the timing flag for nice_wait after 3 seconds. - * This makes this drive eligible for scheduling again. - */ -cywait_timeout(uq) - struct buf *uq; -{ - - uq->b_active &= ~SLEEPING; -} - -/* - * Process a status ioctl request. - * It depends entirly on the interupt routines to load the last_XXX - * registers in unit_info[]. - */ -cydrive_status(bp, cq) - struct buf *bp, *cq; -{ - - cyexecute(DRIVE_S, (long)0, 0, 0, CYUNIT(bp->b_dev), 10, FALSE); - cydone(cq); -} - -/* -** cybuf_read handles the read requests from the block device. -** -** The special cases are: -** 1) we can not read after a write. (writting defines end of file) -** 2) reading past end of file returns 0 bytes; -** 3) if we are mispositioned we have to seek to the correct block. -** 4) we can hit end of tape while seeking. -** 5) we want to be nice to other processes while seeking so we -** break the request up into smaller requests. -** 6) returns error if the block was larger than requested. -*/ -cybuf_read(request, cq) -register struct buf *request; -register struct buf *cq; -{ - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - register int ctlr = cydinfo[unit]->ui_ctlr; - register ctlr_tab *ci = &ctlr_info[ctlr]; - register int addr, command, bus_lock; - - cydebug = 1; - if(cyseek(request, cq)) { - if(ui->cleanup != cyno_op) { - clrbuf(request); - longjmp(&ci->environ); - } - if(request->b_bcount > ci->bs) - command = READ_TA, bus_lock = CW_LOCK; - else - command = READ_BU, bus_lock = 0; - ui->blkno++; - addr = vbastart(request, (caddr_t)ci->rawbuf, (long *)ci->map, - ci->utl); - cyexecute(command,request->b_bcount,addr,bus_lock,unit,8,FALSE); - vbadone(request, (caddr_t)ci->rawbuf, (long *)ci->map, ci->utl); - cydone(cq); - } -} - - -/* -** cybuf_write handles the write requests from the block device. -** -** The special cases are: -** 1) if we are mispositioned we have to seek to the correct block. -** 2) we can hit end of tape while seeking. -** 3) we want to be nice to other processes while seeking so we -** break the request up into smaller requests. -** 4) we don't allow writes after end of tape is reached. -*/ - -cybuf_write(request, cq) -register struct buf *request; -register struct buf *cq; -{ - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - register int ctlr = cydinfo[unit]->ui_ctlr; - register ctlr_tab *ci = &ctlr_info[ctlr]; - register int addr, command, bus_lock; - - if(ui->eot && (request->b_blkno >= ui->blkno)) { - request->b_error = ENXIO, request->b_flags |= B_ERROR; - request->b_resid = request->b_bcount; - longjmp(&ci->environ); - } - if(cyseek(request, cq)) { - ui->cleanup = cywrite_2_fm; - ui->blkno++; - if(request->b_bcount > ci->bs) - command = WRIT_TA, bus_lock = CW_LOCK; - else - command = WRIT_BU, bus_lock = 0; - addr = vbastart(request, (caddr_t)ci->rawbuf, (long *)ci->map, - ci->utl); - load_mbus_addr((caddr_t)addr, (short *)&ci->tpb.data_ptr); - cyexecute(command,request->b_bcount,addr,bus_lock,unit,5,FALSE); - vbadone(request, (caddr_t)ci->rawbuf, (long *)ci->map, ci->utl); - cydone(cq); - } -} - - -/* -** cyseek is used by the block device to position the tape correctly -** before each read or write request. -** -** The special cases are: -** 1) we can hit end of tape while seeking. -** 2) we want to be nice to other processes while seeking so we -** break the request up into smaller requests. -*/ -cyseek(request, cq) -register struct buf *request; -register struct buf *cq; -{ - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - register int ctlr = cydinfo[unit]->ui_ctlr; - register ctlr_tab *ci = &ctlr_info[ctlr]; - -#ifdef lint - cq = cq; -#endif - if(request->b_blkno < ui->blkno) { - register int count; - - (*ui->cleanup)(unit, MAINTAIN_POSITION); - count = ((request->b_blkno+1) == ui->blkno) ? 2 : 1; - ui->blkno -= count; - cyexecute(SPAC_FM, (long)1, 0, CW_REV, unit, 10, FALSE); - if(!ui->eof) - return FALSE; - ui->eof = FALSE; - request->b_blkno = ui->blkno + 1; - } - if(request->b_blkno > ui->blkno) { - if((ui->cleanup != cyno_op) || ui->eof || ui->eot) { - request->b_resid = request->b_bcount; - request->b_error = ENXIO, request->b_flags |= B_ERROR; - longjmp(&ci->environ); - } - ui->blkno++; - cyexecute(SPAC_FM, (long)1, 0, 0, unit, 10, FALSE); - return FALSE; - } - return TRUE; -} - - -/* -*/ - -cywrite_eov(request, cq) -register struct buf *request; -register struct buf *cq; -{ - extern int cyno_op(); - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[CYUNIT(unit)]; - - if(ui->cleanup != cyno_op) { - (*ui->cleanup)(unit, DONT_MAINTAIN_POSITION); - cyexecute(SPACE, (long)2, 0, CW_REV, unit, 10, FALSE); - cyexecute(SPACE, (long)1, 0, 0, unit, 10, FALSE); - unit_info[unit].cleanup = cyno_op; - ui->blkno = 0; - } - cydone(cq); -} - - -/* -** Do nothing -*/ -/*ARGSUSED*/ -cyno_op(unit, action) -int unit, action; -{ -} - - -/* -** Write 0 file marks to tape -*/ -/*ARGSUSED*/ -cywrite_0_fm(unit, action) -int unit, action; -{ - unit_info[unit].cleanup = cyno_op; -} - - -/* -** Write 1 file mark to tape -*/ - -cywrite_1_fm(unit, action) -int unit, action; -{ - - cyexecute(WRIT_FM, (long)1, 0, 0, unit, 5, FALSE); - if(action == MAINTAIN_POSITION) { - cyexecute(SPACE, (long)2, 0, CW_REV, unit, 10, FALSE); - cyexecute(SPACE, (long)1, 0, 0, unit, 10, FALSE); - } - unit_info[unit].cleanup = cyno_op; -} - - -/* -** Write 2 file marks to tape -*/ - -cywrite_2_fm(unit, action) -int unit, action; -{ - - cyexecute(WRIT_FM, (long)1, 0, 0, unit, 5, FALSE); - cyexecute(WRIT_FM, (long)1, 0, 0, unit, 5, FALSE); - if(action == MAINTAIN_POSITION) { - cyexecute(SPACE, (long)3, 0, CW_REV, unit, 10, FALSE); - cyexecute(SPACE, (long)1, 0, 0, unit, 2, FALSE); - } - unit_info[unit].cleanup = cyno_op; -} - - -extern int cytimeout(); -extern int cy_normal_path(); -/* -** Cyexecute is used to start all commands to the controller. We -** do all common code here before starting. -*/ - -cyexecute(command, count, addr, control_flags, unit, time, interupt_routine) - register int command; - long count; - int addr, control_flags, unit, time, interupt_routine; -{ - register int priority; - register int ctlr = cydinfo[unit]->ui_ctlr; - register unit_tab *ui = &unit_info[unit]; - register ctlr_tab *ci = &ctlr_info[ctlr]; - register struct buf *request = ui->u_queue.av_forw; - - ci->tpb.cmd = command; - ci->tpb.control = ui->control_proto | control_flags; - ci->tpb.status = ci->tpb.count = (short)0; - load_mbus_addr((caddr_t)addr, (short *)&ci->tpb.data_ptr); - switch(command) { - case READ_BU: - case READ_TA: - case WRIT_BU: - case WRIT_TA: - ci->tpb.size = MULTIBUS_SHORT((short)count); - ci->tpb.rec_over = (short)0; - break; - default: - ci->tpb.size = (short)0; - ci->tpb.rec_over = MULTIBUS_SHORT((short)count); - break; - } - load_mbus_addr((caddr_t)0, ci->tpb.link_ptr); - if(!interupt_routine) - ci->last = ci->tpb; - /* - gag! but it the last possible moment to wait - for this controller to get out of it's own way..... - */ - uncache(&ci->ccb.gate); - while(ci->ccb.gate == GATE_CLOSED) - uncache(&ci->ccb.gate); - load_mbus_addr((caddr_t)&ci->tpb, ci->ccb.tpb_ptr); - ci->ccb.ccw = NORMAL_INTERUPT; - ci->ccb.gate = GATE_CLOSED; - if(!interupt_routine) - ci->interupt_path = cy_normal_path; - timeout(cytimeout, (caddr_t)ctlr, time*60); - priority = spl3(); - CY_ATTENTION(cyminfo[ctlr]->um_addr); - if(!interupt_routine) { - sleep((caddr_t)ci, PRIBIO+3); - splx(priority); - if(request->b_flags & B_ERROR) { - if((command == READ_BU) || (command == READ_TA) || - (command == WRIT_BU) || (command == WRIT_TA)) - vbadone(request, (caddr_t)ci->rawbuf, - (long *)ci->map,ci->utl); - longjmp(&ci->environ); - } - return; - } - splx(priority); -} - - -/* -** cytimeout is the interupt timeout routine. We assume that a -** particular command has gone astray, so we completely reset the controller, -** and call the interupt routine to help us clean up. Before the interupt -** routine is called we jam a controller timeout value in the status register -** to fake out the calling routines. -*/ - -cytimeout(ctlr) -register int ctlr; -{ - register int priority = spl3(); - register char *ctlr_vaddr = cyminfo[ctlr]->um_addr; - register int tmp_stat; - - uncache(&ctlr_info[ctlr].tpb.status); - tmp_stat = ctlr_info[ctlr].tpb.status; - CY_RESET(ctlr_vaddr); - cy_init_controller(ctlr_vaddr, ctlr, 0); - splx(priority); - ctlr_info[ctlr].tpb = ctlr_info[ctlr].last; - ctlr_info[ctlr].tpb.status = (tmp_stat & ~CS_ERm) | CS_OL | ER_TIMOUT; - cyintr(ctlr); -} - -/* -** Cyintr is the interupt routine for the Tapemaster controller. -** -** Due to controller problems, the first thing we have to do is turn -** off the Tapemaster interupting mechanism. If we don't we will be flooded -** with bogus interupts and the system will spend all it's time processing -** them. To Turn the interupts off we issue a NOOP command with the 'turn -** off interupts' code in the ccb. -** -** take note that since this command TURNS OFF the interupts it -** itself CANNOT interupt... This means that polling must be done -** at sometime to make sure that tis command is completed. The polling -** is done before the next command is issued to reduce polling (halting -** UNIX) time. -** -** After we turn off interupts we uncache all the values in the tpb -** and call the correct processing routine. This routine can be for normal -** interupts or for interupts generated during a retry operation. -*/ - -cyintr(ctlr) -register int ctlr; -{ - extern int cytimeout(); - register ctlr_tab *ci = &ctlr_info[ctlr]; - - untimeout(cytimeout, (caddr_t)ctlr); - /* turn off interupts for the stupid controller */ - ci->ccb.ccw = CLEAR_INTERUPT; - ci->noop.cmd = NO_OP; - ci->noop.control = (short)0; - load_mbus_addr((caddr_t)&ci->noop, ci->ccb.tpb_ptr); - ci->ccb.gate = GATE_CLOSED; - CY_ATTENTION(cyminfo[ctlr]->um_addr); - uncache_tpb(ci); - (*ci->interupt_path)(ctlr); -} - - -/* -** This is the portion of the interupt routine that processes all -** normal cases i.e. non retry cases. We check the operations status -** if it is retryable we set the interupt path to the retry routines and -** start the backward spaceing. when the spacing is done the retry logic -** will be called and this routine will be skipped entirely. -** -** If the command is ok or not retryable we set the status accordingly -** and wakeup cyexecute to continue processing. -*/ - -cy_normal_path(ctlr) -register int ctlr; -{ - extern int cy_retry_path(); - extern int cy_extended_gap_path(); - register int error; - register struct buf *cq = &cyminfo[ctlr]->um_tab; - register struct buf *uq = cq->b_forw; - register struct buf *request = uq->av_forw; - register int unit = CYUNIT(request->b_dev); - register unit_tab *ui = &unit_info[unit]; - register ctlr_tab *ci = &ctlr_info[ctlr]; - - if (error = cydecode_error(unit, ci->tpb.status)) { - if(error != FATAL) { - if (error == RETRY) - ci->interupt_path = cy_retry_path; - else - ci->interupt_path = cy_extended_gap_path; - cyexecute(SPACE, (long)2, 0, CW_REV, unit, 5, TRUE); - return; - } - } - request->b_resid=request->b_bcount-MULTIBUS_SHORT(ci->tpb.count); - ui->error_count = 0; - ui->last_resid = request->b_resid; - ui->last_status = ci->tpb.status; - ui->last_control = ci->tpb.control; - if (error == FATAL) - request->b_flags |= B_ERROR, request->b_error = EIO; - wakeup((caddr_t)ci); -} - - -/* -** Cy_retry_path finishes up the retry sequence for the tape. -** If we were going in the reverse direction it means that we have to -** space forward to correctly position ourselfs in back of the tape gap -** instead of in front of it. If we were going forward it means that -** we are positioned correctly and we can actually restart the instruction -** that failed before. -*/ - -cy_retry_path(ctlr) -register int ctlr; -{ - extern int cy_do_again_path(); - register struct buf *cq = &cyminfo[ctlr]->um_tab; - register struct buf *uq = cq->b_forw; - register struct buf *request = uq->av_forw; - register int unit = CYUNIT(request->b_dev); - register ctlr_tab *ci = &ctlr_info[ctlr]; - - if(!(ci->tpb.status & CS_OL)) { - ci->interupt_path = cy_normal_path; - cy_normal_path(ctlr); - return; - } - if(ci->tpb.control & CW_REV) { - if(!(ci->tpb.status & CS_LP)) { - ci->interupt_path = cy_do_again_path; - cyexecute(SPACE, (long)1, 0, 0, unit, 5, TRUE); - return; - } - cy_do_again_path(ctlr); - } -} - - -/* -** -*/ - -cy_extended_gap_path(ctlr) -register int ctlr; -{ - extern int cy_do_again_path(); - register ctlr_tab *ci = &ctlr_info[ctlr]; - register struct buf *cq = &cyminfo[ctlr]->um_tab; - register struct buf *uq = cq->b_forw; - register struct buf *request = uq->av_forw; - register int unit = CYUNIT(request->b_dev); - - if(!(ci->tpb.status & CS_OL)) { - ci->interupt_path = cy_normal_path; - cy_normal_path(ctlr); - return; - } - if(ci->tpb.control & CW_REV) { - if(!(ci->tpb.status & CS_LP)) { - cyexecute(SPACE, (long)1, 0, 0, unit, 5, TRUE); - return; - } - } - ci->interupt_path = cy_do_again_path; - cyexecute(ERASE_F, (long)unit_info[unit].error_count, 0, 0, - unit, 5, TRUE); -} - - -/* -** -*/ - -cy_do_again_path(ctlr) -register int ctlr; -{ - extern int cy_normal_path(); - register ctlr_tab *ci = &ctlr_info[ctlr]; - - if(!(ci->tpb.status & CS_OL)) { - ci->interupt_path = cy_normal_path; - cy_normal_path(ctlr); - return; - } - ci->tpb = ci->last; - uncache(&ci->ccb.gate); - while(ci->ccb.gate == GATE_CLOSED) - uncache(&ci->ccb.gate); - load_mbus_addr((caddr_t)&ci->tpb, ci->ccb.tpb_ptr); - ci->ccb.ccw = NORMAL_INTERUPT; - ci->ccb.gate = GATE_CLOSED; - ci->interupt_path = cy_normal_path; - CY_ATTENTION(cyminfo[ctlr]->um_addr); -} - - -/* -** for each longword in the tpb we call uncache to purge it from -** the cache. This is done so that we can correctly access tpb data -** that was placed there by the controller. -*/ - -uncache_tpb(ci) -ctlr_tab *ci; -{ - register long *ptr = (long *)&ci->tpb; - register int i; - - for(i=0; i<((sizeof(fmt_tpb)+sizeof(long)-1)/sizeof(long)); i++) - uncache(ptr++); -} - - -/* -** Cyprint_error is the common printing routine for all messages -** that need to print the tape status along with it. This is so we -** we can save space, have consistant messages, and we can send the messages -** to the correct places. -*/ - -cyprint_err(message, unit, status) -register char *message; -register int unit, status; -{ - status &= 0xffff; - printf("cy%d: %s! Status = %x\n", unit, message, status); -} - -/* -** Decode the error to determine whether the previous command was -** ok, retryable, or fatal and return the value. If it was a hardware -** problem we print the message to the console, otherwise we print it -** to the user's terminal later when execute returns. -*/ - -cydecode_error(unit, status) -register int unit, status; -{ - register unit_tab *ui = &unit_info[unit]; - register ctlr_tab *ci = &ctlr_info[cydinfo[unit]->ui_ctlr]; - - if(!(status & CS_OL) && (ci->tpb.cmd != OFF_UNL)) { - ui->message = "Drive is not on-line"; - cyprint_err(ui->message, unit, status); - return FATAL; - } - ui->bot = ((status & CS_LP) != 0); - ui->eof = ((status & CS_FM) != 0); - switch(status & CS_ERm) { - case ER_EOT: - if(ci->tpb.control & CW_REV) { - ui->bot = TRUE; - ui->eot = FALSE; - } - else if(!ui->eot){ - ui->message = "End of tape"; - ui->bot = FALSE; - ui->eot = TRUE; - } - case 0 : - case ER_FM: - case ER_NOSTRM: - return 0; - case ER_TIMOUT: - case ER_TIMOUT1: - case ER_TIMOUT2: - case ER_TIMOUT3: - case ER_TIMOUT4: - ui->message = "Drive timed out during transfer"; - cyprint_err(ui->message, unit, status); - return FATAL; - case ER_NEX: - ui->message = - "Controller referenced non-existant system memory"; - cyprint_err(ui->message, unit, status); - return FATAL; - case ER_DIAG: - case ER_JUMPER: - ui->message = "Controller diagnostics failed"; - cyprint_err(ui->message, unit, status); - return FATAL; - case ER_STROBE: - if (ci->tpb.cmd == READ_BU) { - ci->last.cmd = READ_TA; - return RETRY; - } - if(ci->tpb.cmd == READ_TA) - return 0; - ui->message = "Unsatisfactory media found"; - return FATAL; - case ER_FIFO: - case ER_NOTRDY: - ui->error_count = 1; - return RETRY; - case ER_PROT: - ui->message = "Tape is write protected"; - return FATAL; - case ER_CHKSUM: - ui->message = "Checksum error in controller proms"; - cyprint_err(ui->message, unit, status); - return FATAL; - case ER_HARD: - ui->error_count++; - if((ci->tpb.cmd == WRIT_TA) || - (ci->tpb.cmd == WRIT_BU) || - (ci->tpb.cmd == WRIT_FM)) { - ui->bad_count++; - return EXTEND; - } - ui->message = "Unrecoverable media error during read"; - return FATAL; - case ER_PARITY: - if(++ui->error_count < 8) - return RETRY; - ui->message = "Unrecoverable tape parity error"; - return FATAL; - case ER_BLANK: - ui->message="Blank tape found (data expected)"; - return FATAL; - case ER_HDWERR: - default: - ui->message = "Unrecoverble hardware error"; - cyprint_err(ui->message, unit, status); - return FATAL; - } -} - -cyread(dev, uio) - dev_t dev; - struct uio *uio; -{ - unit_tab *ui = &unit_info[CYUNIT(dev)]; - - return (physio(cystrategy, &ui->rawbp, dev, B_READ, cyminsize, uio)); -} - - -cywrite(dev, uio) - dev_t dev; - struct uio *uio; -{ - unit_tab *ui = &unit_info[CYUNIT(dev)]; - - return (physio(cystrategy,&ui->rawbp, dev, B_WRITE, cyminsize, uio)); -} - -/*ARGSUSED*/ -cyioctl(dev, cmd, data, flag) - dev_t dev; - caddr_t data; -{ - - switch (cmd) { - - case MTIOCTOP: { - struct mtop *mp = (struct mtop *)data; - - if (mp->mt_op <= DO_WAIT) - return (cycmd(dev, (int)mp->mt_op, (int)mp->mt_count)); - return (EIO); - } - - case MTIOCGET: { - register unit_tab *ui = &unit_info[CYUNIT(dev)]; - register struct mtget *mp = (struct mtget *)data; - - mp->mt_type = MT_ISCY; - mp->mt_dsreg = ui->last_control; - mp->mt_erreg = ui->last_status; - mp->mt_resid = ui->last_resid; - mp->mt_fileno = ui->file_number; - mp->mt_blkno = ui->blkno; - cycmd(dev, DO_STAT, 1); - break; - } - - default: - return (ENXIO); - } - return (0); -} - -/* - * Dump routine. - */ -cydump(dev) - dev_t dev; -{ - register int unit = CYUNIT(dev); - register int ctlr = cydinfo[unit]->ui_ctlr; - register unit_tab *ui = &unit_info[unit]; - register ctlr_tab *ci = &ctlr_info[ctlr]; - register int blk_siz; - register int num = maxfree; - register int start = 0x800; - - if ((unit >= NCY) || cydinfo[unit]) - return(ENXIO); - ui->control_proto = CW_LOCK | CW_25ips | CW_16bits; - if (cywait(&ci->ccb)) - return(EFAULT); - while (num > 0) { - blk_siz = num > TBUFSIZ ? TBUFSIZ : num; - bcopy((caddr_t)(start*NBPG), (caddr_t)ci->rawbuf, - (unsigned)(blk_siz*NBPG)); - ci->tpb.cmd = WRIT_TA; - ci->tpb.control = ui->control_proto; - ci->tpb.status = 0; - ci->tpb.size = MULTIBUS_SHORT(blk_siz*NBPG); - load_mbus_addr((caddr_t)0, ci->tpb.link_ptr); - load_mbus_addr((caddr_t)ci->rawbuf, (short *)&ci->tpb.data_ptr); - load_mbus_addr((caddr_t)&ci->tpb, ci->ccb.tpb_ptr); - ci->ccb.gate = GATE_CLOSED; - CY_ATTENTION(cyminfo[ctlr]->um_addr); - start += blk_siz; - num -= blk_siz; - if (cywait(&ci->ccb)) - return(EFAULT); - uncache(&ci->tpb); - if (ci->tpb.status&CS_ERm) /* error */ - return (EIO); - } - for(num=0; num<2; num++) { - ci->tpb.cmd = WRIT_FM; - ci->tpb.control = ui->control_proto; - ci->tpb.status = ci->tpb.size = 0; - ci->tpb.count = MULTIBUS_SHORT(1); - load_mbus_addr((caddr_t)0, ci->tpb.link_ptr); - load_mbus_addr((caddr_t)ci->rawbuf, (short *)&ci->tpb.data_ptr); - load_mbus_addr((caddr_t)&ci->tpb, ci->ccb.tpb_ptr); - ci->ccb.gate = GATE_CLOSED; - CY_ATTENTION(cyminfo[ctlr]->um_addr); - if (cywait(&ci->ccb)) - return(EFAULT); - uncache(&ci->tpb); - if (ci->tpb.status&CS_ERm) /* error */ - return (EIO); - } - ci->tpb.cmd = REWD_OV; - ci->tpb.control = ui->control_proto; - ci->tpb.status = ci->tpb.size = 0; - ci->tpb.count = MULTIBUS_SHORT(1); - load_mbus_addr((caddr_t)0, ci->tpb.link_ptr); - load_mbus_addr((caddr_t)ci->rawbuf, (short *)&ci->tpb.data_ptr); - load_mbus_addr((caddr_t)&ci->tpb, ci->ccb.tpb_ptr); - ci->ccb.gate = GATE_CLOSED; - CY_ATTENTION(cyminfo[ctlr]->um_addr); - if (cywait(&ci->ccb)) - return EFAULT; - uncache(&ci->tpb); - return 0; -} - -/* - * Poll until the controller is ready. - */ -cywait(cp) - register fmt_ccb *cp; -{ - register int i = 5000; - - uncache(&cp->gate); - while (i-- > 0 && cp->gate == GATE_CLOSED) { - DELAY(1000); - uncache(&cp->gate); - } - return (i <= 0); -} - -/* - * Load a 20 bit pointer into the i/o registers. - */ -load_mbus_addr(in, out) - caddr_t in; - short *out; -{ - register int tmp_in = (int)in; - register char *out_ptr = (char *)out; - - *out_ptr++ = (char)(tmp_in & 0xff); - *out_ptr++ = (char)((tmp_in >> 8) & 0xff); - *out_ptr++ = (char)0; - *out_ptr++ = (char)((tmp_in & 0xf0000) >> 12); -} - -/* -** CYMINSIZE s supposed to adjust the buffer size for any raw i/o. -** since tapes can not read the tail end of partial blocks we ignore -** this request and strategy will return an appropriate error message later. -** -** If this is not done UNIX will lose data that is on the tape. -*/ -unsigned -cyminsize(bp) - struct buf *bp; -{ - if (bp->b_bcount > MAX_BLOCKSIZE) - bp->b_bcount = MAX_BLOCKSIZE; -} - -/* - * Unconditionally reset all controllers to their initial state. - */ -cyreset(vba) - int vba; -{ - register caddr_t addr; - register int ctlr; - - for (ctlr = 0; ctlr < NCY; ctlr++) - if (cyminfo[ctlr] && cyminfo[ctlr]->um_vbanum == vba) { - addr = cyminfo[ctlr]->um_addr; - CY_RESET(addr); - if (!cy_init_controller(addr, ctlr, 0)) { - printf("cy%d: reset failed\n", ctlr); - cyminfo[ctlr] = NULL; - } - } +/* cy.c 1.1 85/07/21 */ +/* cy.c Tahoe version Mar 1983. */ + +#include "cy.h" +#if NCY > 0 /* number of CYPHER tapes in system */ +/* + * Cypher tape driver + * + */ +#include "../h/param.h" +#include "../h/systm.h" +#include "../h/vm.h" +#include "../h/buf.h" +#include "../h/dir.h" +#include "../h/conf.h" +#include "../h/user.h" +#include "../h/file.h" +#include "../machine/pte.h" +#include "../vba/vbavar.h" +#include "../h/mtio.h" +#include "../machine/mtpr.h" +#include "../h/ioctl.h" +#include "../h/cmap.h" +#include "../h/uio.h" + +#include "../vba/cyvar.h" + +#define NTM 1 /* number of TAPEMASTER controllers */ + +/* + * There is a ccybuf per tape controller. + * It is used as the token to pass to the control routines + * and also acts as a lock on the slaves on the + * controller, since there is only one per controller. + * In particular, when the tape is rewinding on close we release + * the user process but any further attempts to use the tape drive + * before the rewind completes will hang waiting for ccybuf. + */ +struct buf ccybuf[NTM]; + +/* + * Raw tape operations use rcybuf. The driver + * notices when rcybuf is being used and allows the user + * program to continue after errors and read records + * not of the standard length (BSIZE). + */ +struct buf rcybuf[NTM]; +long cybufused = 0; + +/* + * Driver interface routines and variables. + */ +int cyprobe(), cyslave(), cyattach(), cydgo(), cyintr(); +int cywait(), cyrewind(); +unsigned tminphys(); +struct vba_ctlr *cyminfo[NTM]; +struct vba_device *cydinfo[NCY]; +struct buf cyutab[NCY]; +short cytotm[NCY]; +extern char cyutl[]; +long cystd[] = { 0x400000, 0 }; +struct vba_driver cydriver = + { cyprobe, cyslave, cyattach, cydgo, cystd, "yc", cydinfo, "cy", + cyminfo, 0 }; + +/* bits in minor device */ +#define CYUNIT(dev) (minor(dev)&07) /* tape unit number */ +#define TMUNIT(dev) (cytotm[CYUNIT(dev)]) /* tape controller number */ +#define T_NOREWIND 0x08 /* no rewind bit */ +#define T_100IPS 0x10 /* high speed flag */ + +int pflag; /* probe flag, set every interrupt by cyintr */ + +#define INF (daddr_t)1000000L +extern int hz; + +struct scp /* SYSTEM CONFIGUREATION POINTER */ +{ + char sysbus ; /* width of system buss 0=8;1=16 */ + char nu1 ; + char pt_scb[4] ; /* pointer to ->SYSTEM CONFIGUREATION BLOCK */ +}; + +/* absolute address - jumpered on the controller */ +#define SCP ((struct scp *)0xc0000c06) + +struct Scb /* SYSTEM CONFIGUREATION BLOCK */ +{ + char sysblk[1] ; /* 0x03 fixed value code */ + char nu2[1] ; + char pt_ccb[4] ; /* pointer to ->CHANNEL CONTROL BLOCK */ +}Scb; + +struct ccb /* CHANNEL CONTROL BLOCK */ +{ + char ccw[1] ; /* 0x11 normal; 0x09 clear non_vect interrupt */ + char gate[1] ; /* This is "the" GATE */ + char pt_tpb[4] ; /* pointer to ->TAPE OPERATION BLOCK or MOVE BLOCK */ +}ccb; + +struct tpb /* TAPE OPERATIONS PARAMETER BLOCK */ +{ + long cmd ; /* COMMAND (input) */ + char control[2] ; /* CONTROL (input) */ + short count ; /* RETURN COUNT (output) */ + short size ; /* BUFFER SIZE (input/output) */ + short rec_over ; /* RECORDS/OVERRUN (input/output) */ + char pt_data[4] ; /* pointer to ->SOURCE/DEST (input) */ + char status[2] ; /* STATUS (output) */ + char pt_link[4] ; /* pointer to ->INTERRUPT/PARAMETER BLOCK (input) */ +} tpb[NTM]; + +struct tpb cycool /* tape parameter block to clear interrupts */ += { + 0L, /* command */ + 0, 0, /* control */ + 0, /* count */ + 0, /* size */ + 0, /* rec_over */ + 0, 0, 0, 0, /* pt_data */ + 0, 0, /* status */ + 0, 0, 0, 0 /* pt_link */ +} ; +/* + * Software state per tape transport. + * + * 1. A tape drive is a unique-open device; we refuse opens when it is already. + * 2. We keep track of the current position on a block tape and seek + * before operations by forward/back spacing if necessary. + * 3. We remember if the last operation was a write on a tape, so if a tape + * is open read write and the last thing done is a write we can + * write a standard end of tape mark (two eofs). + */ +struct cy_softc { + char cy_openf; /* lock against multiple opens */ + char cy_lastiow; /* last op was a write */ + daddr_t cy_blkno; /* block number, for block device tape */ + daddr_t cy_nxrec; /* position of end of tape, if known */ + daddr_t cy_timo; /* time until timeout expires */ + short cy_tact; /* timeout is active */ + short cy_count; /* return count of last operation */ + char cy_status[2]; /* return status of last operation */ +} cy_softc[NTM]; + +/* + * I/O buffer for raw devices. + */ +char cybuf[TBUFSIZ*NBPG]; /* 10k buffer */ + +/* + * States for um->um_tab.b_active, the per controller state flag. + * This is used to sequence control in the driver. + */ +#define SSEEK 1 /* seeking */ +#define SIO 2 /* doing seq i/o */ +#define SCOM 3 /* sending control command */ +#define SREW 4 /* sending a drive rewind */ + +/* + * Determine if there is a controller for + * a cypher at address ctlr_vaddr. + * Reset the controller. + * Our goal is to make the device interrupt. + */ +cyprobe(ctlr_vaddr) + caddr_t ctlr_vaddr; +{ + int *ip; + + pflag = 0; /* clear interrupt flag */ + if (badcyaddr(ctlr_vaddr + 1)) /* check for versabuss timeout */ + return (0); + /* + * Initialize the system configuration pointer + */ + ip = (int *)vtopte(0, btop(SCP)); *ip &= ~PG_PROT; *ip |= PG_KW; + mtpr(SCP, TBIS); + SCP->sysbus = 1; /* system width = 16 bits. */ + /* initialize the pointer to the system configuration block */ + set_pointer((int)&Scb.sysblk[0], (char *)SCP->pt_scb); + /* + * Initialize the system configuration block. + */ + Scb.sysblk[0] = 0x3; /* fixed value */ + /* initialize the pointer to the channel control block */ + set_pointer((int)&ccb.ccw[0], (char *)Scb.pt_ccb); + /* + * Initialize the channel control block. + */ + ccb.ccw[0] = 0x11; /* normal interrupts */ + /* initialize the pointer to the tape parameter block */ + set_pointer((int)&tpb[0], (char *)ccb.pt_tpb); + /* + * set the command to be CONFIGURE. + */ + tpb[0].cmd = CONFIG; + tpb[0].control[0] = CW_I; /* interrupt on completion */ + tpb[0].control[1] = CW_16bits; + ccb.gate[0] = GATE_CLOSED; + *ip &= ~PG_PROT; *ip |= PG_KR; + mtpr(SCP, TBIS); + TM_ATTENTION(ctlr_vaddr, 0xff); /* execute! */ + if (cywait()) return(0); + else return(1); +} + +/* + * Due to a design flaw, we cannot ascertain if the tape + * exists or not unless it is on line - ie: unless a tape is + * mounted. This is too severe a restriction to bear, + * so all units are assumed to exist. + */ +/*ARGSUSED*/ +cyslave(ui, ctlr_vaddr) + struct vba_device *ui; + caddr_t ctlr_vaddr; +{ + + return (1); +} + +/* + * Record attachment of the unit to the controller. + */ +/*ARGSUSED*/ +cyattach(ui) + struct vba_device *ui; +{ + + /* + * Cytotm is used in TMUNIT to index the ccybuf and rcybuf + * arrays given a cy unit number. + */ + cytotm[ui->ui_unit] = ui->ui_mi->um_ctlr; +} + +int cytimer(); +/* + * Open the device. Tapes are unique open + * devices, so we refuse if it is already open. + * We also check that a tape is available, and + * don't block waiting here; if you want to wait + * for a tape you should timeout in user code. + */ +cyopen(dev, flag) + dev_t dev; + int flag; +{ + register int cyunit, s; + register struct vba_device *ui; + register struct cy_softc *cy; + + cyunit = CYUNIT(dev); + if (cyunit>=NCY || (cy = &cy_softc[cyunit])->cy_openf || + (ui = cydinfo[cyunit]) == 0 || ui->ui_alive == 0) + return ENXIO; + cycommand(dev, (int)DRIVE_S, 1); /* drive status */ + uncache(&tpb[cyunit].status[0]); + if ((tpb[cyunit].status[0]&(CS_DR|CS_OL)) != (CS_DR|CS_OL)) { + uprintf("cy%d: not online\n", cyunit); + return EIO; + } + if ((flag&FWRITE) && (tpb[cyunit].status[0]&CS_P)) { + uprintf("cy%d: no write ring\n", cyunit); + return EIO; + } + cy->cy_openf = 1; + cy->cy_blkno = (daddr_t)0; + cy->cy_nxrec = INF; + cy->cy_lastiow = 0; + s = spl8(); + if (cy->cy_tact == 0) { + cy->cy_timo = INF; + cy->cy_tact = 1; + timeout(cytimer, (caddr_t)dev, 5*hz); + } + splx(s); + return 0; +} + +/* + * Close tape device. + * + * If tape was open for writing or last operation was + * a write, then write two EOF's and backspace over the last one. + * Unless this is a non-rewinding special file, rewind the tape. + * Make the tape available to others. + */ +cyclose(dev, flag) + register dev_t dev; + register flag; +{ + register struct cy_softc *cy = &cy_softc[CYUNIT(dev)]; + + if (flag == FWRITE || (flag&FWRITE) && cy->cy_lastiow) { + cycommand(dev, (int)WRIT_FM, 1); /* write file mark */ + cycommand(dev, (int)WRIT_FM, 1); + cycommand(dev, (int)SP_BACK, 1); /* space back */ + } + if ((minor(dev)&T_NOREWIND) == 0) + /* + * 0 count means don't hang waiting for rewind complete + * rather ccybuf stays busy until the operation completes + * preventing further opens from completing by + * preventing a SENSE operation from completing. + */ + cycommand(dev, (int)REWD_TA, 0); + cy->cy_openf = 0; +} + +int commflag; /* signal cystrategy that it is called from cycommand */ + +/* + * Execute a command on the tape drive + * a specified number of times. + */ +cycommand(dev, com, count) + dev_t dev; + int com, count; +{ + register struct buf *bp; + int s; + + bp = &ccybuf[TMUNIT(dev)]; + s = spl8(); + while (bp->b_flags&B_BUSY) { + /* + * This special check is because B_BUSY never + * gets cleared in the non-waiting rewind case. + */ + if (bp->b_repcnt == 0 && (bp->b_flags&B_DONE)) + break; + bp->b_flags |= B_WANTED; + sleep((caddr_t)bp, PRIBIO); + } + bp->b_flags = B_BUSY|B_READ; + splx(s); + bp->b_dev = dev; + bp->b_repcnt = count; + bp->b_command = com; + bp->b_blkno = 0; + commflag = 1; + cystrategy(bp); + commflag = 0; + /* + * In case of rewind from close, don't wait. + * This is the only case where count can be 0. + */ + if (count == 0) + return; + iowait(bp); + if (bp->b_flags&B_WANTED) + wakeup((caddr_t)bp); + bp->b_flags &= B_ERROR; +} + +/* + * Queue a tape operation. + */ +cystrategy(bp) + register struct buf *bp; +{ + int cyunit = CYUNIT(bp->b_dev); + int s; + register struct vba_ctlr *um; + register struct buf *dp; + + /* + * Put transfer at end of unit queue + */ + dp = &cyutab[cyunit]; + bp->av_forw = NULL; + s = spl8(); +/* + * Next piece of logic takes care of unusual cases when more than + * a full block is required. + * The driver reads the tape to a temporary buffer and + * then moves the amount needed back to the process. + * In this case, the flag NOT1K is set. + */ + + if (commflag == 0) + buf_setup(bp, 1); + um = cydinfo[cyunit]->ui_mi; + if (dp->b_actf == NULL) { + dp->b_actf = bp; + /* + * Transport not already active... + * put at end of controller queue. + */ + dp->b_forw = NULL; + if (um->um_tab.b_actf == NULL) + um->um_tab.b_actf = dp; + else + um->um_tab.b_actl->b_forw = dp; + um->um_tab.b_actl = dp; + } else + dp->b_actl->av_forw = bp; + dp->b_actl = bp; + /* + * If the controller is not busy, get + * it going. + */ + if (um->um_tab.b_active == 0) + cystart(um); + splx(s); +} + +/* + * Start activity on a cypher controller. + */ +cystart(um) + register struct vba_ctlr *um; +{ + register struct buf *bp, *dp; + register struct tpb *tp; + register struct cy_softc *cy; + register int phadr; + int cyunit, timer; + daddr_t blkno; + caddr_t ctlr_vaddr; + ctlr_vaddr = um->um_addr; + /* + * Look for an idle transport on the controller. + */ +loop: + if ((dp = um->um_tab.b_actf) == NULL) + return; + if ((bp = dp->b_actf) == NULL) { + um->um_tab.b_actf = dp->b_forw; + goto loop; + } + cyunit = CYUNIT(bp->b_dev); + cy = &cy_softc[cyunit]; + tp = &tpb[cyunit]; + /* + * Default is that last command was NOT a write command; + * if we do a write command we will notice this in cyintr(). + */ + cy->cy_lastiow = 0; + uncache(&tp->status[0]); + uncache(&tp->count); + cy->cy_count = TM_SHORT(tp->count); + cy->cy_status[0] = tp->status[0]; + cy->cy_status[1] = tp->status[1]; + if (cy->cy_openf < 0 || + (bp->b_command != DRIVE_S) && + ((tp->status[0]&CS_OL) != CS_OL)) { + /* + * Have had a hard error on a non-raw tape + * or the tape unit is now unavailable + * (e.g. taken off line). + */ + bp->b_flags |= B_ERROR; + goto next; + } + if (bp == &ccybuf[TMUNIT(bp->b_dev)]) { + /* + * Execute control operation with the specified count. + * Set next state; give 5 minutes to complete + * rewind, or 10 seconds per iteration (minimum 60 + * seconds and max 5 minutes) to complete other ops. + */ + if (bp->b_command == REWD_TA) { + um->um_tab.b_active = SREW; + cy->cy_timo = 5 * 60; + } else { + um->um_tab.b_active = SCOM; + cy->cy_timo = imin(imax(10*(int)bp->b_repcnt, 60), 5*60); + } + /* + * Prepare parameter block for controller + */ + tp->cmd = bp->b_command; + tp->control[0] = (CW_I | (cyunit<b_dev)&T_100IPS) + tp->control[1] = (CW_100ips | CW_16bits); + else tp->control[1] = (CW_25ips | CW_16bits); + if (bp->b_command == SP_BACK) { + tp->control[1] |= CW_R; + tp->cmd = SPACE; + tp->rec_over = TM_SHORT((short)bp->b_repcnt); + } + if (bp->b_command == SP_FORW) + tp->rec_over = TM_SHORT((short)bp->b_repcnt); + if (bp->b_command == SRFM_BK) { + tp->control[1] |= CW_R; + tp->cmd = SERH_FM; + tp->rec_over = TM_SHORT((short)bp->b_repcnt); + } + if (bp->b_command == SRFM_FD) + tp->rec_over = TM_SHORT((short)bp->b_repcnt); + tp->status[0] = tp->status[1] = 0; + tp->count = 0; + set_pointer((int)&tpb[cyunit], (char *)ccb.pt_tpb); + goto dobpcmd; + } + /* + * The following checks handle boundary cases for operation + * on non-raw tapes. On raw tapes the initialization of + * cy->cy_nxrec by cyphys causes them to be skipped normally + */ + if (bdbtofsb(bp->b_blkno) > cy->cy_nxrec) { + /* + * Can't read past known end-of-file. + */ + bp->b_flags |= B_ERROR; + bp->b_error = ENXIO; + goto next; + } + if (bdbtofsb(bp->b_blkno) == cy->cy_nxrec && + bp->b_flags&B_READ) { + /* + * Reading at end of file returns 0 bytes. + */ + bp->b_resid = bp->b_bcount; + clrbuf(bp); + goto next; + } + if ((bp->b_flags&B_READ) == 0) + /* + * Writing sets EOF + */ + cy->cy_nxrec = bdbtofsb(bp->b_blkno) + 1; + /* + * If the data transfer command is in the correct place, + * set up the tape parameter block, and start the i/o. + */ + if ((blkno = cy->cy_blkno) == bdbtofsb(bp->b_blkno)) { + um->um_tab.b_active = SIO; + cy->cy_timo = 60; /* premature, but should serve */ + + phadr = get_ioadr(bp, cybuf, CYmap, cyutl); + + if ( (bp->b_flags & B_READ) == 0) + tp->cmd = WRIT_BU; + else tp->cmd = READ_BU; + tp->control[0] = (CW_I | (cyunit<b_dev)&T_100IPS) + tp->control[1] = (CW_100ips | CW_16bits); + else tp->control[1] = (CW_25ips | CW_16bits); + tp->status[0] = tp->status[1] = 0; + tp->count = 0; + tp->size = TM_SHORT(bp->b_bcount); + set_pointer(phadr, (char *)tp->pt_data); + set_pointer((int)&tpb[cyunit], (char *)ccb.pt_tpb); + goto dobpcmd; + } + /* + * Tape positioned incorrectly; + * set to seek forwards or backwards to the correct spot. + */ + um->um_tab.b_active = SSEEK; + tp->cmd = SPACE; + tp->control[0] = (CW_I | (cyunit<b_dev)&T_100IPS) + tp->control[1] = (CW_100ips | CW_16bits); + else tp->control[1] = (CW_25ips | CW_16bits); + tp->status[0] = tp->status[1] = 0; + set_pointer((int)&tpb[cyunit], (char *)ccb.pt_tpb); + if (blkno < bdbtofsb(bp->b_blkno)) + tp->rec_over = TM_SHORT((short)(blkno - bdbtofsb(bp->b_blkno))); + else { + tp->rec_over = TM_SHORT((short)(bdbtofsb(bp->b_blkno) - blkno)); + tp->control[1] |= CW_R; + } + cy->cy_timo = imin(imax(10 * (int)TM_SHORT(tp->rec_over), 60), 5 * 60); +dobpcmd: + /* + * Do the command in bp. + */ + timer = 8000; /* software tolerance for gate open */ + uncache(&ccb.gate[0]); + while (ccb.gate[0] != GATE_OPEN) { + if (--timer == 0) { + ccb.ccw[0] = 0x9; /* forget it...... */ + TM_RESET(ctlr_vaddr, 0xff); + bp->b_flags |= B_ERROR; + goto next; + } + uncache(&ccb.gate[0]); + } + ccb.ccw[0] = 0x11; /* normal mode */ + ccb.gate[0] = GATE_CLOSED; + TM_ATTENTION(ctlr_vaddr, 0xff); /* execute! */ + return; + +next: + /* + * Done with this operation due to error or + * the fact that it doesn't do anything. + * dequeue the transfer and continue processing this slave. + */ + um->um_tab.b_errcnt = 0; + dp->b_actf = bp->av_forw; + iodone(bp); + goto loop; +} + +/* + * Kept for historical reasons. Probably not neccessary. + */ +cydgo(um) + struct vba_ctlr *um; +{ +} + +/* + * Cy interrupt routine. + */ +/*ARGSUSED*/ +cyintr(ctlr) + int ctlr; +{ + struct buf *dp; + register struct buf *bp; + register struct tpb *tp; + register struct vba_ctlr *um = cyminfo[ctlr]; + register struct cy_softc *cy; + caddr_t ctlr_vaddr; + int cyunit; + register state; + + /* + * First we clear the interrupt and close the gate. + */ + ctlr_vaddr = um->um_addr; + ccb.ccw[0] = 0x9; /* clear the interrupt */ + ccb.gate[0] = GATE_CLOSED; + set_pointer((int)&cycool, (char *)ccb.pt_tpb); + cycool.cmd = NO_OP; /* no operation */ + cycool.control[0] = 0; /* No INTERRUPTS */ + cycool.control[1] = 0; + TM_ATTENTION(ctlr_vaddr, 0xff); /* cool it ! */ + cywait(); + /* + * Now we can start handling the interrupt. + */ + pflag = 1; /* set for the probe routine */ + if (intenable == 0) return; /* ignore all interrupts */ + if ((dp = um->um_tab.b_actf) == NULL) + return; + bp = dp->b_actf; + cyunit = CYUNIT(bp->b_dev); + tp = &tpb[cyunit]; + cy = &cy_softc[cyunit]; + /* + * If last command was a rewind, and tape is still + * rewinding, wait for the rewind complete interrupt. + */ + if (um->um_tab.b_active == SREW) { + um->um_tab.b_active = SCOM; + /* uncache(&tp->status[1]); */ + /* if (tp->status[1]&CS_CC != CS_CC) { */ /* not completed */ + /* cy->cy_timo = 5*60; */ /* 5 minutes */ + /* return; */ + /* } */ + } + /* + * An operation completed... update status + */ + cy->cy_timo = INF; + uncache(&tp->count); + uncache(&tp->status[0]); + cy->cy_count = TM_SHORT(tp->count); + cy->cy_status[0] = tp->status[0]; + cy->cy_status[1] = tp->status[1]; + if ((bp->b_flags & B_READ) == 0) + cy->cy_lastiow = 1; + state = um->um_tab.b_active; + um->um_tab.b_active = 0; + /* + * Check for errors. + */ + if (tp->status[1] & CS_ERm) { + /* + * If we hit the end of the tape file, update our position. + */ + if (tp->status[0] & CS_FM) + { + cyseteof(bp); /* set blkno and nxrec */ + state = SCOM; + goto opdone; + } + /* If reading raw device and block was too short ignore the + * error and let the user program decide what to do. + */ + if ((tp->status[0] & ER_TOF) && /* (bp->b_flags & B_PHYS) && */ + (bp->b_flags & B_READ)) goto cont; + cy->cy_openf = -1; /* cause to close */ + printf("cy%d: hard error bn %d er=%x\n", cyunit, + bp->b_blkno, tp->status[1]&CS_ERm); + bp->b_flags |= B_ERROR; + goto opdone; + } + /* + * If we were reading block tape and the record + * was too long, we consider this an error. + */ +cont: + uncache(&tp->count); + uncache(&tp->cmd); + if (bp != &rcybuf[TMUNIT(bp->b_dev)] && (tp->cmd == READ_BU) && + bp->b_bcount < TM_SHORT(tp->count)) { + cy->cy_openf = -1; /* cause to close */ + printf("cy%d: error - tape block too long \n", cyunit); + bp->b_flags |= B_ERROR; + goto opdone; + } + /* + * No errors. + * Advance tape control FSM. + */ + switch (state) { + + case SIO: + /* + * Read/write increments tape block number + */ + cy->cy_blkno++; + end_transfer(bp, cybuf, CYmap, cyutl); + goto opdone; + + case SCOM: + /* + * For forward/backward space record update current position. + */ + if (bp == &ccybuf[TMUNIT(bp->b_dev)]) + switch (bp->b_command) { + + case SP_FORW: + cy->cy_blkno += bp->b_repcnt; + break; + + case SP_BACK: + cy->cy_blkno -= bp->b_repcnt; + break; + } + goto opdone; + + case SSEEK: + cy->cy_blkno = bdbtofsb(bp->b_blkno); + goto opcont; + + default: + panic("cyintr"); + } +opdone: + /* + * Reset error count and remove + * from device queue. + */ + um->um_tab.b_errcnt = 0; + dp->b_actf = bp->av_forw; + uncache(&tp->count); + bp->b_resid = bp->b_bcount - TM_SHORT(tp->count); + iodone(bp); + /* + * Circulate slave to end of controller + * queue to give other slaves a chance. + */ + um->um_tab.b_actf = dp->b_forw; + if (dp->b_actf) { + dp->b_forw = NULL; + if (um->um_tab.b_actf == NULL) + um->um_tab.b_actf = dp; + else + um->um_tab.b_actl->b_forw = dp; + um->um_tab.b_actl = dp; + } + if (um->um_tab.b_actf == 0) + return; +opcont: + cystart(um); +} + +cytimer(dev) + int dev; +{ + register struct cy_softc *cy = &cy_softc[CYUNIT(dev)]; + int s; + + if (cy->cy_timo != INF && (cy->cy_timo -= 5) < 0) { + printf("cy%d: lost interrupt\n", CYUNIT(dev)); + cy->cy_timo = INF; + s = spl8(); + cyintr(TMUNIT(dev)); + splx(s); + return; + } + if (cy->cy_timo != INF ) timeout(cytimer, (caddr_t)dev, 5*hz); +} + +cyseteof(bp) + register struct buf *bp; +{ + register int cyunit = CYUNIT(bp->b_dev); + register struct cy_softc *cy = &cy_softc[cyunit]; + register struct tpb *tp; + + tp = &tpb[cyunit]; + uncache(&tp->rec_over); + if (bp == &ccybuf[TMUNIT(bp->b_dev)]) { + if (cy->cy_blkno > bdbtofsb(bp->b_blkno)) { + /* reversing */ + cy->cy_nxrec = bdbtofsb(bp->b_blkno) - (int)TM_SHORT(tp->rec_over); + cy->cy_blkno = cy->cy_nxrec; + } else { + /* spacing forward */ + cy->cy_blkno = bdbtofsb(bp->b_blkno) + (int)TM_SHORT(tp->rec_over); + cy->cy_nxrec = cy->cy_blkno - 1; + } + return; + } + /* eof on read */ + cy->cy_nxrec = bdbtofsb(bp->b_blkno); +} + +cyread(dev, uio) +dev_t dev; +struct uio *uio; +{ + register error; + + error = cyphys(dev, uio); + if (error) + return error; + while (cybufused) sleep (&cybufused, PRIBIO+1); + cybufused = 1; + error = physio(cystrategy, &rcybuf[TMUNIT(dev)], dev, B_READ, tminphys, uio); + cybufused = 0; + wakeup (&cybufused); + return error; +} + +cywrite(dev, uio) +dev_t dev; +struct uio *uio; +{ + register error; + + error = cyphys(dev, uio); + if (error) + return error; + while (cybufused) sleep (&cybufused, PRIBIO+1); + cybufused = 1; + error = physio(cystrategy, &rcybuf[TMUNIT(dev)], dev, B_WRITE, tminphys, uio); + cybufused = 0; + wakeup (&cybufused); + return error; +} + + +cyreset(uban) + int uban; +{ + register struct vba_ctlr *um; + register cy0f, cyunit; + register struct vba_device *ui; + register struct buf *dp; + + for (cy0f = 0; cy0f < NTM; cy0f++) { + if ((um = cyminfo[cy0f]) == 0 || um->um_alive == 0 || + um->um_vbanum != uban) + continue; + printf(" cy%d", cy0f); + um->um_tab.b_active = 0; + um->um_tab.b_actf = um->um_tab.b_actl = 0; + for (cyunit = 0; cyunit < NCY; cyunit++) { + if ((ui = cydinfo[cyunit]) == 0 || ui->ui_mi != um || + ui->ui_alive == 0) + continue; + dp = &cyutab[cyunit]; + dp->b_active = 0; + dp->b_forw = 0; + dp->b_command = DRIVE_R; + if (um->um_tab.b_actf == NULL) + um->um_tab.b_actf = dp; + else + um->um_tab.b_actl->b_forw = dp; + um->um_tab.b_actl = dp; + if (cy_softc[cyunit].cy_openf > 0) + cy_softc[cyunit].cy_openf = -1; + } + cystart(um); + } +} + + +cyioctl(dev, cmd, data, flag) + caddr_t data; + dev_t dev; +{ + int cyunit = CYUNIT(dev); + register struct cy_softc *cy = &cy_softc[cyunit]; + register struct buf *bp = &ccybuf[TMUNIT(dev)]; + register callcount; + int fcount; + struct mtop *mtop; + struct mtget *mtget; + /* we depend of the values and order of the MT codes here */ + static cyops[] = + {WRIT_FM, SRFM_FD, SRFM_BK, SP_FORW, SP_BACK, REWD_TA, OFF_UNL, NO_OP}; + + switch (cmd) { + case MTIOCTOP: /* tape operation */ + mtop = (struct mtop *)data; + switch(mtop->mt_op) { + case MTWEOF: + callcount = mtop->mt_count; + fcount = 1; + break; + case MTFSF: case MTBSF: + callcount = mtop->mt_count; + fcount = INF; + break; + case MTFSR: case MTBSR: + callcount = 1; + fcount = mtop->mt_count; + break; + case MTREW: case MTOFFL: case MTNOP: + callcount = 1; + fcount = 1; + break; + default: + return ENXIO; + } + if (callcount <= 0 || fcount <= 0) + return EINVAL; + while (--callcount >= 0) { + cycommand(dev, cyops[mtop->mt_op], fcount); + if ((bp->b_flags&B_ERROR) || cy->cy_status[1]&CS_ERm) + break; + } + return geterror(bp); + case MTIOCGET: + mtget = (struct mtget *)data; + mtget->mt_dsreg = cy->cy_status[0]; + mtget->mt_erreg = cy->cy_status[1]; + mtget->mt_resid = cy->cy_count; + mtget->mt_type = MT_ISCY; + break; + default: + return ENXIO; + } + return 0; +} + + + +/* + * Check that a raw device exists. + * If it does, set up cy_blkno and cy_nxrec + * so that the tape will appear positioned correctly. + */ +cyphys(dev, uio) +dev_t dev; +struct uio *uio; +{ + register int cyunit = CYUNIT(dev); + register daddr_t a; + register struct cy_softc *cy; + register struct vba_device *ui; + + if (cyunit >= NCY || (ui=cydinfo[cyunit]) == 0 || ui->ui_alive == 0) + return ENXIO; + cy = &cy_softc[cyunit]; + a = bdbtofsb(uio->uio_offset >> PGSHIFT); + cy->cy_blkno = a; + cy->cy_nxrec = a + 1; + return 0; +} + +/* + * Set a TAPEMASTER pointer (first parameter), into the + * 4 bytes array pointed by the second parameter. + */ +set_pointer(pointer, dest) +int pointer; +char * dest; +{ + *dest++ = pointer & 0xff; /* low byte - offset */ + *dest++ = (pointer >> 8) & 0xff; /* high byte - offset */ + *dest++ = 0; + *dest = (pointer & 0xf0000) >> 12; /* base */ +} + +cydump(dev) +dev_t dev; +{ + register struct vba_device *ui; + register struct tpb *tp; + int cyunit = CYUNIT(dev); + int blk, num; + int start; + + start = 0x800; + num = maxfree; + tp = &tpb[cyunit]; + if (cyunit >= NCY || (ui=cydinfo[cyunit]) == 0 || ui->ui_alive == 0) + return(ENXIO); + if (cywait) return(EFAULT); + while (num > 0) { + blk = num > TBUFSIZ ? TBUFSIZ : num; + bcopy(start*NBPG, cybuf, blk*NBPG); + tp->cmd = WRIT_BU; + tp->control[0] = cyunit<control[1] = (CW_100ips | CW_16bits); + tp->status[0] = tp->status[1] = 0; + tp->size = TM_SHORT(blk*NBPG); + set_pointer((int)cybuf, (char *)tp->pt_data); + set_pointer((int)&tpb[cyunit], (char *)ccb.pt_tpb); + ccb.gate[0] = GATE_CLOSED; + TM_ATTENTION(cyaddr, 0xff); /* execute! */ + start += blk; + num -= blk; + if (cywait) return(EFAULT); + uncache(&tp->status[1]); + if (tp->status[1]&CS_ERm) /* error */ + return (EIO); + } + cyeof(tp, cyunit); + if (cywait) return(EFAULT); + cyeof(tp, cyunit); + if (cywait) return(EFAULT); + uncache(&tp->status[1]); + if (tp->status[1]&CS_ERm) /* error */ + return (EIO); + cyrewind(tp, cyunit); + return (0); +} + +cywait() +{ + register cnt; + + cnt = 5000; /* 5 seconds timeout */ + do { + --cnt; + DELAY(1000); + uncache(&ccb.gate[0]); + } + while (cnt>0 && ccb.gate[0] == GATE_CLOSED); + if (cnt == 0) return(1); /* timeout */ + else return(0); +} + +cyeof(tp, unit) + register struct tpb *tp; + int unit; +{ + tp->cmd = WRIT_FM; + tp->control[0] = unit<control[1] = (CW_100ips | CW_16bits); + tp->status[0] = tp->status[1] = 0; + tp->rec_over = TM_SHORT(1); + set_pointer((int)&tpb[unit], (char *)ccb.pt_tpb); + ccb.gate[0] = GATE_CLOSED; + TM_ATTENTION(cyaddr, 0xff); /* execute! */ +} + + +cyrewind(tp, unit) + register struct tpb *tp; + int unit; +{ + tp->cmd = REWD_TA; + tp->control[0] = unit<control[1] = (CW_100ips | CW_16bits); + tp->status[0] = tp->status[1] = 0; + set_pointer((int)&tpb[unit], (char *)ccb.pt_tpb); + ccb.gate[0] = GATE_CLOSED; + TM_ATTENTION(cyaddr, 0xff); /* execute! */ +} + +unsigned +tminphys(bp) +register struct buf *bp; +{ + + if (bp->b_bcount > sizeof cybuf) + bp->b_bcount = sizeof cybuf; } #endif DELETED sys/tahoe/vba/cyreg.h Index: sys/tahoe/vba/cyreg.h ================================================================== --- sys/tahoe/vba/cyreg.h +++ sys/tahoe/vba/cyreg.h @@ -1,166 +0,0 @@ -/* cyreg.h 7.1 86/01/05 */ - -/* get controller attention and start an operation */ -#define CY_ATTENTION(addr) movob(addr, 0xff) /* also known as: GO */ -#define CY_RESET(addr) CY_ATTENTION(addr+1) /* reset controller */ -#define CYUNIT(d) (minor(d) & 0xf) - -#define MULTIBUS_SHORT(x) (short)((((x)>>8)&0xff) | (((x)<<8)&0xff00)) - -#define NORMAL_INTERUPT 0x11 -#define CLEAR_INTERUPT 0x09 - -#define T_NOREWIND 0x80 - - -/* Tape Parameter Block definitions */ -typedef struct { - long cmd; /* Command */ - short control; /* Control */ - short count; /* Return count */ - short size; /* Buffer size */ - short rec_over; /* Records/Overrun */ - char *data_ptr; /* Pointer to source/dest */ - short status; /* Status */ - short link_ptr[2]; /* Pointer to next parameter block */ -} fmt_tpb; - -/* Controller commands */ - -/* Group. I Control status/commands */ -#define CONFIG (0x00000000) /* configure */ -#define SET_PA (0x08000000) /* set page */ -#define NO_OP (0x20000000) /* no operation */ -#define DRIVE_S (0x28000000) /* drive status */ -#define TAPE_AS (0x74000000) /* tape assign */ -#define DRIVE_R (0x90000000) /* drive reset */ - -/* Group. II Tape position commands */ -#define REWD_OV (0x04000000) /* rewind overlapped */ -#define READ_FO (0x1C000000) /* read foreign tape */ -#define REWD_TA (0x34000000) /* rewind tape */ -#define OFF_UNL (0x38000000) /* off_line and unload */ -#define WRIT_FM (0x40000000) /* write filemark */ -#define SERH_FM (0x44000000) /* search filemark */ -#define SRFM_FD (0x44000000) /* search filemark forward */ -#define SRFM_BK (0xC4000000) /* search filemark backward */ -#define SPACE (0x48000000) /* skip record */ -#define SP_FORW (0x48000000) /* space forward */ -#define SP_BACK (0xC8000000) /* space backwords */ -#define ERASE_F (0x4C000000) /* erase fixed length */ -#define ERASE_T (0x50000000) /* erase to end of tape */ -#define SPAC_FM (0x70000000) /* space filemark */ -#define SP_FM_F (0x70000000) /* space filemark forward */ -#define SP_FM_B (0xC9000000) /* space filemark backward */ -#define SERH_MU (0x94000000) /* search multiple filemarks */ - -/* Group. III Data transfer commands */ -#define READ_BU (0x10000000) /* read buffered */ -#define WRIT_BU (0x14000000) /* write buffered */ -#define EDIT_BU (0x18000000) /* edit buffered */ -#define READ_TA (0x2C000000) /* read tape */ -#define WRIT_TA (0x30000000) /* write tape */ -#define EDIT_TA (0x3C000000) /* edit tape */ -#define READ_ST (0x60000000) /* read streaming */ -#define WRIT_ST (0x64000000) /* write streaming */ - -/* Group. IV Special commands */ -#define EXCHANG (0x0C000000) /* exchange system and tapemaster RAM */ -#define BLOCK_M (0x80000000) /* block move */ - -/* Group. V Diagnostic commands */ -#define TEST_SH (0x54000000) /* short memory test */ -#define TEST_LG (0x58000000) /* long memory test */ -#define TEST_CN (0x5C000000) /* controller confidence test */ -#define TEST_RW (0x68000000) /* test read/write timeing */ - - -/* Control field bit definitions */ -#define CW_UNIT (0x000c<<8) /* tape select mask, 2 bit field */ -#define CW_MAIL (0x0010<<8) /* mailbox flag */ -#define CW_INTR (0x0020<<8) /* interrupt flag */ -#define CW_LINK (0x0040<<8) /* link flag */ -#define CW_LOCK (0x0080<<8) /* bus lock flag */ -#define CW_BANK (0x0100>>8) /* bank select */ -#define CW_REV (0x0400>>8) /* reverse flag */ -#define CW_SPEED (0x0800>>8) /* speed/density */ -#define CW_25ips 0 -#define CW_100ips (0x0800>>8) -#define CW_STREAM (0x1000>>8) /* continuous */ -#define CW_WIDTH (0x8000>>8) /* width */ -#define CW_8bits 0 -#define CW_16bits (0x8000>>8) - - -/* Status field bit definitions */ -#define CS_P (0x0002<<8) /* Protected, no write ring */ -#define CS_FB (0x0004<<8) /* formatter busy */ -#define CS_RDY (0x0008<<8) /* drive ready */ -#define CS_EOT (0x0010<<8) /* end of tape detected */ -#define CS_LP (0x0020<<8) /* tape is at load point */ -#define CS_OL (0x0040<<8) /* drive on_line */ -#define CS_FM (0x0080<<8) /* Filemark detected */ -#define CS_ERm (0x1F00>>8) /* Error value mask */ -#define CS_CR (0x2000>>8) /* Controller executed retries */ -#define CS_CC (0x4000>>8) /* Command Completed successfully */ -#define CS_CE (0x8000>>8) /* Command execution has begun */ - -#define CYDS_BITS "\20\6CS_CR\7CS_CC\8CS_CE\12CS_P\13CS_FB\14CS_RDY\15CS_EOT\ -\16CS_LP\17CS_OL\20CS_FM" - -/* Error value definitions for CS_ERm field */ -#define ER_TIMOUT (0x01) /* timed out data busy false */ -#define ER_TIMOUT1 (0x02) /* data busy false,formatter,ready */ -#define ER_TIMOUT2 (0x03) /* time out ready busy false */ -#define ER_TIMOUT3 (0x04) /* time out ready busy true */ -#define ER_TIMOUT4 (0x05) /* time out data busy true */ -#define ER_NEX (0x06) /* time out memory */ -#define ER_BLANK (0X07) /* blank tape */ -#define ER_DIAG (0x08) /* micro-diagnostic */ -#define ER_EOT (0x09) /* EOT forward, BOT rev. */ -#define ER_HARD (0x0A) /* retry unsuccessful */ -#define ER_FIFO (0x0B) /* FIFO over/under flow */ -#define ER_PARITY (0x0D) /* drive to tapemaster parity error */ -#define ER_CHKSUM (0x0E) /* prom checksum */ -#define ER_STROBE (0x0F) /* time out tape strobe */ -#define ER_NOTRDY (0x10) /* tape not ready */ -#define ER_PROT (0x11) /* write, no enable ring */ -#define ER_JUMPER (0x13) /* missing diagnostic jumper */ -#define ER_LINK (0x14) /* bad link, link inappropriate */ -#define ER_FM (0x15) /* unexpected filemark */ -#define ER_PARAM (0x16) /* bad parameter, byte count ? */ -#define ER_HDWERR (0x18) /* unidentified hardware error */ -#define ER_NOSTRM (0x19) /* streaming terminated */ - - -/* Channel control block definitions */ -typedef struct { - char ccw; /* channel control word */ - char gate; /* Tpb access gate */ - short tpb_ptr[2]; /* points to first tape parameter block */ -} fmt_ccb; - -#define GATE_OPEN (char)(0x00) -#define GATE_CLOSED (char)(0xFF) -#define NORMAL_INTERUP 0x11 - - - -/* System configuration block structrure definitions */ -typedef struct { - char fixed_value; /* 0x03 fixed value code */ - char unused_scb; - short ccb_ptr[2]; /* pointer to ->CHANNEL CONTROL BLOCK */ -} fmt_scb; - - -/* System configuration pointer structure definitions */ -typedef struct { - char bus_size; /* width of system bus 0=8; 1=16 */ - char unused_scp; - short scb_ptr[2]; /* pointer to ->SYSTEM CONFIGUREATION BLOCK */ -} fmt_scp; - -#define _16_BITS 1 -#define _8_BITS 0 - Index: sys/tahoe/vba/scat_vddc.c ================================================================== --- sys/tahoe/vba/scat_vddc.c +++ sys/tahoe/vba/scat_vddc.c @@ -1,6 +1,6 @@ -/* scat_vddc.c 1.2 86/01/05 */ +/* scat_vddc.c 1.1 85/07/21 */ #include "fsd.h" #if NVD > 0 /* ** VDDC Driver - Versabus to SMD direct interface version. @@ -13,19 +13,19 @@ #include "../h/cmap.h" #include "../h/conf.h" #include "../h/dir.h" #include "../h/dk.h" #include "../h/map.h" -#include "../tahoe/mtpr.h" -#include "../tahoe/pte.h" +#include "../machine/mtpr.h" +#include "../machine/pte.h" #include "../h/systm.h" -#include "../tahoevba/vbavar.h" +#include "../vba/vbavar.h" #include "../h/user.h" #include "../h/vmmac.h" #include "../h/proc.h" #include "../h/uio.h" -#include "../tahoevba/vddc.h" +#include "../vba/vddc.h" int vddebug = 1; /* if = 1, error messages are printed on the console */ int vdintflg = 0; /* if = 1, interrupts are handled by the driver, * otherwise they are just ignored. (during setup) */ Index: sys/tahoe/vba/scope.h ================================================================== --- sys/tahoe/vba/scope.h +++ sys/tahoe/vba/scope.h @@ -1,6 +1,6 @@ -/* scope.h 1.2 86/01/05 */ +/* scope.h 1.1 85/07/21 */ /* Some I/O addresses used to generate pulses for scopes */ #define OUT1 0xffffb034 #define OUT2 0xffffb018 #define OUT3 0xffffb020 @@ -7,11 +7,11 @@ #define OUT4 0xffffb004 #define OUT5 0xffffb024 #define OUT6 0xffffb00c #define OUT7 0xffffb02c -#define IOaddr(off) (caddr_t)(&vmem[(off) & 0x0fffff]) +#define IOaddr(off) (char *)(&vmem[(off) & 0x0fffff]) extern char vmem[]; int iospace_mapped; -#define scope_out(x) if(iospace_mapped) movob(IOaddr(OUT/**/x),0) +#define scope_out(x) if(iospace_mapped) movob (0, IOaddr(OUT/**/x)) #define scope_in(x) if(iospace_mapped) dummy = *IOaddr(IN/**/x) Index: sys/tahoe/vba/vba.c ================================================================== --- sys/tahoe/vba/vba.c +++ sys/tahoe/vba/vba.c @@ -1,28 +1,22 @@ -/* vba.c 1.2 86/01/05 */ - -#include "../tahoe/mtpr.h" -#include "../tahoe/pte.h" - -#include "param.h" -#include "buf.h" -#include "cmap.h" -#include "conf.h" -#include "dir.h" -#include "dk.h" -#include "map.h" -#include "systm.h" -#include "user.h" -#include "vmparam.h" -#include "vmmac.h" -#include "proc.h" - -#include "../tahoevba/vbavar.h" - -/* - * Tahoe VERSAbus adapator support routines. - */ +/* vba.c 1.1 85/07/21 */ + +#include "../h/param.h" +#include "../h/buf.h" +#include "../h/cmap.h" +#include "../h/conf.h" +#include "../h/dir.h" +#include "../h/dk.h" +#include "../h/map.h" +#include "../machine/mtpr.h" +#include "../machine/pte.h" +#include "../h/systm.h" +#include "../vba/vbavar.h" +#include "../h/user.h" +#include "../h/vmmac.h" +#include "../h/proc.h" + /* * Next piece of logic takes care of unusual cases when less (or more) than * a full block (or sector) are required. This is done by the swaping * logic, when it brings page table pages from the swap device. @@ -36,100 +30,116 @@ * 1) The data length is not a multiple of sector size * 2) The base address + length cross a physical page boundary * 3) The virtual address for I/O is not in the system space. */ +buf_setup(bp, sectsize) +struct buf *bp; +long sectsize; /* This disk's physical sector size */ +{ /* * IO buffer preparation for possible buffered transfer. * The relevant page table entries are kept in the 'buf' structure, * for later use by the driver's 'start' routine or 'interrupt' * routine, when user's data has to be moved to the intermediate * buffer. */ -vbasetup(bp, sectsize) - register struct buf *bp; - int sectsize; /* This disk's physical sector size */ -{ caddr_t source_pte_adr; - register int v; if ((((int)bp->b_un.b_addr & PGOFSET) + bp->b_bcount) > NBPG || - (bp->b_bcount % sectsize) != 0 || - ((int)bp->b_un.b_addr & 0xc0000000) != 0xc0000000) { + (bp->b_bcount % sectsize) != 0 || + ((int)bp->b_un.b_addr & 0xc0000000) != 0xc0000000) { bp->b_flags |= B_NOT1K; - v = btop(bp->b_un.b_addr); - source_pte_adr = (caddr_t)(bp->b_flags&B_DIRTY ? - vtopte(&proc[2], v) : vtopte(bp->b_proc, v)); + if (bp->b_flags & B_DIRTY) + source_pte_adr = (caddr_t)vtopte(&proc[2], + btop(bp->b_un.b_addr)); + else source_pte_adr = (caddr_t)vtopte(bp->b_proc, + btop(bp->b_un.b_addr)); bp->b_ptecnt = (bp->b_bcount + NBPG -1 + - ((int)bp->b_un.b_addr & PGOFSET)) / NBPG; - bcopy(source_pte_adr, (caddr_t)bp->b_upte, - (unsigned)bp->b_ptecnt*4); + ((int)bp->b_un.b_addr & PGOFSET)) / NBPG; + bcopy (source_pte_adr, bp->b_upte, bp->b_ptecnt*4); } } +int mapbusy; /* semaphore on the system IOmap buffer */ + +get_ioadr(bp, buffer, map, utl) +struct buf *bp; +char *buffer; /* Driver's own intermediate buffer. */ +long *map; /* A bunch of system pte's */ +struct user *utl; /* The system address mapped through 'map' */ /* * This routine is usually called by the 'start' routine. It * returns the physical address of the first byte for IO, to * be presented to the controller. If intermediate buffering is * needed and a write out is done, now is the time to get the * original user's data in the buffer. */ -vbastart(bp, v, map, utl) - struct buf *bp; - caddr_t v; /* Driver's own intermediate buffer. */ - long *map; /* A bunch of system pte's */ - caddr_t utl; /* The system address mapped through 'map' */ { register phadr, i; if (bp->b_flags & B_NOT1K) { - phadr = vtoph(bp->b_proc, (unsigned)v); - if ((bp->b_flags & B_READ) == 0) { + phadr = vtoph (bp->b_proc, buffer); + if ( (bp->b_flags & B_READ) == 0) { for (i=0; ib_ptecnt; i++) { map[i] = bp->b_upte[i] & ~PG_PROT | PG_V | PG_KR; - mtpr(TBIS, utl + i*NBPG); - mtpr(P1DC, utl + i*NBPG); - } - bcopy(((int)bp->b_un.b_addr & PGOFSET) + utl, - v, (unsigned)bp->b_bcount); - } - } else - phadr = vtoph(bp->b_proc, (unsigned)bp->b_un.b_addr); + mtpr ((caddr_t)utl + i*NBPG, TBIS); + mtpr ((caddr_t)utl + i*NBPG, P1DC); + } + bcopy (((int)bp->b_un.b_addr & PGOFSET) + + (caddr_t)utl, buffer,bp->b_bcount); + } + } + else + phadr = vtoph (bp->b_proc, bp->b_un.b_addr); return (phadr); } +end_transfer(bp, buffer, map, utl) +register struct buf *bp; +char *buffer; /* Driver's own intermediate buffer. */ +long *map; /* A bunch of system pte's */ +struct user *utl; /* The system address mapped through 'map' */ +{ /* * Called by the driver's interrupt routine, after the data is * realy in or out. If that was a read, and the NOT1K flag was on, * now is the time to move the data back into user's space. - * Similar to the vbastart routine, but in the reverse direction. + * Mostly analogous to the get_ioadr routine, but in the reverse direction. */ -vbadone(bp, v, map, utl) - register struct buf *bp; - caddr_t v; /* Driver's own intermediate buffer. */ - long *map; /* A bunch of system pte's */ - caddr_t utl; /* The system address mapped through 'map' */ -{ register i, cnt; if (bp->b_flags & B_READ) if (bp->b_flags & B_NOT1K) { for (cnt = bp->b_bcount ; cnt >= 0; cnt -= NBPG) { - mtpr(P1DC, (int)v + cnt-1); - mtpr(P1DC, (caddr_t)bp->b_un.b_addr + cnt-1); + mtpr ((int)buffer + cnt-1, P1DC); + mtpr ((caddr_t)bp->b_un.b_addr + cnt-1, P1DC); } - if (((int)v & PGOFSET) != 0) - mtpr(P1DC, v); - if (((int)bp->b_un.b_addr & PGOFSET) != 0) - mtpr(P1DC, (caddr_t)bp->b_un.b_addr); + if ( ((int)buffer & PGOFSET) != 0) + mtpr (buffer, P1DC); + if ( ((int)bp->b_un.b_addr & PGOFSET) != 0) + mtpr ((caddr_t)bp->b_un.b_addr, P1DC); for (i=0; ib_ptecnt; i++) { map[i] = bp->b_upte[i] & ~PG_PROT | PG_V | PG_KW; - mtpr(TBIS, utl + i*NBPG); + mtpr ((caddr_t)utl + i*NBPG, TBIS); } - bcopy(v, ((int)bp->b_un.b_addr & PGOFSET)+utl, - (unsigned)bp->b_bcount); - } else - mtpr(P1DC, bp->b_un.b_addr); + bcopy (buffer, + ((int)bp->b_un.b_addr & PGOFSET) + + (caddr_t)utl, bp->b_bcount); + } + else + mtpr (bp->b_un.b_addr, P1DC); bp->b_flags &= ~B_NOT1K; } + +movob (byte, address) +{ + asm(" movob 7(fp),*8(fp);"); +} + +movow (word, address) +{ + asm(" movow 6(fp),*8(fp);"); +} + Index: sys/tahoe/vba/vd.c ================================================================== --- sys/tahoe/vba/vd.c +++ sys/tahoe/vba/vd.c @@ -1,924 +1,841 @@ -/* vd.c 1.2 86/01/05 */ +/* vd.c 1.1 85/07/21 */ #include "fsd.h" #if NVD > 0 /* - * VDDC - Versabus SMD/ESMD driver. - */ -#include "../tahoe/mtpr.h" -#include "../tahoe/pte.h" - -#include "param.h" -#include "buf.h" -#include "cmap.h" -#include "conf.h" -#include "dir.h" -#include "dk.h" -#include "map.h" -#include "systm.h" -#include "user.h" -#include "vmmac.h" -#include "proc.h" -#include "uio.h" - -#include "../tahoevba/vbavar.h" -#define VDGENDATA -#include "../tahoevba/vddcreg.h" -#undef VDGENDATA - -#define MAX_BLOCKSIZE (MAXBPTE*NBPG) -#define DUMPSIZE 64 /* controller limit */ +** VDDC Driver - Versabus to SMD direct interface version. +** Written for TAHOE vmunix, CCI-WDC 9/1/83. +*/ + +#include "../h/param.h" +#include "../h/buf.h" +#include "../h/cmap.h" +#include "../h/conf.h" +#include "../h/dir.h" +#include "../h/dk.h" +#include "../h/map.h" +#include "../machine/mtpr.h" +#include "../machine/pte.h" +#include "../h/systm.h" +#include "../vba/vbavar.h" +#include "../h/user.h" +#include "../h/vmmac.h" +#include "../h/proc.h" +#include "../h/uio.h" +#include "../vba/vddc.h" + +int vddebug = 1; /* if = 1, error messages are printed on the console */ +int vdintflg = 0; /* if = 1, interrupts are handled by the driver, + * otherwise they are just ignored. (during setup) */ + +static struct size FSD[] = { + 9600, 0, /* minor 0/ 8/16/24 = fsd0a - fsd3a - cyl 0 - 59*/ + 12000, 9600, /* minor 1/ 9/17/25 = fsd0b - fsd3b - cyl 60 - 134*/ + 108480, 21600, /* minor 2/10/18/26 = fsd0c - fsd3c - cyl 135 - 812*/ + 1600, 130080, /* minor 3/11/19/27 = fsd0d - fsd3d - cyl 813 - 822*/ + 130080, 0, /* minor 4/12/20/28 = fsd0e - fsd3e - cyl 0 - 812*/ + 131680, 0, /* minor 5/13/21/29 = fsd0f - fsd3f - cyl 0 - 822*/ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ +}; + +static struct size SMD[]= { + 20064, 0, /* minor 32/40/48/56 = smd0a - smd3a cyl 0- 65 */ + 13680, 20064, /* minor 33/41/49/57 = smd0b - smd3b cyl 66- 110 */ + 214928, 33744, /* minor 34/42/50/58 = smd0c - smd3c cyl 111-817 */ + 1520, 248672, /* minor 35/43/51/59 = smd0d - smd3d cyl 818-822 */ + 248672, 0, /* minor 36/44/52/60 = smd0e - smd3e cyl 0-817 */ + 250192, 0, /* minor 37/45/53/61 = smd0f - smd3f cyl 0-822 */ + 0, 0, /* minor 38/46/54/62 = smd0g - smd3g */ + 0, 0, /* minor 39/47/55/63 = smd0h - smd3h */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ +}; + +static struct size XFSD[] = { + 20352, 0, /* minor 64/72/80/88 = xfsd0a - xfsd3a cyl 0- 52 */ + 20352, 20352, /* minor 65/73/81/89 = xfsd0b - xfsd3b cyl 53- 105 */ + 230400, 40704, /* minor 66/74/82/90 = xfsd0c - xfsd3c cyl 106-705 */ + 1920, 271104, /* minor 67/75/83/91 = xfsd0d - xfsd3d cyl 706-710 */ + 271104, 0, /* minor 68/76/84/92 = xfsd0e - xfsd3e cyl 0-705 */ + 273024, 0, /* minor 69/77/85/93 = xfsd0f - xfsd3f cyl 0-710 */ + 0, 0, /* minor 70/78/86/94 = xfsd0g - xfsd3g */ + 0, 0, /* minor 71/79/87/95 = xfsd0h - xfsd3h */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ + 0, 0, /* Non existent minor device */ +}; + +/* +/* +/* Layout of minor number assignments for the VDDC devices. +/* +/* 1 +/* 5 3 2 0 +/* +---------------------------+-----+ +/* | Unit number | FLS | +/* +---------------------------+-----+ +/* | |_____ File system # ( 0-7 ) +/* |__________ Unit # in the system +/* +/********************************************************/ #define VDUNIT(x) (minor(x) >> 3) -#define FILSYS(x) (minor(x) & 0x07) -#define PHYS(x) (vtoph((struct proc *)0, (unsigned)(x))) -#define TRUE 1 -#define FALSE 0 - -#define CTLR_ERROR 1 -#define DRIVE_ERROR 2 -#define HARD_DATA_ERROR 3 -#define SOFT_DATA_ERROR 4 - -#define b_cylin b_resid -#define b_daddr b_error +#define FLSYS(x) (minor(x) & 0x07) +#define PHYS(x) ( vtoph( 0, (int) (x) ) ) + + +/* Drive types should be in order of drive capacity for auto-configuration */ +/* e.g: smallest capacity = drive type 0, highest capacity = type NXPDRV-1 */ + +struct vdst { + short nsect; + short ntrak; + short nspc; + short ncyl; + struct size *sizes; + short dtype; /* type as in byte 5 (drive) of iopb */ + char *name; /* drive name for autoconf */ +} vdst[] = { + +16, 10, 16*10, 823, FSD, 0, "fsd", +16, 19, 16*19, 823, SMD, 1, "smd", +16, 24, 16*24, 711, XFSD, 2, "xfd" +}; + struct vba_ctlr *vdminfo[NVD]; struct vba_device *vddinfo[NFSD]; -int vdprobe(), vdslave(), vdattach(), vddgo(); -struct vba_driver vddriver = - { vdprobe, vdslave, vdattach, vddgo, vddcaddr, "smd/fsd", - vddinfo, "vd", vdminfo }; - -/* - * Per-drive state. - */ -typedef struct { - struct buf raw_q_element; - short sec_per_blk; - short sec_per_cyl; - char status; - struct buf xfer_queue; - int drive_type; - fs_tab info; -} unit_tab; - -/* - * Per-controller state. - */ -typedef struct { - char ctlr_type; /* controller type */ - char *map; /* i/o page map */ - char *utl; /* mapped i/o space */ - u_int cur_slave:8; /* last active unit number */ - u_int int_expected:1; /* expect an interupt */ - u_int ctlr_started:1; /* start command was issued */ - u_int overlap_seeks:1;/* should overlap seeks */ - u_int off_cylinder:16;/* off cylinder bit map */ - u_int unit_type[16]; /* slave types */ - u_int cur_cyl[16]; /* cylinder last selected */ - long cur_trk[16]; /* track last selected */ - fmt_mdcb ctlr_mdcb; /* controller mdcb */ - fmt_dcb ctlr_dcb; /* r/w dcb */ - fmt_dcb seek_dcb[4]; /* dcbs for overlapped seeks */ - /* buffer for raw/swap i/o */ - char rawbuf[MAX_BLOCKSIZE]; -} ctlr_tab; - -extern char vd0utl[]; -#if NVD > 1 -extern char vd1utl[]; -#endif -#if NVD > 2 -extern char vd2utl[]; -#endif -#if NVD > 3 -extern char vd3utl[]; -#endif - -#define VDCINIT(map, utl) { \ - UNKNOWN, (char *)map, utl, 0, FALSE, FALSE, TRUE, 0, \ - { UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN, \ - UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN,UNKNOWN } \ -} -ctlr_tab vdctlr_info[NVD] = { - VDCINIT(VD0map, vd0utl), -#if NVD > 1 - VDCINIT(VD1map, vd1utl), -#endif -#if NVD > 2 - VDCINIT(VD2map, vd2utl), -#endif -#if NVD > 3 - VDCINIT(VD3map, vd3utl), -#endif + +/* +** Internal Functions +*/ +int vdopen(); +int vdclose(); +int vdprobe(); /* See if VDDC is really there */ +int vd_setup(); /* Called from vdprobe */ +int vdslave(); /* See if drive is really there */ +int vdattach(); +int vddgo(); +int vdstrategy(); /* VDDC strategy routine */ +int vdstart(); /* Top level interface to device queue */ +int vdintr(); /* Top Level ISR */ +int vdread(); /* raw i/o read routine */ +int vdwrite(); /* raw i/o write routine */ +int vddump(); /* dump routine */ +int vdsize(); /* sizes for swapconfig */ +int dskrst(); /* reset a drive after hard error */ + +long vdstd[] = { + 0x0f2000 }; + +struct vba_driver vddriver = { + vdprobe, vdslave, vdattach, vddgo, vdstd, + "smd/fsd", vddinfo, "vd", vdminfo +}; + +struct buf vdutab[NFSD]; +struct buf rvdbuf[NFSD]; +char vdbuf[NVD][MAXBPTE * NBPG]; /* internal buffer for raw/swap i/o */ +long vdbufused[NVD]; +extern char vd0utl[],vd1utl[],vd2utl[],vd3utl[]; + +/* +** Disk Address +*/ +struct dskadr { + char track; /* all 8 bits */ + char sector; /* low order 5 bits */ + short cylinder; /* low order 12 bits */ +}; + +/* +** DCB Trailer Formats +**********************************/ + +/* +** Read / Write Trailer +*/ +struct trrw { + char *memadr; /* memory address */ + long wcount; /* 16 bit word count */ + struct dskadr disk; /* disk address */ +}; + +/* +** Format Trailer +*/ +struct trfmt { + char *addr; /* data buffer to be filled on sector*/ + long nsectors; /* # of sectors to be formatted */ + struct dskadr disk; + struct dskadr hdr; +}; + +/* +** Reset / Configure Trailer +*/ +struct treset { + long ncyl; /* # cylinders */ + long nsurfaces; /* # surfaces */ +}; /* # of sectors is defined by VDDC */ + /* to be 32/track of 512 data bytes each */ + +/* +** Seek Trailer +*/ +struct trseek { + struct dskadr disk; +}; + +/* +** DCB Format +*/ +struct fmt_dcb { + struct fmt_dcb *nxtdcb; /* next dcb in chain or End of Chain */ + short intflg; /* interrupt settings and flags */ + short opcode; /* DCB Command code etc... */ + long operrsta; /* Error & Status info */ + short fill; /* not used */ + char devselect; /* Drive selection */ + char trailcnt; /* Trailer Word Count */ + long err_memadr; /* Error memory address */ + short fill2; + short err_wcount; /* Error word count */ + short err_track; /* Error track/sector */ + short err_cyl; /* Error cylinder adr */ + union { + struct trrw rwtrail; /* read/write trailer */ + struct trfmt fmtrail; /* format trailer */ + struct treset resetrail; /* reset/configure trailer */ + struct trseek seektrail; /* seek trailer */ + } trail; }; -unit_tab vdunit_info[NFSD]; +/* +** MDCB Format +*/ +struct fmt_mdcb { + struct fmt_dcb *firstdcb; /* first dcb in chain */ + struct fmt_dcb *procdcb; /* dcb being processed */ + struct fmt_dcb *intdcb; /* dcb causing interrupt */ + long vddcstat; /* VDDC status */ +}mdcbx[NVD]; + +/* +** DCB +*/ + +struct fmt_dcb dcbx[NVD]; + +int vdtimeout; +#define POLLTILLDONE(x, name) { \ + vdtimeout = 1000*(x); \ + uncache((char *)&dcb->operrsta); \ + while (! (dcb->operrsta & DCBCMP)) { \ + DELAY(1000); \ + vdtimeout--; \ + uncache((char *)&dcb->operrsta); \ + if (vdtimeout <=0) { \ + printf("vd: timeout on %s\n", name);\ + return(0); \ + } \ + } \ +} /* - * See if the controller is really there; if so, initialize it. - */ -vdprobe(addr) - cdr *addr; -{ - if (badaddr((caddr_t)addr, 2)) - return (0); - addr->cdr_reset = 0xffffffff; - DELAY(1000000); - if (addr->cdr_reset != (unsigned)0xffffffff) { - DELAY(1000000); - } else { - addr->cdr_reserved = 0x0; - DELAY(3000000); - } - return (sizeof (cdr)); -} +** See if the controller is really there. +** if TRUE - initialize the controller. +*/ +vdprobe(cntrl_vaddr) +caddr_t cntrl_vaddr; +{ + if ( badaddr(cntrl_vaddr,2) ) return(0); /* no controller */ + else + if (vd_setup(cntrl_vaddr)) /* initialize the controller */ + return(1); + else return(0); /* initialization error */ +} + +vd_setup(cntrl_vaddr) +caddr_t cntrl_vaddr; +{ + register struct fmt_dcb *dcb = &dcbx[0]; + register struct fmt_mdcb *mdcb = &mdcbx[0]; + int j; + + VDDC_RESET(cntrl_vaddr); /* Reset the controller */ + /* Burn some time ...... needed after accessing reset port */ + for (j=0; j<20; j++) + DELAY(1000); + + /* setup & issue INIT to initialize VDDC */ + + dcb->opcode = INIT; + dcb->nxtdcb = (struct fmt_dcb *)0; + dcb->intflg = NOINT; + mdcb->firstdcb = (struct fmt_dcb *)PHYS(dcb); + dcb->operrsta = 0; + VDDC_ATTENTION(cntrl_vaddr,PHYS(mdcb) ); /* do it */ + POLLTILLDONE(1,"INIT"); /* poll till done */ + if (dcb->operrsta & HRDERR) { + if (vddebug) + printf("vd: init error, err=%b\n", + dcb->operrsta, ERRBITS); + return(0); + } + /* setup & issue DIAGNOSE */ + + dcb->opcode = DIAG; + dcb->nxtdcb = (struct fmt_dcb *)0; + dcb->intflg = NOINT; + mdcb->firstdcb = (struct fmt_dcb *)PHYS(dcb); + dcb->operrsta = 0; + VDDC_ATTENTION(cntrl_vaddr,PHYS(mdcb) ) /* do it */ + POLLTILLDONE(1,"DIAG") /* poll till done */ + if (dcb->operrsta & HRDERR) { + if (vddebug) + printf("vd: diagnose error, err=%b\n", + dcb->operrsta, ERRBITS); + return(0); + } + /* Start drives command */ +#ifdef notdef + dcb->opcode = VDSTART; + dcb->nxtdcb = (struct fmt_dcb *)0; + dcb->intflg = NOINT; + mdcb->firstdcb = (struct fmt_dcb *)PHYS(dcb); + dcb->operrsta = 0; + VDDC_ATTENTION(cntrl_vaddr,PHYS(mdcb) ) /* do it */ + POLLTILLDONE(20,"VDSTART") /* poll till done */ + if (dcb->operrsta & HRDERR) { + if (vddebug) + printf("vd: start error, err=%b\n", + dcb->operrsta, ERRBITS); + return(0); + } +#endif + return(1); + } /* * See if a drive is really there - * Try to reset/configure the drive, then test its status. - */ -vdslave(vi, addr) - register struct vba_device *vi; - register cdr *addr; -{ - register ctlr_tab *ci = &vdctlr_info[vi->ui_ctlr]; - register unit_tab *ui = &vdunit_info[vi->ui_unit]; - register fmt_mdcb *mdcb = &ci->ctlr_mdcb; - register fmt_dcb *dcb = &ci->ctlr_dcb; - register int type; - - if (ci->ctlr_type == UNKNOWN) { - addr->cdr_reset = 0xffffffff; - DELAY(1000000); - if (addr->cdr_reset != (unsigned)0xffffffff) { - ci->ctlr_type = SMDCTLR; - ci->overlap_seeks = 0; - DELAY(1000000); - } else { - ci->overlap_seeks = 1; - ci->ctlr_type = SMD_ECTLR; - addr->cdr_reserved = 0x0; - DELAY(3000000); - addr->cdr_csr = 0; - addr->mdcb_tcf = AM_ENPDA; - addr->dcb_tcf = AM_ENPDA; - addr->trail_tcf = AM_ENPDA; - addr->data_tcf = AM_ENPDA; - addr->cdr_ccf = CCF_STS | XMD_32BIT | BSZ_16WRD | - CCF_ENP | CCF_EPE | CCF_EDE | CCF_ECE | CCF_ERR; - } - if (vdnotrailer(addr, - vi->ui_ctlr, vi->ui_slave, INIT, 10) & HRDERR) { - printf("vd%d: init error\n", vi->ui_unit); - return (0); - } - if (vdnotrailer(addr, - vi->ui_ctlr, vi->ui_slave, DIAG, 10) & HRDERR) { - printf("vd%d: diagnostic error\n", vi->ui_unit); - return (0); - } - } + * Try to Reset/Configure the drive, then test its status. +*/ +vdslave(ui,cntrl_vaddr) +register struct vba_device *ui; +register caddr_t cntrl_vaddr; +{ + register struct fmt_dcb *dcb = &dcbx[0]; + register struct fmt_mdcb *mdcb = &mdcbx[ui->ui_ctlr]; + register struct vdst *st; + int dsktype; + + /* + ** check drive status - see if drive exists. + */ + dcb->opcode = VDSTATUS; + dcb->intflg = NOINT; + dcb->operrsta = 0; + dcb->devselect = (char)ui->ui_slave; + dcb->trailcnt = (char)0; + mdcb->firstdcb = (struct fmt_dcb *)PHYS(dcb); + mdcb->vddcstat = 0; + VDDC_ATTENTION(cntrl_vaddr,PHYS(mdcb)) /* do it */ + POLLTILLDONE(5,"VDSTATUS") +#ifdef notdef + if (dcb->operrsta & HRDERR) { + if (vddebug) + printf("vd%d: status error, err=%b\n", ui->ui_unit, + dcb->operrsta, ERRBITS); + return(0); + } +#endif + uncache((char *)&mdcb->vddcstat); + if (mdcb->vddcstat & DRVNRDY) return(0); /* not ready-> non existent */ + /* + * drive is alive, now get its type! * Seek on all drive types starting from the largest one. - * a successful seek to the last sector/cylinder/track verifies + * a sucessful seek to the last sector/cylinder/track verifies * the drive type connected to this port. */ - for (type = 0; type < nvddrv; type++) { - /* XXX */ - if (ci->ctlr_type == SMDCTLR && vdst[type].nsec != 32) - continue; - /* XXX */ - if (!vdconfigure_drive(addr, vi->ui_ctlr, vi->ui_slave, type,0)) - return (0); - dcb->opcode = (short)RD; + for (dsktype = NVDDRV-1; dsktype >= 0; dsktype--) { + st = &vdst[dsktype]; + dcb->opcode = RSTCFG; /* configure drive command */ + dcb->intflg = NOINT; + dcb->operrsta = 0; + dcb->trail.resetrail.ncyl = st->ncyl; + dcb->trail.resetrail.nsurfaces = st->ntrak; + dcb->devselect = (char)ui->ui_slave; + dcb->trailcnt = (char)2; + mdcb->firstdcb = (struct fmt_dcb *)PHYS(dcb); + VDDC_ATTENTION(cntrl_vaddr,PHYS(mdcb) ) /* do it */ + POLLTILLDONE(3,"RSTCFG") + if (dcb->operrsta & HRDERR) { + if (vddebug) + printf("vd%d: reset error, err=%b\n", + ui->ui_unit, dcb->operrsta, ERRBITS); + return(0); + } + mdcb->firstdcb = (struct fmt_dcb *)PHYS(dcb); dcb->intflg = NOINT; - dcb->nxtdcb = (fmt_dcb *)0; /* end of chain */ + dcb->opcode = RD; dcb->operrsta = 0; - dcb->devselect = (char)(vi->ui_slave); - dcb->trailcnt = (char)(sizeof (trrw) / sizeof (long)); - dcb->trail.rwtrail.memadr = (char *)PHYS(ci->rawbuf); - dcb->trail.rwtrail.wcount = vdst[type].secsize/sizeof(short); - dcb->trail.rwtrail.disk.cylinder = vdst[type].ncyl - 2; - dcb->trail.rwtrail.disk.track = vdst[type].ntrak - 1; - dcb->trail.rwtrail.disk.sector = vdst[type].nsec - 1; - mdcb->firstdcb = (fmt_dcb *)(PHYS(dcb)); - mdcb->vddcstat = 0; - VDDC_ATTENTION(addr, (fmt_mdcb *)(PHYS(mdcb)), ci->ctlr_type); - POLLTILLDONE(addr, dcb, 60, ci->ctlr_type); - if (vdtimeout <= 0) - printf(" during probe\n"); - if ((dcb->operrsta&HRDERR) == 0) + dcb->devselect = (char)ui->ui_slave; + dcb->trailcnt = (char)3; + dcb->trail.rwtrail.memadr = (char *)PHYS(vdbuf); + dcb->trail.rwtrail.wcount = 256; + dcb->trail.rwtrail.disk.cylinder = st->ncyl -4; + dcb->trail.rwtrail.disk.track = st->ntrak -1; + dcb->trail.rwtrail.disk.sector = 0; + VDDC_ATTENTION(cntrl_vaddr,PHYS(mdcb) ) /* do it */ + POLLTILLDONE(5,"RD") +if (vddebug) + printf("vd%d: cyl %d, trk %d, sec %d, operrsta err=%b\n", + ui->ui_unit, + dcb->trail.rwtrail.disk.cylinder, + dcb->trail.rwtrail.disk.track, + dcb->trail.rwtrail.disk.sector, + dcb->operrsta, ERRBITS); + if ( (dcb->operrsta & HRDERR) == 0) + /* found the drive type! */ break; } - if (type >= nvddrv) { - /* - * If reached here, a drive which is not defined in the + if (dsktype < 0) { + /* If reached here, a drive which is not defined in the * 'vdst' tables is connected. Cannot set it's type. */ - printf("vd%d: unknown drive type\n", vi->ui_unit); - return (0); - } - ui->drive_type = type; - ui->info = vdst[type]; - ui->sec_per_blk = DEV_BSIZE / ui->info.secsize; - vi->ui_type = type; - vi->ui_dk = 1; - vddriver.ud_dname = ui->info.type_name; - return (1); -} - -vdconfigure_drive(addr, ctlr, slave, type, pass) - register cdr *addr; - int ctlr, slave, type, pass; -{ - register ctlr_tab *ci = &vdctlr_info[ctlr]; - - ci->ctlr_dcb.opcode = RSTCFG; /* command */ - ci->ctlr_dcb.intflg = NOINT; - ci->ctlr_dcb.nxtdcb = (fmt_dcb *)0; /* end of chain */ - ci->ctlr_dcb.operrsta = 0; - ci->ctlr_dcb.devselect = (char)slave; - ci->ctlr_dcb.trail.rstrail.ncyl = vdst[type].ncyl; - ci->ctlr_dcb.trail.rstrail.nsurfaces = vdst[type].ntrak; - if (ci->ctlr_type == SMD_ECTLR) { - ci->ctlr_dcb.trailcnt = (char)4; - ci->ctlr_dcb.trail.rstrail.nsectors = vdst[type].nsec; - ci->ctlr_dcb.trail.rstrail.slip_sec = vdst[type].nslip; - } else - ci->ctlr_dcb.trailcnt = (char)2; - ci->ctlr_mdcb.firstdcb = (fmt_dcb *)(PHYS(&ci->ctlr_dcb)); - ci->ctlr_mdcb.vddcstat = 0; - VDDC_ATTENTION(addr, (fmt_mdcb *)(PHYS(&ci->ctlr_mdcb)), ci->ctlr_type); - POLLTILLDONE(addr, &ci->ctlr_dcb, 5, ci->ctlr_type); - if (vdtimeout <= 0) { - printf(" during config\n"); - return (0); - } - if (ci->ctlr_dcb.operrsta & HRDERR) { - if ((ci->ctlr_dcb.operrsta & (NOTCYLERR|DRVNRDY)) == 0) - printf("vd%d: drive %d: config error\n", ctlr, slave); - else if (pass == 0) { - vdstart_drive(addr, ctlr, slave); - return (vdconfigure_drive(addr, ctlr, slave, type, 1)); - } else if (pass == 2) - return (vdconfigure_drive(addr, ctlr, slave, type, 3)); - return (0); - } - return (1); -} - -vdstart_drive(addr, ctlr, slave) - cdr *addr; - register int ctlr, slave; -{ - int error = 0; - - printf("vd%d: starting drive %d, wait...", ctlr, slave); - if (vdctlr_info[ctlr].ctlr_started) { -printf("DELAY(5500000)..."); - DELAY(5500000); - goto done; - } - vdctlr_info[ctlr].ctlr_started = 1; - error = vdnotrailer(addr, ctlr, 0, VDSTART, (slave*6)+62) & HRDERR; - if (!error) { -printf("DELAY(%d)...", (slave * 5500000) + 62000000); - DELAY((slave * 5500000) + 62000000); - } -done: - printf("\n"); - return (error == 0); -} - -vdnotrailer(addr, ctlr, unit, function, time) - register cdr *addr; - int ctlr, unit, function, time; -{ - fmt_mdcb *mdcb = &vdctlr_info[ctlr].ctlr_mdcb; - fmt_dcb *dcb = &vdctlr_info[ctlr].ctlr_dcb; - int type = vdctlr_info[ctlr].ctlr_type; - - dcb->opcode = function; /* command */ - dcb->intflg = NOINT; - dcb->nxtdcb = (fmt_dcb *)0; /* end of chain */ - dcb->operrsta = 0; - dcb->devselect = (char)unit; - dcb->trailcnt = (char)0; - mdcb->firstdcb = (fmt_dcb *)(PHYS(dcb)); - mdcb->vddcstat = 0; - VDDC_ATTENTION(addr, (fmt_mdcb *)(PHYS(mdcb)), type); - POLLTILLDONE(addr, dcb, time, type); - if (vdtimeout <= 0) { - printf(" during init\n"); - return (DCBCMP|ANYERR|HRDERR|OPABRT); - } - return (dcb->operrsta); -} - -vdattach(vi) - register struct vba_device *vi; -{ - register unit_tab *ui = &vdunit_info[vi->ui_unit]; - register ctlr_tab *ci = &vdctlr_info[vi->ui_ctlr]; - register struct buf *cq = &vi->ui_mi->um_tab; - register struct buf *uq = cq->b_forw; - register struct buf *start_queue = uq; - register fs_tab *fs = &ui->info; - - ui->info = vdst[vi->ui_type]; - ui->sec_per_blk = DEV_BSIZE / ui->info.secsize; - ui->sec_per_cyl = ui->info.nsec * ui->info.ntrak; - ui->xfer_queue.b_dev = vi->ui_slave; - ci->unit_type[vi->ui_slave] = vi->ui_type; - /* load unit into controller's active unit list */ - if (uq == NULL) { - cq->b_forw = &ui->xfer_queue; - ui->xfer_queue.b_forw = &ui->xfer_queue; - ui->xfer_queue.b_back = &ui->xfer_queue; - } else { - while (uq->b_forw != start_queue) - uq = uq->b_forw; - ui->xfer_queue.b_forw = start_queue; - ui->xfer_queue.b_back = uq; - uq->b_forw = &ui->xfer_queue; - start_queue->b_back = &ui->xfer_queue; - } - /* - * (60 / rpm) / (number of sectors per track * (bytes per sector / 2)) - */ - dk_mspw[vi->ui_unit] = 120.0 / (fs->rpm * fs->nsec * fs->secsize); -} - -/*ARGSUSED*/ + printf("vd%d: unrecognized drive type\n", ui->ui_unit); + return(0); + } + ui->ui_type = dsktype; + vddriver.ud_dname = st->name; + return(1); +} + +vdattach(ui) +struct vba_device *ui; +{ + if (ui->ui_dk >= 0) + dk_mspw[ui->ui_dk] = .0000020345; /* BAD VALUE */ +} + vddgo(um) - struct vba_ctlr *um; +struct vba_ctlr *um; { - } vdstrategy(bp) - register struct buf *bp; -{ - register int unit = VDUNIT(bp->b_dev); - register struct vba_device *vi = vddinfo[unit]; - register par_tab *par; - register unit_tab *ui; - register fs_tab *fs; - register int blks, bn, s; - - if (bp->b_bcount == 0 || vi == 0 || vi->ui_alive == 0) - goto bad; - ui = &vdunit_info[unit]; - fs = &ui->info; - par = &fs->partition[FILSYS(bp->b_dev)]; - blks = (bp->b_bcount + DEV_BSIZE-1) >> DEV_BSHIFT; - if (bp->b_blkno + blks >= par->par_len) { - blks = par->par_len - bp->b_blkno; - if (blks <= 0) - goto bad; - bp->b_bcount = blks * DEV_BSIZE; - } - bn = bp->b_blkno + par->par_start; - bn *= ui->sec_per_blk; - bp->b_daddr = (bn / fs->nsec) % fs->ntrak; - bp->b_cylin = bn / ui->sec_per_cyl; - vbasetup(bp, ui->info.secsize); - s = spl7(); - if (ui->xfer_queue.av_forw == NULL) { - register ctlr_tab *ci = &vdctlr_info[vi->ui_ctlr]; - int slave = vi->ui_slave; - - if (bp->b_cylin != ci->cur_cyl[slave] || - bp->b_daddr != ci->cur_trk[slave]) - ci->off_cylinder |= 1 << slave; - } - bp->b_daddr |= (bn % fs->nsec) << 8; - disksort(&ui->xfer_queue, bp); - if (!vddinfo[unit]->ui_mi->um_tab.b_active++) { - splx(s); - vdstart(vddinfo[unit]->ui_mi); - } else - splx(s); +register struct buf *bp; +{ + register struct vba_device *ui; + register struct vba_ctlr *um; + register int unit; + register struct buf *dp; + register struct size *sizep; + int index, blocks, s; + + vdintflg = 1; /* enable interrupts handling by the driver */ + blocks = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT; + unit = VDUNIT(bp->b_dev); + ui = vddinfo[unit]; + if (ui == 0 || ui->ui_alive == 0) goto bad1; + index = FLSYS(bp->b_dev); /* get file system index */ + sizep = vdst[ui->ui_type].sizes; + if (bp->b_blkno < 0 || + (dkblock(bp)+blocks > sizep[index].nblocks)) /* disk overflow */ + goto bad1; + s = spl8(); + dp = &vdutab[ui->ui_unit]; + bp->b_resid = bp->b_blkno + sizep[index].block0; + /* block # plays same role as + cylinder # for disksort, as long + as increasing blocks correspond to + increasing cylinders on disk */ + + buf_setup (bp, SECTSIZ); + + disksort(dp, bp); + if (dp->b_active == 0) { /* unit is on controller queue */ + /* put the device on the controller queue */ + dp->b_forw = NULL; /* end of queue indicator */ + um = ui->ui_mi; /* get controller structure !! */ + if (um->um_tab.b_actf == NULL) /* controller queue is empty */ + um->um_tab.b_actf = dp; + else + um->um_tab.b_actl->b_forw = dp; /* add into queue */ + um->um_tab.b_actl = dp; /* update queue tail */ + dp->b_active ++; + } + bp = &ui->ui_mi->um_tab; /* controller structure addr */ + if (bp->b_actf && /* cntrl queue not empty */ + bp->b_active == 0) /* controller not active */ + (void) vdstart(ui->ui_mi);/* go start I/O */ + splx(s); return; -bad: - bp->b_flags |= B_ERROR, bp->b_error = ENXIO; - bp->b_resid = bp->b_bcount; + +bad1: + bp->b_flags |= B_ERROR; iodone(bp); + return; } + /* * Start up a transfer on a drive. */ -vdstart(ci) - register struct vba_ctlr *ci; -{ - register struct buf *cq = &ci->um_tab; - register struct buf *uq = cq->b_forw; - - /* search for next ready unit */ - cq->b_forw = cq->b_forw->b_forw; - uq = cq->b_forw; - do { - if (uq->av_forw != NULL) { - cq->b_forw = uq; - vdexecute(ci, uq); - return; - } - uq = uq->b_forw; - } while (uq != cq->b_forw); -} - -/* - * Initiate seeks for all drives off-cylinder. - */ -vdload_seeks(ci, uq) - register ctlr_tab *ci; - register struct buf *uq; -{ - register int unit, slave, nseeks; - register fmt_dcb *dcb; - register struct buf *bp; - register struct buf *start_queue = uq; - - nseeks = 0; - do { - bp = uq->av_forw; - if (bp != NULL) { - unit = VDUNIT(bp->b_dev); - slave = vddinfo[unit]->ui_slave; - if (ci->off_cylinder & (1 << slave)) { - ci->off_cylinder &= ~(1 << slave); - if (ci->cur_cyl[slave] != bp->b_cylin) { - ci->cur_cyl[slave] = bp->b_cylin; - dk_seek[unit]++; - } - ci->cur_trk[slave] = bp->b_daddr&0xff; - dcb = &ci->seek_dcb[nseeks++]; - dcb->opcode = SEEK; - dcb->intflg = NOINT | INT_PBA; - dcb->operrsta = 0; - dcb->devselect = (char)slave; - dcb->trailcnt = (char)1; - dcb->trail.sktrail.skaddr.cylinder = - bp->b_cylin; - dcb->trail.sktrail.skaddr.track = - bp->b_daddr & 0xff; - dcb->trail.sktrail.skaddr.sector = 0; - } - } - uq = uq->b_forw; - } while (uq != start_queue && nseeks < 4); - return (nseeks); -} - -extern vd_int_timeout(); -/* - * Execute the next command on the unit queue uq. - */ -vdexecute(controller_info, uq) - register struct vba_ctlr *controller_info; - register struct buf *uq; -{ - register struct buf *bp = uq->av_forw; - register int ctlr = controller_info->um_ctlr; - register ctlr_tab *ci = &vdctlr_info[ctlr]; - register int unit = VDUNIT(bp->b_dev); - register int slave = vddinfo[unit]->ui_slave; - register fmt_mdcb *mdcb = &ci->ctlr_mdcb; - register fmt_dcb *dcb = &ci->ctlr_dcb; - - /* - * If there are overlapped seeks to perform, shuffle - * them to the front of the queue and get them started - * before any data transfers (to get some parallelism). - */ - if ((ci->off_cylinder & ~(1<overlap_seeks) { - register int i, nseeks; - - /* setup seek requests in seek-q */ - nseeks = vdload_seeks(ci, uq); - /* place at the front of the master q */ - mdcb->firstdcb = (fmt_dcb *)PHYS(&ci->seek_dcb[0]); - /* shuffle any remaining seeks up in the seek-q */ - for (i = 1; i < nseeks; i++) - ci->seek_dcb[i-1].nxtdcb = - (fmt_dcb *)PHYS(&ci->seek_dcb[i]); - ci->seek_dcb[nseeks-1].nxtdcb = (fmt_dcb *)PHYS(dcb); - } else { - if (bp->b_cylin != ci->cur_cyl[slave]) { - ci->cur_cyl[slave] = bp->b_cylin; - dk_seek[unit]++; - } - ci->cur_trk[slave] = bp->b_daddr & 0xff; - ci->off_cylinder = 0; - mdcb->firstdcb = (fmt_dcb *)(PHYS(dcb)); - } - dcb->opcode = (bp->b_flags & B_READ) ? RD : WD; - dcb->intflg = INTDONE; - dcb->nxtdcb = (fmt_dcb *)0; /* end of chain */ - dcb->operrsta = 0; - dcb->devselect = (char)slave; - dcb->trailcnt = (char)(sizeof (trrw) / sizeof (long)); - dcb->trail.rwtrail.memadr = (char *) - vbastart(bp, ci->rawbuf, (long *)ci->map, ci->utl); - dcb->trail.rwtrail.wcount = (short)((bp->b_bcount+1) / sizeof (short)); - dcb->trail.rwtrail.disk.cylinder = bp->b_cylin; - dcb->trail.rwtrail.disk.track = bp->b_daddr & 0xff; - dcb->trail.rwtrail.disk.sector = bp->b_daddr >> 8; - mdcb->vddcstat = 0; - dk_wds[unit] += bp->b_bcount / 32; - ci->int_expected = 1; - timeout(vd_int_timeout, (caddr_t)ctlr, 20*60); - dk_busy |= 1 << unit; +vdstart(um) +register struct vba_ctlr *um; +{ + register struct buf *bp, *dp; + register struct fmt_dcb *dcb = &dcbx[um->um_ctlr]; + register struct fmt_mdcb *mdcb; + register struct size *sizep; /* Pointer to one of the tables */ + register struct vdst *st; + register int index ; /* Index in the relevant table */ + register int phadr; /* Buffer's physical address */ + register caddr_t cntrl_vaddr = um->um_addr; + int sblock, unit; + int ct; + +loop: + /* + * Pull a request off the controller queue + */ + if ((dp = um->um_tab.b_actf) == NULL) + return ; + if ((bp = dp->b_actf) == NULL) { + dp->b_active = 0; /* device removed from ctlr queue */ + um->um_tab.b_actf = dp->b_forw; + goto loop; + } + /* + * Mark controller busy, and + * prepare a command packet for the controller. + */ + um->um_tab.b_active++; + unit = VDUNIT(bp->b_dev); + st = &vdst[vddinfo[unit]->ui_type]; + mdcb = &mdcbx[vddinfo[unit]->ui_ctlr]; + index = FLSYS(bp->b_dev); + sizep = st->sizes; + mdcb->firstdcb = (struct fmt_dcb *)PHYS(dcb); + dcb->intflg = INTDUN; /* interrupt on completion */ + dcb->opcode = (bp->b_flags & B_READ) ? RD : WD; + dcb->operrsta = 0; + dcb->devselect = (char)(vddinfo[unit])->ui_slave; + dcb->trailcnt = (char)3; + ct = vddinfo[unit]->ui_ctlr; + + switch (ct) { + case 0: + phadr = get_ioadr(bp, vdbuf[0], VD0map, (caddr_t)vd0utl); + break; + case 1: + phadr = get_ioadr(bp, vdbuf[1], VD1map, (caddr_t)vd1utl); + break; + case 2: + phadr = get_ioadr(bp, vdbuf[2], VD2map, (caddr_t)vd2utl); + break; + case 3: + phadr = get_ioadr(bp, vdbuf[3], VD3map, (caddr_t)vd3utl); + break; + } +/* + phadr = get_ioadr(bp, vdbuf, IOmap, (caddr_t)ioutl); +*/ + + if (vddinfo[unit]->ui_dk >= 0) { + int dku = vddinfo[unit]->ui_dk; + dk_busy |= 1<b_bcount>>6; + } + dcb->trail.rwtrail.memadr = (char *)phadr; + dcb->trail.rwtrail.wcount = (bp->b_bcount + 1) / 2; + sblock = sizep[index].block0 + bp->b_blkno; + dcb->trail.rwtrail.disk.cylinder = (short)(sblock / st->nspc); + dcb->trail.rwtrail.disk.track = (char)((sblock % st->nspc) / st->nsect); + dcb->trail.rwtrail.disk.sector = (char)(sblock*2 % (st->nsect*2)); + #ifdef VDDCPERF scope_out(1); #endif - VDDC_ATTENTION((cdr *)(vdminfo[ctlr]->um_addr), - (fmt_mdcb *)(PHYS(mdcb)), ci->ctlr_type); -} - -/* - * Watch for lost interrupts. - */ -vd_int_timeout(ctlr) - register int ctlr; -{ - register ctlr_tab *ci = &vdctlr_info[ctlr]; - register fmt_dcb *dcb = &ci->ctlr_dcb; - - uncache(&dcb->operrsta); - printf("vd%d: lost interupt, status %x", ctlr, dcb->operrsta); - if (ci->ctlr_type == SMD_ECTLR) { - uncache(&dcb->err_code); - printf(", error code %x", dcb->err_code); - } - printf("\n"); - if ((dcb->operrsta&DCBCMP) == 0) { - VDDC_ABORT((cdr *)(vdminfo[ctlr]->um_addr), ci->ctlr_type); - dcb->operrsta |= DCBUSC | DCBABT | ANYERR | HRDERR | CTLRERR; - } - vdintr(ctlr); -} + + VDDC_ATTENTION(cntrl_vaddr,PHYS(mdcb)) /* do it */ +} + /* * Handle a disk interrupt. */ -vdintr(ctlr) - register int ctlr; -{ - register ctlr_tab *ci; - register struct buf *cq, *uq, *bp; - register int slave, unit; - register fmt_mdcb *mdcb; - register fmt_dcb *dcb; - int code, s; - - untimeout(vd_int_timeout, (caddr_t)ctlr); +vdintr(vdnum) +register vdnum; +{ + register struct buf *bp, *dp; + register struct vba_ctlr *um = vdminfo[vdnum]; + register struct fmt_dcb *dcb = &dcbx[vdnum]; + register struct fmt_mdcb *mdcb = &mdcbx[vdnum]; + register struct vdst *st; + int unit; + struct vba_device *ui; + #ifdef VDDCPERF scope_out(2); #endif - ci = &vdctlr_info[ctlr]; - if (!ci->int_expected) { - printf("vd%d: stray interrupt\n", ctlr); - return; - } - /* - * Take first request off controller's queue. - */ - cq = &vdminfo[ctlr]->um_tab; - uq = cq->b_forw; - bp = uq->av_forw; - unit = VDUNIT(bp->b_dev); - dk_busy &= ~(1 << unit); - dk_xfer[unit]++; - ci->int_expected = 0; - /* find associated control blocks */ - mdcb = &ci->ctlr_mdcb, uncache(&mdcb->intdcb); - dcb = &ci->ctlr_dcb, uncache(&dcb->operrsta); - if (ci->ctlr_type == SMD_ECTLR) - uncache(&dcb->err_code); - slave = uq->b_dev; - switch (code = vddecode_error(dcb)) { - - case CTLR_ERROR: - case DRIVE_ERROR: - if (cq->b_errcnt >= 2) - vdhard_error(ci, bp, dcb); - if (code == CTLR_ERROR) - vdreset_ctlr((cdr *)vdminfo[ctlr]->um_addr, ctlr); - else - reset_drive((cdr *)vdminfo[ctlr]->um_addr, ctlr, - slave, 2); - if (cq->b_errcnt++ < 2) { /* retry error */ - cq->b_forw = uq->b_back; - vdstart(vdminfo[ctlr]); - return; - } - bp->b_resid = bp->b_bcount; - break; - - case HARD_DATA_ERROR: - vdhard_error(ci, bp, dcb); - bp->b_resid = 0; - break; - - case SOFT_DATA_ERROR: - vdsoft_error(ci, bp, dcb); - /* fall thru... */ - - default: /* operation completed */ - bp->b_error = 0; - bp->b_resid = 0; - break; - } - vbadone(bp, ci->rawbuf, (long *)ci->map, ci->utl); - /* - * Take next request on this unit q, or, if none, - * the next request on the next active unit q. - */ - s = spl7(); - uq->av_forw = bp->av_forw; - if (uq->av_back != bp) { - register struct buf *next; - - unit = VDUNIT(uq->av_forw->b_dev); - slave = vddinfo[unit]->ui_slave; - next = uq->av_forw; - if (next->b_cylin != ci->cur_cyl[slave] || - (next->b_daddr & 0xff) != ci->cur_trk[slave]) - ci->off_cylinder |= 1 << slave; - } else - uq->av_back = NULL; - splx(s); - /* reset controller state */ - cq->b_errcnt = 0; - cq->b_active--; + if (intenable == 0 || vdintflg == 0) /* ignore all interrupts */ + return; + if (um->um_tab.b_active == NULL) return;/* unexpected interrupt */ + uncache((char *)&mdcb->intdcb); + uncache((char *)&dcb->operrsta); + if ( mdcb->intdcb != (struct fmt_dcb *)PHYS(dcb)) { /* dcb causing interrupt */ + printf("vd%d: bad dcb=%x (phys=%x)\n", + vdnum, mdcb->intdcb, PHYS(dcb)); + return; + } + if (! (dcb->operrsta & DCBCMP)) { /* unexpected interrupt */ + printf("vd%d: unexpected interrupt, err=%b\n", vdnum, + dcb->operrsta, ERRBITS); + return; + } + dp = um->um_tab.b_actf; /* device queue head in ctlr queue */ + bp = dp->b_actf; /* first buffer in device queue */ + unit = VDUNIT(bp->b_dev); + ui = vddinfo[unit]; + if (ui->ui_dk >= 0) + dk_busy &= ~(1 << ui->ui_dk); + if (dcb->operrsta & (HRDERR|SFTERR)) { + st = &vdst[ui->ui_type]; + if (dcb->operrsta & HRDERR) { + harderr(bp, &st->name[7]); + printf("status=%b\n", dcb->operrsta, ERRBITS); + dskrst(bp); + bp->b_flags |= B_ERROR; + } else +#define SECTOR(x) ((x)*2) + printf("%s%d: soft error sn%d status=%b\n", &st->name[7], unit, + SECTOR(bp->b_blkno + st->sizes[FLSYS(bp->b_dev)].block0), + dcb->operrsta, ERRBITS); + } + switch (vdnum) { + case 0: + end_transfer(bp, vdbuf[0], VD0map, (caddr_t)vd0utl); + break; + case 1: + end_transfer(bp, vdbuf[1], VD1map, (caddr_t)vd1utl); + break; + case 2: + end_transfer(bp, vdbuf[2], VD2map, (caddr_t)vd2utl); + break; + case 3: + end_transfer(bp, vdbuf[3], VD3map, (caddr_t)vd3utl); + break; + } + + um->um_tab.b_active = 0; + um->um_tab.b_errcnt = 0; + if (dp->b_forw != NULL) { /* more than 1 unit on queue */ + um->um_tab.b_actf = dp->b_forw; /* next device on ctlr queue */ + dp->b_forw = um->um_tab.b_actl->b_forw; /* be last in queue */ + um->um_tab.b_actl->b_forw = dp; /* last points now to dp */ + um->um_tab.b_actl = dp; /* pointer in ctlr structure */ + } + dp->b_errcnt = 0; + dp->b_actf = bp->av_forw; /* remove first from queue */ + bp->b_resid = 0; /* All data read here */ + #ifdef VDDCPERF scope_out(3); #endif - if (bp->b_flags & B_ERROR) - bp->b_error = EIO; + iodone(bp); - vdstart(vdminfo[ctlr]); -} - -/* - * Convert controller status to internal operation/error code. - */ -vddecode_error(dcb) - register fmt_dcb *dcb; -{ - - if (dcb->operrsta & HRDERR) { - if (dcb->operrsta & (HCRCERR | HCMPERR | UCDATERR | WPTERR | - DSEEKERR | NOTCYLERR |DRVNRDY | INVDADR)) - return (DRIVE_ERROR); - if (dcb->operrsta & (CTLRERR | OPABRT | INVCMD | DNEMEM)) - return (CTLR_ERROR); - return (HARD_DATA_ERROR); - } - if (dcb->operrsta & SFTERR) - return (SOFT_DATA_ERROR); - return (0); -} - -/* - * Report a hard error. - */ -vdhard_error(ci, bp, dcb) - ctlr_tab *ci; - register struct buf *bp; - register fmt_dcb *dcb; -{ - unit_tab *ui = &vdunit_info[VDUNIT(bp->b_dev)]; - - bp->b_flags |= B_ERROR; - harderr(bp, ui->info.type_name); - printf("status %x", dcb->operrsta); - if (ci->ctlr_type == SMD_ECTLR) - printf(" ecode %x", dcb->err_code); - printf("\n"); -} - -/* - * Report a soft error. - */ -vdsoft_error(ci, bp, dcb) - ctlr_tab *ci; - register struct buf *bp; - register fmt_dcb *dcb; -{ - unit_tab *ui = &vdunit_info[VDUNIT(bp->b_dev)]; - - printf("%s%d%c: soft error sn%d status %x", ui->info.type_name, - dkunit(bp), 'a'+(minor(bp->b_dev)&07), bp->b_blkno, - dcb->operrsta); - if (ci->ctlr_type == SMD_ECTLR) - printf(" ecode %x", dcb->err_code); - printf("\n"); -} - -/*ARGSUSED*/ -vdopen(dev, flag) - dev_t dev; - int flag; -{ - register unit = VDUNIT(dev); - register struct vba_device *vi = vddinfo[unit]; - - if (vi == 0 || vi->ui_alive == 0 || vi->ui_type >= nvddrv) - return (ENXIO); - if (vdunit_info[unit].info.partition[FILSYS(dev)].par_len == 0) - return (ENXIO); - return (0); -} + vdstart(um); /* start requests for next device on queue */ +} + vdread(dev, uio) - dev_t dev; - struct uio *uio; +dev_t dev; +struct uio *uio; { register int unit = VDUNIT(dev); - register unit_tab *ui = &vdunit_info[unit]; + register int error; + register int ct; + register int s; if (unit >= NFSD) - return (ENXIO); - return (physio(vdstrategy, &ui->raw_q_element, dev, B_READ, - minphys, uio)); + error = ENXIO; + else { + ct = vddinfo[unit]->ui_ctlr; + s = spl8(); + while (vdbufused[ct]) sleep (&vdbufused[ct],PRIBIO+1); + vdbufused[ct] = 1; + splx(s); + error = physio(vdstrategy, &rvdbuf[unit], dev, B_READ, minphys, uio); + vdbufused[ct] = 0; + wakeup (&vdbufused[ct]); + } + return error; } vdwrite(dev, uio) - dev_t dev; - struct uio *uio; -{ - register int unit = VDUNIT(dev); - register unit_tab *ui = &vdunit_info[unit]; - - if (unit >= NFSD) - return (ENXIO); - return (physio(vdstrategy, &ui->raw_q_element, dev, B_WRITE, - minphys, uio)); -} - -/* - * Crash dump. - */ -vddump(dev) - dev_t dev; -{ - register int unit = VDUNIT(dev); - register unit_tab *ui = &vdunit_info[unit]; - register fs_tab *fs = &ui->info; - register int ctlr = vddinfo[unit]->ui_ctlr; - register struct vba_ctlr *vba_vdctlr_info = vdminfo[ctlr]; - register int filsys = FILSYS(dev); - register cdr *addr = (cdr *)(vba_vdctlr_info->um_addr); - register int cur_blk, blkcount, blocks; - caddr_t memaddr; - - vdreset_ctlr(addr, ctlr); - blkcount = maxfree - 2; /* In 1k byte pages */ - if (dumplo + blkcount > fs->partition[filsys].par_len) { - blkcount = fs->partition[filsys].par_len - dumplo; - printf("vd%d: Dump truncated to %dMB\n", unit, blkcount/1024); - } - cur_blk = fs->partition[filsys].par_start + dumplo; - memaddr = 0; - while (blkcount > 0) { - blocks = MIN(blkcount, DUMPSIZE); - if (!vdwrite_block(addr, ctlr, unit, memaddr, cur_blk, blocks)) - return (EIO); - blkcount -= blocks; - memaddr += blocks * NBPG; - cur_blk += blocks; - } - return (0); -} - -/* - * Write a block to disk during a crash dump. - */ -vdwrite_block(caddr, ctlr, unit, addr, block, blocks) - register cdr *caddr; - register int ctlr, unit; - register caddr_t addr; - register int block, blocks; -{ - register fmt_mdcb *mdcb = &vdctlr_info[ctlr].ctlr_mdcb; - register fmt_dcb *dcb = &vdctlr_info[ctlr].ctlr_dcb; - register unit_tab *ui = &vdunit_info[unit]; - register fs_tab *fs = &ui->info; - - block *= (int)ui->sec_per_blk; - blocks *= (int)ui->sec_per_blk; - mdcb->firstdcb = (fmt_dcb *)(PHYS(dcb)); - dcb->intflg = NOINT; - dcb->opcode = WD; - dcb->operrsta = 0; - dcb->devselect = (char)(vddinfo[unit])->ui_slave; - dcb->trailcnt = (char)(sizeof (trrw) / sizeof (long)); - dcb->trail.rwtrail.memadr = addr; - dcb->trail.rwtrail.wcount = (short) - ((blocks * fs->secsize)/ sizeof (short)); - dcb->trail.rwtrail.disk.cylinder = (short)(block / ui->sec_per_cyl); - dcb->trail.rwtrail.disk.track = (char)((block / fs->nsec) % fs->ntrak); - dcb->trail.rwtrail.disk.sector = (char)(block % fs->nsec); - VDDC_ATTENTION(caddr, (fmt_mdcb *)(PHYS(mdcb)), - vdctlr_info[ctlr].ctlr_type); - POLLTILLDONE(caddr, dcb, 5, vdctlr_info[ctlr].ctlr_type); - if (vdtimeout <= 0) { - printf(" during dump\n"); - return (0); - } - if (dcb->operrsta & HRDERR) { - printf("vd%d: hard error, status %x\n", unit, dcb->operrsta); - return (0); - } - return (1); +dev_t dev; +struct uio *uio; +{ + register int unit = VDUNIT(dev); + register int error; + register int ct; + register int s; + + if (unit >= NFSD) + error = ENXIO; + else { + ct = vddinfo[unit]->ui_ctlr; + s = spl8(); + while (vdbufused[ct]) sleep (&vdbufused[ct],PRIBIO+1); + vdbufused[ct] = 1; + splx(s); + error = physio(vdstrategy, &rvdbuf[unit], dev, B_WRITE, minphys, uio); + vdbufused[ct] = 0; + wakeup (&vdbufused[ct]); + } + return error; +} + +#define DUMPSIZE 32 /* Up to 32k at a time - controller limit */ + +vddump(dev) +dev_t dev; +/* + * Dump the main memory to the given device. + */ +{ + register struct vba_ctlr *um; + register struct fmt_dcb *dcb = &dcbx[0]; + register struct fmt_mdcb *mdcb = &mdcbx[0]; + register struct vdst *st; + register int unit; + register caddr_t cntrl_vaddr ; + register struct size *sizep; /* Pointer to one of the tables */ + int index,sblock,blkcount,thiscount; + int memaddr; + + unit = VDUNIT(dev); + um = (vddinfo[unit])->ui_mi; + st = &vdst[(vddinfo[unit])->ui_type]; + dcb = &dcbx[um->um_ctlr]; + cntrl_vaddr = um->um_addr; + memaddr = 0x0; + index = FLSYS(dev); + sizep = st->sizes; + blkcount = maxfree - 2; /* In 1k byte pages */ + if (dumplo + blkcount > sizep[index].nblocks) return(EINVAL); + sblock = sizep[index].block0 + dumplo; + while (blkcount > 0) { + thiscount = MIN (blkcount, DUMPSIZE); + mdcb->firstdcb = (struct fmt_dcb *)PHYS(dcb); + dcb->intflg = NOINT; + dcb->opcode = WD; + dcb->operrsta = 0; + dcb->devselect = (char)(vddinfo[unit])->ui_slave; + dcb->trailcnt = (char)3; + dcb->trail.rwtrail.memadr = (char *)memaddr; + dcb->trail.rwtrail.wcount = thiscount*512; + dcb->trail.rwtrail.disk.cylinder= (short)(sblock/st->nspc); + dcb->trail.rwtrail.disk.track = (char)((sblock % st->nspc) + / st->nsect); + dcb->trail.rwtrail.disk.sector = (char)(sblock*2 % (st->nsect*2)); + VDDC_ATTENTION(cntrl_vaddr,PHYS(mdcb) ) /* do it */ + POLLTILLDONE(5,"WD"); + if (dcb->operrsta & HRDERR) { + if (vddebug) + printf("vd%d: i/o error, err=%b\n", unit, + dcb->operrsta, ERRBITS); + return(EIO); + }; + blkcount -= thiscount; + memaddr += thiscount*NBPG; + sblock += thiscount; + } + return(0); +} + +vdopen(dev, flag) +register dev_t dev; +int flag; +{ + register struct vba_device *ui; + register unit = VDUNIT(dev); + + ui = vddinfo[unit]; + if (ui == 0 || ui->ui_alive == 0 || ui->ui_type >= NVDDRV) + return ENXIO; + return 0; } vdsize(dev) - dev_t dev; -{ - struct vba_device *vi = vddinfo[VDUNIT(dev)]; - - if (vi == 0 || vi->ui_alive == 0 || vi->ui_type >= nvddrv) - return (-1); - return (vdunit_info[VDUNIT(dev)].info.partition[FILSYS(dev)].par_len); -} - -/* - * Perform a controller reset. - */ -vdreset_ctlr(addr, ctlr) - register cdr *addr; - register int ctlr; -{ - register struct buf *cq = &vdminfo[ctlr]->um_tab; - register struct buf *uq = cq->b_forw; - register ctlr_tab *ci = &vdctlr_info[ctlr]; - - VDDC_RESET(addr, ci->ctlr_type); - ci->ctlr_started = 0; - if (ci->ctlr_type == SMD_ECTLR) { - addr->cdr_csr = 0; - addr->mdcb_tcf = AM_ENPDA; - addr->dcb_tcf = AM_ENPDA; - addr->trail_tcf = AM_ENPDA; - addr->data_tcf = AM_ENPDA; - addr->cdr_ccf = CCF_STS | XMD_32BIT | BSZ_16WRD | - CCF_ENP | CCF_EPE | CCF_EDE | CCF_ECE | CCF_ERR; - } - if (vdnotrailer(addr, ctlr, 0, INIT, 10) & HRDERR) { - printf("failed to init\n"); - return (0); - } - if (vdnotrailer(addr, ctlr, 0, DIAG, 10) & HRDERR) { - printf("diagnostic error\n"); - return (0); - } - /* reset all units attached to controller */ - uq = cq->b_forw; - do { - reset_drive(addr, ctlr, uq->b_dev, 0); - uq = uq->b_forw; - } while (uq != cq->b_forw); - return (1); -} - -/* - * Perform a reset on a drive. - */ -reset_drive(addr, ctlr, slave, start) - register cdr *addr; - register int ctlr, slave, start; -{ - register int type = vdctlr_info[ctlr].unit_type[slave]; - - if (type == UNKNOWN) - return; - if (!vdconfigure_drive(addr, ctlr, slave, type, start)) - printf("vd%d: drive %d: couldn't reset\n", ctlr, slave); -} - -#ifdef notdef -/* - * Dump the mdcb and DCB for diagnostic purposes. - */ -vdprintdcb(lp) - register long *lp; -{ - register int i, dcb, tc; - - for (dcb = 0; lp; lp = (long *)(*lp), dcb++) { - lp = (long *)((long)lp | 0xc0000000); - printf("\nDump of dcb%d@%x:", dcb, lp); - for (i = 0, tc = lp[3] & 0xff; i < tc+7; i++) - printf(" %lx", lp[i]); - printf("\n"); - } - DELAY(1750000); -} -#endif +register dev_t dev; +{ + register struct vba_device *ui; + register unit = VDUNIT(dev); + + ui = vddinfo[unit]; + if (ui == 0 || ui->ui_alive == 0 || ui->ui_type >= NVDDRV) + return -1; + return vdst[ui->ui_type].sizes[FLSYS(dev)].nblocks; +} + +/* reset a drive after a hard error */ +dskrst(bp) + register struct buf *bp; +{ + register struct vdst *st; + register struct fmt_dcb *dcb; + register struct fmt_mdcb *mdcb; + register struct vba_device *ui; + register caddr_t cntrl_vaddr ; + int unit; + + unit = VDUNIT(bp->b_dev); + ui = vddinfo[unit]; + mdcb = &mdcbx[ui->ui_ctlr]; + dcb = &dcbx[ui->ui_ctlr]; + cntrl_vaddr = (ui->ui_mi)->um_addr; + st = &vdst[vddinfo[unit]->ui_type]; + dcb->opcode = RSTCFG; /* configure drive command */ + dcb->intflg = NOINT; + dcb->operrsta = 0; + dcb->trail.resetrail.ncyl = st->ncyl; + dcb->trail.resetrail.nsurfaces = st->ntrak; + dcb->devselect = (char)ui->ui_slave; + dcb->trailcnt = (char)2; + mdcb->firstdcb = (struct fmt_dcb *)PHYS(dcb); + VDDC_ATTENTION(cntrl_vaddr,PHYS(mdcb) ) /* do it */ + POLLTILLDONE(3,"reset") + if (dcb->operrsta & HRDERR) { + if (vddebug) { + harderr(bp, &st->name[7]); + printf("reset failed, err=%b\n", dcb->operrsta,ERRBITS); + } + } +} #endif DELETED sys/tahoe/vba/vdreg.h Index: sys/tahoe/vba/vdreg.h ================================================================== --- sys/tahoe/vba/vdreg.h +++ sys/tahoe/vba/vdreg.h @@ -1,502 +0,0 @@ -/* vdreg.h 1.1 86/01/05 */ - -/* - * VDDC (Versabus Direct Disk Controller) definitions. - */ - -/* - * DCB Command Codes - */ -#define RD 0x80 /* Read Data */ -#define FTR 0xc0 /* Full Track Read */ -#define RAS 0x90 /* Read and Scatter */ -#define C 0xa0 /* Compare */ -#define FTC 0xe0 /* Full Track Compare */ -#define RHDE 0x180 /* Read Header, Data & ECC (not used) */ -#define WD 0x00 /* Write Data */ -#define FTW 0x40 /* Full Track Write */ -#define WTC 0x20 /* Write Then Compare */ -#define FTWTC 0x60 /* Full Track Write Then Compare */ -#define GAW 0x10 /* Gather and Write */ -#define WDE 0x100 /* Write Data & ECC (not used) */ -#define FSECT 0x900 /* Format Sector */ -#define GWC 0x30 /* Gather Write & Compare */ -#define VDSTART 0x800 /* Start drives */ -#define VDRELEASE 0xa00 /* Stop drives */ -#define SEEK 0xb00 /* Seek */ -#define INIT 0xc00 /* Initialize VDDC */ -#define DIAG 0xd00 /* Diagnose (self-test) VDDC */ -#define RSTCFG 0xe00 /* Reset/Configure VDDC/DDI/Drive(s) */ -#define VDSTATUS 0xf00 /* VDDC Status */ - -#define ABORT 0x80000000 /* ABORT active i/o */ - -/* - * Error/status codes. - */ -#define HCRCERR 0x1 /* Header CRC Error */ -#define HCMPERR 0x2 /* Header Compare Error */ -#define WPTERR 0x4 /* Write Protect Error/Status */ -#define CTLRERR 0x8 /* Controller Error */ -#define DSEEKERR 0x10 /* Disk Seek Error */ -#define UCDATERR 0x20 /* Uncorrectable Data Error */ -#define NOTCYLERR 0x40 /* Not on Cylinder Error */ -#define DRVNRDY 0x80 /* Drive Not Ready Error/Status */ -#define ALTACC 0x100 /* Alternate (track) accessed Status */ -#define SEEKSTRT 0x200 /* Seek Started Status */ -#define INVDADR 0x400 /* Invalid Disk Address Error */ -#define DNEMEM 0x800 /* Non-Existant Memory Error */ -#define PARERR 0x1000 /* Memory Parity Error */ -#define DCOMPERR 0x2000 /* Data Compare Error */ -#define DDIRDY 0x4000 /* DDI Ready Error/Status */ -#define OPABRT 0x8000 /* Operator Abort (Host) Error/Status */ -#define DSERLY 0x10000 /* Data Strobe Early */ -#define DSLATE 0x20000 /* Data Strobe Late */ -#define TOPLUS 0x40000 /* Track Offset Plus */ -#define TOMNUS 0x80000 /* Track Offset Minus */ -#define CPDCRT 0x100000 /* Cntlr Performed Data Correction */ -#define HRDERR 0x200000 /* Hard Error */ -#define SFTERR 0x400000 /* Soft Error (retry succesful) */ -#define ANYERR 0x800000 /* Any Error */ -#define INVCMD 0x1000000 /* Programmer error */ - -/* hard error */ -#define HTYPES \ - (HCRCERR|HCMPERR|WPTERR|CTLRERR|DSEEKERR|UCDATERR|NOTCYLERR|DRVNRDY|\ - INVDADR|DNEMEM|PARERR|DCOMPERR) - -#define ERRS 0x3FFF -/* retryable errors */ -#define CANRETRY \ - (CTLRERR|DSEEKERR|NOTCYLERR|DCOMPERR|UCDATERR|PARERR|DNEMEM|HCRCERR|HCMPERR) - -#define ERRBITS "\20\1HCRC\2HCMP\3WPT\4CTLR\5DSEEK\6UCDATA\7NOTCYL\10DRVNRDY\ -\11ALTACC\12SEEKSTRT\13INVDADR\14DNEMEM\15PAR\16DCOMP\17DDIRDY\20OPABRT\ -\21DSERLY\22DSLATE\23TOPLUS\24TOPMNUS\25CPDCRT\26HRDERR\27SFTERR\30ANYERR\ -\31INVCMD" - -/* - * DCB status codes. - */ -#define DCBABT 0x10000000 /* DCB Aborted */ -#define DCBUSC 0x20000000 /* DCB Unsuccesfully Completed */ -#define DCBCMP 0x40000000 /* DCB Complete */ -#define DCBSTR 0x80000000 /* DCB Started */ - -/* - * MDCB status codes. - */ -#define CTLRBSY 0x10000000 /* Cntlr Busy */ -#define INTCCDE 0x60000000 /* Interrupt Cause Code */ -#define DCBINT 0x80000000 /* DCB Interrupt Flag */ - -/* - * VDDC interrupt modes. - */ -#define NOINT 0x0 /* No Interrupt */ -#define INTERR 0x2 /* Interrupt on Error */ -#define INTSUC 0x1 /* Interrupt on Success */ -#define INTDONE 0x3 /* Interrupt on Error or Success */ - - -/* - * Constrol status definitions. - */ -#define CS_SCS 0xf /* Status Change Source (drive number) */ -#define CS_ELC 0x10 /* Error on Last Command */ -#define CS_ICC 0x60 /* Interupt Cause Code */ -#define ICC_NOI 0x00 /* No interupt */ -#define ICC_DUN 0x20 /* No interupt */ -#define ICC_ERR 0x40 /* No interupt */ -#define ICC_SUC 0x60 /* No interupt */ -#define CS_GO 0x80 /* Go bit (controller working) */ -#define CS_BE 0x100 /* Buss Error */ -#define CS_BOK 0x4000 /* Board O.K. */ -#define CS_SFL 0x8000 /* System fail */ -#define CS_LEC 0xff000000 /* Last Error Code */ - -/* Status word bit assignments */ -#define STA_UR 0x1 /* Unit Ready */ -#define STA_OC 0x2 /* On Cylinder */ -#define STA_SE 0x4 /* Seek Error */ -#define STA_DF 0x8 /* Drive Fault */ -#define STA_WP 0x10 /* Write Protected */ -#define STA_US 0x20 /* Unit Selected */ - -/* Interupt Control Field bit assignments */ -#define ICF_IPL 0x7 /* Interupt Priority Level */ -#define ICF_IEN 0x8 /* Interupt ENable */ -#define ICF_IV 0xff00 /* Interupt Vector */ - -/* Transfer Control Format bit assignments */ -#define TCF_AM 0xff /* Address Modifier */ -#define AM_SNPDA 0x01 /* Standard Non-Privileged Data Access */ -#define AM_SASA 0x81 /* Standard Ascending Sequential Access */ -#define AM_ENPDA 0xf1 /* Extended Non-Privileged Data Access */ -#define AM_EASA 0xe1 /* Extended Ascending Sequential Access */ -#define TCF_BTE 0x800 /* Block Transfer Enable */ - -/* Controller Configuration Flags bit assignments */ -#define CCF_STS 0x1 /* Sectors per Track Selectable */ -#define CCF_EAV 0x2 /* Enable Auto Vector */ -#define CCF_ERR 0x4 /* Enable Reset Register */ -#define CCF_XMD 0x60 /* XMD transfer mode (buss size) */ -#define XMD_8BIT 0x20 /* Do only 8 bit transfers */ -#define XMD_16BIT 0x40 /* Do only 16 bit transfers */ -#define XMD_32BIT 0x60 /* Do only 32 bit transfers */ -#define CCF_BSZ 0x300 /* Burst SiZe */ -#define BSZ_16WRD 0x000 /* 16 word transfer burst */ -#define BSZ_12WRD 0x100 /* 12 word transfer burst */ -#define BSZ_8WRD 0x200 /* 8 word transfer burst */ -#define BSZ_4WRD 0x300 /* 4 word transfer burst */ -#define CCF_ENP 0x1000 /* ENable Parity */ -#define CCF_EPE 0x2000 /* Enable Parity Errors */ -#define CCF_EDE 0x10000 /* Error Detection Enable */ -#define CCF_ECE 0x20000 /* Error Correction Enable */ - -/* - * Diagnostic register definitions. - */ -#define DIA_DC 0x7f /* Dump count mask */ -#define DIA_DWR 0x80 /* Dump Write / Read flag */ -#define DIA_ARE 0x100 /* Auto Rebuild Enable */ -#define DIA_CEN 0x200 /* Call ENable flag */ -#define DIA_KEY 0xAA550000 /* Reset KEY */ - -/* Sector Header bit assignments */ -#define VDMF 0x8000 /* Manufacturer Fault 1=good sector */ -#define VDUF 0x4000 /* User Fault 1=good sector */ -#define VDALT 0x2000 /* Alternate Sector 1=alternate */ -#define VDWPT 0x1000 /* Write Protect 1=Read Only Sector */ - -/* DCB Bit assignments */ -#define INT_IC 0x3 /* Interupt Control */ -#define IC_NOI 0x0 /* NO Interupt */ -#define IC_IOD 0x1 /* Interupt On Done */ -#define IC_IOE 0x2 /* Interupt On Error */ -#define IC_IOS 0x3 /* Interupt On Success */ -#define INT_PBA 0x4 /* Proceed before ACK */ - -/* - * Perform a reset on the controller. - */ -#define VDDC_RESET(addr, type) { \ - if (type == SMD_ECTLR) { \ - (addr)->diag_flags = DIA_KEY|DIA_CEN; \ - (addr)->cdr_mdcb_ptr = (fmt_mdcb *)0xffffffff; \ - DELAY(5000000); \ - } else { \ - (addr)->cdr_reset = 0x0; \ - DELAY(1500000); \ - } \ -} - -/* - * Abort a controller operation. - */ -#define VDDC_ABORT(a, type) { \ - if ((type) == SMDCTLR) { \ - movow(a, (ABORT & 0xffff0000) >> 16) ; \ - movow((int)(a)+2, ABORT & 0xffff); \ - } else \ - (a)->cdr_mdcb_ptr = (fmt_mdcb *)ABORT; \ - DELAY(1000000); \ -} - -/* - * Start i/o on controller. - */ -#define VDDC_ATTENTION(ctlr, mdcbadr, type) {\ - if (type == SMDCTLR) { \ - movow(ctlr, ((int)mdcbadr & 0xffff0000) >> 16) ; \ - movow((int)(ctlr)+2, (int)mdcbadr & 0xffff); \ - } else \ - (ctlr)->cdr_mdcb_ptr = mdcbadr; \ -} - -/* - * Poll controller until operation completes - * or timeout expires. - * YECH!!!! THIS SHOULD BE A SUBROUTINE!!! - */ -#define POLLTILLDONE(c, a, x, t) { \ - vdtimeout = 1000 * (x); \ - uncache(&(a)->operrsta); \ - while ((((a)->operrsta) & (DCBCMP|DCBABT)) == 0) { \ - DELAY(1000); \ - vdtimeout--; \ - uncache(&(a)->operrsta); \ - if (vdtimeout <= 0) { \ - printf("vd%d: controller timeout", c); \ - VDDC_ABORT(c, t); \ - DELAY(30000); \ - break; \ - } \ - } \ - if (vdtimeout > 0) \ - if ((t) == SMD_ECTLR && vdtimeout > 0) { \ - uncache(&(c)->cdr_csr); \ - while((c)->cdr_csr&CS_GO) { \ - DELAY(50); \ - uncache(&(c)->cdr_csr); \ - } \ - DELAY(500); \ - } else \ - DELAY(200); \ - uncache(&(a)->operrsta); \ -} - -/* - * A disk address. - */ -typedef struct { - char track; /* all 8 bits */ - char sector; /* all 8 bits */ - short cylinder; /* low order 12 bits */ -} dskadr; - -/* - * Sector formats. - */ -typedef union { - struct { - dskadr hdr_addr; - short smd_crc; - } smd; - struct { - dskadr physical; - dskadr logical; - long smd_e_crc; - } smd_e; -} fmt_hdr; - -/* - * DCB trailer formats. - */ -/* read/write trailer */ -typedef struct { - char *memadr; /* memory address */ - u_long wcount; /* 16 bit word count */ - dskadr disk; /* disk address */ -} trrw; - -/* scatter/gather trailer */ -typedef struct { - trrw start_addr; - struct { - char *nxt_addr; - u_long nxt_len; - } addr_chain[126]; -} trsg; - -/* seek trailer format */ -typedef struct { - dskadr skaddr; -} trseek; - -/* format trailer */ -typedef struct { - char *addr; /* data buffer to be filled on sector*/ - long nsectors; /* # of sectors to be formatted */ - dskadr disk; /* disk physical address info */ - dskadr hdr; /* header address info */ -} trfmt; - -/* reset/configure trailer */ -typedef struct { - long ncyl; /* # cylinders */ - long nsurfaces; /* # surfaces */ - long nsectors; /* # sectors */ - long slip_sec; /* # of slip sectors */ -} treset; - -/* - * DCB layout. - */ -typedef struct fmtdcb { - struct fmtdcb *nxtdcb; /* next dcb */ - short intflg; /* interrupt settings and flags */ - short opcode; /* DCB command code etc... */ - long operrsta; /* error & status info */ - short fill; /* not used */ - char devselect; /* drive selection */ - char trailcnt; /* trailer Word Count */ - long err_memadr; /* error memory address */ - char err_code; /* error codes for SMD/E */ - char fill2; /* not used */ - short err_wcount; /* error word count */ - char err_trk; /* error track/sector */ - char err_sec; /* error track/sector */ - short err_cyl; /* error cylinder adr */ - union { - trseek sktrail; /* seek command trailer */ -#ifdef notdef - trsg sgtrail; /* scatter/gather trailer */ -#endif - trrw rwtrail; /* read/write trailer */ - trfmt fmtrail; /* format trailer */ - treset rstrail; /* reset/configure trailer */ - } trail; -} fmt_dcb; - -/* - * MDCB layout. - */ -typedef struct { - fmt_dcb *firstdcb; /* first dcb in chain */ - fmt_dcb *procdcb; /* dcb being processed */ - fmt_dcb *intdcb; /* dcb causing interrupt */ - long vddcstat; /* VDDC status */ -} fmt_mdcb; - -/* - * Control-status communications block. - */ -typedef struct { - fmt_mdcb *cdr_mdcb_ptr; /* controller's mdcb */ - u_long cdr_reset; /* controller reset register */ - u_long cdr_csr; /* control/status register */ - long cdr_reserved; /* reserved */ - u_short cdr_status[16]; /* per-drive status register */ - u_short stat_chng; /* status change interupt register */ - u_short done_icf; /* interupt-complete register */ - u_short error_icf; /* error-interupt register */ - u_short success_icf; /* success-interupt register */ - u_short mdcb_tcf; /* mdcb transfer control register */ - u_short dcb_tcf; /* dcb transfer control register */ - u_short trail_tcf; /* trail transfer control register */ - u_short data_tcf; /* data transfer control register */ - u_long cdr_ccf; /* controller configuration flags */ - u_long sec_size; /* drive sector size */ - u_long diag_flags; /* diagnostic flag register */ - u_long diag_dump; /* pointer for diagnostic addresses */ -} cdr; - -/* controller types */ -#define UNKNOWN -1 -#define SMDCTLR 1 /* smd interface */ -#define SMD_ECTLR 2 /* extended-smd interface */ - -/* drive types */ -#define XSD 0 -#define FUJ 1 /* fujitsu */ -#define XFD 2 /* CDC 340Mb Winchester */ -#define SMD 3 /* CDC 9766 or equivalent */ -#define FSD 4 - -/* - * Drive logical partitions. - */ -typedef struct { - long par_start; /* starting sector # */ - long par_len; /* size in sectors */ -} par_tab; - -typedef struct { - int secsize; /* bytes/sector */ - int nsec; /* sectors/track */ - int ntrak; /* tracks/cylinder */ - int ncyl; /* # cylinders */ - int nslip; /* # slip sectors */ - int rpm; /* revolutions/minute */ - int nbits; /* bits/track */ - char *type_name; /* drive name */ - long fmt_pat[16]; /* patterns to be used for formatting */ - par_tab partition[8]; /* partition tables */ -} fs_tab; - -/* physical information for known disk drives. */ -#ifdef VDGENDATA -long vddcaddr[] = { 0xf2000, 0xf2100, 0xf2200, 0xf2300 }; -long vdtimeout = 0; - -fs_tab vdst[] = { - {512, 48, 24, 711, 0, 3600, 0, "xsd", /* 515 Mb FSD */ - { 0x0264c993, 0x04c99326, 0x0993264c, 0x13264c98, - 0x264c9930, 0x4c993260, 0x993264c0, 0x3264c980, - 0x64c99300, 0xc9932600, 0x93264c00, 0x264c9800, - 0x4c993000, 0x99326000, 0x3264c000, 0x54c98000}, - {{0, 30528}, /* xsd0a cyl 0 - 52 */ - {30528, 30528}, /* xsd0b cyl 53 - 105 */ - {61056, 345600}, /* xsd0c cyl 106 - 705 */ - {0, 61056}, /* xsd0d cyl 709 - 710 (a & b) */ - {0, 406656}, /* xsd0e cyl 0 - 705 */ - {30528, 376128}, /* xsd0f cyl 53 - 705 (b & c) */ - {61056, 172800}, /* xsd0g cyl 106 - 405 (1/2 of c) */ - {233856, 172800}} /* xsd0h cyl 406 - 705 (1/2 of c) */ - }, - {512, 64, 10, 823, 0, 3600, 0, "fuj", /* 360 Mb Fujitsu */ - { 0x0264c993, 0x04c99326, 0x0993264c, 0x13264c98, - 0x264c9930, 0x4c993260, 0x993264c0, 0x3264c980, - 0x64c99300, 0xc9932600, 0x93264c00, 0x264c9800, - 0x4c993000, 0x99326000, 0x3264c000, 0x54c98000}, - {{0, 19200}, /* fuj0a cyl 0 - 59 */ - {19200, 24000}, /* fuj0b cyl 60 - 134 */ - {43200, 218560}, /* fuj0c cyl 135 - 817 */ - {0, 43200}, /* fuj0d cyl 821 - 822 (a & b) */ - {0, 261760}, /* fuj0e cyl 0 - 817 */ - {19200, 242560}, /* fuj0f cyl 0 - 134 (b & c) */ - {43200, 109440}, /* fuj0g cyl 135 - 476 (1/2 of c) */ - {152640, 109120}} /* fug0h cyl 477 - 817 (1/2 of c) */ - }, - {512, 32, 24, 711, 0, 3600, 0, "xfd", /* 340 Mb FSD */ - { 0x0d9b366c, 0x1b366cd8, 0x366cd9b0, 0x6cd9b360, - 0xd9b366c0, 0xb366cd80, 0x66cd9b00, 0xcd9b3600, - 0x9b366300, 0x366cd800, 0x6cd9b000, 0xd9b36000, - 0xb366c000, 0x66cd8000, 0xcd9b0000, 0x9b360000}, -#ifdef MICKEY - {{ 0, 20352 }, /* xfd0a cyl 0-52 */ - { 20352, 20352 }, /* xfd0b cyl 53-105 */ - { 40704, 230400 }, /* xfd0c cyl 106-705 */ - { 271104,1920 }, /* xfd0d cyl 706-710 */ - { 0, 271104 }, /* xfd0e cyl 0-705 */ - { 0, 273024 }}, /* xfd0f cyl 0-710 */ -#else - {{ 0, 20352 }, /* xfd0a cyl 0 - 52 */ - { 20352, 20352 }, /* xfd0b cyl 53 - 105 */ - { 40704, 230400 }, /* xfd0c cyl 106 - 705 */ - { 0, 40704 }, /* xfd0d cyl 709 - 710 (a & b) */ - { 0, 271104 }, /* xfd0e cyl 0 - 705 */ - { 20352, 250752 }, /* xfd0f cyl 53 - 705 (b & c) */ - { 40704, 115200 }, /* xfd0g cyl 106 - 405 (1/2 of c) */ - { 155904,115200 }} /* xfd0h cyl 406 - 705 (1/2 of c) */ -#endif - }, - {512, 32, 19, 823, 0, 3600, 0, "smd", /* 300 Mb SMD */ - { 0x0d9b366c, 0x1b366cd8, 0x366cd9b0, 0x6cd9b360, - 0xd9b366c0, 0xb366cd80, 0x66cd9b00, 0xcd9b3600, - 0x9b366300, 0x366cd800, 0x6cd9b000, 0xd9b36000, - 0xb366c000, 0x66cd8000, 0xcd9b0000, 0x9b360000}, - {{ 0, 20064}, /* smd0a cyl 0-65 */ - { 20064, 13680}, /* smd0b cyl 66-110 */ - { 33744, 214928}, /* smd0c cyl 111-817 */ - { 248672,1520 }, /* smd0d cyl 818-822 */ - { 0, 248672 }, /* smd0e cyl 0-817 */ - { 0, 250192 }}, /* smd0f cyl 0-822 */ - }, - {512, 32, 10, 823, 0, 3600, 0, "fsd", /* 160 Mb FSD */ - { 0x0d9b366c, 0x1b366cd8, 0x366cd9b0, 0x6cd9b360, - 0xd9b366c0, 0xb366cd80, 0x66cd9b00, 0xcd9b3600, - 0x9b366300, 0x366cd800, 0x6cd9b000, 0xd9b36000, - 0xb366c000, 0x66cd8000, 0xcd9b0000, 0x9b360000}, - {{0, 9600}, /* fsd0a cyl 0 - 59 */ - {9600, 12000}, /* fsd0b cyl 60 - 134 */ - {21600, 109280}, /* fsd0c cyl 135 - 817 */ - {0, 21600}, /* fsd0d cyl 0 - 134 (a & b) */ - {0, 130880}, /* fsd0e cyl 0 - 817 */ - {9600, 121280}, /* fsd0f cyl 60 - 817 (b & c) */ - {21600, 54240}, /* fsd0g cyl 135 - 473 (1/2 of c) */ - {75840, 55040}} /* fsd0h cyl 474 - 817 (1/2 of c) */ - } -}; - -int nvddrv = (sizeof (vdst) / sizeof (fs_tab)); - -#else -#ifdef STANDALONE -extern long vddcaddr[]; -extern long vdtimeout; -extern fs_tab vdst[]; -extern int nvddrv; -#endif -#endif Index: sys/tahoe/vba/vx.c ================================================================== --- sys/tahoe/vba/vx.c +++ sys/tahoe/vba/vx.c @@ -1,31 +1,28 @@ -/* vx.c 1.2 86/01/05 */ +/* vx.c 1.1 85/07/21 */ #include "vx.h" #if NVX > 0 /* * VIOC-X driver */ -#include "../tahoe/pte.h" #include "../h/param.h" #include "../h/ioctl.h" #include "../h/tty.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/map.h" +#include "../machine/pte.h" #include "../h/buf.h" +#include "../vba/vbavar.h" #include "../h/conf.h" #include "../h/file.h" #include "../h/uio.h" -#include "../h/proc.h" -#include "../h/vm.h" - -#include "../tahoevba/vbavar.h" -#include "../tahoevba/vioc.h" +#include "../vba/vioc.h" #ifdef VXPERF -#include "../tahoevba/scope.h" +#include "../vba/scope.h" #endif VXPERF #include "vbsc.h" #if NVBSC > 0 #include "../bsc/bscio.h" #include "../bsc/bsc.h" @@ -49,10 +46,11 @@ extern struct vcmds v_cmds[]; extern long reinit; int vxstart() ; int ttrstrt() ; +caddr_t vtoph(); struct vxcmd *vobtain() ; struct vxcmd *nextcmd() ; /* * Driver information for auto-configuration stuff. @@ -60,11 +58,11 @@ */ int vxprobe(), vxattach(), vxrint(); struct vba_device *vxinfo[NVIOCX]; long vxstd[] = { 0 }; struct vba_driver vxdriver = - { vxprobe, 0, vxattach, 0, vxstd, "vx", vxinfo }; + { vxprobe, 0, vxattach, 0, vxstd, "vioc ", vxinfo }; char vxtype[NVIOCX]; /* 0: viox-x/vioc-b; 1: vioc-bop */ char vxbbno = -1; char vxbopno[NVIOCX]; /* BOP board no. if indicated by vxtype[] */ extern vbrall(); @@ -76,36 +74,32 @@ register int br, cvec; register struct vblok *vp = (struct vblok *)reg; #ifdef lint br = 0; cvec = br; br = cvec; - vackint(0); vunsol(0); vcmdrsp(0); vxfreset(0); #endif - if (badaddr((caddr_t)vp, 1)) - return (0); - vp->v_fault = 0; - vp->v_vioc = V_BSY; - vp->v_hdwre = V_RESET; /* reset interrupt */ + if(badaddr(vp, 1)) + return(0); + vp->v_fault = 0 ; + vp->v_vioc = V_BSY ; + vp->v_hdwre = V_RESET ; /* reset interrupt */ + DELAY(4000000); - if (vp->v_fault != VREADY) - return (0); - return (sizeof (*vp)); + return ( vp->v_fault == VREADY); } vxattach(ui) register struct vba_device *ui; { - VIOCBAS[ui->ui_unit] = ui->ui_addr; - vxinit(ui->ui_unit,(long)1); + vxinit(ui->ui_unit,1); } /* * Open a VX line. */ -/*ARGSUSED*/ vxopen(dev, flag) { register struct tty *tp; /* pointer to tty struct for port */ register struct vcx *xp; /* pointer to VIOC-X info/cmd buffer */ register d; /* minor device number */ @@ -150,20 +144,19 @@ /* wait for data carrier detect to go high */ d = spl8(); if( !vcmodem(dev,VMOD_ON) ) while( (tp->t_state&TS_CARR_ON) == 0 ) - sleep((caddr_t)&tp->t_canq,TTIPRI); + sleep(&tp->t_canq,TTIPRI); jj= (*linesw[tp->t_line].l_open)(dev,tp); /*let tty.c finish the open */ splx(d); /* 1/2/85 : assures open complete */ return (jj); } /* * Close a VX line. */ -/*ARGSUSED*/ vxclose(dev, flag) dev_t dev; int flag; { register struct tty *tp; @@ -249,10 +242,11 @@ sp = (short *)(*aa + (char *)kp) ; } else { c = kp->v_usdata[0] << 6; sp = (short *)((char *)kp + SILOBAS + c); } +nextsilo: i = *(savsilo = sp); if (i == 0) return(1); if(xp->v_vers == V_NEW) if( i > xp->v_silosiz ) { printf("vx: %d exceeds silo size\n",i) ; @@ -355,12 +349,12 @@ cp->par[7] = 0; /* no parity */ } cp->par[5] = 0x4; /* 1 stop bit */ cp->par[6] = tp->t_ospeed; - if (vcmd(xp->v_nbr, (caddr_t)&cp->cmd) && wait) - sleep((caddr_t)cp,TTIPRI); + if (vcmd(xp->v_nbr, &cp->cmd) && wait) + sleep(cp,TTIPRI); splx(s); } /* * VIOCX command response interrupt. @@ -395,11 +389,11 @@ cp->cmd++; return; case XMITDTA: case XMITIMM: break; case LPARAX: - wakeup((caddr_t)cp); + wakeup(cp); default: /* MDMCTL or FDTATOX */ vrelease(xp, cp); if (xp->v_state & V_RESETTING) { vinthandl(n,((V_BSY | RSPquals) << 8) | V_INTR); } @@ -436,11 +430,11 @@ vp = pvp; xp->v_actport[(vp->line & 017) - xp->v_loport] |= 1 ; if(vxstart(tp) && (cp = nextcmd(xp)) != NULL) { xp->v_xmtcnt++; - vcmd(n, (caddr_t)&cp->cmd); + vcmd(n, &cp->cmd); return ; } xp->v_actport[(vp->line & 017) - xp->v_loport] = 0 ; return ; } @@ -448,16 +442,16 @@ hp = &vx_tty[xp->v_hiport+n*16]; for(tp = &vx_tty[xp->v_loport+n*16];tp <= hp;tp++) if(vxstart(tp) && (cp = nextcmd(xp)) != NULL) { xp->v_xmtcnt++; - vcmd(n, (caddr_t)&cp->cmd); + vcmd(n, &cp->cmd); } if( (cp = nextcmd(xp)) != NULL ) /* command to send ? */ { xp->v_xmtcnt++; - vcmd(n, (caddr_t)&cp->cmd); + vcmd(n,&cp->cmd); } xp->v_actflg = 0; } /* @@ -470,11 +464,11 @@ register int s; s = spl8(); if((cp = nextcmd(xp)) != NULL) { xp->v_xmtcnt++; - vcmd(xp->v_nbr, (caddr_t)&cp->cmd); + vcmd(xp->v_nbr, &cp->cmd); } splx(s); } /* @@ -481,11 +475,11 @@ * Start (restart) transmission on the given VX line. */ vxstart(tp) register struct tty *tp; { - register short n; + register short nch; register struct vcx *xp; register char *outb; register full = 0; int k, s, port; @@ -511,14 +505,14 @@ #ifdef VXPERF scope_out(3); #endif VXPERF if(!(tp->t_flags&(RAW|LITOUT))) full = 0200; - if((n = ndqb(&tp->t_outq, full)) == 0) { + if((nch = ndqb(&tp->t_outq, full)) == 0) { if(full) { - n = getc(&tp->t_outq); - timeout(ttrstrt, (caddr_t)tp, (n&0177) +6); + nch = getc(&tp->t_outq); + timeout(ttrstrt, (caddr_t)tp, (nch&0177) +6); tp->t_state |= TS_TIMEOUT; full = 0; } } else { outb = (char *)tp->t_outq.c_cf; @@ -526,19 +520,19 @@ if(xp->v_vers == V_NEW) k = xp->v_actport[port - xp->v_loport] ; else k = xp->v_actflg ; - full = vsetq(xp, port, outb, n); + full = vsetq(xp, port, outb, nch); if( (k&1) == 0 ) { /* not called from vxxint */ if(full || xp->v_xmtcnt == 0) { outb = (char *)(&nextcmd(xp)->cmd); xp->v_xmtcnt++; vcmd(xp->v_nbr, outb ); } else - timeout(vxforce,(caddr_t)xp,3); + timeout(vxforce,xp,3); } } } splx(s); return(full); /* indicate if max commands or not */ @@ -574,20 +568,20 @@ register struct vcx *xp; /* ptr to VIOC-X info/cmd buffer */ register struct vblok *kp; /* pointer to VIOC-X control block */ register struct vxcmd *cp; /* pointer to a command buffer */ register char *resp; /* pointer to response buffer */ register int j; + register struct vcmds *cpp; char type; -#if NVBSC > 0 register struct bsc *bp; /* bsc change */ extern struct bsc bsc[]; -#endif kp = VBAS(i); /* get base adr of cntl blok for VIOC */ xp = &vcx[i]; /* index info/command buffers */ + cpp = &v_cmds[i]; type = kp->v_ident; vxtype[i] = 0; /* Type is Viox-x */ switch(type) { case VIOCX: { @@ -665,11 +659,11 @@ cp->par[0] = i * 4 + VCVECT; /* ack vector */ cp->par[1] = cp->par[0] + 1; /* cmd resp vector */ cp->par[3] = cp->par[0] + 2; /* unsol intr vector */ cp->par[4] = 15; /* max ports, no longer used */ cp->par[5] = 0; /* set 1st port number */ - vcmd(i, (caddr_t)&cp->cmd); /* initialize the VIOC-X */ + vcmd(i, &cp->cmd); /* initialize the VIOC-X */ if (!wait) return; while(cp->cmd == LIDENT); /* wait for command completion */ /* calculate address of response buffer */ @@ -754,11 +748,11 @@ /* * assemble transmits into a multiple command. * up to 8 transmits to 8 lines can be assembled together */ -vsetq(xp ,d ,addr, n) +vsetq(xp ,d ,addr, cnt) register struct vcx *xp; caddr_t addr; { register struct vxcmd *cp; @@ -779,27 +773,26 @@ } cp->cmd++; } mp = (struct vxmit *)(cp->par + (cp->cmd & 07)*sizvxmit); - mp->bcount = n-1; + mp->bcount = cnt-1; mp->line = d; - if((xp->v_vers == V_NEW) && (n <= 6)) { + if((xp->v_vers == V_NEW) && (cnt <= 6)) { cp->cmd = XMITIMM ; p = addr; - /* bcopy(addr, &(char *)mp->ostream, n) ; */ + /* bcopy(addr, &(char *)mp->ostream, cnt) ; */ } else { - addr = (caddr_t)vtoph((struct proc *)0, (unsigned)addr); - /* should be a sys address */ + addr = vtoph(0, (caddr_t)addr) ; /* should be a sys address */ p = (char *)&addr; - n = sizeof addr; + cnt = sizeof addr; /* mp->ostream = addr ; */ } - for(i=0; iostream[i] = *p++; if(xp->v_vers == V_NEW) return(1) ; else return((cp->cmd&07) == 7) ; /* Indicate if full */ } #endif Index: sys/tahoe/vba/vxc.c ================================================================== --- sys/tahoe/vba/vxc.c +++ sys/tahoe/vba/vxc.c @@ -1,6 +1,6 @@ -/* vxc.c 1.2 86/01/05 */ +/* vxc.c 1.1 85/07/21 */ #include "vx.h" #if NVX > 0 /* * VIOC driver @@ -10,21 +10,21 @@ #include "../h/ioctl.h" #include "../h/tty.h" #include "../h/errno.h" #include "../h/time.h" #include "../h/kernel.h" -#include "../h/proc.h" -#include "../tahoevba/vioc.h" +#include "../vba/vioc.h" #include "../sna/snadebug.h" #ifdef VXPERF -#include "../tahoevba/scope.h" +#include "../vba/scope.h" #endif VXPERF #define CMDquals 0 #define RSPquals 1 #define UNSquals 2 +long reinit = 0; extern struct vcx vcx[] ; extern struct tty vx_tty[]; struct vcmds v_cmds[NVIOCX] ; extern char vxtype[]; @@ -57,14 +57,14 @@ if (xp->v_state&V_RESETTING && cmdad != NULL) { /* * When the vioc is resetting, don't process * anything other than LIDENT commands. */ - register struct vxcmd *cmdp = (struct vxcmd *) - ((char *)cmdad - sizeof(cmdp->c_fwd)); - if (cmdp->cmd != LIDENT) { - vrelease(xp, cmdp); + register struct vxcmd *cp = (struct vxcmd *) + ((char *)cmdad - sizeof(cp->c_fwd)); + if (cp->cmd != LIDENT) { + vrelease(xp, cp); return(0); } } if (cmdad != (caddr_t) 0) { cp->cmdbuf[cp->v_fill] = cmdad ; @@ -81,11 +81,10 @@ cp->v_cmdsem--; cp->v_curcnt++; vinthandl(n, ((V_BSY | CMDquals) << 8) | V_INTR ) ; } splx(s) ; - return(1); } /* * VIOC acknowledge interrupt. The VIOC has received the new * command. If no errors, the new command becomes one of 16 (max) @@ -135,21 +134,21 @@ ((long)cp->cmdbuf[cp->v_empty] - 4); if ((cp0->cmd == XMITDTA) || (cp0->cmd == XMITIMM)) { cp1 = vobtain(&vcx[n]); *cp1 = *cp0; vxintr4 &= ~VXERR4; - (void) vcmd(n,&cp1->cmd); + vcmd(n,&cp1->cmd); } } #endif cp->v_curcmd[vp->v_vcid & VCMDLEN-1] = cp->cmdbuf[cp->v_empty] ; if( ++cp->v_empty >= VC_CMDBUFL ) cp->v_empty = 0 ; } if( ++cp->v_itrempt >= VC_IQLEN ) cp->v_itrempt = 0 ; vintempt(n) ; splx(s); - (void) vcmd(n, (caddr_t)0); /* queue next cmd, if any */ + vcmd(n, 0); /* queue next cmd, if any */ } /* * Command Response interrupt. The Vioc has completed * a command. The command may now be returned to @@ -188,11 +187,11 @@ if((k & 0xFF00) == LIDENT) { /* want hiport number */ for(k=0; kv_state == V_RESETTING) return; } else { vpanic( "vc, cmdresp debug") ; splx(s); @@ -280,11 +279,11 @@ int phys; if(cp->v_empty == cp->v_fill || vp->v_vcbsy&V_BSY) break; (&vcx[n])->v_mricmd = (caddr_t)cp->cmdbuf[cp->v_empty]; - phys = vtoph((struct proc *)0, (unsigned)cp->cmdbuf[cp->v_empty]) ; /* should be a sys address */ + phys = vtoph(0, cp->cmdbuf[cp->v_empty]) ; /* should be a sys address */ vp->v_vcp[0] = ((short *)&phys)[0]; vp->v_vcp[1] = ((short *)&phys)[1]; vp->v_vcbsy = V_BSY ; *intr = item ; } @@ -335,12 +334,12 @@ /* * Zero out the vioc structures, mark the vioc as being * reset, reinitialize the free command list, reset the vioc * and start a timer to check on the progress of the reset. */ - bzero((caddr_t)&v_cmds[n], (unsigned)sizeof (struct vcmds)); - bzero((caddr_t)xp, (unsigned)sizeof (struct vcx)); + bzero(&v_cmds[n], sizeof(struct vcmds)); + bzero(xp, sizeof(struct vcx)); /* * Setting V_RESETTING prevents others from issuing * commands while allowing currently queued commands to * be passed to the VIOC. @@ -367,16 +366,18 @@ /* continue processing a reset on a vioc after an error (hopefully) */ vxinreset(vioc) caddr_t vioc; { - register int n = (int)vioc; + register struct vcx *xp; register struct vblok *vp ; + register int n = (int)vioc; int s = spl8(); printf("vxinreset "); vp = VBAS(n); + xp = &vcx[n]; /* * See if the vioc has reset. */ if (vp->v_fault != VREADY) { @@ -387,11 +388,11 @@ /* * Send a LIDENT to the vioc and mess with carrier flags * on parallel printer ports. */ - vxinit(n, (long)0); + vxinit(n, 0); splx(s); } /* * Restore modem control, parameters and restart output. @@ -406,13 +407,11 @@ { register struct vcx *xp; register struct vblok *vp ; register struct tty *tp; register int i; -#ifdef notdef register int on; -#endif extern int vxrestart(); int s = spl8(); printf("vxfnreset "); vp = VBAS(n); @@ -452,11 +451,11 @@ } /* * If carrier has changed while we were resetting, * take appropriate action. */ -#ifdef notdef +/* on = vp->v_dcd & 1<t_state&TS_CARR_ON) == 0) { tp->t_state |= TS_CARR_ON ; wakeup((caddr_t)&tp->t_canq) ; } else if (!on && tp->t_state&TS_CARR_ON) { @@ -469,11 +468,11 @@ gsignal(tp->t_pgrp, SIGHUP) ; gsignal(tp->t_pgrp, SIGCONT); } } } -#endif +*/ } xp->v_state |= V_RESETTING; timeout(vxrestart, (caddr_t)n, hz); @@ -528,14 +527,15 @@ } vxfreset(n) register int n; { + register struct vblok *vp; if (n < 0 || n > NVX || VBAS(n) == NULL) return(ENODEV); vcx[n].v_state &= ~V_RESETTING; vxstreset(n); return(0); /* completes asynchronously */ } #endif Index: sys/tahoe/vba/vxm.c ================================================================== --- sys/tahoe/vba/vxm.c +++ sys/tahoe/vba/vxm.c @@ -1,6 +1,6 @@ -/* vxm.c 1.2 86/01/05 */ +/* vxm.c 1.1 85/07/21 */ #include "vx.h" #if NVX > 0 /* * VIOC-X Modem control @@ -9,11 +9,11 @@ #include "../h/param.h" #include "../h/file.h" #include "../h/ioctl.h" #include "../h/tty.h" #include "../h/conf.h" -#include "../tahoevba/vioc.h" +#include "../vba/vioc.h" #include "vbsc.h" #if NVBSC > 0 #include "../bsc/bscio.h" #include "../bsc/bsc.h" extern char bscport[]; @@ -49,11 +49,11 @@ * Issue MODEM command */ cp->cmd = MDMCTL ; cp->par[0] = (flag == VMOD_ON) ? V_ENAB : V_DISAB ; cp->par[1] = port; - vcmd(xp->v_nbr, (caddr_t)&cp->cmd) ; + vcmd(xp->v_nbr, &cp->cmd) ; port -= xp->v_loport ; if((kp->v_dcd >> port) & 1) { if(flag == VMOD_ON) tp->t_state |= TS_CARR_ON ; return(1) ; @@ -130,11 +130,11 @@ /* cmd is already in vioc, have to flush it */ else { cmdp = vobtain(xp); cmdp->cmd = FDTATOX ; cmdp->par[1] = port ; - vcmd(n, (caddr_t)&cmdp->cmd); + vcmd(n, &cmdp->cmd); } } if((tp->t_flags&NOHANG)==0) { gsignal(tp->t_pgrp, SIGHUP) ; gsignal(tp->t_pgrp, SIGCONT); Index: sys/vax/if/if_dmc.c ================================================================== --- sys/vax/if/if_dmc.c +++ sys/vax/if/if_dmc.c @@ -1,11 +1,11 @@ /* * Copyright (c) 1982 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)if_dmc.c 6.9 (Berkeley) 01/08/86 + * @(#)if_dmc.c 6.8 (Berkeley) 12/19/85 */ #include "dmc.h" #if NDMC > 0 @@ -36,10 +36,13 @@ #include "../net/if.h" #include "../net/netisr.h" #include "../net/route.h" +#ifdef BBNNET +#define INET +#endif #ifdef INET #include "../netinet/in.h" #include "../netinet/in_systm.h" #include "../netinet/ip.h" #endif Index: sys/vax/if/if_ex.c ================================================================== --- sys/vax/if/if_ex.c +++ sys/vax/if/if_ex.c @@ -1,11 +1,11 @@ /* * Copyright (c) 1982 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)if_ex.c 6.10 (Berkeley) 01/07/86 + * @(#)if_ex.c 6.9 (Berkeley) 12/19/85 */ #include "ex.h" #if NEX > 0 @@ -104,21 +104,19 @@ struct ex_msg xs_x2hent[NX2H]; /* reply msg buffers */ struct confmsg xs_cm; /* configuration message */ struct stat_array xs_xsa; /* EXOS writes stats here */ /* end mapped area */ #define INCORE_BASE(p) (((u_long)(&(p)->xs_h2xhdr)) & 0xFFFFFFF0) -#define RVAL_OFF(unit, n) \ - ((u_long)(&(ex_softc[unit].n)) - INCORE_BASE(&ex_softc[unit])) -#define LVAL_OFF(unit, n) \ - ((u_long)(ex_softc[unit].n) - INCORE_BASE(&ex_softc[unit])) -#define H2XHDR_OFFSET(unit) RVAL_OFF(unit, xs_h2xhdr) -#define X2HHDR_OFFSET(unit) RVAL_OFF(unit, xs_x2hhdr) -#define H2XENT_OFFSET(unit) LVAL_OFF(unit, xs_h2xent) -#define X2HENT_OFFSET(unit) LVAL_OFF(unit, xs_x2hent) -#define CM_OFFSET(unit) RVAL_OFF(unit, xs_cm) -#define SA_OFFSET(unit) RVAL_OFF(unit, xs_xsa) -#define INCORE_SIZE(unit) RVAL_OFF(unit, xs_end) +#define RVAL_OFF(n) ((u_long)(&(ex_softc[0].n)) - INCORE_BASE(&ex_softc[0])) +#define LVAL_OFF(n) ((u_long)(ex_softc[0].n) - INCORE_BASE(&ex_softc[0])) +#define H2XHDR_OFFSET RVAL_OFF(xs_h2xhdr) +#define X2HHDR_OFFSET RVAL_OFF(xs_x2hhdr) +#define H2XENT_OFFSET LVAL_OFF(xs_h2xent) +#define X2HENT_OFFSET LVAL_OFF(xs_x2hent) +#define CM_OFFSET RVAL_OFF(xs_cm) +#define SA_OFFSET RVAL_OFF(xs_xsa) +#define INCORE_SIZE RVAL_OFF(xs_end) int xs_end; /* place holder */ } ex_softc[NEX]; /* * The following structure is a kludge to store a cvec value @@ -177,20 +175,19 @@ { register struct ex_softc *xs = &ex_softc[ui->ui_unit]; register struct ifnet *ifp = &xs->xs_if; register struct exdevice *addr = (struct exdevice *)ui->ui_addr; register struct ex_msg *bp; - int unit = ui->ui_unit; + ifp->if_unit = ui->ui_unit; ifp->if_name = "ex"; ifp->if_mtu = ETHERMTU; /* * Temporarily map queues in order to configure EXOS */ - xs->xs_ubaddr = uballoc(ui->ui_ubanum, INCORE_BASE(xs), - INCORE_SIZE(unit), 0); + xs->xs_ubaddr = uballoc(ui->ui_ubanum, INCORE_BASE(xs), INCORE_SIZE, 0); exconfig(ui, 0); /* without interrupts */ if (xs->xs_cm.cm_cc) goto badconf; bp = exgetcbuf(xs); bp->mb_rqst = LLNET_ADDRS; @@ -269,11 +266,11 @@ printf("ex%d: can't initialize\n", unit); xs->xs_if.if_flags &= ~IFF_UP; return; } xs->xs_ubaddr = uballoc(ui->ui_ubanum, INCORE_BASE(xs), - INCORE_SIZE(unit), 0); + INCORE_SIZE, 0); } exconfig(ui, 4); /* with vectored interrupts*/ /* * Put EXOS on the Ethernet, using NET_MODE command */ @@ -354,14 +351,14 @@ cm->cm_nproc = 0xFF; cm->cm_nmbox = 0xFF; cm->cm_nmcast = 0xFF; cm->cm_nhost = 1; cm->cm_h2xba = P_UNIADDR(xs->xs_ubaddr); - cm->cm_h2xhdr = H2XHDR_OFFSET(unit); + cm->cm_h2xhdr = H2XHDR_OFFSET; cm->cm_h2xtyp = 0; /* should never wait for rqst buffer */ cm->cm_x2hba = cm->cm_h2xba; - cm->cm_x2hhdr = X2HHDR_OFFSET(unit); + cm->cm_x2hhdr = X2HHDR_OFFSET; cm->cm_x2htyp = itype; /* 0 for none, 4 for vectored */ for (i=0; (addr != ex_cvecs[i].xc_csraddr); i++) #ifdef DEBUG if (i >= NEX) panic("ex: matching csr address not found"); @@ -379,11 +376,11 @@ bp->mb_status = MH_HOST; bp->mb_next = bp+1; } xs->xs_h2xhdr = xs->xs_h2xent[NH2X-1].mb_link = - (u_short)H2XENT_OFFSET(unit); + (u_short)H2XENT_OFFSET; xs->xs_h2xnext = xs->xs_h2xent[NH2X-1].mb_next = xs->xs_h2xent; /* Now the reply queue. */ @@ -394,11 +391,11 @@ bp->mb_status = MH_EXOS; bp->mb_next = bp+1; } xs->xs_x2hhdr = xs->xs_x2hent[NX2H-1].mb_link = - (u_short)X2HENT_OFFSET(unit); + (u_short)X2HENT_OFFSET; xs->xs_x2hnext = xs->xs_x2hent[NX2H-1].mb_next = xs->xs_x2hent; /* @@ -407,11 +404,11 @@ * within 2 seconds). */ shiftreg = (u_long)0x0000FFFF; for (i = 0; i < 8; i++) { if (i == 4) - shiftreg = P_UNIADDR(xs->xs_ubaddr) + CM_OFFSET(unit); + shiftreg = P_UNIADDR(xs->xs_ubaddr) + CM_OFFSET; while (addr->xd_portb & EX_UNREADY) ; addr->xd_portb = (u_char)(shiftreg & 0xFF); shiftreg >>= 8; } @@ -819,11 +816,11 @@ bp->mb_rqst = LLNET_STSTCS; bp->mb_ns.ns_mask = READ_OBJ; bp->mb_ns.ns_rsrv = 0; bp->mb_ns.ns_nobj = 8; /* read all 8 stats objects */ bp->mb_ns.ns_xobj = 0; /* starting with the 1st one */ - bp->mb_ns.ns_bufp = P_UNIADDR(xs->xs_ubaddr) + SA_OFFSET(unit); + bp->mb_ns.ns_bufp = P_UNIADDR(xs->xs_ubaddr) + SA_OFFSET; bp->mb_status |= MH_EXOS; addr->xd_portb = EX_NTRUPT; exspnd: splx(s); xs->xs_if.if_timer = EXWATCHINTVL; Index: sys/vax/vax/locore.s ================================================================== --- sys/vax/vax/locore.s +++ sys/vax/vax/locore.s @@ -1,11 +1,11 @@ /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)locore.s 6.33 (Berkeley) 01/08/86 + * @(#)locore.s 6.32 (Berkeley) 09/16/85 */ #include "psl.h" #include "pte.h" @@ -237,11 +237,11 @@ PUSHR #include "imp.h" #if NIMP > 0 bbcc $NETISR_IMP,_netisr,1f; calls $0,_impintr; 1: #endif -#ifdef INET +#if defined(INET) || defined(BBNNET) bbcc $NETISR_IP,_netisr,1f; calls $0,_ipintr; 1: #endif #ifdef NS bbcc $NETISR_NS,_netisr,1f; calls $0,_nsintr; 1: #endif Index: usr.bin/apropos/apropos.1 ================================================================== --- usr.bin/apropos/apropos.1 +++ usr.bin/apropos/apropos.1 @@ -1,6 +1,6 @@ -.\" @(#)apropos.1 6.2 (Berkeley) 01/08/86 +.\" @(#)apropos.1 6.1 (Berkeley) 04/29/85 .\" .TH APROPOS 1 "" .AT 3 .SH NAME apropos \- locate commands by keyword lookup @@ -34,10 +34,10 @@ option to the .IR man (1) command. .SH FILES .DT -/usr/man/whatis data base +/usr/lib/whatis data base .SH "SEE ALSO" man(1), whatis(1), catman(8) .SH AUTHOR William Joy Index: usr.bin/compress/compress.c ================================================================== --- usr.bin/compress/compress.c +++ usr.bin/compress/compress.c @@ -1,7 +1,7 @@ #ifndef lint -static char sccsid[] = "@(#)compress.c 5.8 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)compress.c 5.7 (Berkeley) 09/17/85"; #endif not lint /* * Compress - data compression program */ @@ -339,11 +339,10 @@ fprintf(stderr,"Usage: compress [-fvc] [-b maxbits] [file ...]\n"); } #endif /* DEBUG */ int nomagic = 0; /* Use a 3-byte magic number header, unless old file */ int zcat_flg = 0; /* Write output on stdout, suppress messages */ -int precious = 1; /* Don't unlink output file on interrupt */ int quiet = 1; /* don't tell me about compression */ /* * block compression parameters -- after all codes are used up, * and compression rate changes, start over. @@ -631,11 +630,10 @@ if(zcat_flg == 0) { /* Open output file */ if (freopen(ofname, "w", stdout) == NULL) { perror(ofname); continue; } - precious = 0; if(!quiet) fprintf(stderr, "%s: ", *fileptr); } /* Actually do the compression/decompression */ @@ -647,11 +645,10 @@ else printcodes(); if (verbose) dump_tab(); #endif /* DEBUG */ if(zcat_flg == 0) { copystat(*fileptr, ofname); /* Copy stats */ - precious = 1; if((exit_stat == 1) || (!quiet)) putc('\n', stderr); } } } else { /* Standard input */ @@ -1338,11 +1335,11 @@ } } onintr ( ) { - if (!precious) + if (!zcat_flg) unlink ( ofname ); exit ( 1 ); } oops ( ) /* wild pointer -- assume bad input */ @@ -1465,11 +1462,11 @@ fprintf(stream, "%d.%02d%%", q / 100, q % 100); } version() { - fprintf(stderr, "%s, Berkeley 5.8 01/10/86\n", rcs_ident); + fprintf(stderr, "%s, Berkeley 5.7 09/17/85\n", rcs_ident); fprintf(stderr, "Options: "); #ifdef vax fprintf(stderr, "vax, "); #endif #ifdef NO_UCHAR Index: usr.bin/f77/f77.vax/f77.c ================================================================== --- usr.bin/f77/f77.vax/f77.c +++ usr.bin/f77/f77.vax/f77.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)f77.c 5.3 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)f77.c 5.2 (Berkeley) 08/29/85"; #endif /* * f77.c * @@ -14,16 +14,10 @@ * Driver program for the 4.2 BSD f77 compiler. * * University of Utah CS Dept modification history: * * $Log: f77.c,v $ - * Revision 5.4 85/12/17 19:12:14 donn - * Dynamically allocate buffer; add lint fixes. - * - * Revision 5.3 85/11/25 00:00:02 donn - * 4.3 beta - * * Revision 5.2 85/08/10 05:16:14 donn * Ifdeffed 66 code, added -r8 flag. From Jerry Berkman. * * Revision 5.1 85/08/10 03:32:12 donn * 4.3 alpha @@ -144,10 +138,11 @@ #endif static char rflags[30] = ""; static char lflag[3] = "-x"; static char *fflagp = fflags+1; static char *f2flagp = f2flags; +static char *cflagp = cflags+2; static char *eflagp = eflags+12; static char *rflagp = rflags; static char *cppflags = ""; static char **cppargs; static char **loadargs; @@ -158,34 +153,29 @@ static flag saveasmflag = NO; static flag profileflag = NO; static flag optimflag = NO; static flag debugflag = NO; static flag verbose = NO; +static flag nofloating = NO; static flag fortonly = NO; static flag macroflag = NO; static flag sdbflag = NO; static flag namesflag = YES; -#if TARGET == PDP11 -static flag nofloating = NO; -#endif - static int ncpp; main(argc, argv) int argc; char **argv; { -register int i, n; -int c, status; +int i, c, status; char *setdoto(), *lastchar(), *lastfield(), *copys(), *argvtos(); ptr ckalloc(); -char *strcat(); register char *s; char fortfile[20], *t; -char *buff; +char buff[100]; int intrupt(); int new_aoutname = NO; sigivalue = signal(SIGINT, SIG_IGN) == SIG_IGN; sigqvalue = signal(SIGQUIT,SIG_IGN) == SIG_IGN; @@ -209,14 +199,10 @@ loadp = loadargs + 4; --argc; ++argv; -for (i = 0, n = 50; i < argc; ++i) - n += strlen(argv[i]) + 1; -buff = (char *) ckalloc(n); - while(argc>0 && argv[0][0]=='-' && argv[0][1]!='\0') { for(s = argv[0]+1 ; *s ; ++s) switch(*s) { case 'T': /* use special passes */ @@ -306,11 +292,11 @@ ++s; macroflag = YES; break; case 'S': - (void) strcat(cflags, " -S"); + strcat(cflags, " -S"); saveasmflag = YES; case 'c': if( new_aoutname == YES ){ fprintf(diagfile, "-c prevents loading, -o %s ignored\n", aoutname); @@ -342,17 +328,17 @@ if(optimflag) { fprintf(diagfile, "-g and -O are incompatible; -g ignored\n"); break; } - (void) strcat(cflags," -g"); + strcat(cflags," -g"); sdbflag = YES; goto copyfflag; case 'p': profileflag = YES; - (void) strcat(cflags," -p"); + strcat(cflags," -p"); *fflagp++ = 'p'; if(s[1] == 'g') { proffoot = GPRFFOOT; s++; @@ -445,11 +431,11 @@ if(!debugflag) { struct rlimit r; r.rlim_cur = r.rlim_max = 0; - (void) setrlimit(RLIMIT_CORE, &r); + setrlimit(RLIMIT_CORE, &r); } #endif NOCORE *fflagp = '\0'; @@ -759,12 +745,11 @@ if( sys(buff) ) rmf(optzfname); else { sprintf(buff,"mv %s %s", optzfname, asmpass2); - if( sys(buff) ) - fatal("can't rename optimizer output file"); + sys(buff); } } # endif #endif @@ -785,12 +770,11 @@ #else sprintf(buff, "%s %s %s %s >%s", CATNAME, asmfname, initfname, asmpass2, obj); #endif #endif - if( sys(buff) ) - fatal("can't concatenate assembly files"); + sys(buff); *lastc = 'o'; } else { if(verbose) @@ -806,12 +790,11 @@ sprintf(buff, "%s %s %s >>%s", CATNAME, asmpass2, initfname, asmfname); else sprintf(buff, "%s %s %s >>%s", CATNAME, initfname, asmpass2, asmfname); - if( sys(buff) ) - fatal("can't concatenate assembly files"); + sys(buff); #ifdef UCBVAXASM sprintf(buff, "%s -J -o %s %s", asmname, obj, asmfname); #else sprintf(buff, "%s -o %s %s", asmname, obj, asmfname); #endif @@ -875,12 +858,11 @@ { enbint(SIG_DFL); execv(ldname, v0); fatalstr("couldn't load %s", ldname); } - if( await(waitpid) ) - erred = YES; + await(waitpid); #endif #if HERE==INTERDATA if(optimflag) { @@ -958,15 +940,13 @@ for(t = argv[1] ; *s++ = *t++ ; ) ; if((waitpid = fork()) == 0) { if(inname) - if(freopen(inname, "r", stdin) == NULL) - fatalstr("Cannot open %s", inname); + freopen(inname, "r", stdin); if(outname) - if(freopen(outname, (append ? "a" : "w"), stdout) == NULL) - fatalstr("Cannot open %s", outname); + freopen(outname, (append ? "a" : "w"), stdout); enbint(SIG_DFL); texec(path+9, argv); /* command */ texec(path+4, argv); /* /bin/command */ texec(path , argv); /* /usr/bin/command */ @@ -1027,17 +1007,17 @@ enbint(k) int (*k)(); { if(sigivalue == 0) - (void) signal(SIGINT,k); + signal(SIGINT,k); if(sigqvalue == 0) - (void) signal(SIGQUIT,k); + signal(SIGQUIT,k); if(sighvalue == 0) - (void) signal(SIGHUP,k); + signal(SIGHUP,k); if(sigtvalue == 0) - (void) signal(SIGTERM,k); + signal(SIGTERM,k); } @@ -1122,11 +1102,10 @@ stupid(s) char *s; { char c; -extern char *index(); if( (c = dotchar(s)) && index("focsreF", c) && access(s, 0) == 0 ) { @@ -1285,14 +1264,13 @@ ptr ckalloc(n) int n; { -ptr p; -extern char *calloc(); +ptr p, calloc(); -if( p = (ptr) calloc(1, (unsigned) n) ) +if( p = calloc(1, (unsigned) n) ) return(p); fatal("out of memory"); /* NOTREACHED */ } Index: usr.bin/f77/libI77/open.c ================================================================== --- usr.bin/f77/libI77/open.c +++ usr.bin/f77/libI77/open.c @@ -1,11 +1,11 @@ /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)open.c 5.2 01/08/86 + * @(#)open.c 5.1 06/07/85 */ /* * open.c - f77 file open and I/O library initialization routines */ @@ -43,13 +43,11 @@ b= &units[lunit]; if(a->osta) st = lcase(*a->osta); else st = 'u'; if(SCRATCH) { strcpy(buf,tmplate); - /* make a new temp file name, err if mktemp fails */ - if( strcmp( mktemp(buf), "/" ) == 0 ) - err(errflag, F_ERSYS, "open") + mktemp(buf); } else { if(a->ofnm) g_char(a->ofnm,a->ofnmlen,buf); else sprintf(buf,fortfile,lunit); Index: usr.bin/f77/pass1.vax/defs.h ================================================================== --- usr.bin/f77/pass1.vax/defs.h +++ usr.bin/f77/pass1.vax/defs.h @@ -1,11 +1,11 @@ /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)defs.h 5.3 (Berkeley) 01/10/86 + * @(#)defs.h 5.2 (Berkeley) 08/29/85 */ /* * defs.h * @@ -12,17 +12,10 @@ * Definitions for f77pass1 * * University of Utah CS Dept modification history: * * $Log: defs.h,v $ - * Revision 5.5 86/01/10 17:11:11 donn - * Add a vparamval field to Nameblock struct -- fix up klugy sharing between - * Paramblock and Nameblock structs. - * - * Revision 5.4 85/11/25 00:23:47 donn - * 4.3 beta - * * Revision 5.3 85/08/10 06:31:09 donn * Added missing definition for intrconv(). * * Revision 5.2 85/08/10 04:01:53 donn * Jerry Berkman's change to add a definition for 'dblflag' and to ifdef @@ -314,11 +307,10 @@ field vtype; field vclass; field vstg; expptr vleng; char varname[VL]; - expptr vparamval; unsigned vdovar:1; unsigned vdcldone:1; unsigned vadjdim:1; unsigned vsave:1; unsigned vprocclass:3; Index: usr.bin/f77/pass1.vax/exec.c ================================================================== --- usr.bin/f77/pass1.vax/exec.c +++ usr.bin/f77/pass1.vax/exec.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)exec.c 5.5 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)exec.c 5.4 (Berkeley) 08/29/85"; #endif not lint /* * exec.c * @@ -15,23 +15,10 @@ * F77 compiler, pass 1. * * University of Utah CS Dept modification history: * * $Log: exec.c,v $ - * Revision 5.6 85/12/20 19:42:46 donn - * Change style of error reporting in last fix. - * - * Revision 5.5 85/12/20 18:54:10 donn - * Complain about calls to things which aren't subroutines. - * - * Revision 5.4 85/12/18 19:57:58 donn - * Assignment statements are executable statements -- advance the magic - * parser state to forbid DATA statements and statement functions. - * - * Revision 5.3 85/11/25 00:23:49 donn - * 4.3 beta - * * Revision 5.2 85/08/10 04:07:36 donn * Changed an error message to correct spelling and be more accurate. * From Jerry Berkman. * * Revision 2.3 85/03/18 08:03:31 donn @@ -274,11 +261,10 @@ err("assignment to a subroutine name"); return; } if(parstate < INDATA) enddcl(); - parstate = INEXEC; if (optimflag) optbuff (SKEQ, mkexpr(OPASSIGN, mklhs(lp), fixtype(rp)), 0, 0); else puteq (mklhs(lp), fixtype(rp)); } @@ -335,21 +321,10 @@ int nstars; struct Labelblock *labels[ ]; { register expptr p; -if (name->vdcldone) - if (name->vclass != CLPROC && name->vclass != CLENTRY) - { - dclerr("call to non-subroutine", name); - return; - } - else if (name->vtype != TYSUBR) - { - dclerr("subroutine invocation of function", name); - return; - } settype(name, TYSUBR, ENULL); p = mkfunct( mkprim(name, args, CHNULL) ); p->exprblock.vtype = p->exprblock.leftp->headblock.vtype = TYINT; if (nstars > 0) if (optimflag) Index: usr.bin/f77/pass1.vax/expr.c ================================================================== --- usr.bin/f77/pass1.vax/expr.c +++ usr.bin/f77/pass1.vax/expr.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char *sccsid[] = "@(#)expr.c 5.5 (Berkeley) 01/07/86"; +static char *sccsid[] = "@(#)expr.c 5.4 (Berkeley) 08/29/85"; #endif not lint /* * expr.c * @@ -14,29 +14,10 @@ * Routines for handling expressions, f77 compiler pass 1. * * University of Utah CS Dept modification history: * * $Log: expr.c,v $ - * Revision 5.8 85/12/20 21:37:58 donn - * Fix bug in mklhs() that caused the 'first character' substring parameter - * to be evaluated twice. - * - * Revision 5.7 85/12/20 19:42:05 donn - * Be more specfic -- name the offending subroutine when it's used as a - * function. - * - * Revision 5.6 85/12/19 20:08:12 donn - * Don't optimize first/last char values when they contain function calls - * or array references. - * - * Revision 5.5 85/12/19 00:35:22 donn - * Lots of changes for handling hardware errors which can crop up when - * evaluating constant expressions. - * - * Revision 5.4 85/11/25 00:23:53 donn - * 4.3 beta - * * Revision 5.3 85/08/10 05:48:16 donn * Fixed another of my goofs in the substring parameter conversion code. * * Revision 5.2 85/08/10 04:13:51 donn * Jerry Berkman's change to call pow() directly rather than indirectly @@ -655,12 +636,11 @@ case TPRIM: if(p->primblock.argsp && p->primblock.namep->vclass!=CLVAR) { if(p->primblock.namep->vtype == TYSUBR) { - dclerr("function invocation of subroutine", - p->primblock.namep); + err("function invocation of subroutine"); return( errnode() ); } else return( mkfunct(p) ); } @@ -1301,11 +1281,10 @@ expptr mklhs(p) register struct Primblock *p; { expptr suboffset(); -expptr ep = ENULL; register Addrp s; Namep np; if(p->tag != TPRIM) return( (expptr) p ); @@ -1316,11 +1295,17 @@ { free( (charptr) p ); return( (expptr) s ); } -/* do the substring part */ +/* compute the address modified by subscripts */ + +s->memoffset = mkexpr(OPPLUS, s->memoffset, suboffset(p) ); +frexpr(p->argsp); +p->argsp = NULL; + +/* now do substring part */ if(p->fcharp || p->lcharp) { if(np->vtype != TYCHAR) errstr("substring of noncharacter %s", varstr(VL,np->varname)); @@ -1329,44 +1314,24 @@ p->lcharp = (expptr) cpexpr(s->vleng); frexpr(s->vleng); if(p->fcharp) { if(p->fcharp->tag == TPRIM && p->lcharp->tag == TPRIM - && p->fcharp->primblock.namep == p->lcharp->primblock.namep - && p->fcharp->primblock.argsp == NULL - && p->lcharp->primblock.argsp == NULL) + && p->fcharp->primblock.namep == p->lcharp->primblock.namep) /* A trivial optimization -- upper == lower */ s->vleng = ICON(1); else - { - if(p->fcharp->tag == TEXPR - || (p->fcharp->tag == TPRIM - && p->fcharp->primblock.argsp != NULL)) - { - ep = fixtype(p->fcharp); - p->fcharp = (expptr) mktemp(ep->headblock.vtype, ENULL); - } s->vleng = mkexpr(OPMINUS, p->lcharp, mkexpr(OPMINUS, p->fcharp, ICON(1) )); - } } else s->vleng = p->lcharp; } } -/* compute the address modified by subscripts */ - -s->memoffset = mkexpr(OPPLUS, s->memoffset, suboffset(p) ); -frexpr(p->argsp); -p->argsp = NULL; - s->vleng = fixtype( s->vleng ); s->memoffset = fixtype( s->memoffset ); -if(ep) - /* this code depends on memoffset being evaluated before vleng */ - s->memoffset = mkexpr(OPCOMMA, mkexpr(OPASSIGN, cpexpr(p->fcharp), ep), s->memoffset); free( (charptr) p ); return( (expptr) s ); } @@ -1877,44 +1842,15 @@ { k = letter(rp->primblock.namep->varname[0]); rtype = impltype[ k ]; } -/* - * Eliminate all but the topmost OPPAREN operator when folding constants. - */ -if(lp->tag == TEXPR && - lp->exprblock.opcode == OPPAREN && - lp->exprblock.leftp->tag == TCONST) - { - q = (expptr) cpexpr(lp->exprblock.leftp); - frexpr(lp); - lp = q; - ltag = TCONST; - ltype = lp->constblock.vtype; - } -if(rp && - rp->tag == TEXPR && - rp->exprblock.opcode == OPPAREN && - rp->exprblock.leftp->tag == TCONST) - { - q = (expptr) cpexpr(rp->exprblock.leftp); - frexpr(rp); - rp = q; - rtag = TCONST; - rtype = rp->constblock.vtype; - } - etype = cktype(opcode, ltype, rtype); if(etype == TYERROR) goto error; -if(ltag==TCONST && (rp==0 || rtag==TCONST) ) - goto makenode; -if(etype == TYUNKNOWN) - goto makenode; - +if(etype != TYUNKNOWN) switch(opcode) { /* check for multiplication by 0 and 1 and addition to 0 */ case OPSTAR: @@ -2128,12 +2064,10 @@ default: badop("mkexpr", opcode); } -makenode: - e = (expptr) ALLOC(Exprblock); e->exprblock.tag = TEXPR; e->exprblock.opcode = opcode; e->exprblock.vtype = etype; e->exprblock.leftp = lp; @@ -2284,49 +2218,10 @@ } error: err(errs); error1: return(TYERROR); } -#if HERE == VAX -#include -#include -#define setfpe() ;asm("bispsw $0x60") -jmp_buf jmp_fpe; - -LOCAL int fold_fpe_handler( sig, code ) -int sig; -int code; -{ -char *message; - -switch ( code ) - { - case FPE_INTOVF_TRAP: - message = "integer overflow"; break; - case FPE_INTDIV_TRAP: - message = "integer divide by zero"; break; - case FPE_FLTOVF_TRAP: - case FPE_FLTOVF_FAULT: - message = "floating overflow"; break; - case FPE_FLTDIV_TRAP: - case FPE_FLTDIV_FAULT: - message = "floating divide by zero"; break; - case FPE_FLTUND_TRAP: - case FPE_FLTUND_FAULT: - message = "floating underflow"; break; - default: - message = "arithmetic exception"; - } -errstr("%s in constant expression", message); -longjmp(jmp_fpe, 1); -} -#endif - -#ifndef setfpe -#define setfpe() -#endif - LOCAL expptr fold(e) register expptr e; { Constp p; register expptr lp, rp; @@ -2333,23 +2228,10 @@ int etype, mtype, ltype, rtype, opcode; int i, ll, lr; char *q, *s; union Constant lcon, rcon; -#if HERE == VAX -int (*fpe_handler)(); - -if(setjmp(jmp_fpe)) - { - (void) signal(SIGFPE, fpe_handler); - frexpr(e); - return(errnode()); - } -fpe_handler = signal(SIGFPE, fold_fpe_handler); -setfpe(); -#endif - opcode = e->exprblock.opcode; etype = e->exprblock.vtype; lp = e->exprblock.leftp; ltype = lp->headblock.vtype; @@ -2543,12 +2425,10 @@ consnegop(p) register Constp p; { -setfpe(); - switch(p->vtype) { case TYSHORT: case TYLONG: p->const.ci = - p->const.ci; @@ -2643,12 +2523,10 @@ register union Constant *ap, *bp, *cp; { int k; double temp; -setfpe(); - switch(opcode) { case OPPLUS: switch(type) { @@ -2917,12 +2795,10 @@ register struct dcomplex *a, *b, *c; { double ratio, den; double abr, abi; -setfpe(); - if( (abr = b->dreal) < 0.) abr = - abr; if( (abi = b->dimag) < 0.) abi = - abi; if( abr <= abi ) Index: usr.bin/f77/pass1.vax/gram.dcl ================================================================== --- usr.bin/f77/pass1.vax/gram.dcl +++ usr.bin/f77/pass1.vax/gram.dcl @@ -1,30 +1,19 @@ /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)gram.dcl 5.3 (Berkeley) 01/07/86 + * @(#)gram.dcl 5.2 (Berkeley) 08/29/85 */ /* * Grammar for declarations, f77 compiler, 4.2 BSD. * * University of Utah CS Dept modification history: * * $Log: gram.dcl,v $ - * Revision 5.7 85/12/21 07:29:08 donn - * Rule out CHARACTER*(*) declarations in main programs. - * - * Revision 5.6 85/12/18 20:10:26 donn - * Enforce more strict ordering of specification statements. per the - * standard. Some duplicated code is now concentrated in the nonterminal - * 'inside', which is used to indicate the start of a program. - * - * Revision 5.5 85/11/25 00:23:59 donn - * 4.3 beta - * * Revision 5.4 85/08/20 23:37:33 donn * Fix from Jerry Berkman to prevent length problems with -r8. * * Revision 5.3 85/08/15 20:16:29 donn * SAVE statements are not executable... @@ -55,16 +44,24 @@ | SSAVE in_dcl { NO66("SAVE statement"); saveall = YES; } | SSAVE in_dcl savelist { NO66("SAVE statement"); } - | SFORMAT inside + | SFORMAT { + if (parstate == OUTSIDE) + { + newproc(); + startproc(PNULL, CLMAIN); + parstate = INSIDE; + } + if (parstate < INDCL) + parstate = INDCL; fmtstmt(thislabel); setfmt(thislabel); } - | SPARAM in_param SLPAR paramlist SRPAR + | SPARAM in_dcl SLPAR paramlist SRPAR { NO66("PARAMETER statement"); } ; dcl: type opt_comma name in_dcl dims lengspec { settype($3, $1, $6); @@ -109,11 +106,11 @@ p = $3; NO66("length specification *n"); if( ! ISICON(p) || p->constblock.const.ci<0 ) { $$ = 0; - dclerr("length must be a positive integer value", + dclerr("- length must be a positive integer value", PNULL); } else if( dblflag ) { typlen = p->constblock.const.ci; @@ -123,26 +120,11 @@ } else $$ = p->constblock.const.ci; } | SSTAR intonlyon SLPAR SSTAR SRPAR intonlyoff - { - NO66("length specification *(*)"); - if( parstate < INSIDE ) - { - dclerr("variable length function or variable length string in main program", PNULL); - $$ = 0; - } - else - if( procclass == CLMAIN ) - { - dclerr("variable length string in main program", PNULL); - $$ = 0; - } - else - $$ = -1; - } + { NO66("length specification *(*)"); $$ = -1; } ; common: SCOMMON in_dcl var { incomm( $$ = comblock(0, CNULL) , $3 ); } | SCOMMON in_dcl comblock var @@ -235,16 +217,10 @@ paramitem: name SEQUALS expr { paramset( $1, $3 ); } ; -in_param: inside - { if(parstate > INDCL) - dclerr("parameter statement out of order", PNULL); - } - ; - var: name dims { if(ndim>0) setbound($1, ndim, dims); } ; @@ -290,11 +266,11 @@ label: SICON { $$ = execlab( convci(toklen, token) ); } ; -implicit: SIMPLICIT in_implicit implist +implicit: SIMPLICIT in_dcl implist { NO66("IMPLICIT statement"); } | implicit SCOMMA implist ; implist: imptype SLPAR letgroups SRPAR @@ -302,16 +278,10 @@ imptype: { needkwd = 1; } type { vartype = $2; } ; -in_implicit: inside - { if(parstate >= INDCL) - dclerr("implicit statement out of order", PNULL); - } - ; - letgroups: letgroup | letgroups SCOMMA letgroup ; letgroup: letter @@ -352,25 +322,21 @@ { $$ = mkchain($1, CHNULL); } | namelistlist SCOMMA name { $$ = hookup($1, mkchain($3, CHNULL)); } ; -inside: - { if(parstate < INSIDE) - { - newproc(); - startproc(PNULL, CLMAIN); - parstate = INSIDE; - } - } - ; - -in_dcl: inside - { if(parstate < INDCL) - parstate = INDCL; - if(parstate > INDCL) - dclerr("declaration among executables", PNULL); +in_dcl: + { switch(parstate) + { + case OUTSIDE: newproc(); + startproc(PNULL, CLMAIN); + case INSIDE: parstate = INDCL; + case INDCL: break; + + default: + dclerr("declaration among executables", PNULL); + } } ; data: data1 { @@ -380,12 +346,17 @@ data1: SDATA in_data datapair | data1 opt_comma datapair ; -in_data: inside - { if(parstate < INDATA) +in_data: + { if(parstate == OUTSIDE) + { + newproc(); + startproc(PNULL, CLMAIN); + } + if(parstate < INDATA) { enddcl(); parstate = INDATA; } overlapflag = NO; Index: usr.bin/f77/pass1.vax/gram.exec ================================================================== --- usr.bin/f77/pass1.vax/gram.exec +++ usr.bin/f77/pass1.vax/gram.exec @@ -1,11 +1,11 @@ /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)gram.exec 5.2 (Berkeley) 01/07/86 + * @(#)gram.exec 5.1 (Berkeley) 06/07/85 */ /* * gram.exec * @@ -12,18 +12,10 @@ * Grammar for executable statements, f77 compiler pass 1, 4.2 BSD. * * University of Utah CS Dept modification history: * * $Log: gram.exec,v $ - * Revision 5.2 85/12/18 20:17:38 donn - * Modified end_spec to insist on parser state INEXEC after seeing an - * executable statement. This allows us to limit statement functions to - * parser state INDATA. - * - * Revision 5.1 85/08/10 03:47:22 donn - * 4.3 alpha - * * Revision 3.1 84/10/13 00:36:41 donn * Installed Jerry Berkman's version; preserved comment header. * * Revision 1.3 84/08/06 18:38:43 donn * Fixed a bug in Jerry Berkman's label fixes which caused the same label to @@ -188,11 +180,10 @@ { newproc(); startproc(PNULL, CLMAIN); } if(parstate < INDATA) enddcl(); - parstate = INEXEC; if( yystno != 0 && thislabel->labtype != LABFORMAT) if (optimflag) optbuff (SKLABEL, 0, thislabel->labelno, 1); else putlabel(thislabel->labelno); Index: usr.bin/f77/pass1.vax/gram.expr ================================================================== --- usr.bin/f77/pass1.vax/gram.expr +++ usr.bin/f77/pass1.vax/gram.expr @@ -1,11 +1,11 @@ /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)gram.expr 5.2 (Berkeley) 01/07/86 + * @(#)gram.expr 5.1 (Berkeley) 06/07/85 */ /* * gram.expr * @@ -12,17 +12,10 @@ * Grammar for expressions, f77 compiler pass 1, 4.2 BSD. * * University of Utah CS Dept modification history: * * $Log: gram.expr,v $ - * Revision 5.2 85/12/21 07:26:39 donn - * Permit CHARACTER*(4) in function declarations by eliminating parentheses - * more appropriately. - * - * Revision 5.1 85/08/10 03:47:25 donn - * 4.3 alpha - * * Revision 3.2 85/02/15 19:08:53 donn * Put OPPAREN operators in trees when not optimizing as well as when * optimizing -- this allows '(1)' to produce a writable temporary instead * of a read-only constant when passed as an argument to a subroutine. * @@ -47,11 +40,11 @@ ; expr: uexpr | SLPAR expr SRPAR - { if (parstate > INDCL) + { if (parstate != INDCL) $$ = mkexpr(OPPAREN, $2, ENULL); else $$ = $2; } | complex_const ; @@ -158,11 +151,11 @@ ; fexpr: unpar_fexpr | SLPAR fexpr SRPAR - { if (optimflag && parstate > INDCL) + { if (optimflag && parstate != INDCL) $$ = mkexpr(OPPAREN, $2, ENULL); else $$ = $2; } ; Index: usr.bin/f77/pass1.vax/io.c ================================================================== --- usr.bin/f77/pass1.vax/io.c +++ usr.bin/f77/pass1.vax/io.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char *sccsid = "@(#)io.c 5.2 (Berkeley) 01/07/86"; +static char *sccsid = "@(#)io.c 5.1 (Berkeley) 85/06/07"; #endif /* * io.c * @@ -14,19 +14,12 @@ * Routines to generate code for I/O statements. * Some corrections and improvements due to David Wasley, U. C. Berkeley * * University of Utah CS Dept modification history: * - * $Header: io.c,v 5.2 85/12/19 17:22:35 donn Exp $ + * $Header: io.c,v 2.4 85/02/23 21:09:02 donn Exp $ * $Log: io.c,v $ - * Revision 5.2 85/12/19 17:22:35 donn - * Don't permit more than one 'positional iocontrol' parameter unless we - * are doing a READ or a WRITE. - * - * Revision 5.1 85/08/10 03:47:42 donn - * 4.3 alpha - * * Revision 2.4 85/02/23 21:09:02 donn * Jerry Berkman's compiled format fixes move setfmt into a separate file. * * Revision 2.3 85/01/10 22:33:41 donn * Added some strategic cpexpr()s to prevent memory management bugs. @@ -366,12 +359,11 @@ ++nioctl; if(n == IOSBAD) return; if(n == IOSPOSITIONAL) { - if(nioctl > IOSFMT || - nioctl > IOSUNIT && !(iostmt == IOREAD || iostmt == IOWRITE)) + if(nioctl > IOSFMT) { err("illegal positional iocontrol"); return; } n = nioctl; Index: usr.bin/f77/pass1.vax/lex.c ================================================================== --- usr.bin/f77/pass1.vax/lex.c +++ usr.bin/f77/pass1.vax/lex.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)lex.c 5.3 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)lex.c 5.2 (Berkeley) 08/29/85"; #endif not lint /* * lex.c * @@ -14,17 +14,10 @@ * Lexical scanner routines for the f77 compiler, pass 1, 4.2 BSD. * * University of Utah CS Dept modification history: * * $Log: lex.c,v $ - * Revision 5.4 86/01/07 14:01:13 donn - * Fix the scanning for character constants in gettok() so that it handles - * the case when an error has occurred and there is no closing quote. - * - * Revision 5.3 85/11/25 00:24:06 donn - * 4.3 beta - * * Revision 5.2 85/08/10 04:45:41 donn * Jerry Berkman's changes to ifdef 66 code and handle -r8/double flag. * * Revision 5.1 85/08/10 03:48:20 donn * 4.3 alpha @@ -748,11 +741,11 @@ if(*nextch == (MYQUOTE)) { ++nextch; p = token; - while(nextch <= lastch && *nextch != MYQUOTE) + while(*nextch != MYQUOTE) *p++ = *nextch++; ++nextch; toklen = p - token; *p = '\0'; return (SHOLLERITH); Index: usr.bin/f77/pass1.vax/misc.c ================================================================== --- usr.bin/f77/pass1.vax/misc.c +++ usr.bin/f77/pass1.vax/misc.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)misc.c 5.2 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)misc.c 5.1 (Berkeley) 06/07/85"; #endif not lint /* * misc.c * @@ -14,16 +14,10 @@ * Miscellaneous routines for the f77 compiler, 4.2 BSD. * * University of Utah CS Dept modification history: * * $Log: misc.c,v $ - * Revision 5.2 85/12/18 00:35:08 donn - * Prevent core dumps for peculiar statement numbers. - * - * Revision 5.1 85/08/10 03:48:29 donn - * 4.3 alpha - * * Revision 3.1 84/10/13 01:53:26 donn * Installed Jerry Berkman's version; added UofU comment header. * */ @@ -359,11 +353,11 @@ { register struct Labelblock *lp; if(l <= 0 || l > 99999 ) { errstr("illegal label %d", l); - l = 0; + return(NULL); } for(lp = labeltab ; lp < highlabtab ; ++lp) if(lp->stateno == l) return(lp); Index: usr.bin/f77/pass1.vax/proc.c ================================================================== --- usr.bin/f77/pass1.vax/proc.c +++ usr.bin/f77/pass1.vax/proc.c @@ -3,45 +3,22 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)proc.c 5.6 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)proc.c 5.4 (Berkeley) 10/06/85"; #endif not lint /* * proc.c * * Routines for handling procedures, f77 compiler, pass 1. * * University of Utah CS Dept modification history: * + * $Header: proc.c,v 5.3 85/09/30 23:21:07 donn Exp $ * $Log: proc.c,v $ - * Revision 5.8 86/01/10 19:02:19 donn - * More dbx hacking -- filter out incomplete declarations (with bogus types). - * - * Revision 5.7 86/01/10 13:53:02 donn - * Since we now postpone determination of the type of an argument, we must - * make sure to emit stab information at the end of the routine when we - * definitely have the type. Notice some care was taken to make sure that - * arguments appear in order in the output file since that's how dbx wants - * them. Also a minor change for dummy procedures. - * - * Revision 5.6 86/01/06 16:28:06 donn - * Sigh. We can't commit to defining a symbol as a variable instead of a - * function based only on what we have seen through the declaration section; - * this was properly handled for normal variables but not for arguments. - * - * Revision 5.5 86/01/01 21:59:17 donn - * Pick up CHARACTER*(*) declarations for variables which aren't dummy - * arguments, and complain about them. - * - * Revision 5.4 85/12/20 19:18:35 donn - * Don't assume that dummy procedures of unknown type are functions of type - * undefined until the user (mis-)uses them that way -- they may also be - * subroutines. - * * Revision 5.3 85/09/30 23:21:07 donn * Print space with prspace() in outlocvars() so that alignment is preserved. * * Revision 5.2 85/08/10 05:03:34 donn * Support for NAMELIST i/o from Jerry Berkman. @@ -504,11 +481,11 @@ prendproc(); } /* - * manipulate argument lists (allocate argument slot positions) + manipulate argument lists (allocate argument slot positions) * keep track of return types and labels */ LOCAL doentry(ep) struct Entrypoint *ep; @@ -584,13 +561,12 @@ q->vardesc.varno = nextarg(TYADDR); for(p = ep->arglist ; p ; p = p->nextp) if(! (( q = (Namep) (p->datap) )->vdcldone) ) { - if(q->vclass == CLPROC && q->vtype == TYUNKNOWN) - continue; impldcl(q); + q->vdcldone = YES; if(q->vtype == TYCHAR) { if(q->vleng == NULL) /* character*(*) */ q->vleng = (expptr) mkarg(TYLENG, nextarg(TYLENG) ); @@ -597,10 +573,15 @@ else if(nentry == 1) nextarg(TYLENG); } else if(q->vclass==CLPROC && nentry==1) nextarg(TYLENG) ; +#ifdef SDB + if(sdbflag) { + namestab(q); + } +#endif } if (optimflag) optbuff (SKLABEL, 0, ep->entrylabel, 0); else @@ -694,29 +675,16 @@ } outlocvars(); #ifdef SDB if(sdbflag) { - register struct Entrypoint *ep; - register chainp cp; - - for (ep = entries; ep; ep = ep->entnextp) - for (cp = ep->arglist ; cp ; cp = cp->nextp) - if ((q = (Namep) cp->datap) && q->vstg == STGARG) { - q->vdcldone = YES; - namestab(q); - } - for (p = hashtab ; pvarp) { - if (q->vtype == TYUNKNOWN || q->vtype == TYERROR) - continue; - qstg = q->vstg; - qclass = q->vclass; - q->vdcldone = YES; - if ( ONEOF(qclass, M(CLVAR)|M(CLPARAM)|M(CLPROC)) ) { - if (! ONEOF(qstg,M(STGCOMMON)|M(STGARG) ) ) - namestab(q); - } + for(p = hashtab ; pvarp) { + qstg = q->vstg; + qclass = q->vclass; + if( ONEOF(qclass, M(CLVAR))) { + if (! ONEOF(qstg,M(STGCOMMON)|M(STGARG) ) ) namestab(q); + } } } #endif close(vdatafile); @@ -1318,17 +1286,12 @@ else if(v->vstg != -type) dclerr("incompatible storage declarations", v); } else if(v->vtype == TYUNKNOWN) { - if( (v->vtype = lengtype(type, length))==TYCHAR ) - { - if(length >= 0) - v->vleng = ICON(length); - else if(v->vstg != STGARG) - dclerr("adjustable length character variable that is not a dummy argument", v); - } + if( (v->vtype = lengtype(type, length))==TYCHAR && length>=0) + v->vleng = ICON(length); } else if(v->vtype!=type || (type==TYCHAR && v->vleng->constblock.const.ci!=length) ) dclerr("incompatible type declarations", v); } Index: usr.bin/f77/pass1.vax/regalloc.c ================================================================== --- usr.bin/f77/pass1.vax/regalloc.c +++ usr.bin/f77/pass1.vax/regalloc.c @@ -3,42 +3,22 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)regalloc.c 5.4 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)regalloc.c 5.3 (Berkeley) 10/06/85"; #endif not lint /* * regalloc.c * * Register optimization routines for f77 compiler, pass 1 * * University of Utah CS Dept modification history: * + * $History$ * $Log: regalloc.c,v $ - * Revision 5.6 86/01/04 22:35:44 donn - * More hacking on GOTOs and loops. Fixed a bug in rev 5.4. Changed - * regalloc() so that sibling loops behave like nested loops, eliminating - * problems with GOTOs and different registers used for the same variable. - * This decreases the flexibility of the allocator quite a bit, but it was - * doing the job wrong before, so we come out ahead. - * - * Revision 5.5 86/01/04 19:54:28 donn - * Pick up redundant register moves when address registers (STGPREG) are - * involved. - * - * Revision 5.4 86/01/04 18:28:34 donn - * Patching over some more design problems... If there is a GOTO that jumps - * from an inner loop into an outer loop and there is a variable which is set - * in the inner loop and is in register in the outer loop but is not in - * register in the inner loop (or is in a different register), we get into - * trouble because the register version of the variable in the outer loop - * is 'dead' and we don't maintain enough information to be able to restore - * it. The change causes a variable that is set in an inner loop but is not - * put in register there to be ineligible for a register in the outer loop. - * * Revision 5.3 85/09/27 19:58:16 root * Ended PCC confusion with sizes of objects in registers by forcing SHORT * values in registers to be converted to INT. * * Revision 5.2 85/09/26 19:36:22 donn @@ -179,11 +159,10 @@ field vtype; field vstg; int memno; unsigned istemp : 1; unsigned isset : 1; - unsigned loopset : 1; unsigned freeuse : 1; unsigned mixedtype : 1; unsigned fixed : 1; int refs; struct addrnode *commonlink; @@ -230,11 +209,10 @@ LOCAL int loopcost; LOCAL REGDATA *regtab[MAXREGVAR]; LOCAL REGDATA *rt[TABLELIMIT]; LOCAL int tabletop; LOCAL int linearcode; -LOCAL int docount; LOCAL int globalbranch; LOCAL int commonunusable; LOCAL int regdefined[MAXREGVAR]; LOCAL int memdefined[MAXREGVAR]; LOCAL int regaltered[MAXREGVAR]; @@ -531,10 +509,11 @@ register ADDRNODE *p; register VARNODE *q; Slotp sp1, sp2; ADDRNODE *addrinfo; VARNODE *varinfo; + int docount; struct Labelblock **lp; int toptrack; int track[MAXREGVAR]; Addrp ap, ap1; DOQUEUE *dqp; @@ -542,11 +521,10 @@ REGNODE *regp; if (nregvar >= maxregvar) return; commonvars = NULL; - docount = 0; for (sp = dohead; sp != doend->next; sp = sp->next) switch (sp->type) { case SKLABEL: @@ -564,20 +542,14 @@ case SKPAUSE: case SKRETURN: scanvars(sp->expr); break; - case SKDOHEAD: - ++docount; - break; - - case SKENDDO: - --docount; - break; - case SKNULL: case SKGOTO: + case SKDOHEAD: + case SKENDDO: case SKASSIGN: break; default: badthing ("SKtype", "alreg-1", sp->type); @@ -747,12 +719,11 @@ if (topregvar < maxregvar - 1) for (i = 0; i < VARTABSIZE; i++) for (p = vartable[i]; p; p = p->link) { entableaddr(p); - if ((!p->loopset) && - (!p->mixedtype) && + if ((!p->mixedtype) && (p->vstg != STGARG) && !((p->vstg == STGCOMMON) && ((!p->fixed) || commonunusable))) for (q = p->varlist; q; q = q->link) entablevar(q); } @@ -1158,12 +1129,10 @@ return; if (ISVAR(lhs)) { addrinfo = getaddr(lhs); addrinfo->isset = YES; - if (docount > 1) - addrinfo->loopset = YES; if (fixedaddress(lhs) && ISREGTYPE(lhs->vtype)) { varinfo = getvar(addrinfo, lhs); if (addrinfo->freeuse) varinfo->isused = YES; varinfo->isset = YES; @@ -1196,12 +1165,10 @@ return; if (ISVAR(lhs)) { addrinfo = getaddr(lhs); addrinfo->isset = YES; - if (docount > 1) - addrinfo->loopset = YES; if (fixedaddress(lhs)) { if (ISREGTYPE(lhs->vtype)) { varinfo = getvar(addrinfo, lhs); @@ -1247,12 +1214,10 @@ scanvars(ap->memoffset); if (!ISVAR(ap)) continue; addrinfo = getaddr(ap); addrinfo->isset = YES; - if (docount > 1) - addrinfo->loopset = YES; if (fixedaddress(ap) && ISREGTYPE(ap->vtype)) { varinfo = getvar(addrinfo, ap); if (ap->vstg != STGCONST) varinfo->isset = YES; @@ -1983,17 +1948,10 @@ if ((r->tag == TADDR) && (r->addrblock.vstg == STGREG) && (r->addrblock.memno == l->addrblock.memno)) return YES; - if ((r->tag == TEXPR) && - (r->exprblock.opcode == OPADDR) && - (r->exprblock.leftp->tag == TADDR) && - (r->exprblock.leftp->addrblock.vstg == STGPREG) && - (r->exprblock.leftp->addrblock.memno == l->addrblock.memno)) - return YES; - return NO; } @@ -2122,11 +2080,10 @@ Slotp sl1,sl2; Slotp lastlabslot; if (! optimflag) return; -docount = 0; lastlabslot = NULL; for (sl1 = firstslot; sl1; sl1 = nextslot) { nextslot = sl1->next; switch (sl1->type) @@ -2146,16 +2103,14 @@ } break; ----- */ case SKDOHEAD: - ++docount; pushq (sl1); break; case SKENDDO: - --docount; match = 0; for (sl2 = sl1; sl2; sl2 = sl2->prev) { if (sl2->type == SKDOHEAD) match++; else if (sl2->type == SKENDDO) match--; @@ -2178,31 +2133,23 @@ fatal ("garbled doqueue in regalloc"); /* sl1 now points to the SKENDDO slot; the SKNULL slot * is reached through sl1->nullslot */ - dqptr->doend = (Slotp) sl1->nullslot; - - if (docount == 0) - { - for (dqptr = dqbottom; dqptr; dqptr = dqptr->up) - { - dohead = dqptr->dohead; - doend = dqptr->doend; - alreg(); - } - while (dqtop) - popq (dqtop->dohead); - docount = 0; - } + doend = (Slotp) sl1->nullslot; + + alreg (); break; default: break; } } +while (dqtop) + popq (dqtop->dohead); + return; } Index: usr.bin/f77/pass1.vax/stab.c ================================================================== --- usr.bin/f77/pass1.vax/stab.c +++ usr.bin/f77/pass1.vax/stab.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)stab.c 5.2 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)stab.c 5.1 (Berkeley) 06/07/85"; #endif not lint /* * stab.c * @@ -17,20 +17,10 @@ * symbolic debugging information into the object file. * * University of Utah CS Dept modification history: * * $Log: stab.c,v $ - * Revision 5.3 86/01/10 17:12:58 donn - * Add junk to handle PARAMETER variables. - * - * Revision 5.2 86/01/10 13:51:31 donn - * Changes to produce correct stab information for logical and logical*2 types - * (from Jerry Berkman) plus changes for dummy procedures. - * - * Revision 5.1 85/08/10 03:50:06 donn - * 4.3 alpha - * * Revision 1.2 85/02/02 01:30:09 donn * Don't put the 'program' name into the file; it only confuses dbx, sigh. * */ @@ -133,12 +123,10 @@ public namestab(sym) Namep sym; { register Namep p; char *varname, *classname; - expptr ep; - char buf[100]; Boolean ignore; int vartype; ignore = false; p = sym; @@ -145,49 +133,23 @@ if(!p->vdcldone) return; vartype = p->vtype; varname = varstr(VL, p->varname); switch (p->vclass) { case CLPARAM: /* parameter (constant) */ - classname = buf; - if ((ep = ((struct Paramblock *) p)->paramval) && - ep->tag == TCONST) { - switch(ep->constblock.vtype) { - case TYLONG: - case TYSHORT: - case TYLOGICAL: - case TYADDR: - sprintf(buf, "c=i%d", ep->constblock.const.ci); - break; - case TYREAL: - case TYDREAL: - sprintf(buf, "c=r%f", ep->constblock.const.cd[0]); - break; - default: - /* punt */ - ignore = true; - break; - } - } else { - ignore = true; - } + classname = "c"; break; case CLVAR: /* variable */ case CLUNKNOWN: if(p->vstg == STGARG) classname = "v"; else classname = "V"; break; - case CLPROC: /* external or function or subroutine */ - if(p->vstg == STGARG) { - classname = "v"; - break; - } - /* FALL THROUGH */ case CLMAIN: /* main program */ case CLENTRY: /* secondary entry point */ case CLBLOCK: /* block data name*/ + case CLPROC: /* external or function or subroutine */ ignore = true; /* these are put out by entrystab */ break; } @@ -205,15 +167,10 @@ case STGSTFUNCT : case STGLENG : case STGNULL : case STGREG : case STGINIT : - if (p->vclass == CLPARAM) { - /* these have zero storage class for some reason */ - sprintf(asmline+len, "\",0x%x,0,0,0\n", N_LSYM); - break; - } sprintf(asmline+len, "\",0x%x,0,0,0 /* don't know how to calc loc for stg %d*/ \n", N_LSYM,p->vstg); break; @@ -246,41 +203,36 @@ } p2pass(asmline); } } -static typenum[NTYPES+1]; /* has the given type already been defined ?*/ +static typenum[NTYPES]; /* has the given type already been defined ?*/ private writestabtype(type) int type; { char asmline[130]; - static char *typename[NTYPES+1] = { - "unknown", "addr", "integer*2", "integer", "real", "double precision", - "complex", "double complex", "logical", "char", "void", "error", "logical*2" }; + static char *typename[NTYPES] = + { "unknown", "addr","integer*2", "integer", "real", "double precision", + "complex", "double complex", "logical", "char", "void", "error" }; - static int typerange[NTYPES+1] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; + static int typerange[NTYPES] = { 0, 3, 2, 3, 4, 5, 6, 7, 3, 9, 10, 11 }; /* compare with typesize[] in init.c */ - static int typebounds[2] [NTYPES+1] ={ + static int typebounds[2] [NTYPES] ={ /* "unknown", "addr","integer*2", "integer", "real", "double precision", */ { 0 , 0 , -32768, -2147483648, 4, 8, - /* "complex", "d-complex", "logical", "char", "void", "error", "logical*2" */ - 8, 16, 4, 0, 0, 0, 2 }, + /* "complex", "double complex", "logical", "char", "void", "error" }; */ + 8, 16, 0, 0, 0, 0 }, /* "unknown", "addr","integer*2", "integer", "real", "double precision", */ - { 0 , -1, 32767, 2147483647, 0, 0, - /* "complex", "d-complex", "logical", "char", "void", "error", "logical*2" */ - 0, 0, 0, 127, 0, 0, 0 } + { 0 , -1, 32767, 2147483647, 0, 0, + /* "complex", "double complex", "logical", "char", "void", "error" }; */ + 0, 0, 1, 127, 0, 0 } }; - if (type < 0 || type > NTYPES) - badtype("writestabtype",type); - - /* substitute "logical*2" for "logical" when "-i2" compiler flag used */ - if (type == TYLOGICAL && tylogical == TYSHORT) - type = NTYPES; + if( type < 0 || type > NTYPES) badtype("writestabtype",type); if (typenum[type]) return(typenum[type]); typenum[type] = type; sprintf(asmline, "\t.stabs\t\"%s:t%d=r%d;%ld;%ld;\",0x%x,0,0,0 \n", typename[type], type, typerange[type], typebounds[0][type], @@ -293,21 +245,15 @@ private getbasenum(p) Namep p; { int t; - - if (p->vclass == CLPROC && p->vstg == STGARG) - t = TYADDR; - else - t = p->vtype; - - if (t < TYADDR || t > TYSUBR) - dclerr("can't get dbx basetype information",p); - - if (p->vtype == TYCHAR || p->vdim != nil) - writestabtype(TYINT); + t = p->vtype; + if( t < TYSHORT || t > TYSUBR) + dclerr("can't get dbx basetype information",p); + + if (p->vtype == TYCHAR || p->vdim != nil ) writestabtype(TYINT); return(writestabtype(t)); } /* * Generate debugging information for the given type of the given symbol. @@ -320,12 +266,10 @@ int i,tnum; char lb[20],ub[20]; p = sym; if (p->tag != TNAME) badtag("addtypeinfo",p->tag); - if (p->vclass == CLPARAM) - return; tnum = getbasenum(p); if(p->vdim != (struct Dimblock *) ENULL) { for (i = p->vdim->ndim-1; i >=0 ; --i) { Index: usr.bin/ftp/main.c ================================================================== --- usr.bin/ftp/main.c +++ usr.bin/ftp/main.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1983 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)main.c 5.2 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)main.c 5.1 (Berkeley) 05/31/85"; #endif not lint /* * FTP User Program -- Command Interface. */ @@ -189,12 +189,16 @@ if (fromatty) { printf("ftp> "); fflush(stdout); } if (gets(line) == 0) { - if (feof(stdin)) - quit(); + if (feof(stdin)) { + if (!fromatty) + quit(); + clearerr(stdin); + putchar('\n'); + } break; } if (line[0] == 0) break; makeargv(); Index: usr.bin/gprof/Makefile ================================================================== --- usr.bin/gprof/Makefile +++ usr.bin/gprof/Makefile @@ -1,26 +1,26 @@ # # Copyright (c) 1983 Regents of the University of California. # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # -# @(#)Makefile 5.3 (Berkeley) 01/07/86 +# @(#)Makefile 5.2 (Berkeley) 06/18/85 # -DESTDIR= -DFLAGS= -CFLAGS= -O ${DFLAGS} -LINTFLAGS= -x -a -n ${DFLAGS} +SCCSID = @(#)Makefile 5.2 (Berkeley) 06/18/85 + +DFLAGS = +CFLAGS = -O ${DFLAGS} +LINTFLAGS = -x -a -n ${DFLAGS} RM= /bin/rm -f INSTALL=install PR=pr -#MACHINE= ${MACHINE} -MACHINE= tahoe -GPROFHDRS= gprof.h ${MACHINE}.h -GPROFSRCS= gprof.c arcs.c dfn.c lookup.c ${MACHINE}.c hertz.c \ + +GPROFHDRS = gprof.h vax.h +GPROFSRCS = gprof.c arcs.c dfn.c lookup.c calls.c hertz.c \ printgprof.c printlist.c -GPROFOBJS= gprof.o arcs.o dfn.o lookup.o ${MACHINE}.o hertz.o \ +GPROFOBJS = gprof.o arcs.o dfn.o lookup.o calls.o hertz.o \ printgprof.o printlist.o gprof: ${GPROFOBJS} cc -o gprof ${CFLAGS} ${GPROFOBJS} @@ -43,13 +43,13 @@ @ ${PR} gprof.flat gprof.callg lint: lint ${LINTFLAGS} ${DFLAGS} ${GPROFSRCS} -gprof.o: gprof.c gprof.h ${MACHINE}.h gcrt0.h -arcs.o: arcs.c gprof.h ${MACHINE}.h gcrt0.h -lookup.o: lookup.c gprof.h ${MACHINE}.h gcrt0.h -dfn.o: dfn.c gprof.h ${MACHINE}.h gcrt0.h -${MACHINE}.o: ${MACHINE}.c gprof.h ${MACHINE}.h gcrt0.h -hertz.o: gprof.h ${MACHINE}.h hertz.c -printgprof.o: printgprof.c gprof.h ${MACHINE}.h gcrt0.h -printlist.o: printlist.c gprof.h ${MACHINE}.h gcrt0.h +gprof.o: gprof.c gprof.h vax.h gcrt0.h +arcs.o: arcs.c gprof.h vax.h gcrt0.h +lookup.o: lookup.c gprof.h vax.h gcrt0.h +dfn.o: dfn.c gprof.h vax.h gcrt0.h +calls.o: calls.c gprof.h vax.h gcrt0.h +hertz.o: gprof.h vax.h hertz.c +printgprof.o: printgprof.c gprof.h vax.h gcrt0.h +printlist.o: printlist.c gprof.h vax.h gcrt0.h Index: usr.bin/gprof/arcs.c ================================================================== --- usr.bin/gprof/arcs.c +++ usr.bin/gprof/arcs.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)arcs.c 5.3 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)arcs.c 5.2 (Berkeley) 06/04/85"; #endif not lint #include "gprof.h" /* @@ -103,11 +103,11 @@ parentp -> toporder = DFN_NAN; parentp -> cycleno = 0; parentp -> cyclehead = parentp; parentp -> cnext = 0; if ( cflag ) { - findcall( parentp , parentp -> value , (parentp+1) -> value ); + findcalls( parentp , parentp -> value , (parentp+1) -> value ); } } /* * topologically order things * if any node is unnumbered, Index: usr.bin/gprof/gprof.h ================================================================== --- usr.bin/gprof/gprof.h +++ usr.bin/gprof/gprof.h @@ -1,11 +1,11 @@ /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)gprof.h 5.2 (Berkeley) 01/07/86 + * @(#)gprof.h 5.1 (Berkeley) 06/04/85 */ #include #include #include @@ -14,14 +14,11 @@ #if vax # include "vax.h" #endif #if sun -# include "sun.h" -#endif -#if tahoe -# include "tahoe.h" +# include "sun.h" #endif /* * who am i, for error messages. @@ -247,9 +244,9 @@ #define ARCDEBUG 4 #define TALLYDEBUG 8 #define TIMEDEBUG 16 #define SAMPLEDEBUG 32 #define AOUTDEBUG 64 -#define CALLDEBUG 128 +#define CALLSDEBUG 128 #define LOOKUPDEBUG 256 #define PROPDEBUG 512 #define ANYDEBUG 1024 DELETED usr.bin/gprof/tahoe.c Index: usr.bin/gprof/tahoe.c ================================================================== --- usr.bin/gprof/tahoe.c +++ usr.bin/gprof/tahoe.c @@ -1,316 +0,0 @@ -#ifndef lint -static char *sccsid = "@(#)tahoe.c 1.2 (Berkeley) 01/07/86"; -#endif not lint - -#include "gprof.h" - - /* - * a namelist entry to be the child of indirect callf - */ -nltype indirectchild = { - "(*)" , /* the name */ - (unsigned long) 0 , /* the pc entry point */ - (unsigned long) 0 , /* entry point aligned to histogram */ - (double) 0.0 , /* ticks in this routine */ - (double) 0.0 , /* cumulative ticks in children */ - (long) 0 , /* how many times called */ - (long) 0 , /* how many calls to self */ - (double) 1.0 , /* propagation fraction */ - (double) 0.0 , /* self propagation time */ - (double) 0.0 , /* child propagation time */ - (bool) 0 , /* print flag */ - (int) 0 , /* index in the graph list */ - (int) 0 , /* graph call chain top-sort order */ - (int) 0 , /* internal number of cycle on */ - (struct nl *) &indirectchild , /* pointer to head of cycle */ - (struct nl *) 0 , /* pointer to next member of cycle */ - (arctype *) 0 , /* list of caller arcs */ - (arctype *) 0 /* list of callee arcs */ - }; - -operandenum -operandmode( modep ) - unsigned char *modep; -{ - long usesreg = ((long)*modep) & 0xf; - - switch ( ((long)*modep) >> 4 ) { - case 0: - case 1: - case 2: - case 3: - return literal; - case 4: - return indexed; - case 5: - return reg; - case 6: - return regdef; - case 7: - return autodec; - case 8: - return ( usesreg != 0xe ? autoinc : immediate ); - case 9: - return ( usesreg != PC ? autoincdef : absolute ); - case 10: - return ( usesreg != PC ? bytedisp : byterel ); - case 11: - return ( usesreg != PC ? bytedispdef : bytereldef ); - case 12: - return ( usesreg != PC ? worddisp : wordrel ); - case 13: - return ( usesreg != PC ? worddispdef : wordreldef ); - case 14: - return ( usesreg != PC ? longdisp : longrel ); - case 15: - return ( usesreg != PC ? longdispdef : longreldef ); - } - /* NOTREACHED */ -} - -char * -operandname( mode ) - operandenum mode; -{ - - switch ( mode ) { - case literal: - return "literal"; - case indexed: - return "indexed"; - case reg: - return "register"; - case regdef: - return "register deferred"; - case autodec: - return "autodecrement"; - case autoinc: - return "autoincrement"; - case autoincdef: - return "autoincrement deferred"; - case bytedisp: - return "byte displacement"; - case bytedispdef: - return "byte displacement deferred"; - case byterel: - return "byte relative"; - case bytereldef: - return "byte relative deferred"; - case worddisp: - return "word displacement"; - case worddispdef: - return "word displacement deferred"; - case wordrel: - return "word relative"; - case wordreldef: - return "word relative deferred"; - case immediate: - return "immediate"; - case absolute: - return "absolute"; - case longdisp: - return "long displacement"; - case longdispdef: - return "long displacement deferred"; - case longrel: - return "long relative"; - case longreldef: - return "long relative deferred"; - } - /* NOTREACHED */ -} - -long -operandlength( modep ) - unsigned char *modep; -{ - - switch ( operandmode( modep ) ) { - case literal: - case reg: - case regdef: - case autodec: - case autoinc: - case autoincdef: - return 1; - case bytedisp: - case bytedispdef: - case byterel: - case bytereldef: - return 2; - case worddisp: - case worddispdef: - case wordrel: - case wordreldef: - return 3; - case immediate: - case absolute: - case longdisp: - case longdispdef: - case longrel: - case longreldef: - return 5; - case indexed: - return 1+operandlength( modep + 1 ); - } - /* NOTREACHED */ -} - -unsigned long -reladdr( modep ) - char *modep; -{ - operandenum mode = operandmode( modep ); - char *cp; - short *sp; - long *lp; - int i; - long value = 0; - - cp = modep; - cp += 1; /* skip over the mode */ - switch ( mode ) { - default: - fprintf( stderr , "[reladdr] not relative address\n" ); - return (unsigned long) modep; - case byterel: - return (unsigned long) ( cp + sizeof *cp + *cp ); - case wordrel: - for (i = 0; i < sizeof *sp; i++) - value = (value << 8) + (cp[i] & 0xff); - return (unsigned long) ( cp + sizeof *sp + value ); - case longrel: - for (i = 0; i < sizeof *lp; i++) - value = (value << 8) + (cp[i] & 0xff); - return (unsigned long) ( cp + sizeof *lp + value ); - } -} - -findcall( parentp , p_lowpc , p_highpc ) - nltype *parentp; - unsigned long p_lowpc; - unsigned long p_highpc; -{ - unsigned char *instructp; - long length; - nltype *childp; - operandenum mode; - operandenum firstmode; - unsigned long destpc; - - if ( textspace == 0 ) { - return; - } - if ( p_lowpc < s_lowpc ) { - p_lowpc = s_lowpc; - } - if ( p_highpc > s_highpc ) { - p_highpc = s_highpc; - } -# ifdef DEBUG - if ( debug & CALLDEBUG ) { - printf( "[findcall] %s: 0x%x to 0x%x\n" , - parentp -> name , p_lowpc , p_highpc ); - } -# endif DEBUG - for ( instructp = textspace + p_lowpc ; - instructp < textspace + p_highpc ; - instructp += length ) { - length = 1; - if ( *instructp == CALLF ) { - /* - * maybe a callf, better check it out. - * skip the count of the number of arguments. - */ -# ifdef DEBUG - if ( debug & CALLDEBUG ) { - printf( "[findcall]\t0x%x:callf" , instructp - textspace ); - } -# endif DEBUG - firstmode = operandmode( instructp+length ); - switch ( firstmode ) { - case literal: - case immediate: - break; - default: - goto botched; - } - length += operandlength( instructp+length ); - mode = operandmode( instructp + length ); -# ifdef DEBUG - if ( debug & CALLDEBUG ) { - printf( "\tfirst operand is %s", operandname( firstmode ) ); - printf( "\tsecond operand is %s\n" , operandname( mode ) ); - } -# endif DEBUG - switch ( mode ) { - case regdef: - case bytedispdef: - case worddispdef: - case longdispdef: - case bytereldef: - case wordreldef: - case longreldef: - /* - * indirect call: call through pointer - * either *d(r) as a parameter or local - * (r) as a return value - * *f as a global pointer - * [are there others that we miss?, - * e.g. arrays of pointers to functions???] - */ - addarc( parentp , &indirectchild , (long) 0 ); - length += operandlength( instructp + length ); - continue; - case byterel: - case wordrel: - case longrel: - /* - * regular pc relative addressing - * check that this is the address of - * a function. - */ - destpc = reladdr( instructp+length ) - - (unsigned long) textspace; - if ( destpc >= s_lowpc && destpc <= s_highpc ) { - childp = nllookup( destpc ); -# ifdef DEBUG - if ( debug & CALLDEBUG ) { - printf( "[findcall]\tdestpc 0x%x" , destpc ); - printf( " childp->name %s" , childp -> name ); - printf( " childp->value 0x%x\n" , - childp -> value ); - } -# endif DEBUG - if ( childp -> value == destpc ) { - /* - * a hit - */ - addarc( parentp , childp , (long) 0 ); - length += operandlength( instructp + length ); - continue; - } - goto botched; - } - /* - * else: - * it looked like a callf, - * but it wasn't to anywhere. - */ - goto botched; - default: - botched: - /* - * something funny going on. - */ -# ifdef DEBUG - if ( debug & CALLDEBUG ) { - printf( "[findcall]\tbut it's a botch\n" ); - } -# endif DEBUG - length = 1; - continue; - } - } - } -} DELETED usr.bin/gprof/tahoe.h Index: usr.bin/gprof/tahoe.h ================================================================== --- usr.bin/gprof/tahoe.h +++ usr.bin/gprof/tahoe.h @@ -1,26 +0,0 @@ -/* tahoe.h 1.1 86/01/07 */ - - /* - * opcode of the `callf' instruction - */ -#define CALLF 0xfe - - /* - * offset (in bytes) of the code from the entry address of a routine. - * (see asgnsamples for use and explanation.) - */ -#define OFFSET_OF_CODE 2 -#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT)) - - /* - * register for pc relative addressing - */ -#define PC 0xf - -enum opermodes { - literal, indexed, reg, regdef, autodec, autoinc, autoincdef, - bytedisp, bytedispdef, worddisp, worddispdef, longdisp, longdispdef, - immediate, absolute, byterel, bytereldef, wordrel, wordreldef, - longrel, longreldef -}; -typedef enum opermodes operandenum; Index: usr.bin/gprof/vax.c ================================================================== --- usr.bin/gprof/vax.c +++ usr.bin/gprof/vax.c @@ -3,11 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #ifndef lint -static char sccsid[] = "@(#)vax.c 5.3 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)vax.c 5.1 (Berkeley) 06/04/85"; #endif not lint #include "gprof.h" /* @@ -186,11 +186,11 @@ lp = (long *) cp; return (unsigned long) ( cp + sizeof *lp + *lp ); } } -findcall( parentp , p_lowpc , p_highpc ) +findcalls( parentp , p_lowpc , p_highpc ) nltype *parentp; unsigned long p_lowpc; unsigned long p_highpc; { unsigned char *instructp; @@ -208,12 +208,12 @@ } if ( p_highpc > s_highpc ) { p_highpc = s_highpc; } # ifdef DEBUG - if ( debug & CALLDEBUG ) { - printf( "[findcall] %s: 0x%x to 0x%x\n" , + if ( debug & CALLSDEBUG ) { + printf( "[findcalls] %s: 0x%x to 0x%x\n" , parentp -> name , p_lowpc , p_highpc ); } # endif DEBUG for ( instructp = textspace + p_lowpc ; instructp < textspace + p_highpc ; @@ -223,12 +223,12 @@ /* * maybe a calls, better check it out. * skip the count of the number of arguments. */ # ifdef DEBUG - if ( debug & CALLDEBUG ) { - printf( "[findcall]\t0x%x:calls" , instructp - textspace ); + if ( debug & CALLSDEBUG ) { + printf( "[findcalls]\t0x%x:calls" , instructp - textspace ); } # endif DEBUG firstmode = operandmode( (struct modebyte *) (instructp+length) ); switch ( firstmode ) { case literal: @@ -238,11 +238,11 @@ goto botched; } length += operandlength( (struct modebyte *) (instructp+length) ); mode = operandmode( (struct modebyte *) ( instructp + length ) ); # ifdef DEBUG - if ( debug & CALLDEBUG ) { + if ( debug & CALLSDEBUG ) { printf( "\tfirst operand is %s", operandname( firstmode ) ); printf( "\tsecond operand is %s\n" , operandname( mode ) ); } # endif DEBUG switch ( mode ) { @@ -276,12 +276,12 @@ destpc = reladdr( (struct modebyte *) (instructp+length) ) - (unsigned long) textspace; if ( destpc >= s_lowpc && destpc <= s_highpc ) { childp = nllookup( destpc ); # ifdef DEBUG - if ( debug & CALLDEBUG ) { - printf( "[findcall]\tdestpc 0x%x" , destpc ); + if ( debug & CALLSDEBUG ) { + printf( "[findcalls]\tdestpc 0x%x" , destpc ); printf( " childp->name %s" , childp -> name ); printf( " childp->value 0x%x\n" , childp -> value ); } # endif DEBUG @@ -306,15 +306,15 @@ botched: /* * something funny going on. */ # ifdef DEBUG - if ( debug & CALLDEBUG ) { - printf( "[findcall]\tbut it's a botch\n" ); + if ( debug & CALLSDEBUG ) { + printf( "[findcalls]\tbut it's a botch\n" ); } # endif DEBUG length = 1; continue; } } } } Index: usr.bin/lastcomm/lastcomm.1 ================================================================== --- usr.bin/lastcomm/lastcomm.1 +++ usr.bin/lastcomm/lastcomm.1 @@ -1,10 +1,10 @@ .\" Copyright (c) 1980 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)lastcomm.1 6.2 (Berkeley) 01/05/86 +.\" @(#)lastcomm.1 6.1 (Berkeley) 04/29/85 .\" .TH LASTCOMM 1 "" .UC .SH NAME lastcomm \- show last commands executed in reverse order @@ -52,13 +52,14 @@ .IR exec , ``C'' indicates the command was run in PDP-11 compatibility mode (VAX only), ``D'' indicates the command terminated with the generation of a .I core -file, and ``X'' indicates the command was terminated with a signal. +file, and ``X'' indicates the command was terminated with the signal +SIGTERM. .SH FILES /usr/adm/acct .SH "SEE ALSO" last(1), sigvec(2), acct(8), core(5) Index: usr.bin/login/login.c ================================================================== --- usr.bin/login/login.c +++ usr.bin/login/login.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)login.c 5.11 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)login.c 5.10 (Berkeley) 11/08/85"; #endif not lint /* * login [ name ] * login -r hostname (for rlogind) @@ -522,14 +522,48 @@ for (cpp = speeds; cpp < &speeds[NSPEEDS]; cpp++) if (strcmp(*cpp, speed) == 0) { tp->sg_ispeed = tp->sg_ospeed = cpp-speeds; break; } + compatsiz(cp); } tp->sg_flags = ECHO|CRMOD|ANYP|XTABS; } +/* BEGIN TRASH + * + * This is here only long enough to get us by to the revised rlogin + */ +compatsiz(cp) + char *cp; +{ + struct winsize ws; + + ws.ws_row = ws.ws_col = -1; + ws.ws_xpixel = ws.ws_ypixel = -1; + if (cp) { + ws.ws_row = atoi(cp); + cp = index(cp, ','); + if (cp == 0) + goto done; + ws.ws_col = atoi(++cp); + cp = index(cp, ','); + if (cp == 0) + goto done; + ws.ws_xpixel = atoi(++cp); + cp = index(cp, ','); + if (cp == 0) + goto done; + ws.ws_ypixel = atoi(++cp); + } +done: + if (ws.ws_row != -1 && ws.ws_col != -1 && + ws.ws_xpixel != -1 && ws.ws_ypixel != -1) + ioctl(0, TIOCSWINSZ, &ws); +} +/* END TRASH */ + /* * Set the value of var to be arg in the Unix 4.2 BSD environment env. * Var should end with '='. * (bindings are of the form "var=value") * This procedure assumes the memory for the first level of environ Index: usr.bin/login/login.c.1 ================================================================== --- usr.bin/login/login.c.1 +++ usr.bin/login/login.c.1 @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)login.c.1 5.11 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)login.c.1 5.10 (Berkeley) 11/08/85"; #endif not lint /* * login [ name ] * login -r hostname (for rlogind) @@ -522,14 +522,48 @@ for (cpp = speeds; cpp < &speeds[NSPEEDS]; cpp++) if (strcmp(*cpp, speed) == 0) { tp->sg_ispeed = tp->sg_ospeed = cpp-speeds; break; } + compatsiz(cp); } tp->sg_flags = ECHO|CRMOD|ANYP|XTABS; } +/* BEGIN TRASH + * + * This is here only long enough to get us by to the revised rlogin + */ +compatsiz(cp) + char *cp; +{ + struct winsize ws; + + ws.ws_row = ws.ws_col = -1; + ws.ws_xpixel = ws.ws_ypixel = -1; + if (cp) { + ws.ws_row = atoi(cp); + cp = index(cp, ','); + if (cp == 0) + goto done; + ws.ws_col = atoi(++cp); + cp = index(cp, ','); + if (cp == 0) + goto done; + ws.ws_xpixel = atoi(++cp); + cp = index(cp, ','); + if (cp == 0) + goto done; + ws.ws_ypixel = atoi(++cp); + } +done: + if (ws.ws_row != -1 && ws.ws_col != -1 && + ws.ws_xpixel != -1 && ws.ws_ypixel != -1) + ioctl(0, TIOCSWINSZ, &ws); +} +/* END TRASH */ + /* * Set the value of var to be arg in the Unix 4.2 BSD environment env. * Var should end with '='. * (bindings are of the form "var=value") * This procedure assumes the memory for the first level of environ Index: usr.bin/patch/patch.c ================================================================== --- usr.bin/patch/patch.c +++ usr.bin/patch/patch.c @@ -1,7 +1,7 @@ #ifndef lint -static char sccsid[] = "@(#)patch.c 5.5 (Berkeley) 01/09/86"; +static char sccsid[] = "@(#)patch.c 5.4 (Berkeley) 11/25/85"; #endif not lint /* patch - a program to apply diffs to original files * * $Header: patch.c,v 1.3 85/03/26 15:07:43 lwall Exp $ @@ -1436,13 +1436,11 @@ p_line[p_end] = savestr(buf+2); break; default: fatal("Malformed patch at line %d: %s",p_input_line,buf); } - p_len[p_end] = 0; - if (p_line[p_end] != 0) - p_len[p_end] = strlen(p_line[p_end]); + p_len[p_end] = strlen(p_line[p_end]); /* for strncmp() so we do not have */ /* to assume null termination */ } if (p_end >=0 && !p_ptrn_lines) fatal("No --- found in patch at line %d\n", pch_hunk_beg()); @@ -1548,13 +1546,11 @@ p_line[p_end] = savestr(buf+2); break; default: fatal("Malformed patch at line %d: %s",p_input_line,buf); } - p_len[p_end] = 0; - if (p_line[p_end] != 0) - p_len[p_end] = strlen(p_line[p_end]); + p_len[p_end] = strlen(p_line[p_end]); /* for strncmp() so we do not have */ /* to assume null termination */ } if (p_end >=0 && !p_ptrn_lines) fatal("No --- found in patch at line %d\n", pch_hunk_beg()); @@ -1619,13 +1615,11 @@ fatal("Unexpected end of file in patch at line %d.\n", p_input_line); if (*buf != '<') fatal("< expected at line %d of patch.\n", p_input_line); p_line[i] = savestr(buf+2); - p_len[i] = 0; - if (p_line[i] != 0) - p_len[i] = strlen(p_line[i]); + p_len[i] = strlen(p_line[i]); p_char[i] = '-'; } if (hunk_type == 'c') { ret = pgets(buf,sizeof buf, pfp); p_input_line++; @@ -1645,13 +1639,11 @@ fatal("Unexpected end of file in patch at line %d.\n", p_input_line); if (*buf != '>') fatal("> expected at line %d of patch.\n", p_input_line); p_line[i] = savestr(buf+2); - p_len[i] = 0; - if (p_line[i] != 0) - p_len[i] = strlen(p_line[i]); + p_len[i] = strlen(p_line[i]); p_char[i] = '+'; } } if (reverse) /* backwards patch? */ pch_swap(); Index: usr.bin/rlogin/rlogin.1 ================================================================== --- usr.bin/rlogin/rlogin.1 +++ usr.bin/rlogin/rlogin.1 @@ -1,10 +1,10 @@ .\" Copyright (c) 1983 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)rlogin.1 6.4 (Berkeley) 01/09/86 +.\" @(#)rlogin.1 6.3 (Berkeley) 10/30/85 .\" .TH RLOGIN 1C "" .UC 5 .SH NAME rlogin \- remote login @@ -51,11 +51,11 @@ where logins without passwords are to be permitted. If the originating user is not equivalent to the remote user, then a login and password will be prompted for on the remote machine as in .IR login (1). To avoid some security problems, the \&.rhosts file must be owned by -either the remote user or root. +either the remote user or root and may not be a symbolic link. .PP Your remote terminal type is the same as your local terminal type (as given in your environment TERM variable). All echoing takes place at the remote site, so that (except for delays) the rlogin is transparent. Flow control via ^S and ^Q and Index: usr.bin/ruptime/ruptime.c ================================================================== --- usr.bin/ruptime/ruptime.c +++ usr.bin/ruptime/ruptime.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1983 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)ruptime.c 5.3 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)ruptime.c 5.2 (Berkeley) 06/18/85"; #endif not lint #include #include #include @@ -156,11 +156,11 @@ char *updown; { static char resbuf[32]; int days, hours, minutes; - if (time < 0 || time > 365*24*60*60) { + if (time < 0 || time > 3*30*24*60*60) { (void) sprintf(resbuf, " %s ??:??", updown); return (resbuf); } minutes = (time + 59) / 60; /* round to minutes */ hours = minutes / 60; minutes %= 60; DELETED usr.bin/spell/american Index: usr.bin/spell/american ================================================================== --- usr.bin/spell/american +++ usr.bin/spell/american @@ -1,327 +0,0 @@ -acknowledgment -aggrandize -aluminize -aluminum -amor -amorous -amphitheater -analog -analyze -anemia -anemic -anesthesia -anesthetic -anesthetize -anglicize -antagonize -apologize -appareled -appareling -appetize -arbor -archeology -Archeopteryx -ardor -arithmetize -armor -armory -axiomatize -baptize -barreled -barreling -behavior -behoove -belabor -beveled -beveler -beveling -canceled -canceler -canceling -candor -catalog -catalyze -catechize -categorize -cauterize -center -channeled -channeler -channeling -chiseled -chiseler -chiseling -clamor -clamorous -clangor -color -colorable -colorful -colorist -corbeled -corbeling -counseled -counseling -crystallize -cudgeled -cudgeler -cudgeling -decentralize -decriminalize -defense -dehumanize -deionize -demagnetize -demeanor -demineralize -demoralize -demythologize -depersonalize -depolarize -desensitize -destabilize -desynchronize -detribalize -dialyze -diarrhea -discolor -disemboweled -disemboweling -disfavor -disheveled -disheveler -disheveling -dishonor -dishonorable -disorganize -doweled -doweler -doweling -dramatize -dueled -dueler -dueling -duelist -economize -ecumenical -edema -emphasize -enameled -enameling -enamor -encyclopedia -endeavor -energize -eon -epicenter -esophagus -eulogize -favor -favorable -favorite -fervor -fiber -flavor -fraternize -fueled -fueler -fueling -funneled -funneler -funneling -furor -galvanize -gaveled -gaveler -gaveling -glamorize -gram -graveled -graveling -groveled -groveler -groveling -gynecology -harbor -harmonize -hiccup -hiccupped -hiccupping -homeopathy -homogenize -honor -honorable -humor -hydrolyze -hypnotize -hypostatize -hypothesize -jeweled -jeweler -jeweling -judgment -kilogram -kinesthetic -labeled -labeler -labeling -labor -laborite -legitimize -leveled -leveler -leveling -libeled -libeler -libeling -license -liter -logorrhea -louver -luster -marveled -marveler -marveling -mechanize -medieval -memorize -mesmerize -metallize -milligram -milliliter -millimeter -modeled -modeler -modeling -nanogram -naught -neighbor -neighborhood -notarize -ocher -odor -offense -optimize -orientation -ostracize -pajama -pallor -paneled -paneling -paralleled -paralleling -paralyze -parametrize -parceled -parceler -parceling -parenthesize -parlor -peptize -photolyze -photosynthesize -picogram -plagiarize -platinize -preprogram -program -proselytize -psychoanalyze -psycoanalyze -pulverize -pummeled -pummeler -pummeling -pyorrhea -pyrolyze -quantize -quarreled -quarreler -quarreling -radiosterilize -rancor -raveled -raveler -raveling -realize -recognize -reconnoiter -reveled -reveler -reveling -rigor -rumor -saber -saltpeter -savior -savor -savory -scepter -schematize -scrutinize -sensitize -sepulcher -shoveled -shoveler -shoveling -shriveled -shriveling -siphon -sniveled -sniveler -sniveling -soliloquize -specialty -specter -spirochete -splendor -squirreled -squirreling -stigmatize -succor -summarize -swiveled -swiveling -symmetrize -sympathize -synchronize -synthesize -systematize -tantalize -tasseled -tasseling -temporize -theater -theatergoer -theatergoing -theorize -tinseled -tinseling -titer -toweled -toweling -trammeled -traumatize -traveled -traveler -traveling -tricolor -tumor -tunneled -tunneler -tunneling -tyrannize -valor -vapor -varicolored -vigor -vulcanize -wagon -watercolor -watercolorist -weaseled -weaseling -whiskey -woolen -yodeled -yodeling DELETED usr.bin/spell/british Index: usr.bin/spell/british ================================================================== --- usr.bin/spell/british +++ usr.bin/spell/british @@ -1,331 +0,0 @@ -aeon -aerodrome -aeroplane -aggrandise -alarum -aluminium -amour -amourous -amphitheatre -anaemia -anaemic -anaesthesia -anaesthetic -anaesthetise -analyse -anglicise -antagonise -apologise -apparelled -apparelling -appetise -arbour -archaeology -Archaeopteryx -ardour -arithmetise -armour -armoury -axiomatise -baptise -barrelled -barrelling -behaviour -behavioural -behove -belabour -bevelled -beveller -bevelling -cancelled -canceller -cancelling -candour -catalyse -catechise -categorise -cauterise -centimetre -centre -channelled -channeller -channelling -cheque -chequer -chiselled -chiseller -chiselling -clamour -clamourous -clangour -colour -colourable -colourist -connexion -corbelled -corbelling -counselled -counselling -crystallise -cudgelled -cudgeller -cudgelling -decentralise -decriminalise -defence -dehumanise -deionise -demagnetise -demeanour -demineralise -demoralise -demythologise -depersonalise -depolarise -desensitise -destabilise -desynchronise -detribalise -dialyse -diarrhoea -discolour -disembowelled -disembowelling -disfavour -dishevelled -disheveller -dishevelling -dishonour -dishonourable -disorganise -dowelled -doweller -dowelling -dramatise -draught -duelled -dueller -duelling -duellist -economise -emphasise -enamelled -enamelling -enamour -encyclopaedia -endeavour -energise -epicentre -eulogise -favour -favourable -favourite -fervour -fibre -flavour -fraternise -fuelled -fueller -fuelling -funnelled -funneller -funnelling -furore -fuze -galvanise -gaol -gavelled -gaveller -gavelling -glamourise -gramme -gravelled -gravelling -grovelled -groveller -grovelling -gynaecology -harbour -harmonise -homoeopathy -homogenise -honour -honourable -humour -hydrolyse -hypnotise -hypostatise -hypothesise -jewelled -jeweller -jewelling -kilogramme -kilometre -kinaesthetic -labelled -labeller -labelling -labour -labourite -legitimise -levelled -leveller -levelling -libelled -libeller -libelling -licence -litre -logorrhoea -lustre -marvelled -marveller -marvelling -mechanise -mediaeval -memorise -mesmerise -metallise -metre -milligramme -millilitre -millimetre -modelled -modeller -modelling -nanogramme -nanometre -neighbour -neighbourhood -notarise -nought -ochre -odour -oecumenical -oedema -oesophagus -offence -optimise -orientate -ostracise -pallour -panelled -panelling -parallelled -parallelling -paralyse -parametrise -parcelled -parceller -parcelling -parenthesise -parlour -peptise -photolyse -photosynthesise -picogramme -plagiarise -platinise -practise -preprogramme -programme -proselytise -psychoanalyse -pulverise -pummelled -pummeller -pummelling -pyjama -pyorrhoea -pyrolyse -quantise -quarrelled -quarreller -quarrelling -rancour -radiosterilise -ravelled -raveller -ravelling -realise -recognise -reconnoitre -revelled -reveller -revelling -rigour -rumour -sabre -saltpetre -saviour -savour -savoury -sceptre -schematise -scrutinise -sensitise -sepulchre -shovelled -shoveller -shovelling -shrivelled -shrivelling -snivelled -sniveller -snivelling -soliloquise -speciality -spectre -splendour -squirrelled -squirrelling -stigmatise -succour -summarise -millimetre -swivelled -swivelling -symmetrise -sympathise -synchronise -synthesise -syphon -systematise -tantalise -tasselled -tasselling -temporise -theatre -theorise -tinselled -tinselling -titre -towelled -towelling -trammelled -traumatise -travelled -traveller -travelling -tricolour -tumour -tunnelled -tunneller -tunnelling -tyrannise -tyre -valour -vapour -varicoloured -vigour -vulcanise -waggon -watercolour -watercolourist -weaselled -weaselling -whilst -whisky -woollen -yodelled -yodelling DELETED usr.bin/spell/stop Index: usr.bin/spell/stop ================================================================== --- usr.bin/spell/stop +++ usr.bin/spell/stop @@ -1,919 +0,0 @@ -abator -abeted -abeter -abeting -abuted -abuter -abuting -accessable -acquiter -acquiting -acter -addendums -adly -admitable -admited -admiter -admiting -ahly -allotable -alloted -alloter -alloting -amly -ams -animadvertion -anly -annulable -annuled -annuler -annuling -ans -arguement -arised -asly -ation -ative -atly -ator -ats -audable -auditer -avered -averer -avering -avertion -awared -axises -axly -baned -baning -beared -beated -bedimed -bedimer -bediming -befited -befiter -befiting -befoged -befoger -befoging -begeted -begeter -begeting -begined -beginer -begining -beholded -bely -bes -besetable -beseted -beseter -beseting -besoting -bespeaked -bestired -bestirer -bestiring -betted -bidded -bies -binded -bited -blader -bleeded -blowed -breaked -breeded -bringed -bursted -buyed -byly -Canadan -Carolinan -casted -catched -cheator -checksumable -checksumed -checksuming -choosed -clinged -collapsable -collectable -collecter -colourate -colourful -combustable -comed -commitable -commited -commiter -commiting -compeled -compeler -compeling -compositer -compositon -comprehensable -compressable -condensable -conducter -coner -conferable -confered -conferer -confering -coning -constricter -constructable -constructer -contemptable -contracter -controlable -controled -controler -controling -controvertable -convertable -convertion -corpuses -correcter -corrigendums -corrodable -corruptable -credable -crediter -creeped -currance -currancy -curriculas -cutted -datas -datums -dealed -debared -debarer -debaring -debator -debter -debuged -debuger -debuging -decontroled -decontroler -decontroling -deductable -defecter -defensable -deferable -defered -deferer -defering -deflator -deflecter -degased -degaser -degasing -degumed -degumer -deguming -demitable -demited -demiter -demiting -demured -demuring -depositer -depressable -desolator -destructer -detecter -deterable -detered -deterer -detering -detracter -diffusable -digestable -dimed -dimest -directer -discernable -discomfited -discomfiter -discomfiting -disintered -disinterer -disintering -dispelable -dispeled -dispeler -dispeling -dispence -dispersable -distributory -divertion -doged -doger -doging -doly -doned -doner -doning -drawed -drinked -drived -duely -dus -eated -eator -eavesdroped -eavesdroper -eavesdroping -edable -editer -effluvias -effluviums -ehly -ehs -ejecter -electer -elly -embedable -embeded -embeder -embeding -emitable -emited -emiter -emiting -emly -emphasises -enaction -enbalm -enbank -enbark -enbattle -enbay -enbed -enbit -enblaze -enblazon -enbody -enbolden -enboss -enbow -enbowel -enbrace -enbrittle -enbroil -encant -encur -endebted -enend -enflame -enform -enirate -enit -enly -enpanel -enpathetic -enplace -enplane -enploy -enpower -enpress -enpurple -enroad -entend -entone -entrapable -entraped -entraper -entraping -envoice -equilibriums -equipable -equiped -equiper -equiping -erodable -erosable -esophaguses -estoped -estoper -estoping -etly -ets -exasperator -exceled -exceler -exceling -exegesises -exhaustable -expansable -expection -expelable -expeled -expeler -expeling -expositer -expressable -extendable -extensable -extolable -extoled -extoler -extoling -extracter -extremums -extrovertion -facter -fadded -fadding -fallable -falled -feasable -feeded -feeled -fighted -finded -flexable -flinged -flirtion -Floridan -fluter -foable -forbeared -forbided -forebade -forebear -forebid -forebidden -forebidding -forebore -forefend -foregave -foreget -foregettable -foregetting -foregive -foregiven -foregot -foremat -foremate -foresake -foreswear -forety -foreward -forgetable -forgeted -forsaked -freezed -frustrator -fusable -gayly -genesises -genuses -getted -giddaped -giddaper -giddaping -gived -glomed -glumer -glumest -goly -gos -greator -grimer -grimest -grinded -growed -gullable -haly -heared -heator -hely -hes -hesitator -hily -holded -horrable -huggest -huging -hurted -idly -ifly -iily -iis -impartion -impelable -impeled -impeler -impeling -imperceptable -implausable -importion -impressable -inaccessable -inaudable -incombustable -incompatable -incomprehensable -incontrovertable -incorruptable -incredable -incured -incurer -incuring -indefensable -indelable -indestructable -indigestable -indiscernable -inducter -inexhaustable -inexpressable -infallable -infeasable -inferable -infered -inferer -infering -inflator -inflexable -infusable -ingestable -inheriter -inly -insensable -inspecter -instructer -intence -interable -intered -interer -intering -interruptable -intimator -inventer -invertable -invertion -invester -irresistable -irresponsable -irreversable -isly -itly -ivly -ivs -ixes -ixly -juter -keeped -kiloohm -knowed -lader -laly -lammest -lapeled -layed -lended -letted -loaned -loging -loly -losed -mader -madest -mading -maked -maly -maner -maning -manumitable -manumited -manumiter -manumiting -mared -meaned -meeted -mely -mies -mily -moter -myly -nely -nes -neurosises -noding -noly -notory -nuly -objecter -occured -occurer -occuring -offsetable -offseted -offseter -offseting -ofly -ofs -ohly -ons -opuses -ostensable -outgaser -ows -oxes -oxly -padable -paly -paner -paralysises -parenthesises -paster -payed -perceptable -perfectable -permitable -permited -permiter -permiting -pervertion -phenomenas -phenomenons -photosynthesises -pily -pipper -placator -plausable -plugable -predicter -preempter -prefered -preferer -prefering -preseter -preseting -presuably -programable -programed -programer -programing -projecter -propeled -propeler -propeling -prosecuter -prospecter -protecter -quitable -quiter -quiting -ratter -readed -reah -realter -rean -reas -reat -reax -rebat -rebe -rebeled -rebeler -rebeling -rebutable -rebuted -rebuter -rebuting -reby -recal -recapable -recaped -recaper -recaping -recloth -recommitable -recommited -recommiter -recommiting -recured -recurer -recuring -redacter -redu -reem -reen -reet -referable -refered -referer -refering -refited -refiter -refiting -reflecter -rego -regretable -regreted -regreter -regreting -reha -rehe -rehi -reho -reif -reii -reis -reit -reiv -reix -reknited -rekniter -rekniting -rela -relo -rema -remad -remaned -remaner -remaning -reme -remi -remitable -remited -remiter -remiting -remy -rended -renu -reof -reoh -reon -reor -reow -reox -repa -repelable -repeled -repeler -repeling -repi -reprehensable -rere -rerout -rerunable -reruned -reruner -reruning -resa -reshiped -reshiper -reshiping -resistable -reso -responsable -reti -reto -reup -reversable -revertion -revi -rewe -rewok -rexi -reye -rided -risable -rised -rocketed -rocketer -rocketing -ruber -rubing -runable -runed -runned -saging -saly -saturator -sayed -sculpter -secretory -secter -seeked -selecter -selled -senation -senative -sended -sensable -setable -setted -shaked -shedded -shipable -shooted -shrinked -shutted -siner -sining -sinked -siply -sitted -slayed -sleeped -slided -slinged -slinked -smited -soliciter -soly -speaked -spended -spinable -spiner -spining -spinned -spiting -splitted -spotable -spreaded -stagged -stagging -standed -stealed -sticked -stinked -stopable -stratas -strided -striked -subletable -subleted -subleter -subleting -submitable -submited -submiter -submiting -suggestable -suntaned -suntaning -suppressable -susceptable -sweared -sweeped -swimable -swinged -synopsises -synthesises -taked -teached -teching -telled -terrable -thesises -thier -thinked -thrombosises -throwed -thrusted -tiner -tining -toly -tracter -traiter -tranquility -transferable -transfered -transferer -transfering -transmitable -transmited -transmiter -transmiting -transportion -trivias -triviums -truely -typeseter -typeseting -unactivate -unadequacy -unattention -unboard -unbreed -uncant -uncapacity -uncompletion -uncorporate -uncrease -uncredulity -unculpable -uncur -uncurred -uncurrer -uncurring -undebt -undeed -undefinite -undelicate -undent -undenture -undermind -undices -undignity -undiscriminate -undisposition -undoor -unduct -undwell -unefficacy -unequity -unfamous -unfelicity -unfest -unfield -unfiltrate -unfinity -unflame -unflammable -unflow -unfluence -unflux -unformant -unformation -unfuse -unfusion -ungather -ungrate -ungratitude -unhabitant -unhabitation -unhale -unhere -unholding -unhumane -unhumanity -unjure -unjury -unnumerable -unoperable -unput -unquest -unscribe -unscription -unsect -unside -unspire -unstall -unstance -unstead -untact -untake -untemperance -untend -untestate -untill -untolerant -untuition -unvade -unvalidate -unvent -unverse -unversion -unvertebrate -unviolate -unvocate -unward -unwieldly -uply -upseter -upseting -usly -usses -vendable -vily -visable -visiter -warer -weared -weeped -wely -wetable -whitter -whitting -winable -winned -wringed -writed -xily -yiper Index: usr.bin/tail/tail.c ================================================================== --- usr.bin/tail/tail.c +++ usr.bin/tail/tail.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)tail.c 5.2 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)tail.c 5.1 (Berkeley) 05/31/85"; #endif not lint /* tail command * * tail where [file] @@ -34,13 +34,13 @@ #include #include #include #include -#define LBIN 32769 +#define LBIN 8193 #undef BUFSIZ -#define BUFSIZ 8192 +#define BUFSIZ LBIN-1 struct stat statb; int follow; int piped; char bin[LBIN]; int errno; @@ -153,11 +153,11 @@ if(n <= 0) fexit(); if(!piped) { (void)fstat(0,&statb); /* If by lines, back up 1 buffer: else back up as needed */ - di = bylines?LBIN-1:n; + di = bylines?BUFSIZ:n; if(statb.st_size > di) (void)lseek(0,(off_t)-di,L_XTND); if(!bylines) goto copy; } Index: usr.bin/telnet/telnet.c ================================================================== --- usr.bin/telnet/telnet.c +++ usr.bin/telnet/telnet.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1983 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)telnet.c 5.4 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)telnet.c 5.3 (Berkeley) 11/08/85"; #endif not lint /* * User telnet program. */ @@ -534,12 +534,14 @@ else signal(SIGINT, SIG_DFL); for (;;) { printf("%s> ", prompt); if (gets(line) == 0) { - if (feof(stdin)) - quit(); + if (feof(stdin)) { + clearerr(stdin); + putchar('\n'); + } break; } if (line[0] == 0) break; makeargv(); Index: usr.bin/tftp/main.c ================================================================== --- usr.bin/tftp/main.c +++ usr.bin/tftp/main.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1983 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)main.c 5.2 (Berkeley) 01/10/86"; +static char sccsid[] = "@(#)main.c 5.1 (Berkeley) 06/06/85"; #endif not lint /* * TFTP User Program -- Command Interface. */ @@ -461,16 +461,12 @@ if (!top) putchar('\n'); for (;;) { printf("%s> ", prompt); - if (gets(line) == 0) { - if (feof(stdin)) - quit(); - else - continue; - } + if (gets(line) == 0) + continue; if (line[0] == 0) continue; makeargv(); c = getcmd(margv[0]); if (c == (struct cmd *)-1) { Index: usr.bin/uucp/DOC/CHANGES ================================================================== --- usr.bin/uucp/DOC/CHANGES +++ usr.bin/uucp/DOC/CHANGES @@ -1,7 +1,7 @@ List of Changes to UUCP -CHANGES 5.5 86/01/06 +CHANGES 5.4 85/10/09 Added support for Eunice. Added new dialers: Racal Vadic 212 @@ -153,11 +153,5 @@ You can specify a time for the expect send sequences with ~ instead of getting the default MAXMSGTIME. E.g. system Any ACU 1200 1234567 ogin~20-\r-ogin~10-\b-ogin user password pw will look for ogin for 20 seconds, send CR, look for ogin for 10 seconds, send a BREAK and look for ogin for MAXMSGTIME seconds - -Added code to support GTEs PC Pursuit service. It's mainly the handling of the -dialback they use. - -Added time "NonPeak" for Tymnet/Telenet services that charge lower -rates from 6pm-7am M-F and Sat & Sun. Index: usr.bin/uucp/includes/uucp.h ================================================================== --- usr.bin/uucp/includes/uucp.h +++ usr.bin/uucp/includes/uucp.h @@ -1,6 +1,6 @@ -/* uucp.h 5.10 86/01/06 */ +/* uucp.h 5.9 85/10/24 */ #include /* * Determine local uucp name of this machine. @@ -80,14 +80,13 @@ #if defined(UNETTCP) || defined(BSDTCP) #define TCPIP #endif +#if defined(VENTEL) || defined(NOVATION) || defined(DF112) || defined(PENRIL) /* - * We need a timer to write slowly to certain modems. - * and for generating breaks. - * + * We need a timer to write slowly to ventels. * define INTERVALTIMER to use 4.[23] bsd interval timer. * define FASTTIMER if you have the nap() system call. * define FTIME if you have the ftime() system call. * define BUSYLOOP if you must do a busy loop. * Look at uucpdelay() in condevs.c for details. @@ -94,10 +93,11 @@ */ #define INTERVALTIMER /*#define FASTTIMER /**/ /*#define FTIME /**/ /*#define BUSYLOOP /**/ +#endif VENTEL || NOVATION || DF112 || PENRIL /* * If your site is using "ndir.h" to retrofit the Berkeley * directory reading routines, define NDIR. * You will probably also have to set LIBNDIR in Makefile. Index: usr.bin/uucp/uucico/cico.c ================================================================== --- usr.bin/uucp/uucico/cico.c +++ usr.bin/uucp/uucico/cico.c @@ -1,7 +1,7 @@ #ifndef lint -static char sccsid[] = "@(#)cico.c 5.11 (Berkeley) 01/06/86"; +static char sccsid[] = "@(#)cico.c 5.10 (Berkeley) 11/22/85"; #endif #include #include "uucp.h" #include @@ -36,11 +36,11 @@ "", "BAD SYSTEM", "WRONG TIME TO CALL", "SYSTEM LOCKED", "NO DEVICE", - "CALL FAILED", + "DIAL FAILED", "LOGIN FAILED", "BAD SEQUENCE" }; /* call fail codes */ @@ -53,22 +53,17 @@ SS_FAIL, SS_FAIL, SS_BADSEQ }; - /* Arguments to setdebug(): */ -#define DBG_TEMP 0 /* Create a temporary audit file */ -#define DBG_PERM 1 /* Create a permanent audit file */ -#define DBG_CLEAN 2 /* Cleanup, discard temp file */ int ReverseRole = 0; +int StdErrIsTty = 0; int Role = SLAVE; int onesys = 0; int turntime = 30 * 60; /* 30 minutes expressed in seconds */ -char *ttyn = NULL; extern int LocalOnly; -extern int errno; extern char MaxGrade, DefMaxGrade; extern char Myfullname[]; #ifdef USG struct termio Savettyb; @@ -75,26 +70,27 @@ #endif #ifndef USG struct sgttyb Savettyb; #endif -/* - * this program is used to place a call to a +/******* + * cico - this program is used to place a call to a * remote machine, login, and copy files between the two machines. */ + main(argc, argv) -int argc; register char *argv[]; { register int ret; int seq; char wkpre[NAMESIZE], file[NAMESIZE]; - char msg[MAXFULLNAME], *q; + char msg[MAXFULLNAME], *q, **alias; register char *p; - extern onintr(), timeout(), dbg_signal(); + extern onintr(), timeout(), setdebug(); extern char *pskip(); char rflags[MAXFULLNAME]; + char *ttyn; #ifdef NOGETPEER u_long Hostnumber = 0; #endif NOGETPEER strcpy(Progname, "uucico"); @@ -102,19 +98,19 @@ signal(SIGINT, onintr); signal(SIGHUP, onintr); signal(SIGQUIT, onintr); signal(SIGTERM, onintr); signal(SIGPIPE, onintr); /* 4.1a tcp-ip stupidity */ - signal(SIGFPE, dbg_signal); + signal(SIGFPE, setdebug); ret = guinfo(getuid(), User, msg); strcpy(Loginuser, User); uucpname(Myname); ASSERT(ret == 0, "BAD UID", CNULL, ret); - setbuf (stderr, CNULL); - - rflags[0] = '\0'; +#ifdef BSD4_2 + setlinebuf(stderr); +#endif umask(WFMASK); strcpy(Rmtname, Myname); Ifn = Ofn = -1; while(argc>1 && argv[1][0] == '-'){ switch(argv[1][1]){ @@ -137,14 +133,15 @@ Rmtname[MAXBASENAME] = '\0'; if (Rmtname[0] != '\0') onesys = 1; break; case 'x': + chkdebug(); Debug = atoi(&argv[1][2]); if (Debug <= 0) Debug = 1; - strcat(rflags, argv[1]); + logent("ENABLED", "DEBUG"); break; case 't': turntime = atoi(&argv[1][2])*60;/* minutes to seconds */ break; case 'L': /* local calls only */ @@ -161,11 +158,11 @@ } --argc; argv++; } while (argc > 1) { - fprintf(stderr, "unknown argument %s (ignored)\n", argv[1]); + printf("unknown argument %s (ignored)\n", argv[1]); --argc; argv++; } /* Try to run as uucp */ setgid(getegid()); @@ -188,88 +185,82 @@ ret = subchdir(Spool); ASSERT(ret >= 0, "CHDIR FAILED", Spool, ret); strcpy(Wrkdir, Spool); - if (Debug) { - if (Role == MASTER) - chkdebug(); - setdebug ((Role == SLAVE) ? DBG_TEMP : DBG_PERM); - if (Debug > 0) - logent ("Local Enabled", "DEBUG"); - } - - /* - * First time through: If we're the slave, do initial checking. - */ if (Role == SLAVE) { /* check for /etc/nologin */ if (access(NOLOGIN, 0) == 0) { logent(NOLOGIN, "UUCICO SHUTDOWN"); if (Debug > 4) logent("DEBUGGING", "continuing anyway"); else cleanup(1); } - Ifn = 0; - Ofn = 1; #ifdef TCPIP /* * Determine if we are on TCPIP */ - if (isatty(Ifn) < 0) { + if (isatty(0) == 0) { IsTcpIp = 1; DEBUG(4, "TCPIP connection -- ioctl-s disabled\n", CNULL); } else IsTcpIp = 0; #endif TCPIP /* initial handshake */ onesys = 1; if (!IsTcpIp) { #ifdef USG - ret = ioctl(Ifn, TCGETA, &Savettyb); + ret = ioctl(0, TCGETA, &Savettyb); Savettyb.c_cflag = (Savettyb.c_cflag & ~CS8) | CS7; Savettyb.c_oflag |= OPOST; Savettyb.c_lflag |= (ISIG|ICANON|ECHO); #else !USG - ret = ioctl(Ifn, TIOCGETP, &Savettyb); + ret = ioctl(0, TIOCGETP, &Savettyb); Savettyb.sg_flags |= ECHO; Savettyb.sg_flags &= ~RAW; #endif !USG - ttyn = ttyname(Ifn); } + Ifn = 0; + Ofn = 1; fixmode(Ifn); getbaud(Ifn); - - /* - * Initial Message -- tell them we're here, and who we are. - */ + sprintf(file,"%s/%d", RMTDEBUG, getpid()); +#ifdef VMS + /* hold the version number down */ + unlink(file); +#endif VMS + freopen(file, "w", stderr); +#ifdef BSD4_2 + setlinebuf(stderr); +#else !BSD4_2 + setbuf(stderr, NULL); +#endif !BSD4_2 sprintf(msg, "here=%s", Myfullname); omsg('S', msg, Ofn); signal(SIGALRM, timeout); alarm(MAXMSGTIME); if (setjmp(Sjbuf)) { /* timed out */ if (!IsTcpIp) { #ifdef USG - ret = ioctl(Ifn, TCSETA, &Savettyb); - + ret = ioctl(0, TCSETA, &Savettyb); #else !USG - ret = ioctl(Ifn, TIOCSETP, &Savettyb); + ret = ioctl(0, TIOCSETP, &Savettyb); #endif !USG } cleanup(0); } for (;;) { ret = imsg(msg, Ifn); - if (ret != SUCCESS) { + if (ret != 0) { alarm(0); if (!IsTcpIp) { #ifdef USG - ret = ioctl(Ifn, TCSETA, &Savettyb); + ret = ioctl(0, TCSETA, &Savettyb); #else !USG - ret = ioctl(Ifn, TIOCSETP, &Savettyb); + ret = ioctl(0, TIOCSETP, &Savettyb); #endif !USG } cleanup(0); } if (msg[0] == 'S') @@ -278,16 +269,14 @@ alarm(0); q = &msg[1]; p = pskip(q); strncpy(Rmtname, q, MAXBASENAME); Rmtname[MAXBASENAME] = '\0'; - - /* - * Now that we know who they are, give the audit file the right - * name. - */ - setdebug (DBG_PERM); + sprintf(wkpre,"%s/%s", RMTDEBUG, Rmtname); + unlink(wkpre); + if (link(file, wkpre) == 0) + unlink(file); DEBUG(4, "sys-%s\n", Rmtname); /* The versys will also do an alias on the incoming name */ if (versys(&Rmtname)) { /* If we don't know them, we won't talk to them... */ #ifdef NOSTRANGERS @@ -302,38 +291,38 @@ * table for the site they claim to be. */ if (IsTcpIp) { struct hostent *hp; char *cpnt, *inet_ntoa(); - int fromlen; + int len; struct sockaddr_in from; extern char PhoneNumber[]; #ifdef NOGETPEER from.sin_addr.s_addr = Hostnumber; from.sin_family = AF_INET; #else !NOGETPEER - fromlen = sizeof(from); - if (getpeername(Ifn, &from, &fromlen) < 0) { + len = sizeof(from); + if (getpeername(0, &from, &len) < 0) { logent(Rmtname, "NOT A TCP CONNECTION"); omsg('R', "NOT TCP", Ofn); cleanup(0); } #endif !NOGETPEER hp = gethostbyaddr(&from.sin_addr, sizeof (struct in_addr), from.sin_family); - if (hp == NULL) { + if (hp == 0) { /* security break or just old host table? */ logent(Rmtname, "UNKNOWN IP-HOST Name ="); cpnt = inet_ntoa(from.sin_addr), logent(cpnt, "UNKNOWN IP-HOST Number ="); sprintf(wkpre, "%s/%s isn't in my host table", Rmtname, cpnt); omsg('R' ,wkpre ,Ofn); cleanup(0); } - if (Debug > 99) + if (Debug>99) logent(Rmtname,"Request from IP-Host name ="); /* * The following is to determine if the name given us by * the Remote uucico matches any of the names * given its network number (remote machine) in our @@ -359,11 +348,11 @@ cleanup(0); } } #endif BSDTCP - if (mlock(Rmtname)) { + if (mlock(Rmtname) == FAIL) { omsg('R', "LCK", Ofn); cleanup(0); } else if (callback(Loginuser)) { signal(SIGINT, SIG_IGN); @@ -380,21 +369,13 @@ seq = 0; while (*p == '-') { q = pskip(p); switch(*(++p)) { case 'x': - if (Debug == 0) { - Debug = atoi(++p); - if (Debug <= 0) - Debug = 1; - setdebug(DBG_PERM); - if (Debug > 0) - logent("Remote Enabled", "DEBUG"); - } else { - DEBUG(1, "Remote debug request ignored\n", - CNULL); - } + Debug = atoi(++p); + if (Debug <= 0) + Debug = 1; break; case 'Q': seq = atoi(++p); break; case 'p': @@ -434,12 +415,19 @@ ulkseq(); #endif GNXSEQ omsg('R', "BADSEQ", Ofn); cleanup(0); } + ttyn = ttyname(Ifn); if (ttyn != NULL) chmod(ttyn, 0600); + } else { /* Role == MASTER */ + struct stat stbuf; + if (isatty(fileno(stderr)) || (fstat(fileno(stderr),&stbuf) == 0 + && stbuf.st_mode&S_IFREG) ) + StdErrIsTty = 1; + setdebug(0); } loop: if(setjmp(Pipebuf)) { /* come here on SIGPIPE */ clsacu(); @@ -448,12 +436,19 @@ Ifn = Ofn = -1; rmlock(CNULL); sleep(3); } if (!onesys) { + struct stat sbuf; + + if (!StdErrIsTty) { + sprintf(file, "%s/%s", RMTDEBUG, Rmtname); + if (stat(file, &sbuf) == 0 && sbuf.st_size == 0) + unlink(file); + } ret = gnsys(Rmtname, Spool, CMDPRE); - setdebug(DBG_PERM); + setdebug(0); if (ret == FAIL) cleanup(100); if (ret == SUCCESS) cleanup(0); } else if (Role == MASTER && callok(Rmtname) != 0) { @@ -509,11 +504,11 @@ } #ifdef TCPIP /* * Determine if we are on TCPIP */ - if (isatty(Ifn) == 0) { + if (isatty(Ifn) == 0) { IsTcpIp = 1; DEBUG(4, "TCPIP connection -- ioctl-s disabled\n", CNULL); } else IsTcpIp = 0; #endif @@ -536,10 +531,15 @@ #ifdef GNXSEQ seq = gnxseq(Rmtname); #else !GNXSEQ seq = 0; #endif !GNXSEQ + if (Debug) + sprintf(rflags, "-x%d", Debug); + else + rflags[0] = '\0'; + if (MaxGrade != '\177') { char buf[MAXFULLNAME]; sprintf(buf, " -p%c -vgrade=%c", MaxGrade, MaxGrade); strcat(rflags, buf); } @@ -591,12 +591,10 @@ DEBUG(1, "Rmtname %s, ", Rmtname); DEBUG(1, "Role %s, ", Role ? "MASTER" : "SLAVE"); DEBUG(1, "Ifn - %d, ", Ifn); DEBUG(1, "Loginuser - %s\n", Loginuser); - ttyn = ttyname(Ifn); - alarm(MAXMSGTIME); if (ret=setjmp(Sjbuf)) goto Failure; ret = startup(Role); alarm(0); @@ -606,18 +604,11 @@ US_SST(us_s_start); systat(Rmtname, SS_FAIL, ret > 0 ? "CONVERSATION FAILED" : "STARTUP FAILED"); goto next; } else { - if (ttyn != NULL) { - char startupmsg[BUFSIZ]; - extern int linebaudrate; - sprintf(startupmsg, "startup %s %d baud", &ttyn[5], - linebaudrate); - logent(startupmsg, "OK"); - } else - logent("startup", "OK"); + logent("startup", "OK"); US_SST(us_s_gress); systat(Rmtname, SS_INPROGRESS, "TALKING"); ret = cntrl(Role, wkpre); DEBUG(1, "cntrl - %d\n", ret); signal(SIGINT, SIG_IGN); @@ -658,20 +649,25 @@ #ifndef USG struct sgttyb Hupvec; #endif -/* - * cleanup and exit with "code" status +/*** + * cleanup(code) cleanup and exit with "code" status + * int code; */ + cleanup(code) register int code; { + register char *ttyn; + char bfr[BUFSIZ]; + struct stat sbuf; + signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); rmlock(CNULL); - sleep(5); /* Wait for any pending output */ clsacu(); logcls(); if (Role == SLAVE) { if (!IsTcpIp) { #ifdef USG @@ -683,20 +679,21 @@ (void) ioctl(0, TIOCCDTR, STBNULL); sleep(2); (void) ioctl(0, TIOCSDTR, STBNULL); #else !TIOCSDTR (void) ioctl(0, TIOCGETP, &Hupvec); +#endif !TIOCSDTR Hupvec.sg_ispeed = B0; Hupvec.sg_ospeed = B0; (void) ioctl(0, TIOCSETP, &Hupvec); -#endif !TIOCSDTR sleep(2); (void) ioctl(0, TIOCSETP, &Savettyb); /* make *sure* exclusive access is off */ (void) ioctl(0, TIOCNXCL, STBNULL); #endif !USG } + ttyn = ttyname(Ifn); if (ttyn != NULL) chmod(ttyn, 0600); } if (Ofn != -1) { if (Role == MASTER) @@ -710,16 +707,20 @@ #endif DIALINOUT if (code == 0) xuuxqt(); else DEBUG(1, "exit code %d\n", code); - setdebug (DBG_CLEAN); + sprintf(bfr, "%s/%s", RMTDEBUG, Rmtname); + if (stat(bfr, &sbuf) == 0 && sbuf.st_size == 0) + unlink(bfr); + sprintf(bfr, "%s/%d", RMTDEBUG, getpid()); + unlink(bfr); exit(code); } -/* - * on interrupt - remove locks and exit +/*** + * onintr(inter) interrupt - remove locks and exit */ onintr(inter) register int inter; { @@ -738,140 +739,76 @@ /* * Catch a special signal * (SIGFPE, ugh), and toggle debugging between 0 and 30. * Handy for looking in on long running uucicos. */ -dbg_signal() -{ - Debug = (Debug == 0) ? 30 : 0; - setdebug(DBG_PERM); - if (Debug > 0) - logent("Signal Enabled", "DEBUG"); -} - - -/* - * Check debugging requests, and open RMTDEBUG audit file if necessary. If an - * audit file is needed, the parm argument indicates how to create the file: - * - * DBG_TEMP - Open a temporary file, with filename = RMTDEBUG/pid. - * DBG_PERM - Open a permanent audit file, filename = RMTDEBUG/Rmtname. - * If a temp file already exists, it is mv'ed to be permanent. - * DBG_CLEAN - Cleanup; unlink temp files. - * - * Restrictions - this code can only cope with one open debug file at a time. - * Each call creates a new file; if an old one of the same name exists it will - * be overwritten. - */ -setdebug(parm) -int parm; -{ - char buf[BUFSIZ]; /* Buffer for building filenames */ - static char *temp = NULL; /* Ptr to temporary file name */ - static int auditopen = 0; /* Set to 1 when we open a file */ - struct stat stbuf; /* File status buffer */ - - /* - * If movement or cleanup of a temp file is indicated, we do it no - * matter what. - */ - if (temp != CNULL && parm == DBG_PERM) { - sprintf(buf, "%s/%s", RMTDEBUG, Rmtname); - unlink(buf); - if (link(temp, buf) != 0) { - Debug = 0; - assert("RMTDEBUG LINK FAIL", temp, errno); - cleanup(1); - } - parm = DBG_CLEAN; - } - if (parm == DBG_CLEAN) { - if (temp != CNULL) { - unlink(temp); - free(temp); - temp = CNULL; - } - return; - } - - if (Debug == 0) - return; /* Gotta be in debug to come here. */ - - /* - * If we haven't opened a file already, we can just return if it's - * alright to use the stderr we came in with. We can if: - * - * Role == MASTER, and Stderr is a regular file, a TTY or a pipe. - * - * Caution: Detecting when stderr is a pipe is tricky, because the 4.2 - * man page for fstat(2) disagrees with reality, and System V leaves it - * undefined, which means different implementations act differently. - */ - if (!auditopen && Role == MASTER) { - if (isatty(fileno(stderr))) - return; - else if (fstat(fileno(stderr), &stbuf) == 0) { -#ifdef USG - /* Is Regular File or Fifo */ - if ((stbuf.st_mode & 0060000) == 0) - return; -#else !USG -#ifdef BSD4_2 - /* Is Regular File */ - if ((stbuf.st_mode & S_IFMT) == S_IFREG || - stbuf.st_mode == 0) /* Is a pipe */ - return; -#else !BSD4_2 - /* Is Regular File or Pipe */ - if ((stbuf.st_mode & S_IFMT) == S_IFREG) - return; -#endif BSD4_2 -#endif USG - } - } - - /* - * We need RMTDEBUG directory to do auditing. If the file doesn't exist, - * then we forget about debugging; if it exists but has improper owner- - * ship or modes, we gripe about it in ERRLOG. - */ - if (stat(RMTDEBUG, &stbuf) != SUCCESS) { - Debug = 0; - return; - } - if ((geteuid() != stbuf.st_uid) || /* We must own it */ - ((stbuf.st_mode & 0170700) != 040700)) { /* Directory, rwx */ - Debug = 0; - assert("INVALID RMTDEBUG DIRECTORY:", RMTDEBUG, stbuf.st_mode); - return; - } - - if (parm == DBG_TEMP) { - sprintf(buf, "%s/%d", RMTDEBUG, getpid()); - temp = malloc(strlen (buf) + 1); - if (temp == CNULL) { - Debug = 0; - assert("RMTDEBUG MALLOC ERROR:", temp, errno); - cleanup(1); - } - strcpy(temp, buf); - } else - sprintf(buf, "%s/%s", RMTDEBUG, Rmtname); - - unlink(buf); - if (freopen(buf, "w", stderr) != stderr) { - Debug = 0; - assert("FAILED RMTDEBUG FILE OPEN:", buf, errno); - cleanup(1); - } - setbuf(stderr, CNULL); - auditopen = 1; -} - -/* - * catch SIGALRM routine - */ +setdebug(code) +int code; +{ + char buf[BUFSIZ]; + + if (code) { + if (Debug == 0) + Debug = 30; + else + Debug = 0; + } + if (Debug && !StdErrIsTty) { + sprintf(buf,"%s/%s", RMTDEBUG, Rmtname); + unlink(buf); + freopen(buf, "w", stderr); +#ifdef BSD4_2 + setlinebuf(stderr); +#else !BSD4_2 + setbuf(stderr, NULL); +#endif !BSD4_2 + } +} + + +/*** + * fixmode(tty) fix kill/echo/raw on line + * + * return codes: none + */ + +fixmode(tty) +register int tty; +{ +#ifdef USG + struct termio ttbuf; +#endif +#ifndef USG + struct sgttyb ttbuf; +#endif + + if (IsTcpIp) + return; +#ifdef USG + ioctl(tty, TCGETA, &ttbuf); + ttbuf.c_iflag = ttbuf.c_oflag = ttbuf.c_lflag = (ushort)0; + ttbuf.c_cflag &= (CBAUD); + ttbuf.c_cflag |= (CS8|CREAD); + ttbuf.c_cc[VMIN] = 6; + ttbuf.c_cc[VTIME] = 1; + ioctl(tty, TCSETA, &ttbuf); +#endif +#ifndef USG + ioctl(tty, TIOCGETP, &ttbuf); + ttbuf.sg_flags = (ANYP | RAW); + ioctl(tty, TIOCSETP, &ttbuf); +#endif +#ifndef USG + ioctl(tty, TIOCEXCL, STBNULL); +#endif +} + + +/* + * timeout() catch SIGALRM routine + */ + timeout() { extern int HaveSentHup; if (!HaveSentHup) { logent(Rmtname, "TIMEOUT"); Index: usr.bin/uucp/uucico/condevs.c ================================================================== --- usr.bin/uucp/uucico/condevs.c +++ usr.bin/uucp/uucico/condevs.c @@ -1,12 +1,9 @@ #ifndef lint -static char sccsid[] = "@(#)condevs.c 5.13 (Berkeley) 01/06/86"; +static char sccsid[] = "@(#)condevs.c 5.12 (Berkeley) 10/09/85"; #endif -extern int errno; -extern char *sys_errlist[]; - /* * Here are various dialers to establish the machine-machine connection. * conn.c/condevs.c was glued together by Mike Mitchell. * The dialers were supplied by many people, to whom we are grateful. * @@ -180,20 +177,18 @@ return CF_NODEV; } sprintf(dcname, "/dev/%s", dev.D_line); if (setjmp(Sjbuf)) { - DEBUG(4, "Open timed out\n", CNULL); delock(dev.D_line); return CF_DIAL; } signal(SIGALRM, alarmtr); - /* For PC Pursuit, it could take a while to call back */ - alarm( strcmp(flds[F_LINE], "PCP") ? 10 : MAXMSGTIME*4 ); + alarm(10); getnextfd(); errno = 0; - DEBUG(4,"Opening %s\n",dcname); + DEBUG(4,"Opening %s",dcname); dcr = open(dcname, 2); /* read/write */ #ifdef VMSDTR /* Modem control on vms(works dtr) */ fflush(stdout); if (modem_control) { /* Did we have MOD in the device type field ? */ /* Sense the current terminal setup and save it */ @@ -213,23 +208,20 @@ return CF_DIAL; } } #endif VMSDTR next_fd = -1; + if (dcr < 0 && errno == EACCES) + logent(dcname, "CAN'T OPEN"); alarm(0); if (dcr < 0) { - if (errno == EACCES) - logent(dev.D_line, "CANT OPEN"); - DEBUG(4, "OPEN FAILED: errno %d\n", errno); delock(dev.D_line); return CF_DIAL; } fflush(stdout); - if (fixline(dcr, dev.D_speed) == FAIL) { - DEBUG(4, "FIXLINE FAILED\n", CNULL); + if (fixline(dcr, dev.D_speed) == FAIL) return CF_DIAL; - } strcpy(devSel, dev.D_line); /* for latter unlock */ CU_end = dircls; return dcr; } @@ -345,10 +337,11 @@ if (acustatus == 1) logent("DEVICE", "NO"); return retval; } +#if defined(VENTEL) || defined(NOVATION) || defined(DF112) /* * intervaldelay: delay execution for numerator/denominator seconds. */ #ifdef INTERVALTIMER @@ -406,64 +399,17 @@ register char *str; { DEBUG(6, "slowrite ", CNULL); while (*str) { DEBUG(6, "%c", *str); - uucpdelay(1, 10); /* delay 1/10 second */ + uucpdelay(1,10); /* delay 1/10 second */ write(fd, str, 1); str++; } DEBUG(6, "\n", CNULL); } - -#define BSPEED B150 - -/* - * send a break - */ -genbrk(fn, bnulls) -register int fn, bnulls; -{ -#ifdef USG - if (ioctl(fn, TCSBRK, STBNULL) < 0) - DEBUG(5, "break TCSBRK %s\n", sys_errlist[errno]); -#else !USG -# ifdef TIOCSBRK - if (ioctl(fn, TIOCSBRK, STBNULL) < 0) - DEBUG(5, "break TIOCSBRK %s\n", sys_errlist[errno]); -# ifdef TIOCCBRK - uucpdelay(bnulls, 10); - if (ioctl(fn, TIOCCBRK, STBNULL) < 0) - DEBUG(5, "break TIOCCBRK %s\n", sys_errlist[errno]); -# endif TIOCCBRK - DEBUG(4, "ioctl %f second break\n", (float) bnulls/10 ); -# else !TIOCSBRK - struct sgttyb ttbuf; - register int sospeed; - - if (ioctl(fn, TIOCGETP, &ttbuf) < 0) - DEBUG(5, "break TIOCGETP %s\n", sys_errlist[errno]); - sospeed = ttbuf.sg_ospeed; - ttbuf.sg_ospeed = BSPEED; - if (ioctl(fn, TIOCSETP, &ttbuf) < 0) - DEBUG(5, "break TIOCSETP %s\n", sys_errlist[errno]); - if (write(fn, "\0\0\0\0\0\0\0\0\0\0\0\0", bnulls) != bnulls) { -badbreak: - logent(sys_errlist[errno], "BAD WRITE genbrk"); - alarm(0); - longjmp(Sjbuf, 3); - } - ttbuf.sg_ospeed = sospeed; - if (ioctl(fn, TIOCSETP, &ttbuf) < 0) - DEBUG(5, "break ioctl %s\n", sys_errlist[errno]); - if (write(fn, "@", 1) != 1) - goto badbreak; - DEBUG(4, "sent BREAK nulls - %d\n", bnulls); -#endif !TIOCSBRK -#endif !USG -} - +#endif VENTEL || NOVATION || DF112 #ifdef DIALINOUT /* DIALIN/OUT CODE (WLS) */ /* * disable and reenable: allow a single line to be use for dialin/dialout Index: usr.bin/uucp/uucico/conn.c ================================================================== --- usr.bin/uucp/uucico/conn.c +++ usr.bin/uucp/uucico/conn.c @@ -1,7 +1,7 @@ #ifndef lint -static char sccsid[] = "@(#)conn.c 5.9 (Berkeley) 01/06/86"; +static char sccsid[] = "@(#)conn.c 5.8 (Berkeley) 11/22/85"; #endif #include #include "uucp.h" #include @@ -38,12 +38,11 @@ char *AbortOn = NULL; char par_tab[128]; /* must be power of two */ int linebaudrate; /* used for the sleep test in pk1.c */ int next_fd = -1; /* predicted fd to close interrupted opens */ - -char *PCP = "PCP"; /* PC Pursuit device type */ + /* rti!trt, courtesy unc!smb */ /* * catch alarm routine for "expect". */ alarmtr() { @@ -54,41 +53,10 @@ next_fd = -1; } longjmp(Sjbuf, 1); } -/* This template is for seismo to call ihnp4 - * the 3 lines marked ---> will be overwritten for the appropriate city - */ -#define PCP_BAUD 3 -#define PCP_PHONE 4 -#define PCP_CALLBACK 8 -#define PCP_CITY 10 -#define PCP_RPHONE 12 -#define NPCFIELDS 15 - -static char *PCFlds[] = { - "PC-PURSUIT", - "Any", - "ACU", - "1200", - CNULL, /* <--- **** Welcome to Telenet PC Pursuit ***** */ - "ABORT", - "Good", /* Abort of Good bye! */ - ")", /* <--- Enter your 7-digit phone number (xxx-xxxx) */ - CNULL, /* ---> 528-1234 */ - "call?", /* <--- Which city do you wish to call? */ - CNULL, /* ---> CHICAGO */ - ")", /* <--- Enter the phone number you wish to call (xxx-xxxx) */ - CNULL, /* ---> 690-7171 */ - "R)?", /* <--- You are #1 in the queue. Do you want to wait, or Restart (Y/N/R)? */ - "Y", - CNULL /* <--- .....Good Bye! */ -}; - -static char PCP_brand[20]; - /* * place a telephone call to system and login, etc. * * return codes: * CF_SYSTEM: don't know system @@ -105,11 +73,12 @@ extern int LocalOnly; conn(system) char *system; { - int nf; + int ret, nf; + register int fn = 0; char info[MAXC], wkpre[NAMESIZE], file[NAMESIZE]; register FILE *fsys; int fcode = 0; nf = 0; @@ -121,94 +90,44 @@ keeplooking: while((nf = finds(fsys, system, info, Flds)) > 0) { if (LocalOnly) { if (strcmp("TCP", Flds[F_LINE]) && strcmp("DIR", Flds[F_LINE]) - && strcmp("LOCAL", Flds[F_LINE]) ) { - fcode = CF_TIME; - continue; - } + && strcmp("LOCAL", Flds[F_LINE]) ) + fn = CF_TIME; } sprintf(wkpre, "%c.%.*s", CMDPRE, SYSNSIZE, Rmtname); if (!onesys && MaxGrade != DefMaxGrade && - !iswrk(file, "chk", Spool, wkpre)) { - fcode = CF_TIME; - continue; - } - /* For GTE's PC Pursuit */ - if (snccmp(Flds[F_LINE], PCP) == SAME) { - FILE *dfp; - int status; - static struct Devices dev; - dfp = fopen(DEVFILE, "r"); - ASSERT(dfp != NULL, "Can't open", DEVFILE, 0); - while ((status=rddev(dfp, &dev)) != FAIL - && strcmp(PCP, dev.D_type) != SAME) - ; - fclose(dfp); - if (status == FAIL) - continue; - if (mlock(PCP) == FAIL) { - fcode = CF_NODEV; - logent("DEVICE", "NO"); - continue; - } - PCFlds[PCP_BAUD] = dev.D_class; - PCFlds[PCP_PHONE] = dev.D_calldev; - PCFlds[PCP_CALLBACK] = dev.D_arg[D_CHAT]; - PCFlds[PCP_CITY] = Flds[F_CLASS]; - PCFlds[PCP_RPHONE] = Flds[F_PHONE]; - strncpy(PCP_brand, dev.D_brand, sizeof(PCP_brand)); - if ((fcode = getto(PCFlds)) < 0) - continue; - Dcf = fcode; - fcode = login(NPCFIELDS, PCFlds, Dcf); - clsacu(); /* Hang up, they'll call back */ - if (fcode != SUCCESS) { - fcode = CF_DIAL; - continue; - } - Flds[F_CLASS] = dev.D_class; - Flds[F_PHONE] = dev.D_line; - - } /* end PC Pursuit */ - if ((fcode = getto(Flds)) > 0) + !iswrk(file, "chk", Spool, wkpre)) + fn = CF_TIME; + if (fn != CF_TIME && (fn = getto(Flds)) > 0) { + Dcf = fn; break; + } + fcode = (fn == FAIL ? CF_DIAL : fn); } if (nf <= 0) { fclose(fsys); return fcode ? fcode : nf; } - Dcf = fcode; - - if (fcode >= 0 && snccmp(Flds[F_LINE], PCP) == SAME) { - AbortOn = "Good"; /* .... Good Bye */ - fcode = expect("****~300", Dcf); - if (fcode != SUCCESS) { - DEBUG(4, "\nexpect timed out\n", CNULL); - fcode = CF_DIAL; - } - } - if (fcode >= 0) { - DEBUG(4, "login %s\n", "called"); - fcode = login(nf, Flds, Dcf); - } - if (fcode < 0) { + DEBUG(4, "login %s\n", "called"); + ret = login(nf, Flds, fn); + if (ret != SUCCESS) { clsacu(); - if (fcode == ABORT) { + if (ret == ABORT) { fcode = CF_DIAL; goto keeplooking; } else { fclose(fsys); return CF_LOGIN; } } fclose(fsys); - fioclex(Dcf); - return Dcf; + fioclex(fn); + return fn; } /* * connect to remote machine * @@ -234,27 +153,17 @@ #ifdef DIALINOUT if (snccmp(line, "ACU") != SAME) reenable(); #endif DIALINOUT CU_end = nulldev; - if (snccmp(line, PCP) == SAME) { - for(cd = condevs; cd->CU_meth != NULL; cd++) { - if (snccmp(PCP_brand, cd->CU_brand) == SAME) { - CU_end = cd->CU_clos; - return diropn(flds); - } - } - logent(PCP_brand, "UNSUPPORTED ACU TYPE"); - } else { - for (cd = condevs; cd->CU_meth != NULL; cd++) { - if (snccmp(cd->CU_meth, line) == SAME) { - DEBUG(4, "Using %s to call\n", cd->CU_meth); - return (*(cd->CU_gen))(flds); - } - } - DEBUG(1, "Can't find %s, assuming DIR\n", flds[F_LINE]); - } + for (cd = condevs; cd->CU_meth != NULL; cd++) { + if (snccmp(cd->CU_meth, line) == SAME) { + DEBUG(4, "Using %s to call\n", cd->CU_meth); + return (*(cd->CU_gen))(flds); + } + } + DEBUG(1, "Can't find %s, assuming DIR\n", flds[F_LINE]); return diropn(flds); /* search failed, so use direct */ } /* * close call unit @@ -269,11 +178,11 @@ * Otherwise dual call-in/call-out modems could get stuck. * Unfortunately, doing this here is not ideal, but it is the * easiest place to put the call. * Hopefully everyone honors the LCK protocol, of course */ -#ifdef TIOCNXCL +#ifndef USG if (!IsTcpIp && Dcf >= 0 && ioctl(Dcf, TIOCNXCL, STBNULL) < 0) DEBUG(5, "clsacu ioctl %s\n", sys_errlist[errno]); #endif if (setjmp(Sjbuf)) logent(Rmtname, "CLOSE TIMEOUT"); @@ -425,11 +334,11 @@ if (strcmp(want, "ABORT") == 0) { AbortOn = flds[k+1]; DEBUG(4, "ABORT ON: %s\n", AbortOn); goto nextfield; } - DEBUG(4, "wanted \"%s\"\n", want); + DEBUG(4, "wanted: %s\n", want); ok = expect(want, fn); DEBUG(4, "got: %s\n", ok ? "?" : "that"); if (ok == FAIL) { if (altern == NULL) { logent("LOGIN", _FAILED); @@ -560,11 +469,11 @@ #endif linebaudrate = spwant; return SUCCESS; } -/* +/*** * getbaud(tty) set linebaudrate variable * * return codes: none */ @@ -647,11 +556,10 @@ return FAIL; signal(SIGALRM, alarmtr); alarm(timo); *rp = 0; while (notin(str, rdvec)) { - int c; if(AbortOn != NULL && !notin(AbortOn, rdvec)) { DEBUG(1, "Call aborted on '%s'\n", AbortOn); alarm(0); return ABORT; } @@ -660,15 +568,19 @@ alarm(0); DEBUG(4, "lost line kr - %d\n, ", kr); logent("LOGIN", "LOST LINE"); return FAIL; } + { + int c; c = nextch & 0177; - if (c == '\0') - continue; - DEBUG(4, (isprint(c) || isspace(c)) ? "%c" : "\\%03o", c); - *rp++ = c; + DEBUG(4, c >= 040 ? "%c" : "\\%03o", c); + if (c == '\n') + DEBUG(4,"\n", CNULL); + } + if ((*rp = nextch & 0177) != '\0') + rp++; if (rp >= rdvec + MR) { register char *p; for (p = rdvec+MR/2; p < rp; p++) *(p-MR/2) = *p; rp -= MR/2; @@ -703,11 +615,11 @@ register char *strptr; int i, n, cr = 1; register char c; static int p_init = 0; - DEBUG(5, "send \"%s\"\n", str); + DEBUG(5, "send %s\n", str); if (!p_init) { p_init++; bld_partab(P_EVEN); } @@ -734,20 +646,16 @@ p_chwrite(fn, '\04'); return; } /* Send a '\n' */ - if (strcmp(str, "LF") == SAME) { - p_chwrite(fn, '\n'); - return; - } + if (strcmp(str, "LF") == SAME) + str = "\\n\\c"; /* Send a '\r' */ - if (strcmp(str, "CR") == SAME) { - p_chwrite(fn, '\r'); - return; - } + if (strcmp(str, "CR") == SAME) + str = "\\r\\c"; /* Set parity as needed */ if (strcmp(str, "P_ZERO") == SAME) { bld_partab(P_ZERO); return; @@ -769,33 +677,24 @@ if (strcmp(str, "\"\"") == SAME) { p_chwrite(fn, '\r'); return; } - strptr = str; - while ((c = *strptr++) != '\0') { + for (strptr = str; c = *strptr++;) { if (c == '\\') { switch(*strptr++) { - case '\0': - DEBUG(5, "TRAILING BACKSLASH IGNORED\n", CNULL); - --strptr; - continue; case 's': DEBUG(5, "BLANK\n", CNULL); - c = ' '; + p_chwrite(fn, ' '); break; case 'd': DEBUG(5, "DELAY\n", CNULL); sleep(1); continue; - case 'n': - DEBUG(5, "NEW LINE\n", CNULL); - c = '\n'; - break; case 'r': DEBUG(5, "RETURN\n", CNULL); - c = '\r'; + p_chwrite(fn, '\r'); break; case 'b': if (isdigit(*strptr)) { i = (*strptr++ - '0'); if (i <= 0 || i > 10) @@ -809,28 +708,28 @@ continue; case 'c': if (*strptr == '\0') { DEBUG(5, "NO CR\n", CNULL); cr = 0; - } else - DEBUG(5, "NO CR - IGNORED NOT EOL\n", CNULL); + continue; + } + DEBUG(5, "NO CR - MIDDLE IGNORED\n", CNULL); continue; -#define isoctal(x) ((x >= '0') && (x <= '7')) default: - if (isoctal(strptr[-1])) { + if (isdigit(*strptr)) { i = 0; n = 0; - --strptr; - while (isoctal(*strptr) && ++n <= 3) - i = i * 8 + (*strptr++ - '0'); - DEBUG(5, "\\%o\n", i); + while (isdigit(*strptr) && ++n <= 3) + i = i*8 + (*strptr++ - '0'); p_chwrite(fn, (char)i); continue; } + DEBUG(5, "BACKSLASH\n", CNULL); + --strptr; } - } - p_chwrite(fn, c); + } else + p_chwrite(fn, c); } if (cr) p_chwrite(fn, '\r'); return; @@ -864,10 +763,57 @@ || (type == P_EVEN && (n&01) != 0) || (type == P_ODD && (n&01) == 0)) par_tab[i] |= sizeof(par_tab); } } + +#define BSPEED B150 + +/* + * send a break + */ +genbrk(fn, bnulls) +register int fn, bnulls; +{ +#ifdef USG + if (ioctl(fn, TCSBRK, STBNULL) < 0) + DEBUG(5, "break ioctl %s\n", sys_errlist[errno]); +#else !USG + struct sgttyb ttbuf; + register int sospeed; +# ifdef TIOCSBRK + if (ioctl(fn, TIOCSBRK, STBNULL) < 0) + DEBUG(5, "break ioctl %s\n", sys_errlist[errno]); +# ifdef TIOCCBRK + sleep(1); + if (ioctl(fn, TIOCCBRK, STBNULL) < 0) + DEBUG(5, "break ioctl %s\n", sys_errlist[errno]); +# endif TIOCCBRK + DEBUG(4, "ioctl %d second break\n", bnulls ); +# else !TIOCSBRK + + if (ioctl(fn, TIOCGETP, &ttbuf) < 0) + DEBUG(5, "break ioctl %s\n", sys_errlist[errno]); + sospeed = ttbuf.sg_ospeed; + ttbuf.sg_ospeed = BSPEED; + if (ioctl(fn, TIOCSETP, &ttbuf) < 0) + DEBUG(5, "break ioctl %s\n", sys_errlist[errno]); + if (write(fn, "\0\0\0\0\0\0\0\0\0\0\0\0", bnulls) != bnulls) { +badbreak: + logent(sys_errlist[errno], "BAD WRITE genbrk"); + alarm(0); + longjmp(Sjbuf, 3); + } + ttbuf.sg_ospeed = sospeed; + if (ioctl(fn, TIOCSETP, &ttbuf) < 0) + DEBUG(5, "break ioctl %s\n", sys_errlist[errno]); + if (write(fn, "@", 1) != 1) + goto badbreak; + DEBUG(4, "sent BREAK nulls - %d\n", bnulls); +#endif !TIOCSBRK +#endif !USG +} /* * check for occurrence of substring "sh" * * return codes: @@ -890,11 +836,11 @@ * Allow multiple date specifications separated by ','. */ ifdate(p) register char *p; { - register char *np; + register char *np, c; register int ret, g; int rtime, i; /* pick up retry time for failures */ /* global variable Retrytime is set here */ @@ -983,16 +929,10 @@ || tp->tm_hour >= 23 || tp->tm_hour < 8 /* Sunday before 5pm */ || (tp->tm_wday == 0 && tp->tm_hour < 17)) dayok = 1; } - if (prefix("NonPeak", s)) { /* For Tymnet and PC Pursuit */ - /* Sat or Sun */ - if (tp->tm_wday == 6 || tp->tm_wday == 0 - || tp->tm_hour >= 18 || tp->tm_hour < 7) - dayok = 1; - } s++; } if (dayok == 0 && s != string) return FAIL; @@ -1136,49 +1076,5 @@ */ if (i == 0 && (dev->D_numargs&01)) sleep(2); return(i); } - -/* - * fix kill/echo/raw on line - * - * return codes: none - */ -fixmode(tty) -register int tty; -{ -#ifdef USG - struct termio ttbuf; -#else !USG - struct sgttyb ttbuf; -#endif !USG - register struct sg_spds *ps; - int speed; - - if (IsTcpIp) - return; -#ifdef USG - ioctl(tty, TCGETA, &ttbuf); - ttbuf.c_iflag = ttbuf.c_oflag = ttbuf.c_lflag = (ushort)0; - speed = ttbuf.c_cflag &= (CBAUD); - ttbuf.c_cflag |= (CS8|CREAD); - ttbuf.c_cc[VMIN] = 6; - ttbuf.c_cc[VTIME] = 1; - ioctl(tty, TCSETA, &ttbuf); -#else !USG - ioctl(tty, TIOCGETP, &ttbuf); - ttbuf.sg_flags = (ANYP | RAW); - ioctl(tty, TIOCSETP, &ttbuf); - speed = ttbuf.sg_ispeed; - ioctl(tty, TIOCEXCL, STBNULL); -#endif !USG - - for (ps = spds; ps->sp_val; ps++) - if (ps->sp_name == speed) { - linebaudrate = ps->sp_val; - DEBUG(9,"Incoming baudrate is %d\n", linebaudrate); - return; - } - ASSERT(linebaudrate >= 0, "BAD SPEED", CNULL, speed); -} - Index: usr.bin/uucp/uucico/imsg.c ================================================================== --- usr.bin/uucp/uucico/imsg.c +++ usr.bin/uucp/uucico/imsg.c @@ -1,11 +1,10 @@ #ifndef lint -static char sccsid[] = "@(#)imsg.c 5.3 (Berkeley) 01/06/86"; +static char sccsid[] = "@(#)imsg.c 5.2 (Berkeley) 01/22/85"; #endif #include "uucp.h" -#include char Msync[2] = "\020"; /* to talk to both eunice and x.25 without also screwing up tcp/ip * we must adaptively choose what character to end the msg with @@ -21,53 +20,57 @@ /* * this is the initial read message routine - * used before a protocol is agreed upon. * * return codes: - * FAIL - no more messages - * SUCCESS - message returned + * EOF - no more messages + * 0 - message returned */ -imsg(amsg, fn) -char *amsg; +imsg(msg, fn) +register char *msg; register int fn; { - register char *msg = amsg; - int foundsync = FAIL; - char c; - - DEBUG(5, "imsg looking for SYNC<", CNULL); - for (;;) { - if (read(fn, &c, 1) != 1) - return FAIL; - c &= 0177; - if (c == '\n' || c == '\r') - DEBUG(5, "%c", c); - else - DEBUG(5, (isprint(c) || isspace(c)) ? "%c" : "\\%o", - c & 0377); - if (c == Msync[0]) { - DEBUG(5, ">\nimsg input<", CNULL); + register int ret; + char *amsg; + + DEBUG(5, "imsg %s<", "sync"); + while ((ret = read(fn, msg, 1)) == 1) { + *msg &= 0177; + DEBUG(5, (*msg>037 && *msg<0177) ? "%c" : "\\%03o", *msg & 0377); + if (*msg == Msync[0]) + break; + fflush(stderr); + } + DEBUG(5, ">got %s\n", ret == 1 ? "it" : "EOF"); + if (ret < 1) + return EOF; + amsg = msg; +resync: + DEBUG(5, "imsg %s<", "input"); + while (read(fn, msg, 1) == 1) { + *msg &= 0177; + DEBUG(5, (*msg>037 && *msg<0177) ? "%c" : "\\%03o", *msg & 0377); + if (*msg == Msync[0]) { + DEBUG(5, "%s\n", ">found sync"); msg = amsg; - foundsync = SUCCESS; - continue; - } else if (foundsync != SUCCESS) - continue; - if (c == '\n' || c == '\0') { + goto resync; + } + if (*msg == '\n' || *msg == '\0') { if (!seenend) { - Mend = c; + Mend = *msg; seenend++; - DEBUG(9, "\nUsing \\%o as End of message char\n", Mend); + DEBUG(6,"\nUsing \\%o as End of message char\n", Mend); } break; } - *msg++ = c; + msg++; fflush(stderr); } *msg = '\0'; - DEBUG(5, ">got %d characters\n", strlen(amsg)); - return foundsync; + DEBUG(5, ">got %d\n", strlen(amsg)); + return 0; } /* * this is the initial write message routine - Index: usr.bin/uucp/uucico/pk.h ================================================================== --- usr.bin/uucp/uucico/pk.h +++ usr.bin/uucp/uucico/pk.h @@ -1,20 +1,18 @@ -/* pk.h 5.4 86/01/06 */ +/* pk.h 5.3 85/04/10 */ struct header { char sync; char ksize; unsigned short sum; char cntl; char ccntl; }; -#define HDRSIZ 6 /* Packet header size */ -#define PACKSIZE 64 /* Standard packet size */ -#define WINDOWS 3 - -#define TAILSIZE 2 /* Number of trailing nulls after packet */ +#define HDRSIZ 6 +#define PACKSIZE 64 +#define WINDOWS 3 struct pack { short p_state; /* line state */ short p_bits; /* mask for getepack */ short p_rsize; /* input packet size */ @@ -50,17 +48,20 @@ }; #define CHECK 0125252 #define SYN 020 #define MOD8 7 +#define PKASSERT(e, s1, s2, i1) if (!(e)) {assert(s1, s2, i1);pkfail();} else #define ISCNTL(a) ((a & 0300)==0) /* MIN may have been defined in */ #undef MIN #define MIN(a,b) ((ap_pr]; @@ -285,12 +281,10 @@ if (pk->p_state&DOWN || !pk->p_state&LIVE) { return -1; } - pktimeout = PKTIME; - Ntimeout = 0; count = icount; do { while (pk->p_xcount>=pk->p_swindow) { pkoutput(pk); pkgetpack(pk); Index: usr.bin/uucp/uucico/pk1.c ================================================================== --- usr.bin/uucp/uucico/pk1.c +++ usr.bin/uucp/uucico/pk1.c @@ -1,7 +1,7 @@ #ifndef lint -static char sccsid[] = "@(#)pk1.c 5.7 (Berkeley) 01/06/86"; +static char sccsid[] = "@(#)pk1.c 5.6 (Berkeley) 10/09/85"; #endif #include #include "uucp.h" #include "pk.h" @@ -16,23 +16,22 @@ #include int iomask[2]; #endif VMS #define PKMAXSTMSG 40 -#define MAXPKTIME 32 /* was 16 */ +#define PKTIME 25 #define CONNODATA 10 -#define MAXTIMEOUT 32 +#define NTIMEOUT 10 extern int errno; extern int Retries; extern char *sys_errlist[]; extern jmp_buf Sjbuf; extern char *malloc(); int Connodata = 0; int Ntimeout = 0; -int pktimeout = 4; /* * packet driver support routines * */ @@ -48,10 +47,12 @@ { register struct pack *pk; register char **bp; register int i; + if (++pkactive >= NPLINES) + return NULL; if ((pk = (struct pack *) malloc(sizeof (struct pack))) == NULL) return NULL; bzero((caddr_t) pk, sizeof (struct pack)); pk->p_ifn = ifn; pk->p_ofn = ofn; @@ -62,14 +63,12 @@ if ((bp = (char **) malloc((unsigned)pk->p_xsize)) == NULL) break; *bp = (char *) pk->p_ipool; pk->p_ipool = bp; } - if (i == 0) { - DEBUG(1, "pkopen: can't malloc i = 0\n", CNULL); + if (i == 0) return NULL; - } pk->p_rwindow = i; /* start synchronization */ pk->p_msg = pk->p_rmsg = M_INITA; for (i = 0; i < NPLINES; i++) { @@ -76,25 +75,21 @@ if (pklines[i] == NULL) { pklines[i] = pk; break; } } - if (i >= NPLINES) { - DEBUG(1,"pkopen: i>=NPLINES\n", CNULL); + if (i >= NPLINES) return NULL; - } pkoutput(pk); for (i = 0; i < PKMAXSTMSG; i++) { pkgetpack(pk); if ((pk->p_state & LIVE) != 0) break; } - if (i >= PKMAXSTMSG) { - DEBUG(1, "pkopen: i>= PKMAXSTMSG\n", CNULL); + if (i >= PKMAXSTMSG) return NULL; - } pkreset(pk); return pk; } @@ -116,27 +111,29 @@ int pksizes[] = { 1, 32, 64, 128, 256, 512, 1024, 2048, 4096, 1 }; -#define GETRIES 10 +#define GETRIES 5 /* * Pseudo-dma byte collection. */ -pkgetpack(pk) -register struct pack *pk; +pkgetpack(ipk) +struct pack *ipk; { int k, tries, noise; register char *p; + register struct pack *pk; register struct header *h; unsigned short sum; int ifn; char **bp; char hdchk; - if ((pk->p_state & DOWN) || Connodata > CONNODATA || Ntimeout > MAXTIMEOUT) + pk = ipk; + if ((pk->p_state & DOWN) || Connodata > CONNODATA || Ntimeout > NTIMEOUT) pkfail(); ifn = pk->p_ifn; /* find HEADER */ for (tries = 0, noise = 0; tries < GETRIES; ) { @@ -143,15 +140,14 @@ p = (caddr_t) &pk->p_ihbuf; if (pkcget(ifn, p, 1) == SUCCESS) { if (*p++ == SYN) { if (pkcget(ifn, p, HDRSIZ-1) == SUCCESS) break; - } else { - if (noise++ < 10 || noise < (3*pk->p_rsize)) + } else + if (noise++ < (3*pk->p_rsize)) continue; - } - DEBUG(4, "Noisy line - set up RXMIT\n", CNULL); + DEBUG(4, "Noisy line - set up RXMIT", ""); noise = 0; } /* set up retransmit or REJ */ tries++; Retries++; @@ -159,18 +155,24 @@ if (pk->p_msg == 0) pk->p_msg |= M_RR; if ((pk->p_state & LIVE) == LIVE) pk->p_state |= RXMIT; pkoutput(pk); + + if (*p != SYN) + continue; + p++; + if (pkcget(ifn, p, HDRSIZ - 1) == SUCCESS) + break; } if (tries >= GETRIES) { DEBUG(4, "tries = %d\n", tries); pkfail(); } Connodata++; - h = (struct header *) &pk->p_ihbuf; + h = (struct header * ) &pk->p_ihbuf; p = (caddr_t) h; hdchk = p[1] ^ p[2] ^ p[3] ^ p[4]; p += 2; sum = (unsigned) *p++ & 0377; sum |= (unsigned) *p << 8; @@ -195,22 +197,23 @@ return; } if (k && pksizes[k] == pk->p_rsize) { pk->p_rpr = h->cntl & MOD8; pksack(pk); + Connodata = 0; bp = pk->p_ipool; if (bp == NULL) { DEBUG(7, "bp NULL %s\n", ""); return; } pk->p_ipool = (char **) *bp; - Connodata = 0; - } else + } else { return; - + } if (pkcget(pk->p_ifn, (char *) bp, pk->p_rsize) == SUCCESS) pkdata(h->cntl, h->sum, pk, (char **) bp); + Ntimeout = 0; } pkdata(c, sum, pk, bp) char c; unsigned short sum; @@ -241,10 +244,12 @@ pk->p_imap |= m; pk->p_is[x] = c; pk->p_isum[x] = sum; pk->p_ib[x] = (char *)bp; } + + /* * setup input transfers */ #define PKMAXBUF 128 @@ -267,11 +272,12 @@ p = (caddr_t) &pk->p_ohbuf; *p++ = SYN; if (x < 0) { *p++ = hdchk = 9; checkword = cntl; - } else { + } + else { *p++ = hdchk = pk->p_lpsize; checkword = pk->p_osum[x] ^ (unsigned)(cntl & 0377); } checkword = CHECK - checkword; *p = checkword; @@ -288,23 +294,19 @@ if(write(pk->p_ofn, p, HDRSIZ) != HDRSIZ) { alarm(0); logent("PKXSTART write failed", sys_errlist[errno]); longjmp(Sjbuf, 4); } - } else { - char buf[PKMAXBUF + HDRSIZ + TAILSIZE], *b; + } + else { + char buf[PKMAXBUF + HDRSIZ], *b; int i; for (i = 0, b = buf; i < HDRSIZ; i++) *b++ = *p++; for (i = 0, p = pk->p_ob[x]; i < pk->p_xsize; i++) *b++ = *p++; -#if TAILSIZE != 0 - for (i = 0; i < TAILSIZE; i++) - *b++ = '\0'; -#endif TAILSIZE - if (write(pk->p_ofn, buf, pk->p_xsize + HDRSIZ + TAILSIZE) - != (HDRSIZ + TAILSIZE + pk->p_xsize)) { + if (write(pk->p_ofn, buf, pk->p_xsize + HDRSIZ) != (HDRSIZ + pk->p_xsize)) { alarm(0); logent("PKXSTART write failed", sys_errlist[errno]); longjmp(Sjbuf, 5); } Connodata = 0; @@ -331,12 +333,15 @@ for (i = 0; i < count; i++) *d++ = *s++; } -/* - * get n characters from input +/*** + * pkcget(fn, b, n) get n characters from input + * char *b; - buffer for characters + * int fn; - file descriptor + * int n; - requested number of characters * * return codes: * n - number of characters returned * 0 - end of file */ @@ -347,12 +352,12 @@ longjmp(Getjbuf, 1); } pkcget(fn, b, n) int fn; -register char *b; register int n; +register char *b; { register int ret; extern int linebaudrate; #ifdef BSD4_2 long r, itime = 100000L; /* guess it's been 1/10th second since we @@ -364,19 +369,16 @@ int SYS$QioW(); /* use this for long reads on vms */ #endif VMS if (setjmp(Getjbuf)) { Ntimeout++; - pktimeout += 2; - if (pktimeout > MAXPKTIME) - pktimeout = MAXPKTIME; DEBUG(4, "pkcget: alarm %d\n", Ntimeout); return FAIL; } signal(SIGALRM, cgalarm); - alarm(pktimeout); + alarm(PKTIME); while (n > 0) { #ifdef BSD4_2 if (linebaudrate > 0) { r = n * 100000L; r = r / linebaudrate; Index: usr.bin/vmstat/vmstat.c ================================================================== --- usr.bin/vmstat/vmstat.c +++ usr.bin/vmstat/vmstat.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)vmstat.c 5.4 (Berkeley) 01/06/86"; +static char sccsid[] = "@(#)vmstat.c 5.3 (Berkeley) 11/20/85"; #endif not lint #include #include #include @@ -24,11 +24,10 @@ #include #include #include #include #include -#include struct nlist nl[] = { #define X_CPTIME 0 { "_cp_time" }, #define X_RATE 1 @@ -70,22 +69,14 @@ #define X_DK_NDRIVE 19 { "_dk_ndrive" }, #define X_XSTATS 20 { "_xstats" }, #ifdef vax -#define X_MBDINIT (X_XSTATS+1) - { "_mbdinit" }, -#define X_UBDINIT (X_XSTATS+2) - { "_ubdinit" }, -#endif -#ifdef sun -#define X_MBDINIT (X_XSTATS+1) - { "_mbdinit" }, -#endif -#ifdef tahoe -#define X_VBDINIT (X_XSTATS+1) - { "_vbdinit" }, +#define X_MBDINIT 21 + { "_mbdinit" }, +#define X_UBDINIT 22 + { "_ubdinit" }, #endif { "" }, }; char **dr_name; @@ -100,10 +91,14 @@ double stat1(); int firstfree, maxfree; int hz; int phz; int HZ; + +#ifdef vax +#define INTS(x) ((x) - (hz + phz)) +#endif struct { int busy; long time[CPUSTATES]; long *xfer; @@ -309,11 +304,10 @@ pgtok(rate.v_dfree)/nintv, pgtok(deficit), rate.v_scan/nintv); etime /= (float)HZ; for (i = 0; i < dk_ndrive; i++) if (dr_select[i]) stats(i); -#define INTS(x) ((x) - (hz + phz)) printf("%4d%4d%4d", INTS(rate.v_intr/nintv), rate.v_syscall/nintv, rate.v_swtch/nintv); for(i=0; i */ +/* + * Statistics + */ +struct xstats { + u_long alloc; /* calls to xalloc */ + u_long alloc_inuse; /* found in use/sticky */ + u_long alloc_cachehit; /* found in cache */ + u_long alloc_cacheflush; /* flushed cached text */ + u_long alloc_unused; /* flushed unused cached text */ + u_long free; /* calls to xfree */ + u_long free_inuse; /* still in use/sticky */ + u_long free_cache; /* placed in cache */ + u_long free_cacheswap; /* swapped out to place in cache */ +}; +/* END SHOULD BE AVAILABLE... */ + dosum() { struct nchstats nchstats; struct xstats xstats; long nchtotal; @@ -387,13 +398,12 @@ printf("%9d page ins\n", sum.v_pgin); printf("%9d page outs\n", sum.v_pgout); printf("%9d pages paged in\n", sum.v_pgpgin); printf("%9d pages paged out\n", sum.v_pgpgout); printf("%9d sequential process pages freed\n", sum.v_seqfree); -#define nz(x) ((x) ? (x) : 1) printf("%9d total reclaims (%d%% fast)\n", sum.v_pgrec, - (sum.v_fastpgrec * 100) / nz(sum.v_pgrec)); + (sum.v_fastpgrec * 100) / (sum.v_pgrec == 0 ? 1 : sum.v_pgrec)); printf("%9d reclaims from free list\n", sum.v_pgfrec); printf("%9d intransit blocking page faults\n", sum.v_intrans); printf("%9d zero fill pages created\n", sum.v_nzfod / CLSIZE); printf("%9d zero fill page faults\n", sum.v_zfod / CLSIZE); printf("%9d executable fill pages created\n", sum.v_nexfod / CLSIZE); @@ -416,10 +426,11 @@ lseek(mf, (long)nl[X_NCHSTATS].n_value, 0); read(mf, &nchstats, sizeof nchstats); nchtotal = nchstats.ncs_goodhits + nchstats.ncs_badhits + nchstats.ncs_falsehits + nchstats.ncs_miss + nchstats.ncs_long; printf("%9d total name lookups", nchtotal); +#define nz(x) ((x) ? (x) : 1) printf(" (cache hits %d%% system %d%% per-process)\n", nchstats.ncs_goodhits * 100 / nz(nchtotal), nchstats.ncs_pass2 * 100 / nz(nchtotal)); printf("%9s badhits %d, falsehits %d, toolong %d\n", "", nchstats.ncs_badhits, nchstats.ncs_falsehits, nchstats.ncs_long); @@ -555,68 +566,6 @@ steal(udrv.ud_dname, two_char); sprintf(dr_name[udev.ui_dk], "%c%c%d", cp[0], cp[1], udev.ui_unit); } } -#endif - -#ifdef sun -#include - -read_names() -{ - struct mb_device mdev; - register struct mb_device *mp; - struct mb_driver mdrv; - short two_char; - char *cp = (char *) &two_char; - - mp = (struct mb_device *) nl[X_MBDINIT].n_value; - if (mp == 0) { - fprintf(stderr, "vmstat: Disk init info not in namelist\n"); - exit(1); - } - for (;;) { - steal(mp++, mdev); - if (mdev.md_driver == 0) - break; - if (mdev.md_dk < 0 || mdev.md_alive == 0) - continue; - steal(mdev.md_driver, mdrv); - steal(mdrv.mdr_dname, two_char); - sprintf(dr_name[mdev.md_dk], "%c%c%d", - cp[0], cp[1], mdev.md_unit); - } -} -#endif - -#ifdef tahoe -#include - -/* - * Read the drive names out of kmem. - */ -read_names() -{ - struct vba_device udev, *up; - struct vba_driver udrv; - short two_char; - char *cp = (char *)&two_char; - - up = (struct vba_device *) nl[X_VBDINIT].n_value; - if (up == 0) { - fprintf(stderr, "vmstat: Disk init info not in namelist\n"); - exit(1); - } - for (;;) { - steal(up++, udev); - if (udev.ui_driver == 0) - break; - if (udev.ui_dk < 0 || udev.ui_alive == 0) - continue; - steal(udev.ui_driver, udrv); - steal(udrv.ud_dname, two_char); - sprintf(dr_name[udev.ui_dk], "%c%c%d", - cp[0], cp[1], udev.ui_unit); - } -} #endif Index: usr.bin/whatis/whatis.1 ================================================================== --- usr.bin/whatis/whatis.1 +++ usr.bin/whatis/whatis.1 @@ -1,10 +1,10 @@ .\" Copyright (c) 1980 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" -.\" @(#)whatis.1 6.2 (Berkeley) 01/08/86 +.\" @(#)whatis.1 6.1 (Berkeley) 04/29/85 .\" .TH WHATIS 1 "" .UC 4 .SH NAME whatis \- describe what a command is @@ -27,10 +27,10 @@ option to the .IR man (1) command. .SH FILES .DT -/usr/man/whatis Data base +/usr/lib/whatis Data base .SH "SEE ALSO" man(1), catman(8) .SH AUTHOR William Joy Index: usr.sbin/arp/arp.c ================================================================== --- usr.sbin/arp/arp.c +++ usr.sbin/arp/arp.c @@ -1,7 +1,7 @@ #ifndef lint -static char *sccsid = "@(#)arp.c 1.4 (Berkeley) 01/09/86"; +static char *sccsid = "@(#)arp.c 1.3 (Berkeley) 10/09/85"; #endif /* * arp - display, set, and delete arp table entries */ @@ -58,24 +58,22 @@ file(name) char *name; { FILE *fp; int i; - char line[100], arg[5][50], *args[5]; + char line[100], arg[4][50], *args[4]; if ((fp = fopen(name, "r")) == NULL) { fprintf(stderr, "arp: cannot open %s\n", name); exit(1); } args[0] = &arg[0][0]; args[1] = &arg[1][0]; args[2] = &arg[2][0]; args[3] = &arg[3][0]; - args[4] = &arg[4][0]; while(fgets(line, 100, fp) != NULL) { - i = sscanf(line, "%s %s %s %s", arg[0], arg[1], arg[2], arg[3], - arg[4]); + i = sscanf(line, "%s %s %s %s", arg[0], arg[1], arg[2], arg[3]); if (i < 2) { fprintf(stderr, "arp: bad line: %s\n", line); continue; } set(i, args); @@ -114,12 +112,10 @@ while(argc-- > 0) { if (strncmp(argv[0], "temp", 4) == 0) ar.arp_flags &= ~ATF_PERM; if (strncmp(argv[0], "pub", 3) == 0) ar.arp_flags |= ATF_PUBL; - if (strncmp(argv[0], "trail", 5) == 0) - ar.arp_flags |= ATF_USETRAILERS; argv++; } s = socket(AF_INET, SOCK_DGRAM, 0); if (s < 0) { @@ -173,13 +169,12 @@ printf("%s (%s) at ", host, inet_ntoa(sin->sin_addr)); if (ar.arp_flags & ATF_COM) ether_print(ea); else printf("(incomplete)"); - if (ar.arp_flags & ATF_PERM) printf(" permanent"); + if (!(ar.arp_flags & ATF_PERM)) printf(" temporary"); if (ar.arp_flags & ATF_PUBL) printf(" published"); - if (ar.arp_flags & ATF_USETRAILERS) printf(" trailers"); printf("\n"); } /* * Delete an arp entry @@ -277,13 +272,12 @@ printf("%s (%s) at ", host, inet_ntoa(at->at_iaddr)); if (at->at_flags & ATF_COM) ether_print(at->at_enaddr); else printf("(incomplete)"); - if (at->at_flags & ATF_PERM) printf(" permanent"); + if (!(at->at_flags & ATF_PERM)) printf(" temporary"); if (at->at_flags & ATF_PUBL) printf(" published"); - if (at->at_flags & ATF_USETRAILERS) printf(" trailers"); printf("\n"); } } ether_print(cp) Index: usr.sbin/cron/cron.8 ================================================================== --- usr.sbin/cron/cron.8 +++ usr.sbin/cron/cron.8 @@ -1,6 +1,6 @@ -.\" @(#)cron.8 6.2 (Berkeley) 01/10/86 +.\" @(#)cron.8 6.1 (Berkeley) 04/27/85 .\" .TH CRON 8 "" .AT 3 .SH NAME cron \- clock daemon @@ -7,13 +7,12 @@ .SH SYNOPSIS .B /etc/cron .SH DESCRIPTION .I Cron executes commands at specified dates and times -according to the instructions in the files -/usr/lib/crontab and /usr/lib/crontab.local. -None, either one, or both of these files may be present. +according to the instructions in the file +/usr/lib/crontab. Since .I cron never exits, it should only be executed once. This is best done by running @@ -22,13 +21,12 @@ process through the file /etc/rc; see .IR init (8). .PP -The -crontab files -consist of lines of seven fields each. +Crontab +consists of lines of six fields each. The fields are separated by spaces or tabs. The first five are integer patterns to specify the minute (0-59), hour (0-23), @@ -41,13 +39,11 @@ a minus meaning a range inclusive; a list of numbers separated by commas meaning any of the numbers; or an asterisk meaning all legal values. -The sixth field is a user name: the -command will be run ``as'' that user. -The seventh field is a string +The sixth field is a string that is executed by the Shell at the specified times. A percent character in this field is translated to a new-line character. @@ -54,13 +50,10 @@ Only the first line (up to a % or end of line) of the command field is executed by the Shell. The other lines are made available to the command as standard input. .PP -Both -crontab files are checked by +Crontab is examined by .I cron -every minute, on the minute. +every minute. .SH FILES /usr/lib/crontab -.br -/usr/lib/crontab.local Index: usr.sbin/cron/cron.c ================================================================== --- usr.sbin/cron/cron.c +++ usr.sbin/cron/cron.c @@ -1,7 +1,7 @@ #ifndef lint -static char *sccsid = "@(#)cron.c 4.11 (Berkeley) 01/10/86"; +static char *sccsid = "@(#)cron.c 4.10 (Berkeley) 10/31/85"; #endif #include #include #include @@ -18,39 +18,31 @@ #ifndef CRONTAB #define CRONTAB "/usr/lib/crontab" #endif -#ifndef CRONTABLOC -#define CRONTABLOC "/usr/lib/crontab.local" -#endif - #define EXACT 100 #define ANY 101 #define LIST 102 #define RANGE 103 #define EOS 104 - char crontab[] = CRONTAB; -char loc_crontab[] = CRONTABLOC; time_t itime; struct tm *loct; struct tm *localtime(); char *malloc(); char *realloc(); int reapchild(); int flag; char *list; -char *listend; unsigned listsize; main() { register char *cp; char *cmp(); time_t filetime = 0; - time_t lfiletime = 0; if (fork()) exit(0); chdir("/"); freopen("/", "r", stdout); @@ -62,37 +54,18 @@ signal(SIGCHLD, reapchild); time(&itime); itime -= localtime(&itime)->tm_sec; for (;; itime+=60, slp()) { - struct stat cstat, lcstat; - int newcron, newloc; - - newcron = 0; - if (stat(crontab, &cstat) < 0) - cstat.st_mtime = 1; - if (cstat.st_mtime != filetime) { + struct stat cstat; + + if (stat(crontab, &cstat) == -1) + continue; + if (cstat.st_mtime > filetime) { filetime = cstat.st_mtime; - newcron++; - } - - newloc = 0; - if (stat(loc_crontab, &lcstat) < 0) - lcstat.st_mtime = 1; - if (lcstat.st_mtime != lfiletime) { - lfiletime = lcstat.st_mtime; - newloc++; - } - - if (newcron || newloc) { init(); - append(crontab); - append(loc_crontab); - *listend++ = EOS; - *listend++ = EOS; } - loct = localtime(&itime); loct->tm_mon++; /* 1-12 for month */ if (loct->tm_wday == 0) loct->tm_wday = 7; /* sunday is 7, not 0 */ for(cp = list; *cp != EOS;) { @@ -189,40 +162,30 @@ exit(0); } init() { - /* - * Don't free in case was longer than LISTS. Trades off - * the rare case of crontab shrinking vs. the common case of - * extra realloc's needed in append() for a large crontab. - */ - if (list == 0) { - list = malloc(LISTS); - listsize = LISTS; - } - listend = list; -} - -append(fn) -char *fn; -{ register i, c; register char *cp; register char *ocp; register int n; - if (freopen(fn, "r", stdin) == NULL) - return; - cp = listend; + freopen(crontab, "r", stdin); + if (list) { + list = realloc(list, LISTS); + } else + list = malloc(LISTS); + listsize = LISTS; + cp = list; + loop: if(cp > list+listsize-MAXLIN) { - int length = cp - list; - + char *olist; listsize += LISTS; + olist = list; list = realloc(list, listsize); - cp = list + length; + cp = list + (cp - olist); } ocp = cp; for(i=0;; i++) { do c = getchar(); @@ -287,12 +250,13 @@ ignore: cp = ocp; while(c != '\n') { if(c == EOF) { + *cp++ = EOS; + *cp++ = EOS; fclose(stdin); - listend = cp; return; } c = getchar(); } goto loop; Index: usr.sbin/rmt/rmt.c ================================================================== --- usr.sbin/rmt/rmt.c +++ usr.sbin/rmt/rmt.c @@ -9,11 +9,11 @@ "@(#) Copyright (c) 1983 Regents of the University of California.\n\ All rights reserved.\n"; #endif not lint #ifndef lint -static char sccsid[] = "@(#)rmt.c 5.2 (Berkeley) 01/07/86"; +static char sccsid[] = "@(#)rmt.c 5.1 (Berkeley) 05/28/85"; #endif not lint /* * rmt */ @@ -191,11 +191,10 @@ record = malloc(size); if (record == 0) { DEBUG("rmtd: cannot allocate buffer space\n"); exit(4); } - maxrecsize = size; while (size > 1024 && setsockopt(0, SOL_SOCKET, SO_RCVBUF, &size, sizeof (size)) < 0) size -= 1024; return (record); } Index: usr.sbin/sendmail/doc/op/op.me ================================================================== --- usr.sbin/sendmail/doc/op/op.me +++ usr.sbin/sendmail/doc/op/op.me @@ -1,9 +1,9 @@ .\" eqn % | troff -me .\"if n .ls 2 .he 'Sendmail Installation and Operation Guide''%' -.fo 'Version 5.4''Last Mod 01/07/86' +.fo 'Version 5.3''Last Mod 12/26/85' .nr si 3n .de $0 .(x .in \\$3u*3n .ti -3n @@ -27,11 +27,11 @@ .sp .r Eric Allman Britton-Lee, Inc. .sp -Version 5.4 +Version 5.3 .)l .sp 2 .pp .i Sendmail implements a general purpose internetwork mail routing facility @@ -592,14 +592,10 @@ There will be one line for each recipient. .ip S The sender address. There may only be one of these lines. -.ip E -An error address. -If any such lines exist, -they represent the addresses that should receive error messages. .ip T The job creation time. This is used to compute when to time out the job. .ip P The current message priority. @@ -3455,33 +3451,22 @@ .b T line in sendmail.cf). .ip "MAXUSERENVIRON [40]" The maximum number of items in the user environment that will be passed to subordinate mailers. -.ip "QUEUESIZE [600]" -The maximum number of entries that will be processed -in a single queue run. .lp A number of other compilation options exist. These specify whether or not specific code should be compiled in. .nr ii 1i .ip DBM If set, the .q DBM package in UNIX is used -(see -.i dbm(3X) -in [UNIX80]). +(see DBM(3X) in [UNIX80]). If not set, a much less efficient algorithm for processing aliases is used. -.ip NDBM -If set, -the new version of the DBM library -that allows multiple databases will be used. -.q DBM -must also be set. .ip DEBUG If set, debugging information is compiled in. To actually get the debugging output, the .b \-d @@ -3506,11 +3491,22 @@ This is only necessary if your machine has some mailer that speaks SMTP. .ip DAEMON If set, code to run a daemon is compiled in. -This code is for 4.2 or 4.3BSD. +This code is for 4.2BSD +if the +NVMUNIX +flag is specified; +otherwise, +4.1a BSD code is used. +Beware however +that there are bugs in the 4.1a code +that make it impossible for +.b sendmail +to work correctly +under heavy load. .ip UGLYUUCP If you have a UUCP host adjacent to you which is not running a reasonable version of .i rmail , you will have to set this flag to include the @@ -3866,11 +3862,11 @@ .sp .sz 10 Eric Allman Britton-Lee, Inc. .sp -Version 5.4 +Version 5.3 .ce 0 .bp 1 .ce .sz 12 TABLE OF CONTENTS Index: usr.sbin/sendmail/src/alias.c ================================================================== --- usr.sbin/sendmail/src/alias.c +++ usr.sbin/sendmail/src/alias.c @@ -8,13 +8,13 @@ ** specifies the terms and conditions for redistribution. */ #ifndef lint # ifdef DBM -static char SccsId[] = "@(#)alias.c 5.10 (Berkeley) 01/11/86 (with DBM)"; +static char SccsId[] = "@(#)alias.c 5.8 (Berkeley) 12/17/85 (with DBM)"; # else DBM -static char SccsId[] = "@(#)alias.c 5.10 (Berkeley) 01/11/86 (without DBM)"; +static char SccsId[] = "@(#)alias.c 5.8 (Berkeley) 12/17/85 (without DBM)"; # endif DBM #endif not lint # include # include @@ -192,32 +192,16 @@ ** Check to see that the alias file is complete. ** If not, we will assume that someone died, and it is up ** to us to rebuild it. */ - if (!init) - dbminit(aliasfile); + dbminit(aliasfile); atcnt = SafeAlias * 2; if (atcnt > 0) { while (!init && atcnt-- >= 0 && aliaslookup("@") == NULL) - { - /* - ** Reinitialize alias file in case the new - ** one is mv'ed in instead of cp'ed in. - ** - ** Only works with new DBM -- old one will - ** just consume file descriptors forever. - ** If you have a dbmclose() it can be - ** added before the sleep(30). - */ - sleep(30); -# ifdef NDBM - dbminit(aliasfile); -# endif NDBM - } } else atcnt = 1; /* @@ -356,11 +340,10 @@ { syserr("cannot make %s", line); (void) signal(SIGINT, oldsigint); return; } - dbminit(aliasfile); (void) strcpy(line, aliasfile); (void) strcat(line, ".pag"); if (close(creat(line, DBMMODE)) < 0) { syserr("cannot make %s", line); @@ -433,11 +416,11 @@ rhs = p; for (;;) { register char c; - if (init && CheckAliases) + if (init) { /* do parsing & compression of addresses */ while (*p != '\0') { extern char *DelimChar; Index: usr.sbin/sendmail/src/arpadate.c ================================================================== --- usr.sbin/sendmail/src/arpadate.c +++ usr.sbin/sendmail/src/arpadate.c @@ -7,11 +7,11 @@ ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. */ #ifndef lint -static char SccsId[] = "@(#)arpadate.c 5.4 (Berkeley) 01/09/86"; +static char SccsId[] = "@(#)arpadate.c 5.3 (Berkeley) 06/08/85"; #endif not lint # include "conf.h" # ifdef USG # include @@ -200,18 +200,18 @@ { char *f_from; char *f_to; }; -static struct foreign Foreign[] = -{ - { "EET", "+0200" }, /* eastern europe */ - { "MET", "+0100" }, /* middle europe */ - { "WET", "GMT" }, /* western europe */ - { "EET DST", "+0300" }, /* daylight saving times */ - { "MET DST", "+0200" }, - { "WET DST", "+0100" }, +static struct foreign Foreign[] = +{ + { "EET", " -0200" }, /* eastern europe */ + { "MET", " -0100" }, /* middle europe */ + { "WET", " GMT" }, /* western europe */ + { "EET DST", " -0300" }, /* daylight saving times */ + { "MET DST", " -0200" }, + { "WET DST", " -0100" }, { NULL, NULL } }; bool fconvert(a, b) @@ -226,14 +226,13 @@ extern bool sameword(); if (sameword(euptr->f_from, a)) { p = euptr->f_to; - *b++ = ' '; - while (*p != '\0') + while (*p) *b++ = *p++; *b = '\0'; return (TRUE); } } return (FALSE); } Index: usr.sbin/sendmail/src/conf.c ================================================================== --- usr.sbin/sendmail/src/conf.c +++ usr.sbin/sendmail/src/conf.c @@ -7,11 +7,11 @@ ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. */ #ifndef lint -static char SccsId[] = "@(#)conf.c 5.14 (Berkeley) 01/10/86"; +static char SccsId[] = "@(#)conf.c 5.11 (Berkeley) 12/17/85"; #endif not lint # include # include # ifdef sun @@ -64,14 +64,12 @@ struct hdrinfo HdrInfo[] = { /* originator fields, most to least significant */ "resent-sender", H_FROM|H_RESENT, "resent-from", H_FROM|H_RESENT, - "resent-reply-to", H_FROM|H_RESENT, "sender", H_FROM, "from", H_FROM, - "reply-to", H_FROM, "full-name", H_ACHECK, "return-receipt-to", H_FROM, "errors-to", H_FROM, /* destination fields */ "to", H_RCPT, @@ -145,11 +143,11 @@ QueueFactor = 10000; RefuseLA = 12; SpaceSub = ' '; WkRecipFact = 1000; WkClassFact = 1800; - WkTimeFact = 9000; + WkTimeFact = 600; FileMode = 0644; DefUid = 1; DefGid = 1; } @@ -668,36 +666,5 @@ p += i; while (p < LastArgv) *p++ = ' '; # endif SETPROCTITLE } - /* -** REAPCHILD -- pick up the body of my child, lest it become a zombie -** -** Parameters: -** none. -** -** Returns: -** none. -** -** Side Effects: -** Picks up extant zombies. -*/ - -# ifdef VMUNIX -# include -# endif VMUNIX - -reapchild() -{ -# ifdef WNOHANG - union wait status; - - while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0) - continue; -# else WNOHANG - auto int status; - - while (wait(&status) > 0) - continue; -# endif WNOHANG -} Index: usr.sbin/sendmail/src/conf.h ================================================================== --- usr.sbin/sendmail/src/conf.h +++ usr.sbin/sendmail/src/conf.h @@ -5,11 +5,11 @@ ** ** Copyright (c) 1983 Regents of the University of California. ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. ** -** @(#)conf.h 5.7 (Berkeley) 01/05/86 +** @(#)conf.h 5.4 (Berkeley) 09/24/85 */ /* ** CONF.H -- All user-configurable parameters for sendmail */ @@ -30,24 +30,19 @@ # define MAXMAILERS 25 /* maximum mailers known to system */ # define MAXRWSETS 30 /* max # of sets of rewriting rules */ # define MAXPRIORITIES 25 /* max values for Precedence: field */ # define MAXTRUST 30 /* maximum number of trusted users */ # define MAXUSERENVIRON 40 /* max # of items in user environ */ -# define QUEUESIZE 600 /* max # of jobs per queue run */ /* ** Compilation options. -** -** #define these if they are available; comment them out otherwise. */ -# define DBM 1 /* use DBM library (requires -ldbm) */ -# define NDBM 1 /* new DBM library available (requires DBM) */ -# define DEBUG 1 /* enable debugging */ -# define LOG 1 /* enable logging */ -# define SMTP 1 /* enable user and server SMTP */ -# define QUEUE 1 /* enable queueing */ -# define UGLYUUCP 1 /* output ugly UUCP From lines */ -# define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ -# define FLOCK 1 /* use flock file locking */ -# define SETPROCTITLE 1 /* munge argv to display current status */ -/* # define WIZ 1 /* allow wizard mode */ +#define DBM 1 /* use DBM library (requires -ldbm) */ +#define DEBUG 1 /* enable debugging */ +#define LOG 1 /* enable logging */ +#define SMTP 1 /* enable user and server SMTP */ +#define QUEUE 1 /* enable queueing */ +#define UGLYUUCP 1 /* output ugly UUCP From lines */ +#define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ +#define FLOCK 1 /* use flock file locking */ +#define SETPROCTITLE 1 /* munge argv to display current status */ Index: usr.sbin/sendmail/src/daemon.c ================================================================== --- usr.sbin/sendmail/src/daemon.c +++ usr.sbin/sendmail/src/daemon.c @@ -12,11 +12,11 @@ # include # include "sendmail.h" # ifndef DAEMON # ifndef lint -static char SccsId[] = "@(#)daemon.c 5.17 (Berkeley) 01/05/86 (w/o daemon mode)"; +static char SccsId[] = "@(#)daemon.c 5.16 (Berkeley) 12/26/85 (w/o daemon mode)"; # endif not lint # else # include # include @@ -23,11 +23,11 @@ # include # include # include # ifndef lint -static char SccsId[] = "@(#)daemon.c 5.17 (Berkeley) 01/05/86 (with daemon mode)"; +static char SccsId[] = "@(#)daemon.c 5.16 (Berkeley) 12/26/85 (with daemon mode)"; # endif not lint /* ** DAEMON.C -- routines to use when running as a daemon. ** @@ -52,13 +52,12 @@ ** Make a connection to the named host on the given ** port. Set *outfile and *infile to the files ** appropriate for communication. Returns zero on ** success, else an exit status describing the ** error. -** maphostname(hbuf, hbufsize) -** Convert the entry in hbuf into a canonical form. It -** may not be larger than hbufsize. +** +** The semantics of both of these should be clean. */ /* ** GETREQUESTS -- open mail IPC port and get requests. ** ** Parameters: @@ -253,10 +252,30 @@ /* close the port so that others will hang (for a while) */ (void) close(t); } /*NOTREACHED*/ } + /* +** REAPCHILD -- pick up the body of my child, lest it become a zombie +** +** Parameters: +** none. +** +** Returns: +** none. +** +** Side Effects: +** Picks up zombies. +*/ + +reapchild() +{ + union wait status; + + while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0) + continue; +} /* ** CLRDAEMON -- reset the daemon connection ** ** Parameters: ** none. @@ -584,7 +603,8 @@ char *hbuf; int hbsize; { return; } + #endif DAEMON Index: usr.sbin/sendmail/src/queue.c ================================================================== --- usr.sbin/sendmail/src/queue.c +++ usr.sbin/sendmail/src/queue.c @@ -15,16 +15,16 @@ # include # include # ifndef QUEUE # ifndef lint -static char SccsId[] = "@(#)queue.c 5.19 (Berkeley) 01/05/86 (no queueing)"; +static char SccsId[] = "@(#)queue.c 5.18 (Berkeley) 12/17/85 (no queueing)"; # endif not lint # else QUEUE # ifndef lint -static char SccsId[] = "@(#)queue.c 5.19 (Berkeley) 01/05/86"; +static char SccsId[] = "@(#)queue.c 5.18 (Berkeley) 12/17/85"; # endif not lint /* ** Work queue. */ @@ -110,12 +110,11 @@ e->e_putbody = putbody; } /* ** Output future work requests. - ** Priority and creation time should be first, since - ** they are required by orderq. + ** Priority should be first, since it is read by orderq. */ /* output message priority */ fprintf(tfp, "P%ld\n", e->e_msgpriority); @@ -155,16 +154,10 @@ } #endif DEBUG } } - /* output list of error recipients */ - for (q = e->e_errorqueue; q != NULL; q = q->q_next) - { - fprintf(tfp, "E%s\n", q->q_paddr); - } - /* ** Output headers for this message. ** Expand macros completely here. Queue run will deal with ** everything as absolute headers. ** All headers that must be relative to the recipient @@ -362,21 +355,20 @@ ** ** Side Effects: ** Sets WorkQ to the queue of available work, in order. */ -# define NEED_P 001 -# define NEED_T 002 +# define WLSIZE 120 /* max size of worklist per sort */ orderq(doall) bool doall; { register struct direct *d; register WORK *w; DIR *f; register int i; - WORK wlist[QUEUESIZE+1]; + WORK wlist[WLSIZE+1]; int wn = -1; extern workcmpf(); /* clear out old WorkQ */ for (w = WorkQ; w != NULL; ) @@ -409,11 +401,11 @@ /* is this an interesting entry? */ if (d->d_name[0] != 'q' || d->d_name[1] != 'f') continue; /* yes -- open control file (if not too many files) */ - if (++wn >= QUEUESIZE) + if (++wn >= WLSIZE) continue; cf = fopen(d->d_name, "r"); if (cf == NULL) { /* this may be some random person sending hir msgs */ @@ -425,39 +417,35 @@ #endif DEBUG errno = 0; wn--; continue; } - w = &wlist[wn]; - w->w_name = newstr(d->d_name); + wlist[wn].w_name = newstr(d->d_name); /* make sure jobs in creation don't clog queue */ - w->w_pri = 0x7fffffff; - w->w_ctime = 0; + wlist[wn].w_pri = 0x7fffffff; + wlist[wn].w_ctime = 0; /* extract useful information */ - i = NEED_P | NEED_T; - while (i != 0 && fgets(lbuf, sizeof lbuf, cf) != NULL) + while (fgets(lbuf, sizeof lbuf, cf) != NULL) { extern long atol(); switch (lbuf[0]) { case 'P': - w->w_pri = atol(&lbuf[1]); - i &= ~NEED_P; + wlist[wn].w_pri = atol(&lbuf[1]); break; case 'T': - w->w_ctime = atol(&lbuf[1]); - i &= ~NEED_T; + wlist[wn].w_ctime = atol(&lbuf[1]); break; } } (void) fclose(cf); - if (!doall && shouldqueue(w->w_pri)) + if (!doall && shouldqueue(wlist[wn].w_pri)) { /* don't even bother sorting this job in */ wn--; } } @@ -466,19 +454,19 @@ /* ** Sort the work directory. */ - qsort((char *) wlist, min(wn, QUEUESIZE), sizeof *wlist, workcmpf); + qsort((char *) wlist, min(wn, WLSIZE), sizeof *wlist, workcmpf); /* ** Convert the work list into canonical form. ** Should be turning it into a list of envelopes here perhaps. */ WorkQ = NULL; - for (i = min(wn, QUEUESIZE); --i >= 0; ) + for (i = min(wn, WLSIZE); --i >= 0; ) { w = (WORK *) xalloc(sizeof *w); w->w_name = wlist[i].w_name; w->w_pri = wlist[i].w_pri; w->w_ctime = wlist[i].w_ctime; @@ -693,14 +681,10 @@ { case 'R': /* specify recipient */ sendtolist(&buf[1], (ADDRESS *) NULL, &e->e_sendqueue); break; - case 'E': /* specify error recipient */ - sendtolist(&buf[1], (ADDRESS *) NULL, &e->e_errorqueue); - break; - case 'H': /* header */ if (full) (void) chompheader(&buf[1], FALSE); break; @@ -789,12 +773,12 @@ printf("Mail queue is empty\n"); return; } printf("\t\tMail Queue (%d request%s", nrequests, nrequests == 1 ? "" : "s"); - if (nrequests > QUEUESIZE) - printf(", only %d printed", QUEUESIZE); + if (nrequests > WLSIZE) + printf(", only %d printed", WLSIZE); if (Verbose) printf(")\n--QID-- --Size-- -Priority- ---Q-Time--- -----------Sender/Recipient-----------\n"); else printf(")\n--QID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------\n"); for (w = WorkQ; w != NULL; w = w->w_next) Index: usr.sbin/sendmail/src/readcf.c ================================================================== --- usr.sbin/sendmail/src/readcf.c +++ usr.sbin/sendmail/src/readcf.c @@ -7,11 +7,11 @@ ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. */ #ifndef lint -static char SccsId[] = "@(#)readcf.c 5.10 (Berkeley) 01/11/86"; +static char SccsId[] = "@(#)readcf.c 5.7 (Berkeley) 12/07/85"; #endif not lint # include "sendmail.h" /* @@ -298,11 +298,11 @@ fileclass(class, filename, fmt) int class; char *filename; char *fmt; { - FILE *f; + register FILE *f; char buf[MAXLINE]; f = fopen(filename, "r"); if (f == NULL) { @@ -311,46 +311,16 @@ } while (fgets(buf, sizeof buf, f) != NULL) { register STAB *s; - register char *p; -# ifdef SCANF char wordbuf[MAXNAME+1]; if (sscanf(buf, fmt, wordbuf) != 1) continue; - p = wordbuf; -# else SCANF - p = buf; -# endif SCANF - - /* - ** Break up the match into words. - */ - - while (*p != '\0') - { - register char *q; - - /* strip leading spaces */ - while (isspace(*p)) - p++; - if (*p == '\0') - break; - - /* find the end of the word */ - q = p; - while (*p != '\0' && !isspace(*p)) - p++; - if (*p != '\0') - *p++ = '\0'; - - /* enter the word in the symbol table */ - s = stab(q, ST_CLASS, ST_ENTER); - setbitn(class, s->s_class); - } + s = stab(wordbuf, ST_CLASS, ST_ENTER); + setbitn(class, s->s_class); } (void) fclose(f); } /* @@ -637,16 +607,12 @@ ** Side Effects: ** Sets options as implied by the arguments. */ static BITMAP StickyOpt; /* set if option is stuck */ -extern char *NetName; /* name of home (local) network */ -# ifdef SMTP -# ifdef WIZ extern char *WizWord; /* the stored wizard password */ -# endif WIZ -# endif SMTP +extern char *NetName; /* name of home (local) network */ setoption(opt, val, safe, sticky) char opt; char *val; bool safe; @@ -809,14 +775,10 @@ case 'm': /* send to me too */ MeToo = atobool(val); break; - case 'n': /* validate RHS in newaliases */ - CheckAliases = atobool(val); - break; - # ifdef DAEMON case 'N': /* home (local?) network name */ NetName = newstr(val); break; # endif DAEMON @@ -879,17 +841,15 @@ case 'v': /* run in verbose mode */ Verbose = atobool(val); break; -# ifdef SMTP -# ifdef WIZ +# ifdef DEBUG case 'W': /* set the wizards password */ WizWord = newstr(val); break; -# endif WIZ -# endif SMTP +# endif DEBUG case 'x': /* load avg at which to auto-queue msgs */ QueueLA = atoi(val); break; Index: usr.sbin/sendmail/src/recipient.c ================================================================== --- usr.sbin/sendmail/src/recipient.c +++ usr.sbin/sendmail/src/recipient.c @@ -7,11 +7,11 @@ ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. */ #ifndef lint -static char SccsId[] = "@(#)recipient.c 5.7 (Berkeley) 01/09/86"; +static char SccsId[] = "@(#)recipient.c 5.6 (Berkeley) 12/07/85"; #endif not lint # include # include "sendmail.h" # include @@ -349,33 +349,35 @@ register struct passwd *pw; register char *p; extern struct passwd *getpwent(); extern struct passwd *getpwnam(); - /* map upper => lower case */ + /* + ** Make name canonical. + */ + for (p = name; *p != '\0'; p++) { - if (isascii(*p) && isupper(*p)) + if (*p == (SpaceSub & 0177) || *p == '_') + *p = ' '; + else if (isascii(*p) && isupper(*p)) *p = tolower(*p); } - /* look up this login name using fast path */ + /* look up this login name */ if ((pw = getpwnam(name)) != NULL) return (pw); /* search for a matching full name instead */ - for (p = name; *p != '\0'; p++) - { - if (*p == (SpaceSub & 0177) || *p == '_') - *p = ' '; - } (void) setpwent(); while ((pw = getpwent()) != NULL) { char buf[MAXNAME]; extern bool sameword(); + if (strcmp(pw->pw_name, name) == 0) + return (pw); buildfname(pw->pw_gecos, pw->pw_name, buf); if (index(buf, ' ') != NULL && sameword(buf, name)) { message(Arpa_Info, "sending to login name %s", pw->pw_name); return (pw); Index: usr.sbin/sendmail/src/sendmail.h ================================================================== --- usr.sbin/sendmail/src/sendmail.h +++ usr.sbin/sendmail/src/sendmail.h @@ -5,11 +5,11 @@ ** ** Copyright (c) 1983 Regents of the University of California. ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. ** -** @(#)sendmail.h 5.8 (Berkeley) 01/10/86 +** @(#)sendmail.h 5.7 (Berkeley) 11/22/85 */ /* ** SENDMAIL.H -- Global definitions for sendmail. */ @@ -17,11 +17,11 @@ # ifdef _DEFINE # define EXTERN # ifndef lint -static char SmailSccsId[] = "@(#)sendmail.h 5.8 01/10/86"; +static char SmailSccsId[] = "@(#)sendmail.h 5.7 11/22/85"; # endif lint # else _DEFINE # define EXTERN extern # endif _DEFINE @@ -482,11 +482,10 @@ EXTERN bool HoldErrs; /* only output errors to transcript */ EXTERN bool NoConnect; /* don't connect to non-local mailers */ EXTERN bool SuperSafe; /* be extra careful, even if expensive */ EXTERN bool ForkQueueRuns; /* fork for each job when running the queue */ EXTERN bool AutoRebuild; /* auto-rebuild the alias database as needed */ -EXTERN bool CheckAliases; /* parse addresses during newaliases */ EXTERN int SafeAlias; /* minutes to wait until @:@ in alias file */ EXTERN time_t TimeOut; /* time until timeout */ EXTERN FILE *InChannel; /* input connection */ EXTERN FILE *OutChannel; /* output connection */ EXTERN int RealUid; /* when Daemon, real uid of caller */ Index: usr.sbin/sendmail/src/srvrsmtp.c ================================================================== --- usr.sbin/sendmail/src/srvrsmtp.c +++ usr.sbin/sendmail/src/srvrsmtp.c @@ -13,16 +13,16 @@ # include "sendmail.h" # include # ifndef SMTP # ifndef lint -static char SccsId[] = "@(#)srvrsmtp.c 5.18 (Berkeley) 01/05/86 (no SMTP)"; +static char SccsId[] = "@(#)srvrsmtp.c 5.17 (Berkeley) 12/17/85 (no SMTP)"; # endif not lint # else SMTP # ifndef lint -static char SccsId[] = "@(#)srvrsmtp.c 5.18 (Berkeley) 01/05/86"; +static char SccsId[] = "@(#)srvrsmtp.c 5.17 (Berkeley) 12/17/85"; # endif not lint /* ** SMTP -- run the SMTP protocol. ** @@ -175,14 +175,10 @@ cmd = p; for (cmd = cmdbuf; *p != '\0' && !isspace(*p); ) *cmd++ = *p++; *cmd = '\0'; - /* throw away leading whitespace */ - while (isspace(*p)) - p++; - /* decode command */ for (c = CmdTab; c->cmdname != NULL; c++) { if (sameword(c->cmdname, cmdbuf)) break; Index: usr.sbin/sendmail/src/stats.c ================================================================== --- usr.sbin/sendmail/src/stats.c +++ usr.sbin/sendmail/src/stats.c @@ -7,11 +7,11 @@ ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. */ #ifndef lint -static char SccsId[] = "@(#)stats.c 5.7 (Berkeley) 01/05/86"; +static char SccsId[] = "@(#)stats.c 5.6 (Berkeley) 09/19/85"; #endif not lint # include "sendmail.h" /* @@ -40,11 +40,19 @@ register ENVELOPE *e; register ADDRESS *to; { if (to == NULL) { - if (e->e_from.q_mailer != NULL) + Stat.stat_bf[e->e_from.q_mailer->m_mno] += KBYTES(CurEnv->e_msgsize); + + /* + ** If is possible to get mail from an unparseable address, + ** in this case, the q_mailer field is null, so that the + ** indirection below causes a dereference of a NULL pointer. + */ + + if (e->e_from.q_mailer != NULL ) { Stat.stat_nf[e->e_from.q_mailer->m_mno]++; Stat.stat_bf[e->e_from.q_mailer->m_mno] += KBYTES(CurEnv->e_msgsize); } Index: usr.sbin/sendmail/src/version.c ================================================================== --- usr.sbin/sendmail/src/version.c +++ usr.sbin/sendmail/src/version.c @@ -7,9 +7,9 @@ ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. */ #ifndef lint -static char SccsId[] = "@(#)version.c 5.44 (Berkeley) 01/11/86"; +static char SccsId[] = "@(#)version.c 5.38 (Berkeley) 12/17/85"; #endif not lint -char Version[] = "5.44"; +char Version[] = "5.38";