mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-31 12:56:10 +01:00
Compare commits
31
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe49c12662 | ||
|
|
10891800ac | ||
|
|
e53c87bc5d | ||
|
|
1e241f19a9 | ||
|
|
fd08c444e6 | ||
|
|
f9eba749d7 | ||
|
|
8a90f6c3ad | ||
|
|
61e660abb9 | ||
|
|
c35e478053 | ||
|
|
9d9e22bbbf | ||
|
|
371bf72731 | ||
|
|
b8a0e88098 | ||
|
|
dc35556033 | ||
|
|
2d69cd14a9 | ||
|
|
1575ff5b59 | ||
|
|
c7bcb06440 | ||
|
|
0f1b35f61b | ||
|
|
467194d9b6 | ||
|
|
365738c9e2 | ||
|
|
7753eed96f | ||
|
|
4937b79d09 | ||
|
|
c0eea35fcb | ||
|
|
a7efd265c0 | ||
|
|
e506051a5b | ||
|
|
d85926e0cf | ||
|
|
1c7bd47f2d | ||
|
|
a460193410 | ||
|
|
f8b9627ac5 | ||
|
|
2bd74093d6 | ||
|
|
9a9f7322bf | ||
|
|
f94d869a9b |
No files matched your search
@@ -4,7 +4,7 @@
|
||||
#
|
||||
# Written by Toshiharu OHNO
|
||||
#
|
||||
# $Id: ppp.conf.sample,v 1.5.2.1 1996/11/16 21:03:20 phk Exp $
|
||||
# $Id: ppp.conf.sample,v 1.5.2.2 1997/03/02 14:56:49 joerg Exp $
|
||||
#
|
||||
#################################################################
|
||||
|
||||
@@ -98,7 +98,7 @@ ondemand:
|
||||
# We also set openmode active - this makes us initiate ppp negotiation.
|
||||
# The default is to wait for the server to start talking.
|
||||
#
|
||||
pmdemend:
|
||||
pmdemand:
|
||||
set phone 1234567
|
||||
set login "TIMEOUT 5 login:-\\r-login: ppp word: ppp"
|
||||
set timeout 120
|
||||
|
||||
@@ -52,6 +52,7 @@ char *alloca ();
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
|
||||
+5
-11
@@ -1,12 +1,6 @@
|
||||
/* $Header: /home/ncvs/src/gnu/usr.bin/patch/inp.c,v 1.2 1995/01/12 22:09:39 hsu Exp $
|
||||
/* $Header: /home/ncvs/src/gnu/usr.bin/patch/inp.c,v 1.3 1995/05/30 05:02:31 rgrimes Exp $
|
||||
*
|
||||
* $Log: inp.c,v $
|
||||
* Revision 1.2 1995/01/12 22:09:39 hsu
|
||||
* Fix bug that created new files even when running in -C check mode.
|
||||
* Reviewed by: phk
|
||||
*
|
||||
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
|
||||
* b-maked patch-2.10
|
||||
* Log: inp.c,v
|
||||
*
|
||||
* Revision 2.0.1.1 88/06/03 15:06:13 lwall
|
||||
* patch10: made a little smarter about sccs files
|
||||
@@ -126,7 +120,7 @@ char *filename;
|
||||
|
||||
#define try(f,a1,a2) (Sprintf(s + pathlen, f, a1, a2), stat(s, &cstat) == 0)
|
||||
if (( try("RCS/%s%s", filebase, RCSSUFFIX)
|
||||
|| try("RCS/%s" , filebase, 0)
|
||||
|| try("RCS/%s%s", filebase, "")
|
||||
|| try( "%s%s", filebase, RCSSUFFIX))
|
||||
&&
|
||||
/* Check that RCS file is not working file.
|
||||
@@ -240,7 +234,7 @@ char *filename;
|
||||
"this file doesn't appear to be the %s version--aborting.\n", revision);
|
||||
}
|
||||
else {
|
||||
ask2(
|
||||
(void) ask2(
|
||||
"This file doesn't appear to be the %s version--patch anyway? [n] ",
|
||||
revision);
|
||||
if (*buf != 'y')
|
||||
@@ -289,7 +283,7 @@ char *filename;
|
||||
"this file doesn't appear to be the %s version--aborting.\n", revision);
|
||||
}
|
||||
else {
|
||||
ask2(
|
||||
(void) ask2(
|
||||
"This file doesn't appear to be the %s version--patch anyway? [n] ",
|
||||
revision);
|
||||
if (*buf != 'y')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
char rcsid[] =
|
||||
"$Header: /home/ncvs/src/gnu/usr.bin/patch/patch.c,v 1.5 1995/01/12 22:09:40 hsu Exp $";
|
||||
"$Header: /home/ncvs/src/gnu/usr.bin/patch/patch.c,v 1.6 1995/05/30 05:02:34 rgrimes Exp $";
|
||||
|
||||
/* patch - a program to apply diffs to original files
|
||||
*
|
||||
@@ -8,25 +8,7 @@ char rcsid[] =
|
||||
* This program may be copied as long as you don't try to make any
|
||||
* money off of it, or pretend that you wrote it.
|
||||
*
|
||||
* $Log: patch.c,v $
|
||||
* Revision 1.5 1995/01/12 22:09:40 hsu
|
||||
* Fix bug that created new files even when running in -C check mode.
|
||||
* Reviewed by: phk
|
||||
*
|
||||
* Revision 1.4 1994/02/25 21:46:04 phk
|
||||
* added the -C/-check again.
|
||||
*
|
||||
* Revision 1.3 1994/02/17 22:20:34 jkh
|
||||
* Put this back - I was somehow under the erroneous impression that patch was in
|
||||
* ports, until I saw the the commit messages, that is! :-) All changed backed out.
|
||||
*
|
||||
* Revision 1.2 1994/02/17 22:16:03 jkh
|
||||
* From Poul-Henning Kamp - Implement a -C option to verify the integrity of
|
||||
* a patch before actually applying it.
|
||||
*
|
||||
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
|
||||
* b-maked patch-2.10
|
||||
*
|
||||
* Log: patch.c,v
|
||||
* Revision 2.0.2.0 90/05/01 22:17:50 davison
|
||||
* patch12u: unidiff support added
|
||||
*
|
||||
@@ -296,12 +278,12 @@ char **argv;
|
||||
reverse ? "Assuming" : "Ignoring");
|
||||
}
|
||||
else {
|
||||
ask3(
|
||||
(void) ask3(
|
||||
"%seversed (or previously applied) patch detected! %s -R? [y] ",
|
||||
reverse ? "R" : "Unr",
|
||||
reverse ? "Assume" : "Ignore");
|
||||
if (*buf == 'n') {
|
||||
ask1("Apply anyway? [n] ");
|
||||
(void) ask1("Apply anyway? [n] ");
|
||||
if (*buf == 'y')
|
||||
rev_okayed = TRUE;
|
||||
else
|
||||
@@ -414,6 +396,7 @@ char **argv;
|
||||
set_signals(1);
|
||||
}
|
||||
my_exit(failtotal);
|
||||
return (failtotal);
|
||||
}
|
||||
|
||||
/* Prepare to find the next patch to do in the patch file. */
|
||||
|
||||
+7
-45
@@ -1,45 +1,6 @@
|
||||
/* $Header: /home/ncvs/src/gnu/usr.bin/patch/pch.c,v 1.7 1996/04/11 10:13:40 markm Exp $
|
||||
*
|
||||
* $Log: pch.c,v $
|
||||
* Revision 1.7 1996/04/11 10:13:40 markm
|
||||
* Priorities were broken. If there was an Index: line and *** /--- lines
|
||||
* with valid names, the *** /---names were taken first.
|
||||
* this broke eg:
|
||||
* Index: foo/Makefile
|
||||
* ==========
|
||||
* RCS <blah>
|
||||
* Retrieving <blah>
|
||||
* diff <blah>
|
||||
* *** Makefile <blah>
|
||||
* --- Makefile <blah>
|
||||
*
|
||||
* By trying to patch the Makefile in the _curent_ directory, rather than
|
||||
* the one in the foo/ directory.
|
||||
*
|
||||
* Revision 1.6 1995/09/14 04:33:35 gibbs
|
||||
* Give "Index" specified filenames preference over other filenames specified
|
||||
* in the diff. This makes it so that diffs containing files in different
|
||||
* subdirectories that have the same name not patch the same file. For example
|
||||
* a diff with patches to Makefile, des/Makefile, usr.bin/Makefile would attempt
|
||||
* to patch Makefile three times.
|
||||
*
|
||||
* Revision 1.5 1995/05/30 05:02:35 rgrimes
|
||||
* Remove trailing whitespace.
|
||||
*
|
||||
* Revision 1.4 1994/02/25 21:46:07 phk
|
||||
* added the -C/-check again.
|
||||
*
|
||||
* Revision 1.3 1994/02/17 22:20:36 jkh
|
||||
* Put this back - I was somehow under the erroneous impression that patch was in
|
||||
* ports, until I saw the the commit messages, that is! :-) All changed backed out.
|
||||
*
|
||||
* Revision 1.2 1994/02/17 22:16:05 jkh
|
||||
* From Poul-Henning Kamp - Implement a -C option to verify the integrity of
|
||||
* a patch before actually applying it.
|
||||
*
|
||||
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
|
||||
* b-maked patch-2.10
|
||||
/* $Header: /home/ncvs/src/gnu/usr.bin/patch/pch.c,v 1.8 1996/04/12 11:37:32 markm Exp $
|
||||
*
|
||||
* Log: pch.c,v
|
||||
* Revision 2.0.2.0 90/05/01 22:17:51 davison
|
||||
* patch12u: unidiff support added
|
||||
*
|
||||
@@ -219,7 +180,7 @@ there_is_another_patch()
|
||||
skip_rest_of_patch = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
ask1("File to patch: ");
|
||||
(void) ask1("File to patch: ");
|
||||
if (*buf != '\n') {
|
||||
if (bestguess)
|
||||
free(bestguess);
|
||||
@@ -227,9 +188,10 @@ there_is_another_patch()
|
||||
filearg[0] = fetchname(buf, 0, FALSE);
|
||||
}
|
||||
if (filearg[0] == Nullch) {
|
||||
ask1("No file found--skip this patch? [n] ");
|
||||
if (*buf != 'y') {
|
||||
continue;
|
||||
if (ask1("No file found--skip this patch? [n] ")) {
|
||||
if (*buf != 'y') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (verbose)
|
||||
say1("Skipping patch...\n");
|
||||
|
||||
@@ -169,7 +169,7 @@ Reg1 char *s;
|
||||
}
|
||||
else {
|
||||
t = rv;
|
||||
while (*t++ = *s++);
|
||||
while ((*t++ = *s++));
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@@ -227,7 +227,7 @@ long arg1,arg2,arg3;
|
||||
|
||||
/* Get a response from the user, somehow or other. */
|
||||
|
||||
void
|
||||
int
|
||||
ask(pat,arg1,arg2,arg3)
|
||||
char *pat;
|
||||
long arg1,arg2,arg3;
|
||||
@@ -260,7 +260,9 @@ long arg1,arg2,arg3;
|
||||
}
|
||||
else { /* no terminal at all--default it */
|
||||
buf[0] = '\n';
|
||||
r = 1;
|
||||
buf[1] = 0;
|
||||
say1(buf);
|
||||
return 0; /* signal possible error */
|
||||
}
|
||||
if (r <= 0)
|
||||
buf[0] = 0;
|
||||
@@ -268,6 +270,11 @@ long arg1,arg2,arg3;
|
||||
buf[r] = '\0';
|
||||
if (!tty2)
|
||||
say1(buf);
|
||||
|
||||
if (r <= 0)
|
||||
return 0; /* if there was an error, return it */
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
#endif /* lint */
|
||||
|
||||
@@ -410,7 +417,7 @@ int assume_exists;
|
||||
|
||||
#define try(f, a1, a2) (Sprintf(tmpbuf + pathlen, f, a1, a2), stat(tmpbuf, &filestat) == 0)
|
||||
if ( try("RCS/%s%s", filebase, RCSSUFFIX)
|
||||
|| try("RCS/%s" , filebase, 0)
|
||||
|| try("RCS/%s%s", filebase, "")
|
||||
|| try( "%s%s", filebase, RCSSUFFIX)
|
||||
|| try("SCCS/%s%s", SCCSPREFIX, filebase)
|
||||
|| try( "%s%s", SCCSPREFIX, filebase))
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
/* $Header: /home/ncvs/src/gnu/usr.bin/patch/util.h,v 1.1.1.1 1993/06/19 14:21:52 paul Exp $
|
||||
*
|
||||
* $Log: util.h,v $
|
||||
* Revision 1.1.1.1 1993/06/19 14:21:52 paul
|
||||
* b-maked patch-2.10
|
||||
/* $Header: /home/ncvs/src/gnu/usr.bin/patch/util.h,v 1.2 1995/05/30 05:02:38 rgrimes Exp $
|
||||
*
|
||||
* Log: util.h,v
|
||||
* Revision 2.0 86/09/17 15:40:06 lwall
|
||||
* Baseline for netwide release.
|
||||
*
|
||||
@@ -83,7 +80,7 @@ void copy_file();
|
||||
void say();
|
||||
void fatal();
|
||||
void pfatal();
|
||||
void ask();
|
||||
int ask();
|
||||
char *savestr();
|
||||
void set_signals();
|
||||
void ignore_signals();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
* $Id: malloc.c,v 1.18 1996/10/29 20:35:39 phk Exp $
|
||||
* $Id: malloc.c,v 1.18.2.1 1996/12/30 01:35:15 alex Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -731,7 +731,9 @@ imalloc(size_t size)
|
||||
if (suicide)
|
||||
abort();
|
||||
|
||||
if (size <= malloc_maxsize)
|
||||
if ((size + malloc_pagesize) < size) /* Check for overflow */
|
||||
result = 0;
|
||||
else if (size <= malloc_maxsize)
|
||||
result = malloc_bytes(size);
|
||||
else
|
||||
result = malloc_pages(size);
|
||||
|
||||
+20
-1
@@ -90,6 +90,8 @@ toohard:
|
||||
added[0] = 0;
|
||||
while ( (c = *cp++) ) {
|
||||
if (c != '%') {
|
||||
if (dp >= &result[MAXRETURNSIZE])
|
||||
return ("OVERFLOW");
|
||||
*dp++ = c;
|
||||
continue;
|
||||
}
|
||||
@@ -110,14 +112,20 @@ toohard:
|
||||
/* fall into... */
|
||||
|
||||
case '3':
|
||||
if (dp >= &result[MAXRETURNSIZE])
|
||||
return ("OVERFLOW");
|
||||
*dp++ = (which / 100) | '0';
|
||||
which %= 100;
|
||||
/* fall into... */
|
||||
|
||||
case '2':
|
||||
two:
|
||||
if (dp >= &result[MAXRETURNSIZE])
|
||||
return ("OVERFLOW");
|
||||
*dp++ = which / 10 | '0';
|
||||
one:
|
||||
if (dp >= &result[MAXRETURNSIZE])
|
||||
return ("OVERFLOW");
|
||||
*dp++ = which % 10 | '0';
|
||||
swap:
|
||||
oncol = 1 - oncol;
|
||||
@@ -166,10 +174,17 @@ casedot:
|
||||
* to be the successor of tab.
|
||||
*/
|
||||
do {
|
||||
strcat(added, oncol ? (BC ? BC : "\b") : UP);
|
||||
const char *extra;
|
||||
|
||||
extra = oncol ? (BC ? BC : "\b") : UP;
|
||||
if (strlen(added) + strlen(extra) >= 10)
|
||||
return ("OVERFLOW");
|
||||
strcat(added, extra);
|
||||
which++;
|
||||
} while (which == '\n');
|
||||
}
|
||||
if (dp >= &result[MAXRETURNSIZE])
|
||||
return ("OVERFLOW");
|
||||
*dp++ = which;
|
||||
goto swap;
|
||||
|
||||
@@ -184,6 +199,8 @@ casedot:
|
||||
continue;
|
||||
|
||||
case '%':
|
||||
if (dp >= &result[MAXRETURNSIZE])
|
||||
return ("OVERFLOW");
|
||||
*dp++ = c;
|
||||
continue;
|
||||
|
||||
@@ -203,6 +220,8 @@ casedot:
|
||||
goto toohard;
|
||||
}
|
||||
}
|
||||
if (strlen(added) >= &result[MAXRETURNSIZE] - dp)
|
||||
return ("OVERFLOW");
|
||||
strcpy(dp, added);
|
||||
return (result);
|
||||
}
|
||||
+3
-3
@@ -47,7 +47,7 @@ o E-mail addresses and tech support info:
|
||||
|
||||
For general questions, please send email to :
|
||||
|
||||
[email protected]
|
||||
freebsd-[email protected]
|
||||
|
||||
Please also have patience if your questions are not answered right
|
||||
away - this mailing list is staffed purely by volunteers and they also
|
||||
@@ -63,13 +63,13 @@ changes in status during the life of the bug (or feature request).
|
||||
|
||||
Technical comments on this release should be sent (in English!) to:
|
||||
|
||||
[email protected]
|
||||
freebsd-[email protected]
|
||||
|
||||
Bug reports should be sent using the `send-pr' command or the Web page
|
||||
at http://www.freebsd.org/send-pr.html. If you cannot use either of
|
||||
these two methods, you may also send mail to:
|
||||
|
||||
[email protected]
|
||||
freebsd-[email protected]
|
||||
|
||||
|
||||
PLEASE ALSO BE SURE TO INDICATE WHICH VERSION OF FREEBSD YOU'RE
|
||||
|
||||
@@ -13,7 +13,7 @@ SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c devices.c \
|
||||
msg.c network.c nfs.c options.c package.c register.c samba.c system.c \
|
||||
tape.c tcpip.c termcap.c ufs.c user.c variable.c wizard.c \
|
||||
uc_eisa.c uc_isa.c uc_kmem.c uc_list.c uc_main.c uc_pci.c \
|
||||
uc_scsi.c keymap.h
|
||||
uc_scsi.c keymap.h variable_load.c
|
||||
|
||||
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} -I/sys
|
||||
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS -DSAVE_USERCONFIG
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: attr.c,v 1.8.2.2 1996/12/12 11:18:09 jkh Exp $
|
||||
* $Id: attr.c,v 1.8.2.3 1997/01/19 09:59:22 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -85,7 +85,7 @@ attr_parse(Attribs *attr, FILE *fp)
|
||||
state = NAME;
|
||||
}
|
||||
else {
|
||||
msgDebug("Parse config: Invalid character '%c' at line %d", ch, lno);
|
||||
msgDebug("Parse config: Invalid character '%c' at line %d\n", ch, lno);
|
||||
state = COMMENT; /* Ignore the rest of the line */
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: dist.c,v 1.73.2.21 1997/03/11 17:48:31 jkh Exp $
|
||||
* $Id: dist.c,v 1.73.2.22 1997/03/15 18:00:28 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -665,7 +665,7 @@ distExtractAll(dialogMenuItem *self)
|
||||
|
||||
/* paranoia */
|
||||
if (!Dists) {
|
||||
if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists)
|
||||
if (!dmenuOpenSimple(&MenuDistributions, FALSE) || !Dists)
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
@@ -691,5 +691,3 @@ distExtractAll(dialogMenuItem *self)
|
||||
}
|
||||
return DITEM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: floppy.c,v 1.16.2.3 1997/01/22 00:28:54 jkh Exp $
|
||||
* $Id: floppy.c,v 1.16.2.4 1997/01/24 21:05:52 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -129,9 +129,9 @@ mediaInitFloppy(Device *dev)
|
||||
|
||||
msgDebug("Init floppy called for %s distribution.\n", distWanted ? distWanted : "some");
|
||||
if (!distWanted)
|
||||
msgConfirm("Please insert floppy for %s", dev->description);
|
||||
msgConfirm("Please insert floppy in %s", dev->description);
|
||||
else
|
||||
msgConfirm("Please insert floppy containing %s for %s", distWanted, dev->description);
|
||||
msgConfirm("Please insert floppy containing %s in %s", distWanted, dev->description);
|
||||
|
||||
memset(&dosargs, 0, sizeof dosargs);
|
||||
dosargs.fspec = dev->devname;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
-----------------------------------------
|
||||
FreeBSD 2.2 --- RELEASE Version , ,
|
||||
FreeBSD 2.2.1 --- RELEASE Version , ,
|
||||
----------------------------------------- /( )`
|
||||
\ \___ / |
|
||||
Welcome to the 2.2 RELEASE version of FreeBSD! /- _ `-/ '
|
||||
Welcome to the 2.2.1 RELEASE version of FreeBSD! /- _ `-/ '
|
||||
(/\/ \ \ /\
|
||||
This is the first release on the RELENG_2_2 branch / / | ` \
|
||||
This is a full release on the RELENG_2_2 branch / / | ` \
|
||||
and begins a whole new cycle of FreeBSD release O O ) / |
|
||||
technology, taking over from where 2.1.7-RELEASE `-^--'`< '
|
||||
left off. (_.) _ ) /
|
||||
|
||||
@@ -27,13 +27,6 @@ of registering can help both you and FreeBSD.
|
||||
hardly helpful when you're trying to convince someone to port
|
||||
software to it.
|
||||
|
||||
This process will take time, and we don't expect to receive
|
||||
hundreds of thousands of registrations overnight, but we have
|
||||
to start somewhere and we have to start *now*. It will already
|
||||
take some us time to collect enough registrations that we can
|
||||
actually start influencing some segments of the commercial software
|
||||
market.
|
||||
|
||||
|
||||
2. We will not send you *anything* you do not ask for. Some people
|
||||
are genuinely interested in new product announcements for FreeBSD
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
RELEASE NOTES
|
||||
FreeBSD 2.2-RELEASE
|
||||
FreeBSD 2.2.1-RELEASE
|
||||
|
||||
o For information about the layout of the 2.2-RELEASE directory, see
|
||||
o For information about the layout of the 2.2.1-RELEASE directory, see
|
||||
the ABOUT.TXT file.
|
||||
|
||||
o For general information about FreeBSD, see README.TXT.
|
||||
@@ -9,11 +9,35 @@ o For general information about FreeBSD, see README.TXT.
|
||||
o For installation instructions, see the INSTALL.TXT and HARDWARE.TXT
|
||||
files.
|
||||
|
||||
2.2.1 is a small incremental fix release to 2.2, primarily aimed at
|
||||
fixing:
|
||||
|
||||
o Some recently discovered problems with the Adaptec 2940 driver
|
||||
which could cause instability in very heavily loaded systems (like news
|
||||
servers).
|
||||
|
||||
o A bug which made the package installer fail from CDROM media.
|
||||
|
||||
o Allow the Intel EtherExpress Pro/100B to work in full-duplex mode.
|
||||
|
||||
Since the 2.2.1. release follows 2.2 by just over a week, other
|
||||
documentation still refers to this release as simply "2.2" since it is
|
||||
a complete *replacement* for 2.2.0-RELEASE, not simply another point
|
||||
release following it.
|
||||
|
||||
For even more up-to-date releases along the RELENG_2_2 branch (which
|
||||
is now proceeding onwards toward release 2.2.5), please install from:
|
||||
|
||||
ftp://releng22.freebsd.org/pub/FreeBSD/
|
||||
|
||||
This is a snapshot made of RELENG_2_2 on a daily basis (and containing
|
||||
all the latest 2.2 fixes as of that date).
|
||||
|
||||
|
||||
1. What's new since 2.1.7
|
||||
-------------------------
|
||||
|
||||
Lots of installation bugs fixed, more pc98 changes syncronized, geeze,
|
||||
Lots of installation bugs fixed, more pc98 changes synchronized, geeze,
|
||||
what else?
|
||||
|
||||
gdb 4.16 has been merged from -current, most of the third-party source
|
||||
@@ -30,10 +54,12 @@ their `libm' previously.
|
||||
Javier Martin Rueda's `ex' driver has been merged, bringing support
|
||||
for the Intel EtherExpress Pro/10 network cards.
|
||||
|
||||
The Intel EtherExpress Pro/100B now works in full-duplex mode.
|
||||
|
||||
The `de' driver now recognizes cards using the DE21140A chip, like the
|
||||
popular SMC9332BDT (10/100 Mbit/s) one.
|
||||
|
||||
There's now a workaround for the brokeness of the frequently used
|
||||
There's now a workaround for the brokenness of the frequently used
|
||||
CMD640 PCI IDE chip in the sources, albeit still disabled by default
|
||||
in 2.2.
|
||||
|
||||
@@ -65,7 +91,10 @@ Support for SNMP-style interface MIBs, including full RFC
|
||||
drivers.
|
||||
|
||||
/stand/sysinstall moved even more towards becoming a more general
|
||||
system management tool.
|
||||
system management tool. You can actually add a new, from-scratch
|
||||
formatted disk with it now, from partition label to filesystem
|
||||
creation (though it still doesn't modify your /etc/fstab file to
|
||||
make it permanent).
|
||||
|
||||
The syscons and psm drivers now have a new underlying shared keyboard
|
||||
driver, eliminating many of the previously existing problems with
|
||||
@@ -94,7 +123,7 @@ freed area with junk in order to detect semantical problems in
|
||||
programs that use malloc.
|
||||
|
||||
The `netatalk' implementation of AppleTalk has been integrated into
|
||||
the sources, most of the integration work courtesy Wistle Communic-
|
||||
the sources, most of the integration work courtesy Whistle Communic-
|
||||
ations Corp.
|
||||
|
||||
The mount option `async' allows asynchronous metadata updates on UFS
|
||||
@@ -205,12 +234,12 @@ Buslogic 956c PCI SCSI controller
|
||||
|
||||
SymBios (formerly NCR) 53C810, 53C825, 53c860 and 53c875 PCI SCSI
|
||||
controllers:
|
||||
ASUS SC-200
|
||||
Data Technology DTC3130 (all variants)
|
||||
NCR cards (all)
|
||||
Symbios cards (all)
|
||||
Tekram DC390W, 390U and 390F
|
||||
Tyan S1365
|
||||
ASUS SC-200
|
||||
Data Technology DTC3130 (all variants)
|
||||
NCR cards (all)
|
||||
Symbios cards (all)
|
||||
Tekram DC390W, 390U and 390F
|
||||
Tyan S1365
|
||||
|
||||
Tekram DC390 and DC390T controllers (maybe other cards based on the
|
||||
AMD 53c974 as well).
|
||||
@@ -368,7 +397,7 @@ LAST resort!
|
||||
3.2. CDROM
|
||||
----------
|
||||
|
||||
FreeBSD 2.1.6-RELEASE and 2.2-RELEASE CDs may be ordered on CDROM from:
|
||||
FreeBSD 2.1.7-RELEASE and 2.2-RELEASE CDs may be ordered on CDROM from:
|
||||
|
||||
Walnut Creek CDROM
|
||||
4041 Pike Lane, Suite D
|
||||
@@ -489,8 +518,8 @@ Special mention to:
|
||||
Larry Altneu and Wilko Bulte for providing us with Wangtek
|
||||
and Archive QIC-02 tape drives for testing and driver hacking.
|
||||
|
||||
CalWeb Internet Services for the loan of a P6/200 machine for
|
||||
speedy package building.
|
||||
CalWeb Internet Services for the loan of a P6/200 machine for
|
||||
speedy package building.
|
||||
|
||||
Everyone at Montana State University for their initial support.
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ Syntax:
|
||||
|
||||
Where "var" can be one or more of:
|
||||
|
||||
addUser Add a new user to the system
|
||||
addGroup Add a new group to the system
|
||||
blanktime Screen blank time setting in seconds
|
||||
bootManager Select boot manager: booteasy, standard or none
|
||||
browserBinary Which doc browser to use (default: lynx)
|
||||
@@ -58,6 +56,8 @@ varSize Size of the /var partition to create for Auto
|
||||
|
||||
And "command" can be one or more of:
|
||||
|
||||
addUser Add a new user to the system
|
||||
addGroup Add a new group to the system
|
||||
configAnonFTP Configure system for anonymous FTP
|
||||
configApache Configure and install the Apache WEB server
|
||||
configGated Configure and install gated
|
||||
@@ -97,7 +97,7 @@ mediaSetFtpUserPass Prompt for FTP username and password
|
||||
mediaSetCPIOVerbosity Prompt for CPIO verbosity
|
||||
mediaGetType Prompt for media type
|
||||
optionsEditor Go to options editor
|
||||
|
||||
register Go to registration editor.
|
||||
|
||||
Examples:
|
||||
|
||||
|
||||
+20
-11
@@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: index.c,v 1.38.2.4 1997/01/29 21:46:10 jkh Exp $
|
||||
* $Id: index.c,v 1.38.2.6 1997/03/25 02:45:42 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -56,12 +56,11 @@ _strdup(char *ptr)
|
||||
}
|
||||
|
||||
static char *descrs[] = {
|
||||
"Package Selection", "To mark a package or select a category, move to it and press SPACE.\n"
|
||||
"To unmark a package, press SPACE again. To go to a previous menu,\n"
|
||||
"select the Cancel button. To search for a package by name, press ESC.\n"
|
||||
"To finally extract packages, you should Cancel all the way out of any\n"
|
||||
"submenus and then this top menu. NOTE: The All category selection\n"
|
||||
"creates a very large submenu. If you select it, please be patient.",
|
||||
"Package Selection", "To mark a package, move to it and press SPACE. If the package is\n"
|
||||
"already marked, it will be unmarked or deleted (if installed).\n"
|
||||
"To search for a package by name, press ESC. To select a category,\n"
|
||||
"press RETURN. NOTE: The All category selection creates a very large\n"
|
||||
"submenu. If you select it, please be patient while it comes up.",
|
||||
"Package Targets", "These are the packages you've selected for extraction.\n\n"
|
||||
"If you're sure of these choices, select OK.\n"
|
||||
"If not, select Cancel to go back to the package selection menu.\n",
|
||||
@@ -85,6 +84,7 @@ static char *descrs[] = {
|
||||
"games", "Various and sundry amusements.",
|
||||
"graphics", "Graphics libraries and utilities.",
|
||||
"japanese", "Ported software for the Japanese market.",
|
||||
"korean", "Ported software for the Korean market.",
|
||||
"lang", "Computer languages.",
|
||||
"languages", "Computer languages.",
|
||||
"libraries", "Software development libraries.",
|
||||
@@ -482,12 +482,22 @@ index_menu(PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll)
|
||||
while (1) {
|
||||
n = 0;
|
||||
curr = max = 0;
|
||||
use_helpline(NULL);
|
||||
use_helpfile(NULL);
|
||||
kp = top->kids;
|
||||
if (!hasPackages && plist) {
|
||||
nitems = item_add(nitems, "OK", NULL, NULL, NULL, NULL, NULL, 0, &curr, &max);
|
||||
nitems = item_add(nitems, "Install", NULL, NULL, NULL, NULL, NULL, 0, &curr, &max);
|
||||
}
|
||||
while (kp && kp->name) {
|
||||
char buf[256];
|
||||
IndexEntryPtr ie = kp->data;
|
||||
|
||||
/* Brutally adjust description to fit in menu */
|
||||
SAFE_STRCPY(buf, kp->desc);
|
||||
if (kp->type == PACKAGE)
|
||||
snprintf(buf, sizeof buf, "[%s]", ie->path ? ie->path : "External vendor");
|
||||
else
|
||||
SAFE_STRCPY(buf, kp->desc);
|
||||
if (strlen(buf) > (_MAX_DESC - maxname))
|
||||
buf[_MAX_DESC - maxname] = '\0';
|
||||
nitems = item_add(nitems, kp->name, buf, pkg_checked, pkg_fire, pkg_selected, kp, (int)plist, &curr, &max);
|
||||
@@ -501,9 +511,8 @@ recycle:
|
||||
dialog_clear_norefresh();
|
||||
if (hasPackages)
|
||||
rval = dialog_checklist(top->name, top->desc, -1, -1, n > MAX_MENU ? MAX_MENU : n, -n, nitems, NULL);
|
||||
else /* It's a categories menu */
|
||||
rval = dialog_menu(top->name, top->desc, -1, -1, n > MAX_MENU ? MAX_MENU : n, -n,
|
||||
nitems, NULL, pos, scroll);
|
||||
else
|
||||
rval = dialog_menu(top->name, top->desc, -1, -1, n > MAX_MENU ? MAX_MENU : n, -n, nitems + (plist ? 2 : 0), (char *)plist, pos, scroll);
|
||||
if (rval == -1 && plist) {
|
||||
static char *cp;
|
||||
PkgNodePtr menu;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: install.c,v 1.134.2.36 1997/03/09 22:37:52 jkh Exp $
|
||||
* $Id: install.c,v 1.134.2.38 1997/03/18 07:03:41 mpp Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -281,7 +281,7 @@ installFixitCDROM(dialogMenuItem *self)
|
||||
*/
|
||||
if (symlink("/dist", "/mnt2")) {
|
||||
msgConfirm("Unable to symlink /mnt2 to the CDROM mount point. Please report this\n"
|
||||
"unexpected failure to bugs@freebsd.org.");
|
||||
"unexpected failure to freebsd-bugs@FreeBSD.org.");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
@@ -971,6 +971,7 @@ installVarDefaults(dialogMenuItem *self)
|
||||
variable_set2(VAR_BROWSER_PACKAGE, PACKAGE_LYNX);
|
||||
variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx");
|
||||
variable_set2(VAR_FTP_STATE, "passive");
|
||||
variable_set2(VAR_NFS_SECURE, "YES");
|
||||
variable_set2(VAR_PKG_TMPDIR, "/usr/tmp");
|
||||
variable_set2(VAR_APACHE_PKG, PACKAGE_APACHE);
|
||||
variable_set2(VAR_SAMBA_PKG, PACKAGE_SAMBA);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated for what's essentially a complete rewrite.
|
||||
*
|
||||
* $Id: main.c,v 1.28.2.9 1997/02/15 15:41:42 jkh Exp $
|
||||
* $Id: main.c,v 1.28.2.10 1997/02/20 16:46:39 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -118,32 +118,6 @@ main(int argc, char **argv)
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
#if defined(LOAD_CONFIG_FILE)
|
||||
else {
|
||||
/* If we have a compiled-in startup config file name on
|
||||
the floppy, look for it and try to load it on startup */
|
||||
extern char *distWanted;
|
||||
|
||||
/* Tell mediaSetFloppy() to try floppy now */
|
||||
distWanted = LOAD_CONFIG_FILE;
|
||||
|
||||
/* Try to open the floppy drive if we can do that first */
|
||||
if (DITEM_STATUS(mediaSetFloppy(NULL)) != DITEM_FAILURE && mediaDevice->init(mediaDevice)) {
|
||||
fp = mediaDevice->get(mediaDevice, LOAD_CONFIG_FILE, TRUE);
|
||||
if (fp) {
|
||||
msgNotify("Loading %s pre-configuration file", LOAD_CONFIG_FILE);
|
||||
while (fgets(buf, sizeof buf, fp)) {
|
||||
if (DITEM_STATUS(dispatchCommand(buf)) != DITEM_SUCCESS) {
|
||||
msgDebug("Command `%s' failed - rest of script aborted.\n", buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
mediaDevice->shutdown(mediaDevice);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Begin user dialog at outer menu */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: media.c,v 1.62.2.14 1997/03/07 16:16:58 jkh Exp $
|
||||
* $Id: media.c,v 1.62.2.15 1997/03/11 16:41:15 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -96,7 +96,7 @@ cpioVerbosity()
|
||||
return "";
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
mediaClose(void)
|
||||
{
|
||||
if (mediaDevice)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: menus.c,v 1.89.2.30 1997/03/14 07:01:16 jkh Exp $
|
||||
* $Id: menus.c,v 1.89.2.33 1997/03/25 02:45:52 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -213,6 +213,7 @@ DMenu MenuIndex = {
|
||||
{ "Commit", "Commit any pending actions (dangerous!)", NULL, installCustomCommit },
|
||||
{ "Console settings", "Customize system console behavior.", NULL, dmenuSubmenu, NULL, &MenuSyscons },
|
||||
{ "Configure", "The system configuration menu.", NULL, dmenuSubmenu, NULL, &MenuConfigure },
|
||||
{ "Defaults, Load", "Load default settings.", NULL, variableLoad },
|
||||
{ "Device, Mouse", "The mouse configuration menu.", NULL, dmenuSubmenu, NULL, &MenuMouse },
|
||||
{ "Disklabel", "The disk Label editor", NULL, diskLabelEditor },
|
||||
{ "Dists, All", "Root of the distribution tree.", NULL, dmenuSubmenu, NULL, &MenuDistributions },
|
||||
@@ -286,7 +287,7 @@ DMenu MenuIndex = {
|
||||
/* The initial installation menu */
|
||||
DMenu MenuInitial = {
|
||||
DMENU_NORMAL_TYPE,
|
||||
"Welcome to FreeBSD!", /* title */
|
||||
"Welcome to FreeBSD! [" RELEASE_NAME "]", /* title */
|
||||
"This is the main menu of the FreeBSD installation system. Please\n" /* prompt */
|
||||
"select one of the options below by using the arrow keys or typing the\n"
|
||||
"first character of the option name you're interested in. Invoke an\n"
|
||||
@@ -302,9 +303,10 @@ DMenu MenuInitial = {
|
||||
{ "5 Novice", "Begin a novice installation (for beginners)", NULL, installNovice },
|
||||
{ "6 Express", "Begin a quick installation (for the impatient)", NULL, installExpress },
|
||||
{ "7 Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom },
|
||||
{ "8 Fixit", "Go into repair mode with CDROM or floppy, or start a shell.", NULL, dmenuSubmenu, NULL, &MenuFixit },
|
||||
{ "8 Fixit", "Enter repair mode with CDROM/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit },
|
||||
{ "9 Upgrade", "Upgrade an existing system", NULL, installUpgrade },
|
||||
{ "c Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure },
|
||||
{ "l Load Config","Load default install configuration", NULL, variableLoad },
|
||||
{ "0 Index", "Glossary of functions", NULL, dmenuSubmenu, NULL, &MenuIndex },
|
||||
{ NULL } },
|
||||
};
|
||||
@@ -510,6 +512,8 @@ DMenu MenuMediaFTP = {
|
||||
VAR_FTP_PATH "=ftp://ftp.nl.freebsd.org/pub/FreeBSD/" },
|
||||
{ "Hong Kong", "ftp.hk.super.net", NULL, dmenuSetVariable, NULL,
|
||||
VAR_FTP_PATH "=ftp://ftp.hk.super.net/pub/FreeBSD/" },
|
||||
{ "Iceland", "ftp.is.freebsd.org", NULL, dmenuSetVariable, NULL,
|
||||
VAR_FTP_PATH "=ftp://ftp.is.freebsd.org/pub/FreeBSD/" },
|
||||
{ "Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL,
|
||||
VAR_FTP_PATH "=ftp://ftp.ie.freebsd.org/pub/FreeBSD/" },
|
||||
{ "Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL,
|
||||
@@ -569,9 +573,9 @@ DMenu MenuMediaFTP = {
|
||||
{ "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL,
|
||||
VAR_FTP_PATH "=ftp://ftp.uk.freebsd.org/pub/FreeBSD/" },
|
||||
{ "UK #2", "ftp2.uk.freebsd.org", NULL, dmenuSetVariable, NULL,
|
||||
VAR_FTP_PATH "=ftp://ftp2.uk.freebsd.org/mirrors/FreeBSD/" },
|
||||
VAR_FTP_PATH "=ftp://ftp2.uk.freebsd.org/pub/FreeBSD/" },
|
||||
{ "UK #3", "ftp3.uk.freebsd.org", NULL, dmenuSetVariable, NULL,
|
||||
VAR_FTP_PATH "=ftp://ftp3.uk.freebsd.org/pub/unix/FreeBSD/" },
|
||||
VAR_FTP_PATH "=ftp://ftp3.uk.freebsd.org/pub/FreeBSD/" },
|
||||
{ "USA", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL,
|
||||
VAR_FTP_PATH "=ftp://ftp.freebsd.org/pub/FreeBSD/" },
|
||||
{ "USA #2", "ftp2.freebsd.org", NULL, dmenuSetVariable, NULL,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: package.c,v 1.48.2.7 1997/02/14 21:24:21 jkh Exp $
|
||||
* $Id: package.c,v 1.48.2.8 1997/03/08 11:13:22 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -41,6 +41,14 @@
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
static Boolean sigpipe_caught = FALSE;
|
||||
|
||||
static void
|
||||
catch_pipe(int sig)
|
||||
{
|
||||
sigpipe_caught = TRUE;
|
||||
}
|
||||
|
||||
/* Like package_extract, but assumes current media device */
|
||||
int
|
||||
package_add(char *name)
|
||||
@@ -104,9 +112,10 @@ package_extract(Device *dev, char *name, Boolean depended)
|
||||
sprintf(path, "%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
|
||||
fp = dev->get(dev, path, TRUE);
|
||||
if (fp) {
|
||||
int i, tot, pfd[2];
|
||||
int i = 0, tot, pfd[2];
|
||||
pid_t pid;
|
||||
|
||||
signal(SIGPIPE, catch_pipe);
|
||||
msgNotify("Adding %s%s\nfrom %s", path, depended ? " (as a dependency)" : "", dev->name);
|
||||
pipe(pfd);
|
||||
pid = fork();
|
||||
@@ -128,7 +137,7 @@ package_extract(Device *dev, char *name, Boolean depended)
|
||||
tot = 0;
|
||||
(void)gettimeofday(&start, (struct timezone *)0);
|
||||
|
||||
while ((i = fread(buf, 1, BUFSIZ, fp)) > 0) {
|
||||
while (!sigpipe_caught && (i = fread(buf, 1, BUFSIZ, fp)) > 0) {
|
||||
int seconds;
|
||||
|
||||
tot += i;
|
||||
@@ -143,20 +152,22 @@ package_extract(Device *dev, char *name, Boolean depended)
|
||||
seconds = 1;
|
||||
msgInfo("%10d bytes read from package %s @ %4.1f KBytes/second", tot, name, (tot / seconds) / 1024.0);
|
||||
/* Write it out */
|
||||
if (write(pfd[1], buf, i) != i) {
|
||||
if (sigpipe_caught || write(pfd[1], buf, i) != i) {
|
||||
msgInfo("Write failure to pkg_add! Package may be corrupt.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
close(pfd[1]);
|
||||
fclose(fp);
|
||||
if (i == -1)
|
||||
msgDebug("I/O error while reading in the %s package.\n", name);
|
||||
if (sigpipe_caught)
|
||||
msgInfo("pkg_add(1) apparently did not like the %s package.", name);
|
||||
else if (i == -1)
|
||||
msgInfo("I/O error while reading in the %s package.", name);
|
||||
else
|
||||
msgInfo("Package %s read successfully - waiting for pkg_add", name);
|
||||
msgInfo("Package %s read successfully - waiting for pkg_add(1)", name);
|
||||
refresh();
|
||||
i = waitpid(pid, &tot, 0);
|
||||
if (i < 0 || WEXITSTATUS(tot)) {
|
||||
if (sigpipe_caught || i < 0 || WEXITSTATUS(tot)) {
|
||||
if (variable_get(VAR_NO_CONFIRM))
|
||||
msgNotify("Add of package %s aborted, error code %d -\n"
|
||||
"Please check the debug screen for more info.", name, WEXITSTATUS(tot));
|
||||
@@ -172,6 +183,7 @@ package_extract(Device *dev, char *name, Boolean depended)
|
||||
|
||||
sleep(1);
|
||||
restorescr(w);
|
||||
sigpipe_caught = FALSE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: register.c,v 1.1.2.2 1997/03/14 07:01:18 jkh Exp $
|
||||
* $Id: register.c,v 1.1.2.4 1997/03/16 20:08:22 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1997
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#define REGISTER_HELPFILE "register"
|
||||
#define REGISTRATION_FNAME "/tmp/new-registration"
|
||||
#define REGISTRATION_FNAME "/new-registration"
|
||||
#define REGISTRATION_ADDRESS "[email protected]"
|
||||
#define MAJORDOMO_ADDRESS "[email protected]"
|
||||
|
||||
@@ -64,11 +64,11 @@ static int okbutton, cancelbutton;
|
||||
|
||||
static Layout layout[] = {
|
||||
#define LAYOUT_LASTNAME 0
|
||||
{ 2, 2, LASTNAME_FIELD_LEN - 1, LASTNAME_FIELD_LEN - 1,
|
||||
{ 1, 2, LASTNAME_FIELD_LEN - 1, LASTNAME_FIELD_LEN - 1,
|
||||
"Last Name:", "Your surname (family name) or company name should go here.",
|
||||
lastname, STRINGOBJ, NULL },
|
||||
#define LAYOUT_FIRSTNAME 1
|
||||
{ 2, 36, FIRSTNAME_FIELD_LEN - 1, FIRSTNAME_FIELD_LEN - 1,
|
||||
{ 1, 36, FIRSTNAME_FIELD_LEN - 1, FIRSTNAME_FIELD_LEN - 1,
|
||||
"First Name:", "Your given name or a contact name if registering for a company.",
|
||||
firstname, STRINGOBJ, NULL },
|
||||
#define LAYOUT_EMAIL 2
|
||||
@@ -112,10 +112,10 @@ static Layout layout[] = {
|
||||
#define NEWSLETTER 3
|
||||
|
||||
static struct { int y, x, sel; char *desc, *allowed; } hotspots[] = {
|
||||
{ 7, 35, 0, "Do you wish to receive FreeBSD [ONLY!] related commercial mail?", "Y" },
|
||||
{ 7, 57, 0, "Do you wish to receive FreeBSD [ONLY!] related commercial email?", "Y" },
|
||||
{ 8, 35, 0, "Sign up (with [email protected]) for important announcements?", "Y" },
|
||||
{ 9, 35, 0, "Sign up for the FreeBSD Newsletter? P = Postal (paper) copy, E = Email", "PE" },
|
||||
{ 5, 35, 0, "Do you wish to receive FreeBSD [ONLY!] related commercial mail?", "Y" },
|
||||
{ 5, 57, 0, "Do you wish to receive FreeBSD [ONLY!] related commercial email?", "Y" },
|
||||
{ 6, 35, 0, "Sign up (with [email protected]) for important announcements?", "Y" },
|
||||
{ 10, 35, 0, "Sign up for the FreeBSD Newsletter? P = Postal (paper) copy, E = Email", "PE" },
|
||||
};
|
||||
|
||||
/* Check the accuracy of user's choices before letting them move on */
|
||||
@@ -196,6 +196,7 @@ handle_registration(void)
|
||||
if (hotspots[ANNOUNCE_LIST].sel) {
|
||||
char *cp;
|
||||
|
||||
dialog_clear_norefresh();
|
||||
cp = msgGetInput(email, "What email address would you like to subscribe under?\n"
|
||||
"This is a fairly low-traffic mailing list and only generates\n"
|
||||
"around 5 messages a month, so it's also safe to receive at your\n"
|
||||
@@ -204,6 +205,7 @@ handle_registration(void)
|
||||
msgConfirm("OK, I won't subscribe to announce at this time. To do it manually\n"
|
||||
"yourself, simply send mail to %s.", MAJORDOMO_ADDRESS);
|
||||
else {
|
||||
dialog_clear_norefresh();
|
||||
if (!vsystem("echo subscribe freebsd-announce %s | mail %s", email, MAJORDOMO_ADDRESS))
|
||||
msgConfirm("Your request to join the announce mailing list has been sent.\n"
|
||||
"you should receive notification back in 24 hours or less, otherwise\n"
|
||||
@@ -220,6 +222,7 @@ handle_registration(void)
|
||||
}
|
||||
}
|
||||
else {
|
||||
dialog_clear_norefresh();
|
||||
msgConfirm("OK, your registration has been left in the file %s\n"
|
||||
"When you're connected to the net and ready to send it,\n"
|
||||
"simply type: mail %s < %s\n", REGISTRATION_FNAME,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: sysinstall.h,v 1.82.2.26 1997/03/09 22:37:59 jkh Exp $
|
||||
* $Id: sysinstall.h,v 1.82.2.27 1997/03/15 16:23:11 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@@ -114,6 +114,7 @@
|
||||
#define VAR_HOSTNAME "hostname"
|
||||
#define VAR_IFCONFIG "ifconfig_"
|
||||
#define VAR_INTERFACES "network_interfaces"
|
||||
#define VAR_INSTALL_CFG "installConfig"
|
||||
#define VAR_INSTALL_ROOT "installRoot"
|
||||
#define VAR_IPADDR "ipaddr"
|
||||
#define VAR_LABEL "label"
|
||||
@@ -561,6 +562,7 @@ extern u_char default_scrnmap[];
|
||||
|
||||
/* media.c */
|
||||
extern char *cpioVerbosity(void);
|
||||
extern void mediaClose(void);
|
||||
extern int mediaTimeout(void);
|
||||
extern int mediaSetCDROM(dialogMenuItem *self);
|
||||
extern int mediaSetFloppy(dialogMenuItem *self);
|
||||
@@ -691,6 +693,9 @@ extern char *variable_get(char *var);
|
||||
extern void variable_unset(char *var);
|
||||
extern char *variable_get_value(char *var, char *prompt);
|
||||
|
||||
/* variable_load.c */
|
||||
extern int variableLoad(dialogMenuItem *self);
|
||||
|
||||
/* wizard.c */
|
||||
extern void slice_wizard(Disk *d);
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated for what's essentially a complete rewrite.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 1997
|
||||
* Paul Traina. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY PAUL TRAINA ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL PAUL TRAINA OR HIS KILLER RATS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
#include <sys/signal.h>
|
||||
#include <sys/fcntl.h>
|
||||
|
||||
int
|
||||
variableLoad(dialogMenuItem * self)
|
||||
{
|
||||
extern char *distWanted;
|
||||
int what = DITEM_RESTORE;
|
||||
char *cp, *old;
|
||||
char buf[BUFSIZ];
|
||||
FILE *fp;
|
||||
|
||||
mediaClose();
|
||||
dialog_clear_norefresh();
|
||||
|
||||
if ((cp = variable_get(VAR_INSTALL_CFG)) != NULL) {
|
||||
old = strdup(cp);
|
||||
cp = variable_get_value(VAR_INSTALL_CFG,
|
||||
"Specify the name of a configuration file\n"
|
||||
"residing on a MSDOS or UFS floppy.\n\n"
|
||||
"(default: %s)");
|
||||
if (!cp) {
|
||||
free(old);
|
||||
return DITEM_FAILURE | what;
|
||||
}
|
||||
if (!*cp)
|
||||
variable_set2(VAR_INSTALL_CFG, cp);
|
||||
|
||||
free(old);
|
||||
|
||||
} else {
|
||||
cp = variable_get_value(VAR_INSTALL_CFG,
|
||||
"Specify the name of a configuration file\n"
|
||||
"residing on a MSDOS or UFS floppy.");
|
||||
if (!cp || !*cp) {
|
||||
variable_unset(VAR_INSTALL_CFG);
|
||||
return DITEM_FAILURE | what;
|
||||
}
|
||||
}
|
||||
|
||||
distWanted = cp = variable_get(VAR_INSTALL_CFG);
|
||||
|
||||
/* Try to open the floppy drive if we can do that first */
|
||||
if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE ||
|
||||
mediaDevice->init(mediaDevice)) {
|
||||
msgConfirm("Unable to access floppy.");
|
||||
return DITEM_FAILURE | what;
|
||||
}
|
||||
|
||||
fp = mediaDevice->get(mediaDevice, cp, TRUE);
|
||||
if (!fp) {
|
||||
msgConfirm("Configuration file '%s' not found.");
|
||||
variable_unset(VAR_INSTALL_CFG);
|
||||
what |= DITEM_FAILURE;
|
||||
goto terminate_device;
|
||||
}
|
||||
|
||||
msgNotify("Loading %s pre-configuration file", cp);
|
||||
|
||||
while (fgets(buf, sizeof buf, fp)) {
|
||||
if (DITEM_STATUS(dispatchCommand(buf)) != DITEM_SUCCESS) {
|
||||
msgConfirm("Command `%s' failed - rest of script aborted.\n", buf);
|
||||
what |= DITEM_FAILURE;
|
||||
goto terminate_file;
|
||||
}
|
||||
}
|
||||
what |= DITEM_SUCCESS;
|
||||
|
||||
terminate_file:
|
||||
fclose(fp);
|
||||
|
||||
terminate_device:
|
||||
mediaDevice->shutdown(mediaDevice);
|
||||
|
||||
return what;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- $Id: handbook.sgml,v 1.68 1997/02/22 12:58:34 peter Exp $ -->
|
||||
<!-- $Id: handbook.sgml,v 1.58.2.5 1997/03/15 23:29:34 jkh Exp $ -->
|
||||
<!-- The FreeBSD Documentation Project -->
|
||||
|
||||
<!DOCTYPE linuxdoc PUBLIC "-//FreeBSD//DTD linuxdoc//EN" [
|
||||
@@ -31,7 +31,7 @@
|
||||
<author>
|
||||
<name>The FreeBSD Documentation Project</name>
|
||||
</author>
|
||||
<date>February 1997</date>
|
||||
<date>March 1997</date>
|
||||
|
||||
<abstract>Welcome to FreeBSD! This handbook covers the
|
||||
installation and day to day use of <bf>FreeBSD Release
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- $Id: handbook.sgml,v 1.1.1.1.2.4 1997/03/15 23:32:13 jkh Exp $ -->
|
||||
<!-- $Id: handbook.sgml,v 1.1.1.1.2.5 1997/03/17 04:05:03 jkh Exp $ -->
|
||||
<!-- The FreeBSD Japanese Documentation Project -->
|
||||
<!-- Original revision: 1.68 -->
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<author>
|
||||
<name>FreeBSD ドキュメンテーションプロジェクト</name>
|
||||
</author>
|
||||
<date>1996ǯ12·î</date>
|
||||
<date>1997ǯ3·î</date>
|
||||
|
||||
<abstract>FreeBSD へようこそ! このハンドブックは<bf>FreeBSD Release
|
||||
&rel.current;</bf>のインストールおよび, 日常での使い方について記述したもので,
|
||||
|
||||
@@ -149,7 +149,7 @@ manual page example first appeared in
|
||||
.At v6 .
|
||||
.Sh AUTHOR
|
||||
This
|
||||
manual page was written by Mike Pritchard
|
||||
.Aq [email protected] .
|
||||
manual page was written by
|
||||
.An Mike Pritchard Aq [email protected] .
|
||||
.Sh BUGS
|
||||
The actual code for this command is vaporware.
|
||||
@@ -72,12 +72,7 @@ as follows:
|
||||
#define EXAMPLE_TWO 2
|
||||
.Ed
|
||||
.Sh RETURN VALUES
|
||||
A 0 value is returned if the operation succeeds,
|
||||
otherwise
|
||||
.Fn example
|
||||
returns -1 and the global variable
|
||||
.Va errno
|
||||
indicates the reason for the failure.
|
||||
.Rv -std example
|
||||
.Sh ENVIRONMENT
|
||||
The
|
||||
.Fn example
|
||||
@@ -311,7 +306,7 @@ manual page example first appeared in
|
||||
.At v6 .
|
||||
.Sh AUTHOR
|
||||
This
|
||||
manual page was written by Mike Pritchard
|
||||
.Aq [email protected] .
|
||||
manual page was written by
|
||||
.An Mike Pritchard Aq [email protected] .
|
||||
.Sh BUGS
|
||||
The actual code for this function is vaporware.
|
||||
@@ -94,7 +94,7 @@ manual page example first appeared in
|
||||
.At v6 .
|
||||
.Sh AUTHOR
|
||||
This
|
||||
manual page was written by Mike Pritchard
|
||||
.Aq [email protected] .
|
||||
manual page was written by
|
||||
.An Mike Pritchard Aq [email protected] .
|
||||
.Sh BUGS
|
||||
The actual code for this device driver is vaporware.
|
||||
+29
-29
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)termios.4 8.4 (Berkeley) 4/19/94
|
||||
.\" $Id: termios.4,v 1.5 1997/03/14 05:01:14 mpp Exp $
|
||||
.\" $Id: termios.4,v 1.6 1997/03/18 07:17:22 mpp Exp $
|
||||
.\"
|
||||
.Dd April 19, 1994
|
||||
.Dt TERMIOS 4
|
||||
@@ -354,54 +354,54 @@ members of the
|
||||
array are used to determine how to
|
||||
process the bytes received.
|
||||
.Pp
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
represents the minimum number of bytes that should be received when
|
||||
the
|
||||
.Xr read 2
|
||||
function successfully returns.
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
is a timer of 0.1 second
|
||||
granularity that is used to time out bursty and short term data
|
||||
transmissions. If
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
is greater than
|
||||
.Dv \&{ Dv MAX_INPUT Ns \&} ,
|
||||
the response to the
|
||||
request is undefined. The four possible values for
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
and
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
and
|
||||
their interactions are described below.
|
||||
.Ss "Case A: VMIN > 0, VTIME > 0"
|
||||
.Ss "Case A: MIN > 0, TIME > 0"
|
||||
In this case
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
serves as an inter-byte timer and is activated after
|
||||
the first byte is received. Since it is an inter-byte timer, it is reset
|
||||
after a byte is received. The interaction between
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
and
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
is as
|
||||
follows: as soon as one byte is received, the inter-byte timer is
|
||||
started. If
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
bytes are received before the inter-byte timer expires
|
||||
(remember that the timer is reset upon receipt of each byte), the read is
|
||||
satisfied. If the timer expires before
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
bytes are received, the
|
||||
characters received to that point are returned to the user. Note that if
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
expires at least one byte is returned because the timer would
|
||||
not have been enabled unless a byte was received. In this case
|
||||
.Pf \&( Dv VMIN
|
||||
.Pf \&( Dv MIN
|
||||
> 0,
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
> 0) the read blocks until the
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
and
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
mechanisms are
|
||||
activated by the receipt of the first byte, or a signal is received. If
|
||||
data is in the buffer at the time of the
|
||||
@@ -409,27 +409,27 @@ data is in the buffer at the time of the
|
||||
the result is as
|
||||
if data had been received immediately after the
|
||||
.Fn read .
|
||||
.Ss "Case B: VMIN > 0, VTIME = 0"
|
||||
.Ss "Case B: MIN > 0, TIME = 0"
|
||||
In this case, since the value of
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
is zero, the timer plays no role
|
||||
and only
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
is significant. A pending read is not satisfied until
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
bytes are received (i.e., the pending read blocks until
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
bytes
|
||||
are received), or a signal is received. A program that uses this case to
|
||||
read record-based terminal
|
||||
.Dv I/O
|
||||
may block indefinitely in the read
|
||||
operation.
|
||||
.Ss "Case C: VMIN = 0, VTIME > 0"
|
||||
.Ss "Case C: MIN = 0, TIME > 0"
|
||||
In this case, since
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
= 0,
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
no longer represents an inter-byte
|
||||
timer. It now serves as a read timer that is activated as soon as the
|
||||
read function is processed. A read is satisfied as soon as a single
|
||||
@@ -438,12 +438,12 @@ the timer expires, no bytes are returned. If the timer does not
|
||||
expire, the only way the read can be satisfied is if a byte is received.
|
||||
In this case the read will not block indefinitely waiting for a byte; if
|
||||
no byte is received within
|
||||
.Dv VTIME Ns *0.1
|
||||
.Dv TIME Ns *0.1
|
||||
seconds after the read is initiated,
|
||||
the read returns a value of zero, having read no data. If data is
|
||||
in the buffer at the time of the read, the timer is started as if
|
||||
data had been received immediately after the read.
|
||||
.Ss Case D: VMIN = 0, VTIME = 0
|
||||
.Ss Case D: MIN = 0, TIME = 0
|
||||
The minimum of either the number of bytes requested or the number of
|
||||
bytes currently available is returned without waiting for more
|
||||
bytes to be input. If no characters are available, read returns a
|
||||
@@ -1290,10 +1290,10 @@ If
|
||||
.Dv ICANON
|
||||
is not set, read requests are satisfied directly from the input
|
||||
queue. A read is not satisfied until at least
|
||||
.Dv VMIN
|
||||
.Dv MIN
|
||||
bytes have been
|
||||
received or the timeout value
|
||||
.Dv VTIME
|
||||
.Dv TIME
|
||||
expired between bytes. The time value
|
||||
represents tenths of seconds. See
|
||||
.Sx "Noncanonical Mode Input Processing"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)mdoc.7 8.2 (Berkeley) 12/30/93
|
||||
.\" $Id: mdoc.7,v 1.4 1997/03/07 03:28:15 jmg Exp $
|
||||
.\" $Id: mdoc.7,v 1.6 1997/03/20 16:04:00 mpp Exp $
|
||||
.\"
|
||||
.Dd December 30, 1993
|
||||
.Os
|
||||
@@ -281,7 +281,8 @@ Produces
|
||||
.Ss Manual Domain Macros
|
||||
.Bl -column "Name" "Parsed" Callable" -compact
|
||||
.It Em Name Parsed Callable Description
|
||||
.It Li \&Ad Ta Yes Ta Yes Ta Address. "(This macro may be deprecated.)"
|
||||
.It Li \&Ad Ta Yes Ta Yes Ta "Address. (This macro may be deprecated.)"
|
||||
.It Li \&An Ta Yes Ta Yes Ta "Author name."
|
||||
.It Li \&Ar Ta Yes Ta Yes Ta "Command line argument."
|
||||
.It Li \&Cd Ta \&No Ta \&No Ta "Configuration declaration (section four only)."
|
||||
.It Li \&Cm Ta Yes Ta Yes Ta "Command line argument modifier."
|
||||
@@ -347,6 +348,7 @@ Produces
|
||||
.It Li \&Qq Ta Yes Ta Yes Ta "Strait Double quote."
|
||||
.It Li \&Re Ta \&No Ta \&No Ta "Reference start."
|
||||
.It Li \&Rs Ta \&No Ta \&No Ta "Reference start."
|
||||
.It Li \&Rv Ta \&No Ta \&No Ta "Return values (sections two and three only)."
|
||||
.It Li \&Sc Ta Yes Ta Yes Ta "Single close quote."
|
||||
.It Li \&So Ta Yes Ta Yes Ta "Single open quote."
|
||||
.It Li \&Sq Ta Yes Ta Yes Ta "Single quote."
|
||||
@@ -356,7 +358,7 @@ Produces
|
||||
.It Li \&Tn Ta Yes Ta Yes Ta "Trade or type name (small Caps)."
|
||||
.It Li \&Ux Ta Yes Ta Yes Ta Ux
|
||||
.It Li \&Xc Ta Yes Ta Yes Ta "Extend argument list close."
|
||||
.It Li \&Xo Ta Yes Ta Yes Ta "Extend argument list close."
|
||||
.It Li \&Xo Ta Yes Ta Yes Ta "Extend argument list open."
|
||||
.El
|
||||
.\" .It Sy \&Hf Ta \&No Ta \&No Ta "Include file with header"
|
||||
.Pp
|
||||
|
||||
+145
-81
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93
|
||||
.\" $Id: mdoc.samples.7,v 1.10 1997/03/07 03:28:16 jmg Exp $
|
||||
.\" $Id: mdoc.samples.7,v 1.15 1997/03/20 16:04:04 mpp Exp $
|
||||
.\"
|
||||
.\" This tutorial sampler invokes every macro in the package several
|
||||
.\" times and is guaranteed to give a worst case performance
|
||||
@@ -131,6 +131,7 @@ outlined as follows:
|
||||
.Tn "MANUAL DOMAIN"
|
||||
.Bl -tag -width flag -compact -offset indent
|
||||
.It "Addresses" .
|
||||
.It "Author name" .
|
||||
.It "Arguments" .
|
||||
.It "Configuration Declarations (section four only)" .
|
||||
.It "Command Modifier" .
|
||||
@@ -144,7 +145,6 @@ outlined as follows:
|
||||
.It "Function Types" .
|
||||
.\" .It "Header File (including source code)" .
|
||||
.It "Interactive Commands" .
|
||||
.It "Literals" .
|
||||
.It "Names" .
|
||||
.It "Options" .
|
||||
.It "Pathnames" .
|
||||
@@ -157,7 +157,6 @@ outlined as follows:
|
||||
.It "AT&T Macro" .
|
||||
.It "BSD Macro" .
|
||||
.It "UNIX Macro" .
|
||||
.It "Emphasis Macro" .
|
||||
.It "Enclosure/Quoting Macros"
|
||||
.Bl -tag -width flag -compact -offset indent
|
||||
.It "Angle Bracket Quote/Enclosure" .
|
||||
@@ -171,8 +170,8 @@ outlined as follows:
|
||||
.It "No\-Op or Normal Text Macro" .
|
||||
.It "No Space Macro" .
|
||||
.It "Section Cross References" .
|
||||
.It "Symbolic Macro" .
|
||||
.It "References and Citations" .
|
||||
.It "Return Values (sections two and three only)"
|
||||
.It "Trade Names (Acronyms and Type Names)" .
|
||||
.El
|
||||
.It
|
||||
@@ -182,6 +181,7 @@ outlined as follows:
|
||||
.It "Paragraphs and Line Spacing" .
|
||||
.It "Keeps" .
|
||||
.It "Displays" .
|
||||
.It "Font Modes (Emphasis, Literal, and Symbolic)" .
|
||||
.It "Lists and Columns" .
|
||||
.El
|
||||
.It
|
||||
@@ -825,6 +825,33 @@ It is an error to call
|
||||
without arguments.
|
||||
.Li \&.Ad
|
||||
is callable by other macros and is parsed.
|
||||
.Ss Author Name
|
||||
The
|
||||
.Ql \&.An
|
||||
macro is used to specify the name of the author of the item being
|
||||
documented, or the name of the author of the actual manual page.
|
||||
Any remaining arguments after the name information are assumed
|
||||
to be punctuation.
|
||||
.Pp
|
||||
.Dl Usage: .An author_name \*(Pu
|
||||
.Bl -tag -width ".An Joe Author ) ) ," -compact -offset 14n
|
||||
.It Li \&.An Joe\ Author
|
||||
.An Joe Author
|
||||
.It Li \&.An Joe\ Author\ ,
|
||||
.An Joe\ Author ,
|
||||
.It Li \&.An Joe\ Author\ \&Aq\ [email protected]
|
||||
.An Joe Author Aq [email protected]
|
||||
.It Li \&.An Joe\ Author\ )\ )\ ,
|
||||
.An Joe Author ) ) ,
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Ql \&.An
|
||||
macro is parsed and is callable.
|
||||
It is an error to call
|
||||
.Ql \&.An
|
||||
without
|
||||
any arguments.
|
||||
.Ss Argument Macro
|
||||
The
|
||||
.Li \&.Ar
|
||||
@@ -1160,7 +1187,7 @@ The
|
||||
.Ql \&.Ic
|
||||
macro designates an interactive or internal command.
|
||||
.Pp
|
||||
.Dl Usage: .Li argument ... \*(Pu
|
||||
.Dl Usage: .Ic argument ... \*(Pu
|
||||
.Bl -tag -width ".Ic setenv , unsetenvxx" -compact -offset 14n
|
||||
.It Li \&.Ic :wq
|
||||
.Ic :wq
|
||||
@@ -1176,28 +1203,6 @@ without arguments.
|
||||
The
|
||||
.Ql \&.Ic
|
||||
macro is parsed and is callable.
|
||||
.Ss Literals
|
||||
The
|
||||
.Ql \&.Li
|
||||
literal macro may be used for special characters,
|
||||
variable constants, anything which should be displayed as it
|
||||
would be typed.
|
||||
.Pp
|
||||
.Dl Usage: .Li argument ... \*(Pu
|
||||
.Bl -tag -width ".Li cntrl-D ) ," -compact -offset 14n
|
||||
.It Li \&.Li \een
|
||||
.Li \en
|
||||
.It Li \&.Li M1 M2 M3\ ;
|
||||
.Li M1 M2 M3 ;
|
||||
.It Li \&.Li cntrl-D\ )\ ,
|
||||
.Li cntrl-D ) ,
|
||||
.It Li \&.Li 1024\ ...
|
||||
.Li 1024 ...
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Ql \&.Li
|
||||
macro is parsed and is callable.
|
||||
.Ss Name Macro
|
||||
The
|
||||
.Ql \&.Nm
|
||||
@@ -1431,44 +1436,6 @@ callable. It accepts at most two arguments.
|
||||
The
|
||||
.Ql \&.Ux
|
||||
macro is parsed and is callable.
|
||||
.Ss Emphasis Macro
|
||||
Text may be stressed or emphasized with the
|
||||
.Ql \&.Em
|
||||
macro.
|
||||
The usual font for emphasis is italic.
|
||||
.Pp
|
||||
.Dl Usage: .Em argument ... \*(Pu
|
||||
.Bl -tag -width ".Em vide infra ) ) ," -compact -offset 14n
|
||||
.It Li ".Em does not"
|
||||
.Em does not
|
||||
.It Li ".Em exceed 1024 ."
|
||||
.Em exceed 1024 .
|
||||
.It Li ".Em vide infra ) ) ,"
|
||||
.Em vide infra ) ) ,
|
||||
.El
|
||||
.\" .Pp
|
||||
.\" The emphasis can be forced across several lines of text by using
|
||||
.\" the
|
||||
.\" .Ql \&.Bf
|
||||
.\" macro discussed in
|
||||
.\" .Sx Modes
|
||||
.\" under
|
||||
.\" .Sx PAGE STRUCTURE DOMAIN .
|
||||
.\" .Pp
|
||||
.\" .Bf -emphasis
|
||||
.\" We are certain the reason most people desire a Harvard MBA
|
||||
.\" so they can become to be successful philanthropists. Only
|
||||
.\" mathematicians and physicists go to graduate school strictly
|
||||
.\" to acquire infinite wealthy and fame. Its that infinity
|
||||
.\" word that does it to them. Ruins them.
|
||||
.\" .Ef
|
||||
.Pp
|
||||
The
|
||||
.Ql \&.Em
|
||||
macro is parsed and is callable.
|
||||
It is an error to call
|
||||
.Ql \&.Em
|
||||
without arguments.
|
||||
.Ss Enclosure and Quoting Macros
|
||||
The concept of enclosure is similar to quoting.
|
||||
The object being to enclose one or more strings between
|
||||
@@ -1629,22 +1596,6 @@ It is parsed and is callable.
|
||||
.It Li \&.Sx FILES
|
||||
.Sx FILES
|
||||
.El
|
||||
.Ss Symbolic
|
||||
The symbolic emphasis macro is generally a boldface macro in
|
||||
either the symbolic sense or the traditional English usage.
|
||||
.Pp
|
||||
.Dl Usage: .Sy symbol ... \*(Pu
|
||||
.Bl -tag -width ".Sy Important Noticex" -compact -offset 14n
|
||||
.It Li \&.Sy Important Notice
|
||||
.Sy Important Notice
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Ql \&.Sy
|
||||
macro is parsed and is callable.
|
||||
Arguments to
|
||||
.Ql \&.Sy
|
||||
may be quoted.
|
||||
.Ss References and Citations
|
||||
The following macros make a modest attempt to handle references.
|
||||
At best, the macros make it convenient to manually drop in a subset of
|
||||
@@ -1692,6 +1643,23 @@ The purpose is to allow trade names
|
||||
to be pretty printed in
|
||||
.Xr troff Ns / Ns Xr ditroff
|
||||
output.
|
||||
.Ss Return Values
|
||||
The
|
||||
.Ql \&.Rv
|
||||
macro generates text for use in the
|
||||
.Sx RETURN VALUES
|
||||
section.
|
||||
.Pp
|
||||
.Dl Usage: .Rv [-std function]
|
||||
.Pp
|
||||
.Ql \&.Rv -std atexit
|
||||
will generate the following text:
|
||||
.Pp
|
||||
.Rv -std atexit
|
||||
.Pp
|
||||
The
|
||||
.Fl std
|
||||
option is valid only for manual page sections 2 and 3.
|
||||
.Ss Trade Names (or Acronyms and Type Names)
|
||||
The trade name macro is generally a small caps macro for
|
||||
all upper case words longer than two characters.
|
||||
@@ -2314,6 +2282,102 @@ work and perhaps may never do the right thing by
|
||||
.It ".Ed"
|
||||
End-display.
|
||||
.El
|
||||
.Ss Font Modes
|
||||
There are five macros for changing the appearance of the manual page text:
|
||||
.Bl -tag -width \&.Emxx
|
||||
.It \&.Em
|
||||
Text may be stressed or emphasized with the
|
||||
.Ql \&.Em
|
||||
macro.
|
||||
The usual font for emphasis is italic.
|
||||
.Pp
|
||||
.Dl Usage: .Em argument ... \*(Pu
|
||||
.Bl -tag -width ".Em vide infra ) ) ," -compact -offset 14n
|
||||
.It Li ".Em does not"
|
||||
.Em does not
|
||||
.It Li ".Em exceed 1024 ."
|
||||
.Em exceed 1024 .
|
||||
.It Li ".Em vide infra ) ) ,"
|
||||
.Em vide infra ) ) ,
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Ql \&.Em
|
||||
macro is parsed and is callable.
|
||||
It is an error to call
|
||||
.Ql \&.Em
|
||||
without arguments.
|
||||
.It \&.Li
|
||||
The
|
||||
.Ql \&.Li
|
||||
literal macro may be used for special characters,
|
||||
variable constants, anything which should be displayed as it
|
||||
would be typed.
|
||||
.Pp
|
||||
.Dl Usage: .Li argument ... \*(Pu
|
||||
.Bl -tag -width ".Li cntrl-D ) ," -compact -offset 14n
|
||||
.It Li \&.Li \een
|
||||
.Li \en
|
||||
.It Li \&.Li M1 M2 M3\ ;
|
||||
.Li M1 M2 M3 ;
|
||||
.It Li \&.Li cntrl-D\ )\ ,
|
||||
.Li cntrl-D ) ,
|
||||
.It Li \&.Li 1024\ ...
|
||||
.Li 1024 ...
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Ql \&.Li
|
||||
macro is parsed and is callable.
|
||||
.It \&.Sy
|
||||
The symbolic emphasis macro is generally a boldface macro in
|
||||
either the symbolic sense or the traditional English usage.
|
||||
.Pp
|
||||
.Dl Usage: .Sy symbol ... \*(Pu
|
||||
.Bl -tag -width ".Sy Important Noticex" -compact -offset 14n
|
||||
.It Li \&.Sy Important Notice
|
||||
.Sy Important Notice
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Ql \&.Sy
|
||||
macro is parsed and is callable.
|
||||
Arguments to
|
||||
.Ql \&.Sy
|
||||
may be quoted.
|
||||
.It Li \&.Bf
|
||||
Begin font mode.
|
||||
The
|
||||
.Ql \&.Bf
|
||||
font mode must be ended with the
|
||||
.Ql \&.Ef
|
||||
macro.
|
||||
Font modes may be nested within other font modes.
|
||||
.Ql \&.Bf
|
||||
has the following syntax:
|
||||
.Pp
|
||||
.Dl ".Bf font-mode"
|
||||
.Pp
|
||||
The font-mode must be one of the following three types:
|
||||
.Ql \&.Bf .
|
||||
.Pp
|
||||
.Bl -tag -width "file file_name " -compact
|
||||
.It Sy \&Em | Fl emphasis
|
||||
Same as if the
|
||||
.Ql \&.Em
|
||||
macro was used for the entire block of text.
|
||||
.It Sy \&Li | Fl literal
|
||||
Same as if the
|
||||
.Ql \&.Li
|
||||
macro was used for the entire block of text.
|
||||
.It Sy \&Sy | Fl symbolic
|
||||
Same as if the
|
||||
.Ql \&.Sy
|
||||
macro was used for the entire block of text.
|
||||
.El
|
||||
.It ".Ef"
|
||||
End font mode.
|
||||
.El
|
||||
.Ss Tagged Lists and Columns
|
||||
There are several types of lists which may be initiated with the
|
||||
.Ql ".Bl"
|
||||
|
||||
+2
-1
@@ -301,7 +301,8 @@ nfs/nfs_vfsops.c optional nfs
|
||||
nfs/nfs_vnops.c optional nfs
|
||||
pccard/pccard.c optional crd
|
||||
pccard/pcic.c optional pcic device-driver
|
||||
pci/aic7870.c optional ahc device-driver
|
||||
pci/aic7870.c optional ahc device-driver \
|
||||
dependency "aic7xxx_reg.h $S/pci/aic7870.c"
|
||||
pci/bt9xx.c optional bt device-driver
|
||||
pci/cy_pci.c optional cy device-driver
|
||||
pci/if_de.c optional de device-driver
|
||||
|
||||
+2
-2
@@ -32,10 +32,10 @@
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
|
||||
# $Id: newvers.sh,v 1.26.2.7 1997/02/19 06:08:42 asami Exp $
|
||||
# $Id: newvers.sh,v 1.26.2.8 1997/03/15 23:29:16 jkh Exp $
|
||||
|
||||
TYPE="FreeBSD"
|
||||
REVISION="2.2"
|
||||
REVISION="2.2.1"
|
||||
BRANCH="RELEASE"
|
||||
RELEASE="${REVISION}-${BRANCH}"
|
||||
SNAPDATE=""
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# $Id$
|
||||
|
||||
PROG= aic7xxx_asm
|
||||
|
||||
CSRCS= aic7xxx_asm.c symbol.c
|
||||
GENSRCS= gram.c scan.c
|
||||
|
||||
GENHDRS= y.tab.h token.h
|
||||
# Hack so non root users you can build kernels
|
||||
BINOWN!= id -u -n
|
||||
BINGRP!= id -g -n
|
||||
|
||||
SRCS= ${GENSRCS} ${CSRCS}
|
||||
CLEANFILES+= ${GENSRCS} ${GENHDRS} y.output
|
||||
DPADD+= ${LIBL}
|
||||
LDADD+= -ll
|
||||
NOMAN= noman
|
||||
.include <bsd.prog.mk>
|
||||
File diff suppressed because it is too large.
Load diff
+526
-535
File diff suppressed because it is too large.
Load diff
@@ -1,70 +0,0 @@
|
||||
.\" Copyright (c) 1994, 1995
|
||||
.\" Justin T. Gibbs. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\"
|
||||
.Dd November 11, 1994
|
||||
.Dt AIC7XXX_ASM 1
|
||||
.Os BSD 4
|
||||
.Sh NAME
|
||||
.Nm aic7xxx_asm
|
||||
.Nd Assembler for the Adaptec aic7xxx family of asics
|
||||
.Sh SYNOPSIS
|
||||
.Nm aic7xxx_asm
|
||||
.Op Fl d
|
||||
.Op Fl D Ar variable=value
|
||||
.Op Fl v
|
||||
.Op Fl o Ar file
|
||||
.Ar source-file
|
||||
.Sh DESCRIPTION
|
||||
The Adaptec aic7xxx family of asics are single chip SCSI controllers with a
|
||||
RISC like command processor. This assembler parses the language outlined
|
||||
in the Adaptec technical document
|
||||
.%T "AIC-7770 (EISA/ISA Bus Master Single-Chip SCSI Host Adaptor) Data Book"
|
||||
and produces ascii output intended for a C byte array.
|
||||
.Pp
|
||||
The aic7xxx assembler is required to compile kernels with aic7xxx SCSI
|
||||
adaptor support (AHA-274x, AHA-284x, AHA-294x controllers) and is compiled,
|
||||
installed, and used automatically in the kernel compile directory when
|
||||
necessary.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl D Ar variable=value
|
||||
Define
|
||||
.Ar variable
|
||||
to be
|
||||
.Ar value
|
||||
in the global context
|
||||
.It Fl d
|
||||
Turn on debugging
|
||||
.It Fl v
|
||||
Print version information
|
||||
.It Fl o Ar file
|
||||
Redirect assembler output to
|
||||
.Ar file
|
||||
.Pp
|
||||
.Sh AUTHOR
|
||||
This aic7770 assembler was written by
|
||||
John Aycock ([email protected])
|
||||
+428
-631
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters
|
||||
*
|
||||
* Copyright (c) 1997 Justin T. Gibbs.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <sys/queue.h>
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
typedef struct path_entry {
|
||||
char *directory;
|
||||
int quoted_includes_only;
|
||||
SLIST_ENTRY(path_entry) links;
|
||||
} *path_entry_t;
|
||||
|
||||
typedef enum {
|
||||
QUOTED_INCLUDE,
|
||||
BRACKETED_INCLUDE,
|
||||
SOURCE_FILE
|
||||
} include_type;
|
||||
|
||||
SLIST_HEAD(path_list, path_entry);
|
||||
|
||||
extern struct path_list search_path;
|
||||
extern struct symlist patch_options;
|
||||
extern int includes_search_curdir; /* False if we've seen -I- */
|
||||
extern char *appname;
|
||||
extern int yylineno;
|
||||
extern char *yyfilename;
|
||||
|
||||
void stop __P((const char *errstring, int err_code));
|
||||
void include_file __P((char *file_name, include_type type));
|
||||
struct instruction *seq_alloc __P((void));
|
||||
struct patch *patch_alloc __P((void));
|
||||
@@ -1,801 +0,0 @@
|
||||
/*
|
||||
* Aic7xxx register and scratch ram definitions.
|
||||
*
|
||||
* Copyright (c) 1994, 1995, 1996, 1997 Justin T. Gibbs.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* This header is shared by the sequencer code and the kernel level driver.
|
||||
*
|
||||
* All page numbers refer to the Adaptec AIC-7770 Data Book availible from
|
||||
* Adaptec's Technical Documents Department 1-800-934-2766
|
||||
*/
|
||||
|
||||
/*
|
||||
* SCSI Sequence Control (p. 3-11).
|
||||
* Each bit, when set starts a specific SCSI sequence on the bus
|
||||
*/
|
||||
#define SCSISEQ 0x000
|
||||
#define TEMODEO 0x80
|
||||
#define ENSELO 0x40
|
||||
#define ENSELI 0x20
|
||||
#define ENRSELI 0x10
|
||||
#define ENAUTOATNO 0x08
|
||||
#define ENAUTOATNI 0x04
|
||||
#define ENAUTOATNP 0x02
|
||||
#define SCSIRSTO 0x01
|
||||
|
||||
/*
|
||||
* SCSI Transfer Control 0 Register (pp. 3-13).
|
||||
* Controls the SCSI module data path.
|
||||
*/
|
||||
#define SXFRCTL0 0x001
|
||||
#define DFON 0x80
|
||||
#define DFPEXP 0x40
|
||||
#define FAST20 0x20
|
||||
#define CLRSTCNT 0x10
|
||||
#define SPIOEN 0x08
|
||||
#define SCAMEN 0x04
|
||||
#define CLRCHN 0x02
|
||||
/* UNUSED 0x01 */
|
||||
|
||||
/*
|
||||
* SCSI Transfer Control 1 Register (pp. 3-14,15).
|
||||
* Controls the SCSI module data path.
|
||||
*/
|
||||
#define SXFRCTL1 0x002
|
||||
#define BITBUCKET 0x80
|
||||
#define SWRAPEN 0x40
|
||||
#define ENSPCHK 0x20
|
||||
#define STIMESEL 0x18
|
||||
#define ENSTIMER 0x04
|
||||
#define ACTNEGEN 0x02
|
||||
#define STPWEN 0x01 /* Powered Termination */
|
||||
|
||||
/*
|
||||
* SCSI Control Signal Read Register (p. 3-15).
|
||||
* Reads the actual state of the SCSI bus pins
|
||||
*/
|
||||
#define SCSISIGI 0x003
|
||||
#define CDI 0x80
|
||||
#define IOI 0x40
|
||||
#define MSGI 0x20
|
||||
#define ATNI 0x10
|
||||
#define SELI 0x08
|
||||
#define BSYI 0x04
|
||||
#define REQI 0x02
|
||||
#define ACKI 0x01
|
||||
|
||||
/*
|
||||
* Possible phases in SCSISIGI
|
||||
*/
|
||||
#define PHASE_MASK 0xe0
|
||||
#define P_DATAOUT 0x00
|
||||
#define P_DATAIN 0x40
|
||||
#define P_COMMAND 0x80
|
||||
#define P_MESGOUT 0xa0
|
||||
#define P_STATUS 0xc0
|
||||
#define P_MESGIN 0xe0
|
||||
/*
|
||||
* SCSI Contol Signal Write Register (p. 3-16).
|
||||
* Writing to this register modifies the control signals on the bus. Only
|
||||
* those signals that are allowed in the current mode (Initiator/Target) are
|
||||
* asserted.
|
||||
*/
|
||||
#define SCSISIGO 0x003
|
||||
#define CDO 0x80
|
||||
#define IOO 0x40
|
||||
#define MSGO 0x20
|
||||
#define ATNO 0x10
|
||||
#define SELO 0x08
|
||||
#define BSYO 0x04
|
||||
#define REQO 0x02
|
||||
#define ACKO 0x01
|
||||
|
||||
/*
|
||||
* SCSI Rate Control (p. 3-17).
|
||||
* Contents of this register determine the Synchronous SCSI data transfer
|
||||
* rate and the maximum synchronous Req/Ack offset. An offset of 0 in the
|
||||
* SOFS (3:0) bits disables synchronous data transfers. Any offset value
|
||||
* greater than 0 enables synchronous transfers.
|
||||
*/
|
||||
#define SCSIRATE 0x004
|
||||
#define WIDEXFER 0x80 /* Wide transfer control */
|
||||
#define SXFR 0x70 /* Sync transfer rate */
|
||||
#define SOFS 0x0f /* Sync offset */
|
||||
|
||||
/*
|
||||
* SCSI ID (p. 3-18).
|
||||
* Contains the ID of the board and the current target on the
|
||||
* selected channel.
|
||||
*/
|
||||
#define SCSIID 0x005
|
||||
#define TID 0xf0 /* Target ID mask */
|
||||
#define OID 0x0f /* Our ID mask */
|
||||
|
||||
/*
|
||||
* SCSI Latched Data (p. 3-19).
|
||||
* Read/Write latchs used to transfer data on the SCSI bus during
|
||||
* Automatic or Manual PIO mode. SCSIDATH can be used for the
|
||||
* upper byte of a 16bit wide asyncronouse data phase transfer.
|
||||
*/
|
||||
#define SCSIDATL 0x006
|
||||
#define SCSIDATH 0x007
|
||||
|
||||
/*
|
||||
* SCSI Transfer Count (pp. 3-19,20)
|
||||
* These registers count down the number of bytes transfered
|
||||
* across the SCSI bus. The counter is decremented only once
|
||||
* the data has been safely transfered. SDONE in SSTAT0 is
|
||||
* set when STCNT goes to 0
|
||||
*/
|
||||
#define STCNT 0x008
|
||||
#define STCNT0 0x008
|
||||
#define STCNT1 0x009
|
||||
#define STCNT2 0x00a
|
||||
|
||||
/*
|
||||
* Clear SCSI Interrupt 0 (p. 3-20)
|
||||
* Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
|
||||
*/
|
||||
#define CLRSINT0 0x00b
|
||||
#define CLRSELDO 0x40
|
||||
#define CLRSELDI 0x20
|
||||
#define CLRSELINGO 0x10
|
||||
#define CLRSWRAP 0x08
|
||||
/* UNUSED 0x04 */
|
||||
#define CLRSPIORDY 0x02
|
||||
/* UNUSED 0x01 */
|
||||
|
||||
/*
|
||||
* SCSI Status 0 (p. 3-21)
|
||||
* Contains one set of SCSI Interrupt codes
|
||||
* These are most likely of interest to the sequencer
|
||||
*/
|
||||
#define SSTAT0 0x00b
|
||||
#define TARGET 0x80 /* Board acting as target */
|
||||
#define SELDO 0x40 /* Selection Done */
|
||||
#define SELDI 0x20 /* Board has been selected */
|
||||
#define SELINGO 0x10 /* Selection In Progress */
|
||||
#define SWRAP 0x08 /* 24bit counter wrap */
|
||||
#define SDONE 0x04 /* STCNT = 0x000000 */
|
||||
#define SPIORDY 0x02 /* SCSI PIO Ready */
|
||||
#define DMADONE 0x01 /* DMA transfer completed */
|
||||
|
||||
/*
|
||||
* Clear SCSI Interrupt 1 (p. 3-23)
|
||||
* Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
|
||||
*/
|
||||
#define CLRSINT1 0x00c
|
||||
#define CLRSELTIMEO 0x80
|
||||
#define CLRATNO 0x40
|
||||
#define CLRSCSIRSTI 0x20
|
||||
/* UNUSED 0x10 */
|
||||
#define CLRBUSFREE 0x08
|
||||
#define CLRSCSIPERR 0x04
|
||||
#define CLRPHASECHG 0x02
|
||||
#define CLRREQINIT 0x01
|
||||
|
||||
/*
|
||||
* SCSI Status 1 (p. 3-24)
|
||||
*/
|
||||
#define SSTAT1 0x00c
|
||||
#define SELTO 0x80
|
||||
#define ATNTARG 0x40
|
||||
#define SCSIRSTI 0x20
|
||||
#define PHASEMIS 0x10
|
||||
#define BUSFREE 0x08
|
||||
#define SCSIPERR 0x04
|
||||
#define PHASECHG 0x02
|
||||
#define REQINIT 0x01
|
||||
|
||||
/*
|
||||
* SCSI Interrupt Mode 1 (pp. 3-28,29)
|
||||
* Setting any bit will enable the corresponding function
|
||||
* in SIMODE1 to interrupt via the IRQ pin.
|
||||
*/
|
||||
#define SIMODE1 0x011
|
||||
#define ENSELTIMO 0x80
|
||||
#define ENATNTARG 0x40
|
||||
#define ENSCSIRST 0x20
|
||||
#define ENPHASEMIS 0x10
|
||||
#define ENBUSFREE 0x08
|
||||
#define ENSCSIPERR 0x04
|
||||
#define ENPHASECHG 0x02
|
||||
#define ENREQINIT 0x01
|
||||
|
||||
/*
|
||||
* SCSI Data Bus (High) (p. 3-29)
|
||||
* This register reads data on the SCSI Data bus directly.
|
||||
*/
|
||||
#define SCSIBUSL 0x012
|
||||
#define SCSIBUSH 0x013
|
||||
|
||||
/*
|
||||
* SCSI/Host Address (p. 3-30)
|
||||
* These registers hold the host address for the byte about to be
|
||||
* transfered on the SCSI bus. They are counted up in the same
|
||||
* manner as STCNT is counted down. SHADDR should always be used
|
||||
* to determine the address of the last byte transfered since HADDR
|
||||
* can be squewed by write ahead.
|
||||
*/
|
||||
#define SHADDR 0x014
|
||||
#define SHADDR0 0x014
|
||||
#define SHADDR1 0x015
|
||||
#define SHADDR2 0x016
|
||||
#define SHADDR3 0x017
|
||||
|
||||
/*
|
||||
* Selection/Reselection ID (p. 3-31)
|
||||
* Upper four bits are the device id. The ONEBIT is set when the re/selecting
|
||||
* device did not set its own ID.
|
||||
*/
|
||||
#define SELID 0x019
|
||||
#define SELID_MASK 0xf0
|
||||
#define ONEBIT 0x08
|
||||
/* UNUSED 0x07 */
|
||||
|
||||
/*
|
||||
* SCSI Block Control (p. 3-32)
|
||||
* Controls Bus type and channel selection. In a twin channel configuration
|
||||
* addresses 0x00-0x1e are gated to the appropriate channel based on this
|
||||
* register. SELWIDE allows for the coexistence of 8bit and 16bit devices
|
||||
* on a wide bus.
|
||||
*/
|
||||
#define SBLKCTL 0x01f
|
||||
#define DIAGLEDEN 0x80 /* Aic78X0 only */
|
||||
#define DIAGLEDON 0x40 /* Aic78X0 only */
|
||||
#define AUTOFLUSHDIS 0x20
|
||||
/* UNUSED 0x10 */
|
||||
#define SELBUS_MASK 0x0a
|
||||
#define SELBUSB 0x08
|
||||
/* UNUSED 0x04 */
|
||||
#define SELWIDE 0x02
|
||||
/* UNUSED 0x01 */
|
||||
#define SELNARROW 0x00
|
||||
|
||||
/*
|
||||
* Sequencer Control (p. 3-33)
|
||||
* Error detection mode and speed configuration
|
||||
*/
|
||||
#define SEQCTL 0x060
|
||||
#define PERRORDIS 0x80
|
||||
#define PAUSEDIS 0x40
|
||||
#define FAILDIS 0x20
|
||||
#define FASTMODE 0x10
|
||||
#define BRKADRINTEN 0x08
|
||||
#define STEP 0x04
|
||||
#define SEQRESET 0x02
|
||||
#define LOADRAM 0x01
|
||||
|
||||
/*
|
||||
* Sequencer RAM Data (p. 3-34)
|
||||
* Single byte window into the Scratch Ram area starting at the address
|
||||
* specified by SEQADDR0 and SEQADDR1. To write a full word, simply write
|
||||
* four bytes in sucessesion. The SEQADDRs will increment after the most
|
||||
* significant byte is written
|
||||
*/
|
||||
#define SEQRAM 0x061
|
||||
|
||||
/*
|
||||
* Sequencer Address Registers (p. 3-35)
|
||||
* Only the first bit of SEQADDR1 holds addressing information
|
||||
*/
|
||||
#define SEQADDR0 0x062
|
||||
#define SEQADDR1 0x063
|
||||
#define SEQADDR1_MASK 0x01
|
||||
|
||||
/*
|
||||
* Accumulator
|
||||
* We cheat by passing arguments in the Accumulator up to the kernel driver
|
||||
*/
|
||||
#define ACCUM 0x064
|
||||
|
||||
#define SINDEX 0x065
|
||||
#define DINDEX 0x066
|
||||
#define ALLONES 0x069
|
||||
#define ALLZEROS 0x06a
|
||||
#define NONE 0x06a
|
||||
#define SINDIR 0x06c
|
||||
#define DINDIR 0x06d
|
||||
#define FUNCTION1 0x06e
|
||||
|
||||
/*
|
||||
* Host Address (p. 3-48)
|
||||
* This register contains the address of the byte about
|
||||
* to be transfered across the host bus.
|
||||
*/
|
||||
#define HADDR 0x088
|
||||
#define HADDR0 0x088
|
||||
#define HADDR1 0x089
|
||||
#define HADDR2 0x08a
|
||||
#define HADDR3 0x08b
|
||||
|
||||
#define HCNT 0x08c
|
||||
#define HCNT0 0x08c
|
||||
#define HCNT1 0x08d
|
||||
#define HCNT2 0x08e
|
||||
/*
|
||||
* SCB Pointer (p. 3-49)
|
||||
* Gate one of the four SCBs into the SCBARRAY window.
|
||||
*/
|
||||
#define SCBPTR 0x090
|
||||
|
||||
/*
|
||||
* Board Control (p. 3-43)
|
||||
*/
|
||||
#define BCTL 0x084
|
||||
/* RSVD 0xf0 */
|
||||
#define ACE 0x08 /* Support for external processors */
|
||||
/* RSVD 0x06 */
|
||||
#define ENABLE 0x01
|
||||
|
||||
/*
|
||||
* On the aic78X0 chips, Board Control is replaced by the DSCommand
|
||||
* register (p. 4-64)
|
||||
*/
|
||||
#define DSCOMMAND 0x084
|
||||
#define CACHETHEN 0x80 /* Cache Threshold enable */
|
||||
#define DPARCKEN 0x40 /* Data Parity Check Enable */
|
||||
#define MPARCKEN 0x20 /* Memory Parity Check Enable */
|
||||
#define EXTREQLCK 0x10 /* External Request Lock */
|
||||
|
||||
/*
|
||||
* Bus On/Off Time (p. 3-44)
|
||||
*/
|
||||
#define BUSTIME 0x085
|
||||
#define BOFF 0xf0
|
||||
#define BON 0x0f
|
||||
|
||||
/*
|
||||
* Bus Speed (p. 3-45)
|
||||
*/
|
||||
#define BUSSPD 0x086
|
||||
#define DFTHRSH 0xc0
|
||||
#define STBOFF 0x38
|
||||
#define STBON 0x07
|
||||
#define DFTHRSH_100 0xc0
|
||||
#define DFTHRSH_75 0x80
|
||||
|
||||
/*
|
||||
* Host Control (p. 3-47) R/W
|
||||
* Overal host control of the device.
|
||||
*/
|
||||
#define HCNTRL 0x087
|
||||
/* UNUSED 0x80 */
|
||||
#define POWRDN 0x40
|
||||
/* UNUSED 0x20 */
|
||||
#define SWINT 0x10
|
||||
#define IRQMS 0x08
|
||||
#define PAUSE 0x04
|
||||
#define INTEN 0x02
|
||||
#define CHIPRST 0x01
|
||||
#define CHIPRSTACK 0x01
|
||||
|
||||
/*
|
||||
* Interrupt Status (p. 3-50)
|
||||
* Status for system interrupts
|
||||
*/
|
||||
#define INTSTAT 0x091
|
||||
#define SEQINT_MASK 0xf1 /* SEQINT Status Codes */
|
||||
#define BAD_PHASE 0x01 /* unknown scsi bus phase */
|
||||
#define SEND_REJECT 0x11 /* sending a message reject */
|
||||
#define NO_IDENT 0x21 /* no IDENTIFY after reconnect*/
|
||||
#define NO_MATCH 0x31 /* no cmd match for reconnect */
|
||||
#define EXTENDED_MSG 0x41 /* Extended message received */
|
||||
#define NO_MATCH_BUSY 0x51 /* Couldn't find BUSY SCB */
|
||||
#define REJECT_MSG 0x61 /* Reject message received */
|
||||
#define BAD_STATUS 0x71 /* Bad status from target */
|
||||
#define RESIDUAL 0x81 /* Residual byte count != 0 */
|
||||
#define ABORT_CMDCMPLT 0x91 /*
|
||||
* Command tagged for abort
|
||||
* completed successfully.
|
||||
*/
|
||||
#define AWAITING_MSG 0xa1 /*
|
||||
* Kernel requested to specify
|
||||
* a message to this target
|
||||
* (command was null), so tell
|
||||
* it that it can fill the
|
||||
* message buffer.
|
||||
*/
|
||||
#define MSG_BUFFER_BUSY 0xc1 /*
|
||||
* Sequencer wants to use the
|
||||
* message buffer, but it
|
||||
* already contains a message
|
||||
*/
|
||||
#define MSGIN_PHASEMIS 0xd1 /*
|
||||
* Target changed phase on us
|
||||
* when we were expecting
|
||||
* another msgin byte.
|
||||
*/
|
||||
#define DATA_OVERRUN 0xe1 /*
|
||||
* Target attempted to write
|
||||
* beyond the bounds of its
|
||||
* command.
|
||||
*/
|
||||
|
||||
#define BRKADRINT 0x08
|
||||
#define SCSIINT 0x04
|
||||
#define CMDCMPLT 0x02
|
||||
#define SEQINT 0x01
|
||||
#define INT_PEND (BRKADRINT | SEQINT | SCSIINT | CMDCMPLT)
|
||||
|
||||
/*
|
||||
* Hard Error (p. 3-53)
|
||||
* Reporting of catastrophic errors. You usually cannot recover from
|
||||
* these without a full board reset.
|
||||
*/
|
||||
#define ERROR 0x092
|
||||
/* UNUSED 0xf0 */
|
||||
#define PARERR 0x08
|
||||
#define ILLOPCODE 0x04
|
||||
#define ILLSADDR 0x02
|
||||
#define ILLHADDR 0x01
|
||||
|
||||
/*
|
||||
* Clear Interrupt Status (p. 3-52)
|
||||
*/
|
||||
#define CLRINT 0x092
|
||||
#define CLRBRKADRINT 0x08
|
||||
#define CLRSCSIINT 0x04
|
||||
#define CLRCMDINT 0x02
|
||||
#define CLRSEQINT 0x01
|
||||
|
||||
#define DFCNTRL 0x093
|
||||
#define WIDEODD 0x40
|
||||
#define SCSIEN 0x20
|
||||
#define SDMAEN 0x10
|
||||
#define SDMAENACK 0x10
|
||||
#define HDMAEN 0x08
|
||||
#define HDMAENACK 0x08
|
||||
#define DIRECTION 0x04
|
||||
#define FIFOFLUSH 0x02
|
||||
#define FIFORESET 0x01
|
||||
|
||||
#define DFSTATUS 0x094
|
||||
#define MREQPEND 0x10
|
||||
#define HDONE 0x08
|
||||
#define FIFOEMP 0x01
|
||||
|
||||
#define DFDAT 0x099
|
||||
|
||||
/*
|
||||
* SCB Auto Increment (p. 3-59)
|
||||
* Byte offset into the SCB Array and an optional bit to allow auto
|
||||
* incrementing of the address during download and upload operations
|
||||
*/
|
||||
#define SCBCNT 0x09a
|
||||
#define SCBAUTO 0x80
|
||||
#define SCBCNT_MASK 0x1f
|
||||
|
||||
/*
|
||||
* Queue In FIFO (p. 3-60)
|
||||
* Input queue for queued SCBs (commands that the seqencer has yet to start)
|
||||
*/
|
||||
#define QINFIFO 0x09b
|
||||
|
||||
/*
|
||||
* Queue In Count (p. 3-60)
|
||||
* Number of queued SCBs
|
||||
*/
|
||||
#define QINCNT 0x09c
|
||||
|
||||
/*
|
||||
* Queue Out FIFO (p. 3-61)
|
||||
* Queue of SCBs that have completed and await the host
|
||||
*/
|
||||
#define QOUTFIFO 0x09d
|
||||
|
||||
/*
|
||||
* Queue Out Count (p. 3-61)
|
||||
* Number of queued SCBs in the Out FIFO
|
||||
*/
|
||||
#define QOUTCNT 0x09e
|
||||
|
||||
/*
|
||||
* SCB Definition (p. 5-4)
|
||||
* The two reserved bytes at SCBARRAY+1[23] are expected to be set to
|
||||
* zero. Bit 3 in SCBARRAY+0 is used as an internal flag to indicate
|
||||
* whether or not to DMA an SCB from host ram. This flag prevents the
|
||||
* "re-fetching" of transactions that are requed because the target is
|
||||
* busy with another command. We also use bits 6 & 7 to indicate whether
|
||||
* or not to initiate SDTR or WDTR repectively when starting this command.
|
||||
*/
|
||||
#define SCBARRAY 0x0a0
|
||||
#define SCB_CONTROL 0x0a0
|
||||
#define MK_MESSAGE 0x80
|
||||
#define DISCENB 0x40
|
||||
#define TAG_ENB 0x20
|
||||
#define SPLIT_SG 0x10
|
||||
#define ABORT_SCB 0x08
|
||||
#define DISCONNECTED 0x04
|
||||
#define SCB_TAG_TYPE 0x03
|
||||
#define SCB_TCL 0x0a1
|
||||
#define SCB_TARGET_STATUS 0x0a2
|
||||
#define SCB_SGCOUNT 0x0a3
|
||||
#define SCB_SGPTR 0x0a4
|
||||
#define SCB_SGPTR0 0x0a4
|
||||
#define SCB_SGPTR1 0x0a5
|
||||
#define SCB_SGPTR2 0x0a6
|
||||
#define SCB_SGPTR3 0x0a7
|
||||
#define SCB_RESID_SGCNT 0x0a8
|
||||
#define SCB_RESID_DCNT 0x0a9
|
||||
#define SCB_RESID_DCNT0 0x0a9
|
||||
#define SCB_RESID_DCNT1 0x0aa
|
||||
#define SCB_RESID_DCNT2 0x0ab
|
||||
#define SCB_DATAPTR 0x0ac
|
||||
#define SCB_DATAPTR0 0x0ac
|
||||
#define SCB_DATAPTR1 0x0ad
|
||||
#define SCB_DATAPTR2 0x0ae
|
||||
#define SCB_DATAPTR3 0x0af
|
||||
#define SCB_DATACNT 0x0b0
|
||||
#define SCB_DATACNT0 0x0b0
|
||||
#define SCB_DATACNT1 0x0b1
|
||||
#define SCB_DATACNT2 0x0b2
|
||||
#define SCB_LINKED_NEXT 0x0b3
|
||||
#define SCB_CMDPTR 0x0b4
|
||||
#define SCB_CMDPTR0 0x0b4
|
||||
#define SCB_CMDPTR1 0x0b5
|
||||
#define SCB_CMDPTR2 0x0b6
|
||||
#define SCB_CMDPTR3 0x0b7
|
||||
#define SCB_CMDLEN 0x0b8
|
||||
#define SCB_TAG 0x0b9
|
||||
#define SCB_NEXT 0x0ba
|
||||
#define SCB_PREV 0x0bb
|
||||
#define SCB_ACTIVE0 0x0bc
|
||||
#define SCB_ACTIVE1 0x0bd
|
||||
#define SCB_ACTIVE2 0x0be
|
||||
#define SCB_ACTIVE3 0x0bf
|
||||
|
||||
#define SG_SIZEOF 0x08 /* sizeof(struct ahc_dma) */
|
||||
|
||||
/* --------------------- AHA-2840-only definitions -------------------- */
|
||||
|
||||
#define SEECTL_2840 0x0c0
|
||||
/* UNUSED 0xf8 */
|
||||
#define CS_2840 0x04
|
||||
#define CK_2840 0x02
|
||||
#define DO_2840 0x01
|
||||
|
||||
#define STATUS_2840 0x0c1
|
||||
#define EEPROM_TF 0x80
|
||||
#define BIOS_SEL 0x60
|
||||
#define ADSEL 0x1e
|
||||
#define DI_2840 0x01
|
||||
|
||||
/* --------------------- AIC-7870-only definitions -------------------- */
|
||||
|
||||
#define DSPCISTATUS 0x086
|
||||
|
||||
#define BRDCTL 0x01d
|
||||
#define BRDDAT7 0x80
|
||||
#define BRDDAT6 0x40
|
||||
#define BRDDAT5 0x20
|
||||
#define BRDSTB 0x10
|
||||
#define BRDCS 0x08
|
||||
#define BRDRW 0x04
|
||||
#define BRDCTL1 0x02
|
||||
#define BRDCTL0 0x01
|
||||
|
||||
/*
|
||||
* Serial EEPROM Control (p. 4-92 in 7870 Databook)
|
||||
* Controls the reading and writing of an external serial 1-bit
|
||||
* EEPROM Device. In order to access the serial EEPROM, you must
|
||||
* first set the SEEMS bit that generates a request to the memory
|
||||
* port for access to the serial EEPROM device. When the memory
|
||||
* port is not busy servicing another request, it reconfigures
|
||||
* to allow access to the serial EEPROM. When this happens, SEERDY
|
||||
* gets set high to verify that the memory port access has been
|
||||
* granted.
|
||||
*
|
||||
* After successful arbitration for the memory port, the SEECS bit of
|
||||
* the SEECTL register is connected to the chip select. The SEECK,
|
||||
* SEEDO, and SEEDI are connected to the clock, data out, and data in
|
||||
* lines respectively. The SEERDY bit of SEECTL is useful in that it
|
||||
* gives us an 800 nsec timer. After a write to the SEECTL register,
|
||||
* the SEERDY goes high 800 nsec later. The one exception to this is
|
||||
* when we first request access to the memory port. The SEERDY goes
|
||||
* high to signify that access has been granted and, for this case, has
|
||||
* no implied timing.
|
||||
*
|
||||
* See 93cx6.c for detailed information on the protocol necessary to
|
||||
* read the serial EEPROM.
|
||||
*/
|
||||
#define SEECTL 0x01e
|
||||
#define EXTARBACK 0x80
|
||||
#define EXTARBREQ 0x40
|
||||
#define SEEMS 0x20
|
||||
#define SEERDY 0x10
|
||||
#define SEECS 0x08
|
||||
#define SEECK 0x04
|
||||
#define SEEDO 0x02
|
||||
#define SEEDI 0x01
|
||||
/* ---------------------- Scratch RAM Offsets ------------------------- */
|
||||
/* These offsets are either to values that are initialized by the board's
|
||||
* BIOS or are specified by the sequencer code.
|
||||
*
|
||||
* The host adapter card (at least the BIOS) uses 20-2f for SCSI
|
||||
* device information, 32-33 and 5a-5f as well. As it turns out, the
|
||||
* BIOS trashes 20-2f, writing the synchronous negotiation results
|
||||
* on top of the BIOS values, so we re-use those for our per-target
|
||||
* scratchspace (actually a value that can be copied directly into
|
||||
* SCSIRATE). The kernel driver will enable synchronous negotiation
|
||||
* for all targets that have a value other than 0 in the lower four
|
||||
* bits of the target scratch space. This should work regardless of
|
||||
* whether the bios has been installed.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 1 byte per target starting at this address for configuration values
|
||||
*/
|
||||
#define TARG_SCRATCH 0x020
|
||||
|
||||
/*
|
||||
* The sequencer will stick the frist byte of any rejected message here so
|
||||
* we can see what is getting thrown away.
|
||||
*/
|
||||
#define REJBYTE 0x030
|
||||
#define LASTPHASE 0x031
|
||||
#define P_BUSFREE 0x01
|
||||
|
||||
/*
|
||||
* Bit vector of targets that have disconnection disabled.
|
||||
*/
|
||||
#define DISC_DSB 0x032
|
||||
#define DISC_DSB_A 0x032
|
||||
#define DISC_DSB_B 0x033
|
||||
|
||||
/*
|
||||
* Length of pending message
|
||||
*/
|
||||
#define MSG_LEN 0x034
|
||||
|
||||
/* We reserve 8bytes to store outgoing messages */
|
||||
#define MSG0 0x035
|
||||
#define COMP_MSG0 0xcb /* 2's complement of MSG0 */
|
||||
#define MSG1 0x036
|
||||
#define MSG2 0x037
|
||||
#define MSG3 0x038
|
||||
#define MSG4 0x039
|
||||
#define MSG5 0x03a
|
||||
#define MSG6 0x03b
|
||||
#define MSG7 0x03c
|
||||
|
||||
#define DMAPARAMS 0x03d /* Parameters for DMA Logic */
|
||||
|
||||
#define SCBCOUNT 0x03e /*
|
||||
* Number of SCBs supported by
|
||||
* this card.
|
||||
*/
|
||||
#define COMP_SCBCOUNT 0x03f /*
|
||||
* Two's compliment of SCBCOUNT
|
||||
*/
|
||||
#define QCNTMASK 0x040 /*
|
||||
* Mask of bits to test against
|
||||
* when looking at the Queue Count
|
||||
* registers. Works around a bug
|
||||
* on aic7850 chips.
|
||||
*/
|
||||
#define FLAGS 0x041
|
||||
#define SINGLE_BUS 0x00
|
||||
#define TWIN_BUS 0x01
|
||||
#define WIDE_BUS 0x02
|
||||
#define PAGESCBS 0x04
|
||||
#define DPHASE 0x10
|
||||
#define TAGGED_SCB 0x20
|
||||
#define IDENTIFY_SEEN 0x40
|
||||
#define RESELECTED 0x80
|
||||
|
||||
#define SAVED_TCL 0x042 /*
|
||||
* Temporary storage for the
|
||||
* target/channel/lun of a
|
||||
* reconnecting target
|
||||
*/
|
||||
#define SG_COUNT 0x043
|
||||
#define SG_NEXT 0x044 /* working value of SG pointer */
|
||||
#define SG_NEXT0 0x044
|
||||
#define SG_NEXT1 0x045
|
||||
#define SG_NEXT2 0x046
|
||||
#define SG_NEXT3 0x047
|
||||
|
||||
#define WAITING_SCBH 0x048 /*
|
||||
* head of list of SCBs awaiting
|
||||
* selection
|
||||
*/
|
||||
#define SAVED_LINKPTR 0x049
|
||||
#define SAVED_SCBPTR 0x04a
|
||||
#define ULTRA_ENB 0x04b
|
||||
#define ULTRA_ENB_B 0x04c
|
||||
|
||||
#define MSGIN_EXT_LEN 0x04d
|
||||
#define MSGIN_EXT_OPCODE 0x04e
|
||||
#define MSGIN_EXT_BYTE0 0x04f
|
||||
#define MSGIN_EXT_BYTE1 0x050
|
||||
#define MSGIN_EXT_BYTE2 0x051 /*
|
||||
* This location, stores the last
|
||||
* byte of an extended message if
|
||||
* it passes the two bytes of space
|
||||
* we allow now. This byte isn't
|
||||
* used for anything, it just makes
|
||||
* the code shorter for tossing
|
||||
* extra bytes.
|
||||
*/
|
||||
#define MSGIN_EXT_LASTBYTE 0x052 /* Used as the address for range
|
||||
* checking, not used for storage.
|
||||
*/
|
||||
|
||||
#define DISCONNECTED_SCBH 0x052 /*
|
||||
* head of list of SCBs that are
|
||||
* disconnected. Used for SCB
|
||||
* paging.
|
||||
*/
|
||||
#define FREE_SCBH 0x053 /*
|
||||
* head of list of SCBs that are
|
||||
* not in use. Used for SCB paging.
|
||||
*/
|
||||
|
||||
|
||||
#define HSCB_ADDR0 0x054
|
||||
#define HSCB_ADDR1 0x055
|
||||
#define HSCB_ADDR2 0x056
|
||||
#define HSCB_ADDR3 0x057
|
||||
|
||||
#define CUR_SCBID 0x058
|
||||
#define ARG_1 0x059
|
||||
#define RETURN_1 0x059
|
||||
#define SEND_MSG 0x80
|
||||
#define SEND_SENSE 0x40
|
||||
#define SEND_REJ 0x20
|
||||
#define SCB_PAGEDIN 0x10
|
||||
|
||||
#define SCB_LIST_NULL 0xff
|
||||
|
||||
/*
|
||||
* These are offsets into the card's scratch ram. Some of the values are
|
||||
* specified in the AHA2742 technical reference manual and are initialized
|
||||
* by the BIOS at boot time.
|
||||
*/
|
||||
#define SCSICONF 0x05a
|
||||
#define RESET_SCSI 0x40
|
||||
|
||||
#define HOSTCONF 0x05d
|
||||
|
||||
#define HA_274_BIOSCTRL 0x05f
|
||||
#define BIOSMODE 0x30
|
||||
#define BIOSDISABLED 0x30
|
||||
#define CHANNEL_B_PRIMARY 0x08
|
||||
|
||||
/* WDTR Message values */
|
||||
#define BUS_8_BIT 0x00
|
||||
#define BUS_16_BIT 0x01
|
||||
#define BUS_32_BIT 0x02
|
||||
|
||||
#define MAX_OFFSET_8BIT 0x0f
|
||||
#define MAX_OFFSET_16BIT 0x08
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,243 @@
|
||||
%{
|
||||
/*
|
||||
* Lexical Analyzer for the Aic7xxx SCSI Host adapter sequencer assembler.
|
||||
*
|
||||
* Copyright (c) 1997 Justin T. Gibbs.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: scan.l,v 1.1 1997/03/16 07:08:17 gibbs Exp $
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sysexits.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "aic7xxx_asm.h"
|
||||
#include "symbol.h"
|
||||
#include "y.tab.h"
|
||||
%}
|
||||
|
||||
PATH [-/A-Za-z0-9_.]*[./][-/A-Za-z0-9_.]*
|
||||
WORD [A-Za-z_][-A-Za-z_0-9]*
|
||||
SPACE [ \t]+
|
||||
|
||||
%x COMMENT
|
||||
|
||||
%%
|
||||
\n { ++yylineno; }
|
||||
"/*" { BEGIN COMMENT; /* Enter comment eating state */ }
|
||||
<COMMENT>"/*" { fprintf(stderr, "Warning! Comment within comment."); }
|
||||
<COMMENT>\n { ++yylineno; }
|
||||
<COMMENT>[^*/\n]* ;
|
||||
<COMMENT>"*"+[^*/\n]* ;
|
||||
<COMMENT>"/"+[^*/\n]* ;
|
||||
<COMMENT>"*"+"/" { BEGIN INITIAL; }
|
||||
|
||||
{SPACE} ;
|
||||
|
||||
/* Register/SCB/SRAM definition keywords */
|
||||
register { return T_REGISTER; }
|
||||
const { yylval.value = FALSE; return T_CONST; }
|
||||
address { return T_ADDRESS; }
|
||||
access_mode { return T_ACCESS_MODE; }
|
||||
RW|RO|WO {
|
||||
if (strcmp(yytext, "RW") == 0)
|
||||
yylval.value = RW;
|
||||
else if (strcmp(yytext, "RO") == 0)
|
||||
yylval.value = RO;
|
||||
else
|
||||
yylval.value = WO;
|
||||
return T_MODE;
|
||||
}
|
||||
bit { return T_BIT; }
|
||||
mask { return T_MASK; }
|
||||
alias { return T_ALIAS; }
|
||||
size { return T_SIZE; }
|
||||
scb { return T_SCB; }
|
||||
scratch_ram { return T_SRAM; }
|
||||
accumulator { return T_ACCUM; }
|
||||
allones { return T_ALLONES; }
|
||||
allzeros { return T_ALLZEROS; }
|
||||
none { return T_NONE; }
|
||||
sindex { return T_SINDEX; }
|
||||
A { return T_A; }
|
||||
|
||||
/* Opcodes */
|
||||
shl { return T_SHL; }
|
||||
shr { return T_SHR; }
|
||||
ror { return T_ROR; }
|
||||
rol { return T_ROL; }
|
||||
mvi { return T_MVI; }
|
||||
mov { return T_MOV; }
|
||||
clr { return T_CLR; }
|
||||
jmp { return T_JMP; }
|
||||
jc { return T_JC; }
|
||||
jnc { return T_JNC; }
|
||||
je { return T_JE; }
|
||||
jne { return T_JNE; }
|
||||
jz { return T_JZ; }
|
||||
jnz { return T_JNZ; }
|
||||
call { return T_CALL; }
|
||||
add { return T_ADD; }
|
||||
adc { return T_ADC; }
|
||||
inc { return T_INC; }
|
||||
dec { return T_DEC; }
|
||||
stc { return T_STC; }
|
||||
clc { return T_CLC; }
|
||||
cmp { return T_CMP; }
|
||||
xor { return T_XOR; }
|
||||
test { return T_TEST;}
|
||||
and { return T_AND; }
|
||||
or { return T_OR; }
|
||||
ret { return T_RET; }
|
||||
nop { return T_NOP; }
|
||||
.if { return T_IF; }
|
||||
.else { return T_ELSE; }
|
||||
.endif { return T_ENDIF; }
|
||||
|
||||
/* Allowed Symbols */
|
||||
[-+,:()~|&."{};<>[\]!] { return yytext[0]; }
|
||||
|
||||
/* Number processing */
|
||||
0[0-7]* {
|
||||
yylval.value = strtol(yytext, NULL, 8);
|
||||
return T_NUMBER;
|
||||
}
|
||||
|
||||
0[xX][0-9a-fA-F]+ {
|
||||
yylval.value = strtoul(yytext + 2, NULL, 16);
|
||||
return T_NUMBER;
|
||||
}
|
||||
|
||||
[1-9][0-9]* {
|
||||
yylval.value = strtol(yytext, NULL, 10);
|
||||
return T_NUMBER;
|
||||
}
|
||||
|
||||
/* Include Files */
|
||||
#include { return T_INCLUDE; }
|
||||
|
||||
/* For parsing C include files with #define foo */
|
||||
#define { yylval.value = TRUE; return T_CONST; }
|
||||
/* Throw away macros */
|
||||
#define[^\n]*[()]+[^\n]* ;
|
||||
{PATH} { yylval.str = strdup(yytext); return T_PATH; }
|
||||
|
||||
{WORD} { yylval.sym = symtable_get(yytext); return T_SYMBOL; }
|
||||
|
||||
. {
|
||||
char buf[255];
|
||||
|
||||
snprintf(buf, sizeof(buf), "Invalid character "
|
||||
"'%c'", yytext[0]);
|
||||
stop(buf, EX_DATAERR);
|
||||
}
|
||||
%%
|
||||
|
||||
typedef struct include {
|
||||
YY_BUFFER_STATE buffer;
|
||||
int lineno;
|
||||
char *filename;
|
||||
SLIST_ENTRY(include) links;
|
||||
}include_t;
|
||||
|
||||
SLIST_HEAD(, include) include_stack;
|
||||
|
||||
void
|
||||
include_file(file_name, type)
|
||||
char *file_name;
|
||||
include_type type;
|
||||
{
|
||||
FILE *newfile;
|
||||
include_t *include;
|
||||
|
||||
newfile = NULL;
|
||||
/* Try the current directory first */
|
||||
if (includes_search_curdir != 0 || type == SOURCE_FILE)
|
||||
newfile = fopen(file_name, "r");
|
||||
|
||||
if (newfile == NULL && type != SOURCE_FILE) {
|
||||
path_entry_t include_dir;
|
||||
for (include_dir = search_path.slh_first;
|
||||
include_dir != NULL;
|
||||
include_dir = include_dir->links.sle_next) {
|
||||
char fullname[PATH_MAX];
|
||||
|
||||
if ((include_dir->quoted_includes_only == TRUE)
|
||||
&& (type != QUOTED_INCLUDE))
|
||||
continue;
|
||||
|
||||
snprintf(fullname, sizeof(fullname),
|
||||
"%s/%s", include_dir->directory, file_name);
|
||||
|
||||
if ((newfile = fopen(fullname, "r")) != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (newfile == NULL) {
|
||||
perror(file_name);
|
||||
stop("Unable to open input file", EX_SOFTWARE);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
include = (include_t *)malloc(sizeof(include_t));
|
||||
if (include == NULL) {
|
||||
stop("Unable to allocate include stack entry", EX_SOFTWARE);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
include->buffer = YY_CURRENT_BUFFER;
|
||||
include->lineno = yylineno;
|
||||
include->filename = yyfilename;
|
||||
SLIST_INSERT_HEAD(&include_stack, include, links);
|
||||
yy_switch_to_buffer(yy_create_buffer(newfile, YY_BUF_SIZE));
|
||||
yylineno = 1;
|
||||
yyfilename = strdup(file_name);
|
||||
}
|
||||
|
||||
int
|
||||
yywrap()
|
||||
{
|
||||
include_t *include;
|
||||
|
||||
yy_delete_buffer(YY_CURRENT_BUFFER);
|
||||
(void)fclose(yyin);
|
||||
if (yyfilename != NULL)
|
||||
free(yyfilename);
|
||||
include = include_stack.slh_first;
|
||||
if (include != NULL) {
|
||||
yy_switch_to_buffer(include->buffer);
|
||||
yylineno = include->lineno;
|
||||
yyfilename = include->filename;
|
||||
SLIST_REMOVE_HEAD(&include_stack, links);
|
||||
free(include);
|
||||
return (0);
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Instruction formats for the sequencer program downloaded to
|
||||
* Aic7xxx SCSI host adapters
|
||||
*
|
||||
* Copyright (c) 1997 Justin T. Gibbs.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
struct ins_format1 {
|
||||
u_int8_t immediate;
|
||||
u_int8_t source;
|
||||
u_int8_t destination;
|
||||
u_int8_t opcode_ret;
|
||||
};
|
||||
|
||||
struct ins_format2 {
|
||||
u_int8_t shift_control;
|
||||
u_int8_t source;
|
||||
u_int8_t destination;
|
||||
u_int8_t opcode_ret;
|
||||
#define RETURN_BIT 0x01
|
||||
};
|
||||
|
||||
struct ins_format3 {
|
||||
u_int8_t immediate;
|
||||
u_int8_t source;
|
||||
u_int8_t address;
|
||||
u_int8_t opcode_addr;
|
||||
#define ADDR_HIGH_BIT 0x01
|
||||
};
|
||||
|
||||
struct instruction {
|
||||
union {
|
||||
struct ins_format1 format1;
|
||||
struct ins_format2 format2;
|
||||
struct ins_format3 format3;
|
||||
u_int8_t bytes[4];
|
||||
} format;
|
||||
u_int srcline;
|
||||
struct symbol *patch_label;
|
||||
STAILQ_ENTRY(instruction) links;
|
||||
};
|
||||
|
||||
#define AIC_OP_OR 0x0
|
||||
#define AIC_OP_AND 0x1
|
||||
#define AIC_OP_XOR 0x2
|
||||
#define AIC_OP_ADD 0x3
|
||||
#define AIC_OP_ADC 0x4
|
||||
#define AIC_OP_ROL 0x5
|
||||
|
||||
#define AIC_OP_JMP 0x8
|
||||
#define AIC_OP_JC 0x9
|
||||
#define AIC_OP_JNC 0xa
|
||||
#define AIC_OP_CALL 0xb
|
||||
#define AIC_OP_JNE 0xc
|
||||
#define AIC_OP_JNZ 0xd
|
||||
#define AIC_OP_JE 0xe
|
||||
#define AIC_OP_JZ 0xf
|
||||
|
||||
/* Pseudo Ops */
|
||||
#define AIC_OP_SHL 0x10
|
||||
#define AIC_OP_SHR 0x20
|
||||
#define AIC_OP_ROR 0x30
|
||||
@@ -0,0 +1,451 @@
|
||||
/*
|
||||
* Aic7xxx SCSI host adapter firmware asssembler symbol table implementation
|
||||
*
|
||||
* Copyright (c) 1997 Justin T. Gibbs.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <db.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sysexits.h>
|
||||
|
||||
#include "symbol.h"
|
||||
#include "aic7xxx_asm.h"
|
||||
|
||||
static DB *symtable;
|
||||
|
||||
symbol_t *
|
||||
symbol_create(name)
|
||||
char *name;
|
||||
{
|
||||
symbol_t *new_symbol;
|
||||
|
||||
new_symbol = (symbol_t *)malloc(sizeof(symbol_t));
|
||||
if (new_symbol == NULL) {
|
||||
perror("Unable to create new symbol");
|
||||
exit(EX_SOFTWARE);
|
||||
}
|
||||
memset(new_symbol, 0, sizeof(*new_symbol));
|
||||
new_symbol->name = strdup(name);
|
||||
new_symbol->type = UNINITIALIZED;
|
||||
return (new_symbol);
|
||||
}
|
||||
|
||||
void
|
||||
symbol_delete(symbol)
|
||||
symbol_t *symbol;
|
||||
{
|
||||
if (symtable != NULL) {
|
||||
DBT key;
|
||||
|
||||
key.data = symbol->name;
|
||||
key.size = strlen(symbol->name);
|
||||
symtable->del(symtable, &key, /*flags*/0);
|
||||
}
|
||||
switch(symbol->type) {
|
||||
case SCBLOC:
|
||||
case SRAMLOC:
|
||||
case REGISTER:
|
||||
if (symbol->info.rinfo != NULL)
|
||||
free(symbol->info.rinfo);
|
||||
break;
|
||||
case ALIAS:
|
||||
if (symbol->info.ainfo != NULL)
|
||||
free(symbol->info.ainfo);
|
||||
break;
|
||||
case MASK:
|
||||
case BIT:
|
||||
if (symbol->info.minfo != NULL) {
|
||||
symlist_free(&symbol->info.minfo->symrefs);
|
||||
free(symbol->info.minfo);
|
||||
}
|
||||
break;
|
||||
case CONST:
|
||||
if (symbol->info.cinfo != NULL)
|
||||
free(symbol->info.cinfo);
|
||||
break;
|
||||
case LABEL:
|
||||
if (symbol->info.linfo != NULL)
|
||||
free(symbol->info.linfo);
|
||||
break;
|
||||
case UNINITIALIZED:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
free(symbol->name);
|
||||
free(symbol);
|
||||
}
|
||||
|
||||
void
|
||||
symtable_open()
|
||||
{
|
||||
symtable = dbopen(/*filename*/NULL,
|
||||
O_CREAT | O_NONBLOCK | O_RDWR, /*mode*/0, DB_HASH,
|
||||
/*openinfo*/NULL);
|
||||
|
||||
if (symtable == NULL) {
|
||||
perror("Symbol table creation failed");
|
||||
exit(EX_SOFTWARE);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
symtable_close()
|
||||
{
|
||||
if (symtable != NULL) {
|
||||
DBT key;
|
||||
DBT data;
|
||||
|
||||
while (symtable->seq(symtable, &key, &data, R_FIRST) == 0) {
|
||||
symbol_t *cursym;
|
||||
|
||||
cursym = *(symbol_t **)data.data;
|
||||
symbol_delete(cursym);
|
||||
}
|
||||
symtable->close(symtable);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The semantics of get is to return an uninitialized symbol entry
|
||||
* if a lookup fails.
|
||||
*/
|
||||
symbol_t *
|
||||
symtable_get(name)
|
||||
char *name;
|
||||
{
|
||||
DBT key;
|
||||
DBT data;
|
||||
int retval;
|
||||
|
||||
key.data = (void *)name;
|
||||
key.size = strlen(name);
|
||||
|
||||
if ((retval = symtable->get(symtable, &key, &data, /*flags*/0)) != 0) {
|
||||
if (retval == -1) {
|
||||
perror("Symbol table get operation failed");
|
||||
exit(EX_SOFTWARE);
|
||||
/* NOTREACHED */
|
||||
} else if (retval == 1) {
|
||||
/* Symbol wasn't found, so create a new one */
|
||||
symbol_t *new_symbol;
|
||||
|
||||
new_symbol = symbol_create(name);
|
||||
data.data = &new_symbol;
|
||||
data.size = sizeof(new_symbol);
|
||||
if (symtable->put(symtable, &key, &data,
|
||||
/*flags*/0) !=0) {
|
||||
perror("Symtable put failed");
|
||||
exit(EX_SOFTWARE);
|
||||
}
|
||||
return (new_symbol);
|
||||
} else {
|
||||
perror("Unexpected return value from db get routine");
|
||||
exit(EX_SOFTWARE);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
return (*(symbol_t **)data.data);
|
||||
}
|
||||
|
||||
symbol_node_t *
|
||||
symlist_search(symlist, symname)
|
||||
symlist_t *symlist;
|
||||
char *symname;
|
||||
{
|
||||
symbol_node_t *curnode;
|
||||
|
||||
curnode = symlist->slh_first;
|
||||
while(curnode != NULL) {
|
||||
if (strcmp(symname, curnode->symbol->name) == 0)
|
||||
break;
|
||||
curnode = curnode->links.sle_next;
|
||||
}
|
||||
return (curnode);
|
||||
}
|
||||
|
||||
void
|
||||
symlist_add(symlist, symbol, how)
|
||||
symlist_t *symlist;
|
||||
symbol_t *symbol;
|
||||
int how;
|
||||
{
|
||||
symbol_node_t *newnode;
|
||||
|
||||
newnode = (symbol_node_t *)malloc(sizeof(symbol_node_t));
|
||||
if (newnode == NULL) {
|
||||
stop("symlist_add: Unable to malloc symbol_node", EX_SOFTWARE);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
newnode->symbol = symbol;
|
||||
if (how == SYMLIST_SORT) {
|
||||
symbol_node_t *curnode;
|
||||
int mask;
|
||||
|
||||
mask = FALSE;
|
||||
switch(symbol->type) {
|
||||
case REGISTER:
|
||||
case SCBLOC:
|
||||
case SRAMLOC:
|
||||
break;
|
||||
case BIT:
|
||||
case MASK:
|
||||
mask = TRUE;
|
||||
break;
|
||||
default:
|
||||
stop("symlist_add: Invalid symbol type for sorting",
|
||||
EX_SOFTWARE);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
curnode = symlist->slh_first;
|
||||
if (curnode == NULL
|
||||
|| (mask && (curnode->symbol->info.minfo->mask >
|
||||
newnode->symbol->info.minfo->mask))
|
||||
|| (!mask && (curnode->symbol->info.rinfo->address >
|
||||
newnode->symbol->info.rinfo->address))) {
|
||||
SLIST_INSERT_HEAD(symlist, newnode, links);
|
||||
return;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
if (curnode->links.sle_next == NULL) {
|
||||
SLIST_INSERT_AFTER(curnode, newnode,
|
||||
links);
|
||||
break;
|
||||
} else {
|
||||
symbol_t *cursymbol;
|
||||
|
||||
cursymbol = curnode->links.sle_next->symbol;
|
||||
if ((mask && (cursymbol->info.minfo->mask >
|
||||
symbol->info.minfo->mask))
|
||||
|| (!mask &&(cursymbol->info.rinfo->address >
|
||||
symbol->info.rinfo->address))){
|
||||
SLIST_INSERT_AFTER(curnode, newnode,
|
||||
links);
|
||||
break;
|
||||
}
|
||||
}
|
||||
curnode = curnode->links.sle_next;
|
||||
}
|
||||
} else {
|
||||
SLIST_INSERT_HEAD(symlist, newnode, links);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
symlist_free(symlist)
|
||||
symlist_t *symlist;
|
||||
{
|
||||
symbol_node_t *node1, *node2;
|
||||
|
||||
node1 = symlist->slh_first;
|
||||
while (node1 != NULL) {
|
||||
node2 = node1->links.sle_next;
|
||||
free(node1);
|
||||
node1 = node2;
|
||||
}
|
||||
SLIST_INIT(symlist);
|
||||
}
|
||||
|
||||
void
|
||||
symlist_merge(symlist_dest, symlist_src1, symlist_src2)
|
||||
symlist_t *symlist_dest;
|
||||
symlist_t *symlist_src1;
|
||||
symlist_t *symlist_src2;
|
||||
{
|
||||
symbol_node_t *node;
|
||||
|
||||
*symlist_dest = *symlist_src1;
|
||||
while((node = symlist_src2->slh_first) != NULL) {
|
||||
SLIST_REMOVE_HEAD(symlist_src2, links);
|
||||
SLIST_INSERT_HEAD(symlist_dest, node, links);
|
||||
}
|
||||
|
||||
/* These are now empty */
|
||||
SLIST_INIT(symlist_src1);
|
||||
SLIST_INIT(symlist_src2);
|
||||
}
|
||||
|
||||
void
|
||||
symtable_dump(ofile)
|
||||
FILE *ofile;
|
||||
{
|
||||
/*
|
||||
* Sort the registers by address with a simple insertion sort.
|
||||
* Put bitmasks next to the first register that defines them.
|
||||
* Put constants at the end.
|
||||
*/
|
||||
symlist_t registers;
|
||||
symlist_t masks;
|
||||
symlist_t constants;
|
||||
symlist_t aliases;
|
||||
|
||||
SLIST_INIT(®isters);
|
||||
SLIST_INIT(&masks);
|
||||
SLIST_INIT(&constants);
|
||||
SLIST_INIT(&aliases);
|
||||
|
||||
if (symtable != NULL) {
|
||||
DBT key;
|
||||
DBT data;
|
||||
int flag = R_FIRST;
|
||||
|
||||
while (symtable->seq(symtable, &key, &data, flag) == 0) {
|
||||
symbol_t *cursym;
|
||||
|
||||
cursym = *(symbol_t **)data.data;
|
||||
switch(cursym->type) {
|
||||
case REGISTER:
|
||||
case SCBLOC:
|
||||
case SRAMLOC:
|
||||
symlist_add(®isters, cursym, SYMLIST_SORT);
|
||||
break;
|
||||
case MASK:
|
||||
case BIT:
|
||||
symlist_add(&masks, cursym, SYMLIST_SORT);
|
||||
break;
|
||||
case CONST:
|
||||
if (cursym->info.cinfo->define == FALSE) {
|
||||
symlist_add(&constants, cursym,
|
||||
SYMLIST_INSERT_HEAD);
|
||||
}
|
||||
break;
|
||||
case ALIAS:
|
||||
symlist_add(&aliases, cursym,
|
||||
SYMLIST_INSERT_HEAD);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
flag = R_NEXT;
|
||||
}
|
||||
|
||||
/* Put in the masks and bits */
|
||||
while (masks.slh_first != NULL) {
|
||||
symbol_node_t *curnode;
|
||||
symbol_node_t *regnode;
|
||||
char *regname;
|
||||
|
||||
curnode = masks.slh_first;
|
||||
SLIST_REMOVE_HEAD(&masks, links);
|
||||
|
||||
regnode =
|
||||
curnode->symbol->info.minfo->symrefs.slh_first;
|
||||
regname = regnode->symbol->name;
|
||||
regnode = symlist_search(®isters, regname);
|
||||
SLIST_INSERT_AFTER(regnode, curnode, links);
|
||||
}
|
||||
|
||||
/* Add the aliases */
|
||||
while (aliases.slh_first != NULL) {
|
||||
symbol_node_t *curnode;
|
||||
symbol_node_t *regnode;
|
||||
char *regname;
|
||||
|
||||
curnode = aliases.slh_first;
|
||||
SLIST_REMOVE_HEAD(&aliases, links);
|
||||
|
||||
regname = curnode->symbol->info.ainfo->parent->name;
|
||||
regnode = symlist_search(®isters, regname);
|
||||
SLIST_INSERT_AFTER(regnode, curnode, links);
|
||||
}
|
||||
|
||||
/* Output what we have */
|
||||
fprintf(ofile,
|
||||
"/*
|
||||
* DO NOT EDIT - This file is automatically generated.
|
||||
*/\n");
|
||||
while (registers.slh_first != NULL) {
|
||||
symbol_node_t *curnode;
|
||||
u_int8_t value;
|
||||
char *tab_str;
|
||||
char *tab_str2;
|
||||
|
||||
curnode = registers.slh_first;
|
||||
SLIST_REMOVE_HEAD(®isters, links);
|
||||
switch(curnode->symbol->type) {
|
||||
case REGISTER:
|
||||
case SCBLOC:
|
||||
case SRAMLOC:
|
||||
fprintf(ofile, "\n");
|
||||
value = curnode->symbol->info.rinfo->address;
|
||||
tab_str = "\t";
|
||||
tab_str2 = "\t\t";
|
||||
break;
|
||||
case ALIAS:
|
||||
{
|
||||
symbol_t *parent;
|
||||
|
||||
parent = curnode->symbol->info.ainfo->parent;
|
||||
value = parent->info.rinfo->address;
|
||||
tab_str = "\t";
|
||||
tab_str2 = "\t\t";
|
||||
break;
|
||||
}
|
||||
case MASK:
|
||||
case BIT:
|
||||
value = curnode->symbol->info.minfo->mask;
|
||||
tab_str = "\t\t";
|
||||
tab_str2 = "\t";
|
||||
break;
|
||||
default:
|
||||
value = 0; /* Quiet compiler */
|
||||
tab_str = NULL;
|
||||
tab_str2 = NULL;
|
||||
stop("symtable_dump: Invalid symbol type "
|
||||
"encountered", EX_SOFTWARE);
|
||||
break;
|
||||
}
|
||||
fprintf(ofile, "#define%s%-16s%s0x%02x\n",
|
||||
tab_str, curnode->symbol->name, tab_str2,
|
||||
value);
|
||||
free(curnode);
|
||||
}
|
||||
fprintf(ofile, "\n\n");
|
||||
|
||||
while (constants.slh_first != NULL) {
|
||||
symbol_node_t *curnode;
|
||||
|
||||
curnode = constants.slh_first;
|
||||
SLIST_REMOVE_HEAD(&constants, links);
|
||||
fprintf(ofile, "#define\t%-8s\t0x%02x\n",
|
||||
curnode->symbol->name,
|
||||
curnode->symbol->info.cinfo->value);
|
||||
free(curnode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Aic7xxx SCSI host adapter firmware asssembler symbol table definitions
|
||||
*
|
||||
* Copyright (c) 1997 Justin T. Gibbs.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <sys/queue.h>
|
||||
|
||||
typedef enum {
|
||||
UNINITIALIZED,
|
||||
REGISTER,
|
||||
ALIAS,
|
||||
SCBLOC,
|
||||
SRAMLOC,
|
||||
MASK,
|
||||
BIT,
|
||||
CONST,
|
||||
LABEL,
|
||||
CONDITIONAL
|
||||
}symtype;
|
||||
|
||||
typedef enum {
|
||||
RO = 0x01,
|
||||
WO = 0x02,
|
||||
RW = 0x03
|
||||
}amode_t;
|
||||
|
||||
struct reg_info {
|
||||
u_int8_t address;
|
||||
int size;
|
||||
amode_t mode;
|
||||
u_int8_t valid_bitmask;
|
||||
int typecheck_masks;
|
||||
};
|
||||
|
||||
typedef SLIST_HEAD(symlist, symbol_node) symlist_t;
|
||||
|
||||
struct mask_info {
|
||||
symlist_t symrefs;
|
||||
u_int8_t mask;
|
||||
};
|
||||
|
||||
struct const_info {
|
||||
u_int8_t value;
|
||||
int define;
|
||||
};
|
||||
|
||||
struct alias_info {
|
||||
struct symbol *parent;
|
||||
};
|
||||
|
||||
struct label_info {
|
||||
int address;
|
||||
};
|
||||
|
||||
struct cond_info {
|
||||
int value;
|
||||
};
|
||||
|
||||
typedef struct expression_info {
|
||||
symlist_t referenced_syms;
|
||||
int value;
|
||||
} expression_t;
|
||||
|
||||
typedef struct symbol {
|
||||
char *name;
|
||||
symtype type;
|
||||
union {
|
||||
struct reg_info *rinfo;
|
||||
struct mask_info *minfo;
|
||||
struct const_info *cinfo;
|
||||
struct alias_info *ainfo;
|
||||
struct label_info *linfo;
|
||||
struct cond_info *condinfo;
|
||||
}info;
|
||||
} symbol_t;
|
||||
|
||||
typedef struct symbol_ref {
|
||||
symbol_t *symbol;
|
||||
int offset;
|
||||
} symbol_ref_t;
|
||||
|
||||
typedef struct symbol_node {
|
||||
SLIST_ENTRY(symbol_node) links;
|
||||
symbol_t *symbol;
|
||||
}symbol_node_t;
|
||||
|
||||
typedef struct patch {
|
||||
STAILQ_ENTRY(patch) links;
|
||||
int negative;
|
||||
int begin;
|
||||
int end;
|
||||
int options;
|
||||
} patch_t;
|
||||
|
||||
void symbol_delete __P((symbol_t *symbol));
|
||||
|
||||
void symtable_open __P((void));
|
||||
|
||||
void symtable_close __P((void));
|
||||
|
||||
symbol_t *
|
||||
symtable_get __P((char *name));
|
||||
|
||||
symbol_node_t *
|
||||
symlist_search __P((symlist_t *symlist, char *symname));
|
||||
|
||||
void
|
||||
symlist_add __P((symlist_t *symlist, symbol_t *symbol, int how));
|
||||
#define SYMLIST_INSERT_HEAD 0x00
|
||||
#define SYMLIST_SORT 0x01
|
||||
|
||||
void symlist_free __P((symlist_t *symlist));
|
||||
|
||||
void symlist_merge __P((symlist_t *symlist_dest, symlist_t *symlist_src1,
|
||||
symlist_t *symlist_src2));
|
||||
void symtable_dump __P((FILE *ofile));
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
# LINT -- config file for checking all the sources, tries to pull in
|
||||
# as much of the source tree as it can.
|
||||
#
|
||||
# $Id: LINT,v 1.286.2.17 1997/03/11 23:30:50 se Exp $
|
||||
# $Id: LINT,v 1.286.2.18 1997/03/12 17:45:48 joerg Exp $
|
||||
#
|
||||
# NB: You probably don't want to try running a kernel built from this
|
||||
# file. Instead, you should start from GENERIC, and add options from
|
||||
@@ -327,7 +327,7 @@ options QUOTA #enable disk quotas
|
||||
#options UNION_DIAGNOSTIC
|
||||
|
||||
# Add some error checking code to the null_bypass routine
|
||||
# in nthe NULL filesystem
|
||||
# in the NULL filesystem
|
||||
#options SAFETY
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
# This file tells config what files go into building a kernel,
|
||||
# files marked standard are always included.
|
||||
#
|
||||
# $Id: files.i386,v 1.141.2.7 1997/02/08 15:42:26 joerg Exp $
|
||||
# $Id: files.i386,v 1.141.2.9 1997/03/16 07:21:41 gibbs Exp $
|
||||
#
|
||||
aic7xxx_asm optional ahc device-driver \
|
||||
dependency "$S/dev/aic7xxx/aic7xxx_asm.c" \
|
||||
compile-with "${CC} -Wall -o $@ $>" \
|
||||
dependency "$S/dev/aic7xxx/*.[chyl]" \
|
||||
compile-with "cd $S/dev/aic7xxx; make BINDIR=${.CURDIR} all install" \
|
||||
no-obj no-implicit-rule \
|
||||
clean "aic7xxx_asm"
|
||||
#
|
||||
aic7xxx_seq.h optional ahc device-driver \
|
||||
compile-with "./aic7xxx_asm -o $@ $S/dev/aic7xxx/aic7xxx.seq" \
|
||||
aic7xxx_{seq,reg}.h optional ahc device-driver \
|
||||
compile-with "./aic7xxx_asm ${INCLUDES} -o aic7xxx_seq.h -r aic7xxx_reg.h $S/dev/aic7xxx/aic7xxx.seq" \
|
||||
no-obj no-implicit-rule before-depend \
|
||||
clean "aic7xxx_seq.h" \
|
||||
dependency "$S/dev/aic7xxx/aic7xxx_reg.h $S/dev/aic7xxx/aic7xxx.seq aic7xxx_asm"
|
||||
clean "aic7xxx_{seq,reg}.h" \
|
||||
dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} aic7xxx_asm"
|
||||
#
|
||||
linux_genassym optional compat_linux \
|
||||
dependency "$S/i386/linux/linux_genassym.c $S/i386/linux/linux.h" \
|
||||
@@ -31,7 +31,8 @@ i386/scsi/93cx6.c optional ahc device-driver
|
||||
i386/apm/apm.c optional apm device-driver
|
||||
i386/apm/apm_setup.s optional apm
|
||||
i386/eisa/3c5x9.c optional ep device-driver
|
||||
i386/eisa/aic7770.c optional ahc device-driver
|
||||
i386/eisa/aic7770.c optional ahc device-driver \
|
||||
dependency "aic7xxx_reg.h $S/i386/eisa/aic7770.c"
|
||||
i386/eisa/aha1742.c optional ahb device-driver
|
||||
i386/eisa/bt74x.c optional bt device-driver
|
||||
i386/eisa/eisaconf.c optional eisa
|
||||
@@ -221,7 +222,7 @@ i386/linux/linux_sysent.c optional compat_linux
|
||||
i386/linux/linux_sysvec.c optional compat_linux
|
||||
i386/linux/linux_util.c optional compat_linux
|
||||
i386/scsi/aic7xxx.c optional ahc device-driver \
|
||||
dependency "$S/dev/aic7xxx/aic7xxx_reg.h aic7xxx_seq.h"
|
||||
dependency "aic7xxx_{reg,seq}.h"
|
||||
i386/scsi/bt.c optional bt device-driver
|
||||
libkern/bcd.c standard
|
||||
libkern/divdi3.c standard
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: aic7770.c,v 1.34.2.5 1997/03/01 06:53:07 gibbs Exp $
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
#include <i386/eisa/eisaconf.h>
|
||||
#include <i386/scsi/aic7xxx.h>
|
||||
#include <dev/aic7xxx/aic7xxx_reg.h>
|
||||
#include <aic7xxx_reg.h>
|
||||
|
||||
#define EISA_DEVICE_ID_ADAPTEC_AIC7770 0x04907770
|
||||
#define EISA_DEVICE_ID_ADAPTEC_274x 0x04907771
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91
|
||||
* $Id: vmparam.h,v 1.20 1996/04/30 12:02:12 phk Exp $
|
||||
* $Id: vmparam.h,v 1.21 1996/05/02 14:20:07 phk Exp $
|
||||
*/
|
||||
|
||||
|
||||
@@ -116,4 +116,7 @@
|
||||
/* virtual sizes (bytes) for various kernel submaps */
|
||||
#define VM_KMEM_SIZE (32 * 1024 * 1024)
|
||||
|
||||
/* read and exec are the same thing */
|
||||
#define VM_PROT_READ_IS_EXEC
|
||||
|
||||
#endif /* _MACHINE_VMPARAM_H_ */
|
||||
+245
-89
@@ -32,7 +32,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: aic7xxx.c,v 1.81.2.16 1997/03/24 05:11:03 gibbs Exp $
|
||||
*/
|
||||
/*
|
||||
* TODO:
|
||||
@@ -117,8 +117,9 @@
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
#include <i386/scsi/aic7xxx.h>
|
||||
|
||||
#include <dev/aic7xxx/aic7xxx_reg.h>
|
||||
#include <dev/aic7xxx/sequencer.h>
|
||||
#include <aic7xxx_reg.h>
|
||||
#include <aic7xxx_seq.h>
|
||||
#endif /* defined(__FreeBSD__) */
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
@@ -127,7 +128,7 @@
|
||||
|
||||
#define bootverbose 1
|
||||
|
||||
#if DEBUGTARGET < 0 /* Negative numbrs for disabling cause warnings */
|
||||
#if DEBUGTARGET < 0 /* Negative numbers for disabling cause warnings */
|
||||
#define DEBUGTARGET 17
|
||||
#endif
|
||||
#endif /* defined(__NetBSD__) */
|
||||
@@ -272,6 +273,11 @@ static void ahc_handle_scsiint __P((struct ahc_softc *ahc,
|
||||
static void ahc_handle_devreset __P((struct ahc_softc *ahc,
|
||||
struct scb *scb));
|
||||
static void ahc_loadseq __P((struct ahc_softc *ahc));
|
||||
static struct patch *
|
||||
ahc_next_patch __P((struct patch *cur_patch, int options,
|
||||
int instrptr));
|
||||
static void ahc_download_instr __P((struct ahc_softc *ahc, int options,
|
||||
int instrptr));
|
||||
static int ahc_match_scb __P((struct scb *scb, int target, char channel,
|
||||
int lun, u_int8_t tag));
|
||||
static int ahc_poll __P((struct ahc_softc *ahc, int wait));
|
||||
@@ -409,7 +415,7 @@ static int ahc_num_syncrates =
|
||||
sizeof(ahc_syncrates) / sizeof(ahc_syncrates[0]);
|
||||
|
||||
/*
|
||||
* Allocate a controller structures for a new device and initialize it.
|
||||
* Allocate a controller structure for a new device and initialize it.
|
||||
*/
|
||||
#if defined(__FreeBSD__)
|
||||
struct ahc_softc *
|
||||
@@ -572,12 +578,12 @@ ahc_scsirate(ahc, scsirate, period, offset, channel, target )
|
||||
}
|
||||
}
|
||||
if (i >= ahc_num_syncrates) {
|
||||
/* Use asyncronous transfers. */
|
||||
/* Use asynchronous transfers. */
|
||||
*scsirate = 0;
|
||||
*period = 0;
|
||||
*offset = 0;
|
||||
if (bootverbose)
|
||||
printf("%s: target %d using asyncronous transfers\n",
|
||||
printf("%s: target %d using asynchronous transfers\n",
|
||||
ahc_name(ahc), target );
|
||||
}
|
||||
/*
|
||||
@@ -748,7 +754,7 @@ ahc_intr(arg)
|
||||
intstat = ahc_inb(ahc, INTSTAT);
|
||||
/*
|
||||
* Is this interrupt for me? or for
|
||||
* someone who is sharing my interrupt
|
||||
* someone who is sharing my interrupt?
|
||||
*/
|
||||
if (!(intstat & INT_PEND))
|
||||
#if defined(__FreeBSD__)
|
||||
@@ -806,8 +812,7 @@ ahc_intr(arg)
|
||||
scb->xs->error);
|
||||
ahc_run_done_queue(ahc);
|
||||
}
|
||||
if (scb->hscb->status != SCSI_QUEUE_FULL)
|
||||
ahc_done(ahc, scb);
|
||||
ahc_done(ahc, scb);
|
||||
}
|
||||
ahc_outb(ahc, CLRINT, CLRCMDINT);
|
||||
int_cleared++;
|
||||
@@ -860,7 +865,7 @@ ahc_handle_seqint(ahc, intstat)
|
||||
int scratch_offset;
|
||||
char channel;
|
||||
|
||||
if ((ahc_inb(ahc, FLAGS) & RESELECTED) != 0)
|
||||
if ((ahc_inb(ahc, SEQ_FLAGS) & RESELECTED) != 0)
|
||||
target = ahc_inb(ahc, SELID);
|
||||
else
|
||||
target = ahc_inb(ahc, SCSIID);
|
||||
@@ -869,7 +874,7 @@ ahc_handle_seqint(ahc, intstat)
|
||||
channel = ahc_inb(ahc, SBLKCTL) & SELBUSB ? 'B': 'A';
|
||||
if (channel == 'B')
|
||||
scratch_offset += 8;
|
||||
targ_mask = (0x01 << scratch_offset);
|
||||
targ_mask = (0x01 << scratch_offset);
|
||||
|
||||
switch (intstat & SEQINT_MASK) {
|
||||
case NO_MATCH:
|
||||
@@ -903,7 +908,7 @@ ahc_handle_seqint(ahc, intstat)
|
||||
* handler knows that there is an SCB to
|
||||
* cleanup.
|
||||
*/
|
||||
ahc_outb(ahc, FLAGS, ahc_inb(ahc, FLAGS)
|
||||
ahc_outb(ahc, SEQ_FLAGS, ahc_inb(ahc, SEQ_FLAGS)
|
||||
| IDENTIFY_SEEN);
|
||||
sc_print_addr(scb->xs->sc_link);
|
||||
printf("reconnect SCB abort successfull\n");
|
||||
@@ -946,7 +951,7 @@ ahc_handle_seqint(ahc, intstat)
|
||||
case SEND_REJECT:
|
||||
{
|
||||
u_int8_t rejbyte = ahc_inb(ahc, REJBYTE);
|
||||
printf("%s:%c:%d: Warning - unknown message recieved from "
|
||||
printf("%s:%c:%d: Warning - unknown message received from "
|
||||
"target (0x%x). Rejecting\n",
|
||||
ahc_name(ahc), channel, target, rejbyte);
|
||||
break;
|
||||
@@ -967,13 +972,20 @@ ahc_handle_seqint(ahc, intstat)
|
||||
ahc_name(ahc), channel, target, ahc_inb(ahc, LASTPHASE),
|
||||
ahc_inb(ahc, SAVED_TCL));
|
||||
found = ahc_reset_channel(ahc, channel, XS_TIMEOUT,
|
||||
/*initiate reset*/TRUE);
|
||||
/*initiate reset*/TRUE);
|
||||
printf("%s: Issued Channel %c Bus Reset. "
|
||||
"%d SCBs aborted\n", ahc_name(ahc), channel, found);
|
||||
break;
|
||||
}
|
||||
case BAD_PHASE:
|
||||
printf("%s:%c:%d: unknown scsi bus phase. Attempting to "
|
||||
"continue\n", ahc_name(ahc), channel, target);
|
||||
if (ahc_inb(ahc, LASTPHASE) == P_BUSFREE) {
|
||||
printf("%s:%c:%d: Missed busfree.\n", ahc_name(ahc),
|
||||
channel, target);
|
||||
restart_sequencer(ahc);
|
||||
} else {
|
||||
printf("%s:%c:%d: unknown scsi bus phase. Attempting "
|
||||
"to continue\n", ahc_name(ahc), channel, target);
|
||||
}
|
||||
break;
|
||||
case EXTENDED_MSG:
|
||||
{
|
||||
@@ -999,8 +1011,8 @@ ahc_handle_seqint(ahc, intstat)
|
||||
ahc_outb(ahc, RETURN_1, SEND_REJ);
|
||||
break;
|
||||
}
|
||||
period = ahc_inb(ahc, MSGIN_EXT_BYTE0);
|
||||
saved_offset = ahc_inb(ahc, MSGIN_EXT_BYTE1);
|
||||
period = ahc_inb(ahc, MSGIN_EXT_BYTES);
|
||||
saved_offset = ahc_inb(ahc, MSGIN_EXT_BYTES + 1);
|
||||
targ_scratch = ahc_inb(ahc, TARG_SCRATCH
|
||||
+ scratch_offset);
|
||||
if (targ_scratch & WIDEXFER)
|
||||
@@ -1058,7 +1070,7 @@ ahc_handle_seqint(ahc, intstat)
|
||||
break;
|
||||
}
|
||||
|
||||
bus_width = ahc_inb(ahc, MSGIN_EXT_BYTE0);
|
||||
bus_width = ahc_inb(ahc, MSGIN_EXT_BYTES);
|
||||
scratch = ahc_inb(ahc, TARG_SCRATCH + scratch_offset);
|
||||
|
||||
if ((scb->flags & SCB_MSGOUT_WDTR) != 0) {
|
||||
@@ -1161,8 +1173,8 @@ ahc_handle_seqint(ahc, intstat)
|
||||
/* note asynch xfers and clear flag */
|
||||
targ_scratch &= 0xf0;
|
||||
ahc->needsdtr &= ~targ_mask;
|
||||
printf("%s:%c:%d: refuses syncronous negotiation. "
|
||||
"Using asyncronous transfers\n",
|
||||
printf("%s:%c:%d: refuses synchronous negotiation. "
|
||||
"Using asynchronous transfers\n",
|
||||
ahc_name(ahc),
|
||||
channel, target);
|
||||
} else {
|
||||
@@ -1321,13 +1333,8 @@ ahc_handle_seqint(ahc, intstat)
|
||||
/*
|
||||
* XXX requeue this unconditionally.
|
||||
*/
|
||||
STAILQ_INSERT_TAIL(&ahc->waiting_scbs, scb,
|
||||
links);
|
||||
scb->flags |= SCB_WAITINGQ;
|
||||
/* Give the command a new lease on life */
|
||||
untimeout(ahc_timeout, (caddr_t)scb);
|
||||
timeout(ahc_timeout, (caddr_t)scb,
|
||||
(scb->xs->timeout * hz) / 1000);
|
||||
scb->xs->retries++;
|
||||
scb->xs->error = XS_BUSY;
|
||||
break;
|
||||
}
|
||||
/* Else treat as if it is a BUSY condition */
|
||||
@@ -1361,16 +1368,17 @@ ahc_handle_seqint(ahc, intstat)
|
||||
*/
|
||||
message_offset = ahc_inb(ahc, MSG_LEN);
|
||||
if (scb->flags & SCB_DEVICE_RESET) {
|
||||
ahc_outb(ahc, MSG0, MSG_BUS_DEV_RESET);
|
||||
ahc_outb(ahc, MSG_OUT, MSG_BUS_DEV_RESET);
|
||||
ahc_outb(ahc, MSG_LEN, 1);
|
||||
sc_print_addr(scb->xs->sc_link);
|
||||
printf("Bus Device Reset Message Sent\n");
|
||||
} else if (scb->flags & SCB_ABORT) {
|
||||
if ((scb->hscb->control & TAG_ENB) != 0)
|
||||
ahc_outb(ahc, MSG0 + message_offset,
|
||||
ahc_outb(ahc, MSG_OUT + message_offset,
|
||||
MSG_ABORT_TAG);
|
||||
else
|
||||
ahc_outb(ahc, MSG0 + message_offset, MSG_ABORT);
|
||||
ahc_outb(ahc, MSG_OUT + message_offset,
|
||||
MSG_ABORT);
|
||||
ahc_outb(ahc, MSG_LEN, message_offset + 1);
|
||||
sc_print_addr(scb->xs->sc_link);
|
||||
printf("Abort Message Sent\n");
|
||||
@@ -1420,9 +1428,9 @@ ahc_handle_seqint(ahc, intstat)
|
||||
u_int32_t overrun;
|
||||
int i;
|
||||
scb = ahc->scb_data->scbarray[scbindex];
|
||||
overrun = ahc_inb(ahc, STCNT0)
|
||||
| (ahc_inb(ahc, STCNT1) << 8)
|
||||
| (ahc_inb(ahc, STCNT2) << 16);
|
||||
overrun = ahc_inb(ahc, STCNT)
|
||||
| (ahc_inb(ahc, STCNT + 1) << 8)
|
||||
| (ahc_inb(ahc, STCNT + 2) << 16);
|
||||
overrun = 0x00ffffff - overrun;
|
||||
sc_print_addr(scb->xs->sc_link);
|
||||
printf("data overrun of %d bytes detected in %s phase."
|
||||
@@ -1431,7 +1439,7 @@ ahc_handle_seqint(ahc, intstat)
|
||||
scb->hscb->tag);
|
||||
sc_print_addr(scb->xs->sc_link);
|
||||
printf("%s seen Data Phase. Length = %d. NumSGs = %d.\n",
|
||||
ahc_inb(ahc, FLAGS) & DPHASE ? "Have" : "Haven't",
|
||||
ahc_inb(ahc, SEQ_FLAGS) & DPHASE ? "Have" : "Haven't",
|
||||
scb->xs->datalen, scb->sg_count);
|
||||
for (i = 0; i < scb->sg_count; i++) {
|
||||
printf("sg[%d] - Addr 0x%x : Length %d\n",
|
||||
@@ -1568,8 +1576,9 @@ ahc_handle_scsiint(ahc, intstat)
|
||||
char channel = ahc_inb(ahc, SBLKCTL) & SELBUSB ? 'B': 'A';
|
||||
int printerror = 1;
|
||||
|
||||
ahc_outb(ahc, SCSISEQ, 0);
|
||||
if (lastphase != P_BUSFREE) {
|
||||
u_int8_t flags = ahc_inb(ahc, FLAGS)
|
||||
u_int8_t flags = ahc_inb(ahc, SEQ_FLAGS)
|
||||
& (IDENTIFY_SEEN|RESELECTED);
|
||||
|
||||
if (flags == 0 || flags == (IDENTIFY_SEEN|RESELECTED)) {
|
||||
@@ -1643,8 +1652,10 @@ ahc_handle_scsiint(ahc, intstat)
|
||||
scb = NULL;
|
||||
} else
|
||||
printf("%s: ", ahc_name(ahc));
|
||||
printf("Unexpected busfree. LASTPHASE == 0x%x\n",
|
||||
lastphase);
|
||||
printf("Unexpected busfree. LASTPHASE == 0x%x\n"
|
||||
"SEQADDR == 0x%x\n",
|
||||
lastphase, (ahc_inb(ahc, SEQADDR1) << 8)
|
||||
| ahc_inb(ahc, SEQADDR0));
|
||||
}
|
||||
ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
|
||||
ahc_outb(ahc, CLRSINT1, CLRBUSFREE);
|
||||
@@ -1652,8 +1663,13 @@ ahc_handle_scsiint(ahc, intstat)
|
||||
ahc_outb(ahc, CLRINT, CLRSCSIINT);
|
||||
} else if (scb == NULL) {
|
||||
printf("%s: ahc_intr - referenced scb not "
|
||||
"valid during scsiint 0x%x scb(%d)\n",
|
||||
ahc_name(ahc), status, scb_index);
|
||||
"valid during scsiint 0x%x scb(%d)\n"
|
||||
"SIMODE0 = 0x%x, SIMODE1 = 0x%x, SSTAT0 = 0x%x\n"
|
||||
"SEQADDR = 0x%x\n", ahc_name(ahc),
|
||||
status, scb_index, ahc_inb(ahc, SIMODE0),
|
||||
ahc_inb(ahc, SIMODE1), ahc_inb(ahc, SSTAT0),
|
||||
(ahc_inb(ahc, SEQADDR1) << 8)
|
||||
| ahc_inb(ahc, SEQADDR0));
|
||||
ahc_outb(ahc, CLRSINT1, status);
|
||||
unpause_sequencer(ahc, /*unpause_always*/TRUE);
|
||||
ahc_outb(ahc, CLRINT, CLRSCSIINT);
|
||||
@@ -1707,7 +1723,7 @@ ahc_handle_scsiint(ahc, intstat)
|
||||
* mesg_out to something other than MSG_NOP.
|
||||
*/
|
||||
if (mesg_out != MSG_NOOP) {
|
||||
ahc_outb(ahc, MSG0, mesg_out);
|
||||
ahc_outb(ahc, MSG_OUT, mesg_out);
|
||||
ahc_outb(ahc, MSG_LEN, 1);
|
||||
scb = NULL;
|
||||
} else
|
||||
@@ -1727,15 +1743,17 @@ ahc_handle_scsiint(ahc, intstat)
|
||||
struct scsi_xfer *xs;
|
||||
u_int8_t scbptr;
|
||||
u_int8_t nextscb;
|
||||
u_int8_t flags;
|
||||
|
||||
/*
|
||||
* XXX If we queued an abort tag, go clean up the
|
||||
* disconnected list.
|
||||
*/
|
||||
xs = scb->xs;
|
||||
xs->error = XS_SELTIMEOUT;
|
||||
/*
|
||||
* Clear any pending messages for the timed out
|
||||
* target, and mark the target as free
|
||||
*/
|
||||
flags = ahc_inb(ahc, FLAGS);
|
||||
ahc_outb(ahc, MSG_LEN, 0);
|
||||
ahc_index_busy_target(ahc, xs->sc_link->target,
|
||||
IS_SCSIBUS_B(ahc, xs->sc_link) ? 'B' : 'A',
|
||||
@@ -1906,7 +1924,15 @@ ahc_done(ahc, scb)
|
||||
}
|
||||
untimeout(ahc_timeout, (caddr_t)scb);
|
||||
ahc_free_scb(ahc, scb);
|
||||
scsi_done(xs);
|
||||
/*
|
||||
* If we're polling, we rely on the ITS_DONE flag in the xs structure
|
||||
* to know that the command has completed. Unfortunately, scsi_done
|
||||
* can cause the same xs to get requeued putting us in an infinite
|
||||
* loop. So, we defer the scsi_done call until the poll routine exits
|
||||
* its loop. I hate the way this works.
|
||||
*/
|
||||
if ((xs->flags & SCSI_NOMASK) == 0)
|
||||
scsi_done(xs);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1942,7 +1968,7 @@ ahc_init(ahc)
|
||||
ahc->our_id);
|
||||
} else
|
||||
printf("Single Channel, SCSI Id=%d, ", ahc->our_id);
|
||||
ahc_outb(ahc, FLAGS, SINGLE_BUS | (ahc->flags & AHC_PAGESCBS));
|
||||
ahc_outb(ahc, SEQ_FLAGS, ahc->flags & AHC_PAGESCBS);
|
||||
break;
|
||||
case 2:
|
||||
ahc->our_id = (ahc_inb(ahc, SCSICONF + 1) & HWSCSIID);
|
||||
@@ -1957,7 +1983,7 @@ ahc_init(ahc)
|
||||
} else
|
||||
printf("Wide Channel, SCSI Id=%d, ", ahc->our_id);
|
||||
ahc->type |= AHC_WIDE;
|
||||
ahc_outb(ahc, FLAGS, WIDE_BUS | (ahc->flags & AHC_PAGESCBS));
|
||||
ahc_outb(ahc, SEQ_FLAGS, WIDE_BUS | (ahc->flags & AHC_PAGESCBS));
|
||||
break;
|
||||
case 8:
|
||||
ahc->our_id = (ahc_inb(ahc, SCSICONF) & HSCSIID);
|
||||
@@ -1965,7 +1991,7 @@ ahc_init(ahc)
|
||||
printf("Twin Channel, A SCSI Id=%d, B SCSI Id=%d, ",
|
||||
ahc->our_id, ahc->our_id_b);
|
||||
ahc->type |= AHC_TWIN;
|
||||
ahc_outb(ahc, FLAGS, TWIN_BUS | (ahc->flags & AHC_PAGESCBS));
|
||||
ahc_outb(ahc, SEQ_FLAGS, TWIN_BUS | (ahc->flags & AHC_PAGESCBS));
|
||||
break;
|
||||
default:
|
||||
printf(" Unsupported adapter type. Ignoring\n");
|
||||
@@ -1997,10 +2023,10 @@ ahc_init(ahc)
|
||||
ahc_outb(ahc, SCB_TAG, SCB_LIST_NULL);
|
||||
|
||||
/* No Busy non-tagged targets yet */
|
||||
ahc_outb(ahc, SCB_ACTIVE0, SCB_LIST_NULL);
|
||||
ahc_outb(ahc, SCB_ACTIVE1, SCB_LIST_NULL);
|
||||
ahc_outb(ahc, SCB_ACTIVE2, SCB_LIST_NULL);
|
||||
ahc_outb(ahc, SCB_ACTIVE3, SCB_LIST_NULL);
|
||||
ahc_outb(ahc, SCB_BUSYTARGETS, SCB_LIST_NULL);
|
||||
ahc_outb(ahc, SCB_BUSYTARGETS + 1, SCB_LIST_NULL);
|
||||
ahc_outb(ahc, SCB_BUSYTARGETS + 2, SCB_LIST_NULL);
|
||||
ahc_outb(ahc, SCB_BUSYTARGETS + 3, SCB_LIST_NULL);
|
||||
}
|
||||
|
||||
/* Make that the last SCB terminates the free list */
|
||||
@@ -2062,7 +2088,7 @@ ahc_init(ahc)
|
||||
if (scsi_conf & RESET_SCSI) {
|
||||
/* Reset the bus */
|
||||
if (bootverbose)
|
||||
printf("%s: Reseting Channel B\n",
|
||||
printf("%s: Resetting Channel B\n",
|
||||
ahc_name(ahc));
|
||||
ahc_reset_current_bus(ahc);
|
||||
}
|
||||
@@ -2085,7 +2111,7 @@ ahc_init(ahc)
|
||||
if (scsi_conf & RESET_SCSI) {
|
||||
/* Reset the bus */
|
||||
if (bootverbose)
|
||||
printf("%s: Reseting Channel A\n", ahc_name(ahc));
|
||||
printf("%s: Resetting Channel A\n", ahc_name(ahc));
|
||||
|
||||
ahc_reset_current_bus(ahc);
|
||||
}
|
||||
@@ -2094,8 +2120,8 @@ ahc_init(ahc)
|
||||
* Look at the information that board initialization or
|
||||
* the board bios has left us. In the lower four bits of each
|
||||
* target's scratch space any value other than 0 indicates
|
||||
* that we should initiate syncronous transfers. If it's zero,
|
||||
* the user or the BIOS has decided to disable syncronous
|
||||
* that we should initiate synchronous transfers. If it's zero,
|
||||
* the user or the BIOS has decided to disable synchronous
|
||||
* negotiation to that target so we don't activate the needsdtr
|
||||
* flag.
|
||||
*/
|
||||
@@ -2128,7 +2154,7 @@ ahc_init(ahc)
|
||||
|
||||
if (target_settings & 0x0f) {
|
||||
ahc->needsdtr_orig |= (0x01 << i);
|
||||
/*Default to a asyncronous transfers(0 offset)*/
|
||||
/*Default to a asynchronous transfers(0 offset)*/
|
||||
target_settings &= 0xf0;
|
||||
}
|
||||
if (target_settings & 0x80) {
|
||||
@@ -2185,7 +2211,7 @@ ahc_init(ahc)
|
||||
ahc->needwdtr, ahc->discenable);
|
||||
#endif
|
||||
/*
|
||||
* Set the number of availible hardware SCBs
|
||||
* Set the number of available hardware SCBs
|
||||
*/
|
||||
ahc_outb(ahc, SCBCOUNT, ahc->scb_data->maxhscbs);
|
||||
|
||||
@@ -2228,10 +2254,10 @@ ahc_init(ahc)
|
||||
|
||||
/* Tell the sequencer where it can find the hscb array. */
|
||||
hscb_physaddr = vtophys(ahc->scb_data->hscbs);
|
||||
ahc_outb(ahc, HSCB_ADDR0, hscb_physaddr & 0xFF);
|
||||
ahc_outb(ahc, HSCB_ADDR1, (hscb_physaddr >> 8)& 0xFF);
|
||||
ahc_outb(ahc, HSCB_ADDR2, (hscb_physaddr >> 16)& 0xFF);
|
||||
ahc_outb(ahc, HSCB_ADDR3, (hscb_physaddr >> 24)& 0xFF);
|
||||
ahc_outb(ahc, HSCB_ADDR, hscb_physaddr & 0xFF);
|
||||
ahc_outb(ahc, HSCB_ADDR + 1, (hscb_physaddr >> 8)& 0xFF);
|
||||
ahc_outb(ahc, HSCB_ADDR + 2, (hscb_physaddr >> 16)& 0xFF);
|
||||
ahc_outb(ahc, HSCB_ADDR + 3, (hscb_physaddr >> 24)& 0xFF);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2256,7 +2282,7 @@ ahc_init(ahc)
|
||||
|
||||
/*
|
||||
* QCount mask to deal with broken aic7850s that
|
||||
* sporatically get garbage in the upper bits of
|
||||
* sporadically get garbage in the upper bits of
|
||||
* their QCount registers.
|
||||
*/
|
||||
ahc_outb(ahc, QCNTMASK, ahc->qcntmask);
|
||||
@@ -2519,6 +2545,7 @@ ahc_scsi_cmd(xs)
|
||||
break;
|
||||
}
|
||||
} while ((xs->flags & ITSDONE) == 0); /* a non command complete intr */
|
||||
scsi_done(xs);
|
||||
splx(s);
|
||||
return (COMPLETE);
|
||||
}
|
||||
@@ -2533,7 +2560,12 @@ ahc_run_waiting_queue(ahc)
|
||||
{
|
||||
struct scb *scb;
|
||||
|
||||
pause_sequencer(ahc);
|
||||
/*
|
||||
* On aic78X0 chips, we rely on Auto Access Pause (AAP)
|
||||
* instead of doing an explicit pause/unpause.
|
||||
*/
|
||||
if ((ahc->type & AHC_AIC78X0) == 0)
|
||||
pause_sequencer(ahc);
|
||||
|
||||
while ((scb = ahc->waiting_scbs.stqh_first) != NULL) {
|
||||
|
||||
@@ -2555,11 +2587,12 @@ ahc_run_waiting_queue(ahc)
|
||||
*/
|
||||
ahc->curqincnt++;
|
||||
}
|
||||
unpause_sequencer(ahc, /*Unpause always*/FALSE);
|
||||
if ((ahc->type & AHC_AIC78X0) == 0)
|
||||
unpause_sequencer(ahc, /*Unpause always*/FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* A scb (and hence an scb entry on the board is put onto the
|
||||
* An scb (and hence an scb entry on the board) is put onto the
|
||||
* free list.
|
||||
*/
|
||||
static void
|
||||
@@ -2582,7 +2615,7 @@ ahc_free_scb(ahc, scb)
|
||||
STAILQ_INSERT_HEAD(&ahc->scb_data->free_scbs, scb, links);
|
||||
if (scb->links.stqe_next == NULL) {
|
||||
/*
|
||||
* If there were no SCBs availible, wake anybody waiting
|
||||
* If there were no SCBs available, wake anybody waiting
|
||||
* for one to come free.
|
||||
*/
|
||||
wakeup((caddr_t)&ahc->scb_data->free_scbs);
|
||||
@@ -2700,19 +2733,133 @@ static void
|
||||
ahc_loadseq(ahc)
|
||||
struct ahc_softc *ahc;
|
||||
{
|
||||
static u_char seqprog[] = {
|
||||
# include "aic7xxx_seq.h"
|
||||
};
|
||||
int options;
|
||||
struct patch *cur_patch;
|
||||
int i;
|
||||
int downloaded;
|
||||
|
||||
options = 1; /* Code for all options */
|
||||
downloaded = 0;
|
||||
if ((ahc->type & AHC_ULTRA) != 0)
|
||||
options |= ULTRA;
|
||||
if ((ahc->type & AHC_TWIN) != 0)
|
||||
options |= TWIN_CHANNEL;
|
||||
if (ahc->scb_data->maxscbs > ahc->scb_data->maxhscbs)
|
||||
options |= SCB_PAGING;
|
||||
|
||||
cur_patch = patches;
|
||||
ahc_outb(ahc, SEQCTL, PERRORDIS|LOADRAM);
|
||||
ahc_outb(ahc, SEQADDR0, 0);
|
||||
ahc_outb(ahc, SEQADDR1, 0);
|
||||
|
||||
ahc_outsb(ahc, SEQRAM, seqprog, sizeof(seqprog));
|
||||
for(i = 0; i < sizeof(seqprog)/4; i++) {
|
||||
cur_patch = ahc_next_patch(cur_patch, options, i);
|
||||
|
||||
if (cur_patch && cur_patch->begin <= i && cur_patch->end > i)
|
||||
/* Skip this instruction for this configuration */
|
||||
continue;
|
||||
ahc_download_instr(ahc, options, i);
|
||||
downloaded++;
|
||||
}
|
||||
|
||||
ahc_outb(ahc, SEQCTL, FASTMODE);
|
||||
ahc_outb(ahc, SEQADDR0, 0);
|
||||
ahc_outb(ahc, SEQADDR1, 0);
|
||||
if (bootverbose)
|
||||
printf("%s: %d instructions downloaded\n", ahc_name(ahc),
|
||||
downloaded);
|
||||
}
|
||||
|
||||
static struct patch *
|
||||
ahc_next_patch(cur_patch, options, instrptr)
|
||||
struct patch *cur_patch;
|
||||
int options;
|
||||
int instrptr;
|
||||
{
|
||||
while(cur_patch != NULL) {
|
||||
if (((cur_patch->options & options) != 0
|
||||
&& cur_patch->negative == FALSE)
|
||||
|| ((cur_patch->options & options) == 0
|
||||
&& cur_patch->negative == TRUE)
|
||||
|| (instrptr >= cur_patch->end)) {
|
||||
/*
|
||||
* Either we want to keep this section of code,
|
||||
* or we have consumed this patch. Skip to the
|
||||
* next patch.
|
||||
*/
|
||||
cur_patch++;
|
||||
if (cur_patch->options == 0)
|
||||
/* Out of patches */
|
||||
cur_patch = NULL;
|
||||
} else
|
||||
/* Found an okay patch */
|
||||
break;
|
||||
}
|
||||
return (cur_patch);
|
||||
}
|
||||
|
||||
static void
|
||||
ahc_download_instr(ahc, options, instrptr)
|
||||
struct ahc_softc *ahc;
|
||||
int options;
|
||||
int instrptr;
|
||||
{
|
||||
u_int8_t opcode;
|
||||
struct ins_format3 *instr;
|
||||
|
||||
instr = (struct ins_format3 *)&seqprog[instrptr * 4];
|
||||
/* Pull the opcode */
|
||||
opcode = instr->opcode_addr >> 1;
|
||||
switch (opcode) {
|
||||
case AIC_OP_JMP:
|
||||
case AIC_OP_JC:
|
||||
case AIC_OP_JNC:
|
||||
case AIC_OP_CALL:
|
||||
case AIC_OP_JNE:
|
||||
case AIC_OP_JNZ:
|
||||
case AIC_OP_JE:
|
||||
case AIC_OP_JZ:
|
||||
{
|
||||
int address_offset;
|
||||
struct ins_format3 new_instr;
|
||||
u_int address;
|
||||
struct patch *patch;
|
||||
int i;
|
||||
|
||||
address_offset = 0;
|
||||
new_instr = *instr; /* structure copy */
|
||||
address = new_instr.address;
|
||||
address |= (new_instr.opcode_addr & ADDR_HIGH_BIT) << 8;
|
||||
for (i = 0; i < sizeof(patches)/sizeof(patches[0]); i++) {
|
||||
patch = &patches[i];
|
||||
if (((patch->options & options) == 0
|
||||
&& patch->negative == FALSE)
|
||||
|| ((patch->options & options) != 0
|
||||
&& patch->negative == TRUE)) {
|
||||
if (address >= patch->end)
|
||||
address_offset +=
|
||||
patch->end - patch->begin;
|
||||
}
|
||||
}
|
||||
address -= address_offset;
|
||||
new_instr.address = address & 0xFF;
|
||||
new_instr.opcode_addr &= ~ADDR_HIGH_BIT;
|
||||
new_instr.opcode_addr |= (address >> 8) & ADDR_HIGH_BIT;
|
||||
ahc_outsb(ahc, SEQRAM, &new_instr.immediate, 4);
|
||||
break;
|
||||
}
|
||||
case AIC_OP_OR:
|
||||
case AIC_OP_AND:
|
||||
case AIC_OP_XOR:
|
||||
case AIC_OP_ADD:
|
||||
case AIC_OP_ADC:
|
||||
case AIC_OP_ROL:
|
||||
ahc_outsb(ahc, SEQRAM, &instr->immediate, 4);
|
||||
break;
|
||||
default:
|
||||
panic("Unknown opcode encountered in seq program");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2918,9 +3065,17 @@ bus_reset:
|
||||
active_scb = ahc->scb_data->scbarray[active_scb_index];
|
||||
|
||||
if (bus_state != P_BUSFREE) {
|
||||
if (active_scb_index >= ahc->scb_data->numscbs) {
|
||||
/* Go "immediatly" to the bus reset */
|
||||
sc_print_addr(scb->xs->sc_link);
|
||||
printf("SCB %d: Yucky Immediate reset. "
|
||||
"Flags = 0x%x\n", scb->hscb->tag,
|
||||
scb->flags);
|
||||
goto bus_reset;
|
||||
}
|
||||
/* Send the abort to the active SCB */
|
||||
ahc_outb(ahc, MSG_LEN, 1);
|
||||
ahc_outb(ahc, MSG0,
|
||||
ahc_outb(ahc, MSG_OUT,
|
||||
(active_scb->hscb->control & TAG_ENB) == 0 ?
|
||||
MSG_ABORT : MSG_ABORT_TAG);
|
||||
ahc_outb(ahc, SCSISIGO, bus_state|ATNO);
|
||||
@@ -2954,7 +3109,8 @@ bus_reset:
|
||||
if (disconnected) {
|
||||
/* Simply set the ABORT_SCB control bit */
|
||||
scb->hscb->control |= ABORT_SCB|MK_MESSAGE;
|
||||
scb->hscb->control &= ~DISCONNECTED;
|
||||
if ((ahc->flags & AHC_PAGESCBS) == 0)
|
||||
scb->hscb->control &= ~DISCONNECTED;
|
||||
scb->flags |= SCB_QUEUED_ABORT
|
||||
| SCB_ABORT|SCB_RECOVERY_SCB;
|
||||
if (hscb_index != SCB_LIST_NULL) {
|
||||
@@ -2962,7 +3118,8 @@ bus_reset:
|
||||
|
||||
scb_control = ahc_inb(ahc, SCB_CONTROL);
|
||||
ahc_outb(ahc, SCB_CONTROL,
|
||||
scb_control | ABORT_SCB);
|
||||
scb_control | MK_MESSAGE
|
||||
| ABORT_SCB);
|
||||
}
|
||||
/*
|
||||
* Actually re-queue this SCB in case we can
|
||||
@@ -2977,9 +3134,6 @@ bus_reset:
|
||||
|
||||
target = scb->xs->sc_link->target;
|
||||
lun = scb->xs->sc_link->lun;
|
||||
ahc_index_busy_target(ahc, target,
|
||||
channel,
|
||||
/*unbusy*/TRUE);
|
||||
ahc_search_qinfifo(ahc, target,
|
||||
channel,
|
||||
lun,
|
||||
@@ -3031,7 +3185,7 @@ ahc_find_scb(ahc, scb)
|
||||
break;
|
||||
}
|
||||
ahc_outb(ahc, SCBPTR, saved_scbptr);
|
||||
if (curindex > ahc->scb_data->maxhscbs)
|
||||
if (curindex >= ahc->scb_data->maxhscbs)
|
||||
curindex = SCB_LIST_NULL;
|
||||
|
||||
return curindex;
|
||||
@@ -3381,7 +3535,7 @@ ahc_index_busy_target(ahc, target, channel, unbusy)
|
||||
info_scb += 2;
|
||||
active_scb = ahc_inb(ahc, SCBPTR);
|
||||
ahc_outb(ahc, SCBPTR, info_scb);
|
||||
scb_offset = SCB_ACTIVE0 + (target & 0x03);
|
||||
scb_offset = SCB_BUSYTARGETS + (target & 0x03);
|
||||
busy_scbid = ahc_inb(ahc, scb_offset);
|
||||
if (unbusy)
|
||||
ahc_outb(ahc, scb_offset, SCB_LIST_NULL);
|
||||
@@ -3406,7 +3560,7 @@ ahc_busy_target(ahc, target, channel, scbid)
|
||||
info_scb += 2;
|
||||
active_scb = ahc_inb(ahc, SCBPTR);
|
||||
ahc_outb(ahc, SCBPTR, info_scb);
|
||||
scb_offset = SCB_ACTIVE0 + (target & 0x03);
|
||||
scb_offset = SCB_BUSYTARGETS + (target & 0x03);
|
||||
ahc_outb(ahc, scb_offset, scbid);
|
||||
ahc_outb(ahc, SCBPTR, active_scb);
|
||||
return;
|
||||
@@ -3595,6 +3749,7 @@ ahc_reset_channel(ahc, channel, xs_error, initiate_reset)
|
||||
ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
|
||||
if (initiate_reset)
|
||||
ahc_reset_current_bus(ahc);
|
||||
ahc_outb(ahc, SCSISEQ, 0);
|
||||
ahc_clear_intstat(ahc);
|
||||
ahc_outb(ahc, SBLKCTL, sblkctl);
|
||||
unpause_sequencer(ahc, /*unpause_always*/FALSE);
|
||||
@@ -3603,6 +3758,7 @@ ahc_reset_channel(ahc, channel, xs_error, initiate_reset)
|
||||
ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
|
||||
if (initiate_reset)
|
||||
ahc_reset_current_bus(ahc);
|
||||
ahc_outb(ahc, SCSISEQ, 0);
|
||||
ahc_clear_intstat(ahc);
|
||||
restart_sequencer(ahc);
|
||||
}
|
||||
@@ -3655,11 +3811,11 @@ ahc_construct_sdtr(ahc, start_byte, period, offset)
|
||||
u_int8_t period;
|
||||
u_int8_t offset;
|
||||
{
|
||||
ahc_outb(ahc, MSG0 + start_byte, MSG_EXTENDED);
|
||||
ahc_outb(ahc, MSG1 + start_byte, MSG_EXT_SDTR_LEN);
|
||||
ahc_outb(ahc, MSG2 + start_byte, MSG_EXT_SDTR);
|
||||
ahc_outb(ahc, MSG3 + start_byte, period);
|
||||
ahc_outb(ahc, MSG4 + start_byte, offset);
|
||||
ahc_outb(ahc, MSG_OUT + start_byte, MSG_EXTENDED);
|
||||
ahc_outb(ahc, MSG_OUT + 1 + start_byte, MSG_EXT_SDTR_LEN);
|
||||
ahc_outb(ahc, MSG_OUT + 2 + start_byte, MSG_EXT_SDTR);
|
||||
ahc_outb(ahc, MSG_OUT + 3 + start_byte, period);
|
||||
ahc_outb(ahc, MSG_OUT + 4 + start_byte, offset);
|
||||
ahc_outb(ahc, MSG_LEN, start_byte + 5);
|
||||
}
|
||||
|
||||
@@ -3669,10 +3825,10 @@ ahc_construct_wdtr(ahc, start_byte, bus_width)
|
||||
int start_byte;
|
||||
u_int8_t bus_width;
|
||||
{
|
||||
ahc_outb(ahc, MSG0 + start_byte, MSG_EXTENDED);
|
||||
ahc_outb(ahc, MSG1 + start_byte, MSG_EXT_WDTR_LEN);
|
||||
ahc_outb(ahc, MSG2 + start_byte, MSG_EXT_WDTR);
|
||||
ahc_outb(ahc, MSG3 + start_byte, bus_width);
|
||||
ahc_outb(ahc, MSG_OUT + start_byte, MSG_EXTENDED);
|
||||
ahc_outb(ahc, MSG_OUT + 1 + start_byte, MSG_EXT_WDTR_LEN);
|
||||
ahc_outb(ahc, MSG_OUT + 2 + start_byte, MSG_EXT_WDTR);
|
||||
ahc_outb(ahc, MSG_OUT + 3 + start_byte, bus_width);
|
||||
ahc_outb(ahc, MSG_LEN, start_byte + 4);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
*
|
||||
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
|
||||
*
|
||||
* $Id: procfs_map.c,v 1.4 1996/07/27 19:47:04 dyson Exp $
|
||||
* $Id: procfs_map.c,v 1.6 1996/10/30 03:52:57 dyson Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -113,7 +113,7 @@ procfs_domap(curp, p, pfs, uio)
|
||||
int resident, privateresident;
|
||||
char *type;
|
||||
|
||||
if (entry->is_a_map || entry->is_sub_map)
|
||||
if (entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP))
|
||||
continue;
|
||||
|
||||
obj = entry->object.vm_object;
|
||||
@@ -163,7 +163,7 @@ case OBJT_DEVICE:
|
||||
(entry->protection & VM_PROT_READ)?"r":"-",
|
||||
(entry->protection & VM_PROT_WRITE)?"w":"-",
|
||||
(entry->protection & VM_PROT_EXECUTE)?"x":"-",
|
||||
entry->copy_on_write?"COW":" ",
|
||||
(entry->eflags & MAP_ENTRY_COW)?"COW":" ",
|
||||
type);
|
||||
|
||||
len = strlen(mebuffer);
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: aic7870.c,v 1.41.2.7 1997/03/15 21:18:43 bde Exp $
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
@@ -60,7 +60,7 @@
|
||||
#include <i386/scsi/aic7xxx.h>
|
||||
#include <i386/scsi/93cx6.h>
|
||||
|
||||
#include <dev/aic7xxx/aic7xxx_reg.h>
|
||||
#include <aic7xxx_reg.h>
|
||||
|
||||
#define PCI_BASEADR0 PCI_MAP_REG_START /* I/O Address */
|
||||
#define PCI_BASEADR1 PCI_MAP_REG_START + 4 /* Mem I/O Address */
|
||||
@@ -725,7 +725,7 @@ load_seeprom(ahc, sxfrctl1)
|
||||
}
|
||||
if (!have_seeprom) {
|
||||
if (bootverbose)
|
||||
printf("\n%s: No SEEPROM availible\n", ahc_name(ahc));
|
||||
printf("\n%s: No SEEPROM available\n", ahc_name(ahc));
|
||||
ahc->flags |= AHC_USEDEFAULTS;
|
||||
} else {
|
||||
/*
|
||||
|
||||
+117
-22
@@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxp.c,v 1.21.2.3 1997/02/04 10:53:59 davidg Exp $
|
||||
* $Id: if_fxp.c,v 1.21.2.5 1997/03/17 11:09:42 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -88,6 +88,9 @@ struct fxp_softc {
|
||||
struct fxp_stats *fxp_stats; /* Pointer to interface stats */
|
||||
int tx_queued; /* # of active TxCB's */
|
||||
int promisc_mode; /* promiscuous mode enabled */
|
||||
int phy_primary_addr; /* address of primary PHY */
|
||||
int phy_primary_device; /* device type of primary PHY */
|
||||
int phy_10Mbps_only; /* PHY is 10Mbps-only device */
|
||||
};
|
||||
|
||||
static u_long fxp_count;
|
||||
@@ -134,9 +137,12 @@ static int fxp_ioctl __P((struct ifnet *, int, caddr_t));
|
||||
static void fxp_init __P((struct ifnet *));
|
||||
static void fxp_stop __P((struct fxp_softc *));
|
||||
static void fxp_watchdog __P((struct ifnet *));
|
||||
static void fxp_get_macaddr __P((struct fxp_softc *));
|
||||
static int fxp_add_rfabuf __P((struct fxp_softc *, struct mbuf *));
|
||||
static void fxp_shutdown __P((int, void *));
|
||||
static int fxp_mdi_read __P((struct fxp_csr *, int, int));
|
||||
static void fxp_mdi_write __P((struct fxp_csr *, int, int, int));
|
||||
static void fxp_read_eeprom __P((struct fxp_csr *, u_short *, int, int));
|
||||
|
||||
|
||||
timeout_t fxp_stats_update;
|
||||
|
||||
@@ -208,7 +214,7 @@ fxp_probe(config_id, device_id)
|
||||
{
|
||||
if (((device_id & 0xffff) == FXP_VENDORID_INTEL) &&
|
||||
((device_id >> 16) & 0xffff) == FXP_DEVICEID_i82557)
|
||||
return ("Intel EtherExpress Pro/100B Fast Ethernet");
|
||||
return ("Intel EtherExpress Pro 10/100B Ethernet");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -225,6 +231,7 @@ fxp_attach(config_id, unit)
|
||||
struct ifnet *ifp;
|
||||
vm_offset_t pbase;
|
||||
int s, i;
|
||||
u_short data;
|
||||
|
||||
sc = malloc(sizeof(struct fxp_softc), M_DEVBUF, M_NOWAIT);
|
||||
if (sc == NULL)
|
||||
@@ -275,6 +282,14 @@ fxp_attach(config_id, unit)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Get info about the primary PHY
|
||||
*/
|
||||
fxp_read_eeprom(sc->csr, (u_short *)&data, 6, 1);
|
||||
sc->phy_primary_addr = data & 0xff;
|
||||
sc->phy_primary_device = (data >> 8) & 0x3f;
|
||||
sc->phy_10Mbps_only = data >> 15;
|
||||
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_unit = unit;
|
||||
@@ -286,9 +301,14 @@ fxp_attach(config_id, unit)
|
||||
ifp->if_watchdog = fxp_watchdog;
|
||||
ifp->if_baudrate = 100000000;
|
||||
|
||||
fxp_get_macaddr(sc);
|
||||
printf("fxp%d: Ethernet address %6D\n", unit,
|
||||
sc->arpcom.ac_enaddr, ":");
|
||||
/*
|
||||
* Read MAC address
|
||||
*/
|
||||
fxp_read_eeprom(sc->csr, (u_short *)sc->arpcom.ac_enaddr, 0, 3);
|
||||
printf("fxp%d: Ethernet address %6D", unit, sc->arpcom.ac_enaddr, ":");
|
||||
if (sc->phy_10Mbps_only)
|
||||
printf(", 10Mbps");
|
||||
printf("\n");
|
||||
|
||||
/*
|
||||
* Attach the interface.
|
||||
@@ -327,25 +347,23 @@ fail:
|
||||
}
|
||||
|
||||
/*
|
||||
* Read station (MAC) address from serial EEPROM. Basically, you
|
||||
* manually shift in the read opcode (one bit at a time) and then
|
||||
* shift in the address, and then you shift out the data (all of
|
||||
* this one bit at a time). The word size is 16 bits, so you have
|
||||
* to provide the address for every 16 bits of data. The MAC address
|
||||
* is in the first 3 words (6 bytes total).
|
||||
* Read from the serial EEPROM. Basically, you manually shift in
|
||||
* the read opcode (one bit at a time) and then shift in the address,
|
||||
* and then you shift out the data (all of this one bit at a time).
|
||||
* The word size is 16 bits, so you have to provide the address for
|
||||
* every 16 bits of data.
|
||||
*/
|
||||
static void
|
||||
fxp_get_macaddr(sc)
|
||||
struct fxp_softc *sc;
|
||||
{
|
||||
fxp_read_eeprom(csr, data, offset, words)
|
||||
struct fxp_csr *csr;
|
||||
u_short reg, *data;
|
||||
u_short *data;
|
||||
int offset;
|
||||
int words;
|
||||
{
|
||||
u_short reg;
|
||||
int i, x;
|
||||
|
||||
csr = sc->csr;
|
||||
data = (u_short *)sc->arpcom.ac_enaddr;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (i = 0; i < words; i++) {
|
||||
csr->eeprom_control = FXP_EEPROM_EECS;
|
||||
/*
|
||||
* Shift in read opcode.
|
||||
@@ -366,7 +384,7 @@ fxp_get_macaddr(sc)
|
||||
* Shift in address.
|
||||
*/
|
||||
for (x = 6; x > 0; x--) {
|
||||
if (i & (1 << (x - 1))) {
|
||||
if ((i + offset) & (1 << (x - 1))) {
|
||||
reg = FXP_EEPROM_EECS | FXP_EEPROM_EEDI;
|
||||
} else {
|
||||
reg = FXP_EEPROM_EECS;
|
||||
@@ -862,7 +880,7 @@ fxp_init(ifp)
|
||||
cbp->save_bf = prm; /* save bad frames */
|
||||
cbp->disc_short_rx = !prm; /* discard short packets */
|
||||
cbp->underrun_retry = 1; /* retry mode (1) on DMA underrun */
|
||||
cbp->mediatype = 1; /* (MII) interface mode */
|
||||
cbp->mediatype = !sc->phy_10Mbps_only; /* interface mode */
|
||||
cbp->nsai = 1; /* (don't) disable source addr insert */
|
||||
cbp->preamble_length = 2; /* (7 byte) preamble */
|
||||
cbp->loopback = 0; /* (don't) loopback */
|
||||
@@ -939,6 +957,44 @@ fxp_init(ifp)
|
||||
csr->scb_general = vtophys(sc->rfa_headm->m_ext.ext_buf);
|
||||
csr->scb_command = FXP_SCB_COMMAND_RU_START;
|
||||
|
||||
/*
|
||||
* Toggle a few bits in the DP83840 PHY.
|
||||
*/
|
||||
if (sc->phy_primary_device == FXP_PHY_DP83840 ||
|
||||
sc->phy_primary_device == FXP_PHY_DP83840A) {
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR,
|
||||
fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR) |
|
||||
FXP_DP83840_PCR_LED4_MODE | /* LED4 always indicates duplex */
|
||||
FXP_DP83840_PCR_F_CONNECT | /* force link disconnect bypass */
|
||||
FXP_DP83840_PCR_BIT10); /* XXX I have no idea */
|
||||
/*
|
||||
* If link0 is set, disable auto-negotiation and then:
|
||||
* If link1 is unset = 10Mbps
|
||||
* If link1 is set = 100Mbps
|
||||
* If link2 is unset = half duplex
|
||||
* If link2 is set = full duplex
|
||||
*/
|
||||
if (ifp->if_flags & IFF_LINK0) {
|
||||
int flags;
|
||||
|
||||
flags = (ifp->if_flags & IFF_LINK1) ?
|
||||
FXP_DP83840_BMCR_SPEED_100M : 0;
|
||||
flags |= (ifp->if_flags & IFF_LINK2) ?
|
||||
FXP_DP83840_BMCR_FULLDUPLEX : 0;
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR) &
|
||||
~(FXP_DP83840_BMCR_AUTOEN | FXP_DP83840_BMCR_SPEED_100M |
|
||||
FXP_DP83840_BMCR_FULLDUPLEX)) | flags);
|
||||
} else {
|
||||
fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR,
|
||||
(fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR) |
|
||||
FXP_DP83840_BMCR_AUTOEN));
|
||||
}
|
||||
} else {
|
||||
printf("fxp%d: warning: unsupported PHY, type = %d, addr = %d\n",
|
||||
ifp->if_unit, sc->phy_primary_device, sc->phy_primary_addr);
|
||||
}
|
||||
|
||||
ifp->if_flags |= IFF_RUNNING;
|
||||
ifp->if_flags &= ~IFF_OACTIVE;
|
||||
splx(s);
|
||||
@@ -1011,6 +1067,45 @@ fxp_add_rfabuf(sc, oldm)
|
||||
return (m == oldm);
|
||||
}
|
||||
|
||||
static volatile int
|
||||
fxp_mdi_read(csr, phy, reg)
|
||||
struct fxp_csr *csr;
|
||||
int phy;
|
||||
int reg;
|
||||
{
|
||||
int count = 10000;
|
||||
int value;
|
||||
|
||||
csr->mdi_control = (FXP_MDI_READ << 26) | (reg << 16) | (phy << 21);
|
||||
|
||||
while (((value = csr->mdi_control) & 0x10000000) == 0 && count--)
|
||||
DELAY(10);
|
||||
|
||||
if (count <= 0)
|
||||
printf("fxp_mdi_read: timed out\n");
|
||||
|
||||
return (value & 0xffff);
|
||||
}
|
||||
|
||||
static void
|
||||
fxp_mdi_write(csr, phy, reg, value)
|
||||
struct fxp_csr *csr;
|
||||
int phy;
|
||||
int reg;
|
||||
int value;
|
||||
{
|
||||
int count = 10000;
|
||||
|
||||
csr->mdi_control = (FXP_MDI_WRITE << 26) | (reg << 16) | (phy << 21)
|
||||
| (value & 0xffff);
|
||||
|
||||
while ((csr->mdi_control & 0x10000000) == 0 && count--)
|
||||
DELAY(10);
|
||||
|
||||
if (count <= 0)
|
||||
printf("fxp_mdi_write: timed out\n");
|
||||
}
|
||||
|
||||
static int
|
||||
fxp_ioctl(ifp, command, data)
|
||||
struct ifnet *ifp;
|
||||
|
||||
+36
-1
@@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_fxpreg.h,v 1.3 1996/04/08 01:31:42 davidg Exp $
|
||||
* $Id: if_fxpreg.h,v 1.3.2.2 1997/03/17 11:09:44 davidg Exp $
|
||||
*/
|
||||
|
||||
#define FXP_VENDORID_INTEL 0x8086
|
||||
@@ -275,3 +275,38 @@ struct fxp_stats {
|
||||
#define FXP_EEPROM_OPC_ERASE 0x4
|
||||
#define FXP_EEPROM_OPC_WRITE 0x5
|
||||
#define FXP_EEPROM_OPC_READ 0x6
|
||||
|
||||
/*
|
||||
* Management Data Interface opcodes
|
||||
*/
|
||||
#define FXP_MDI_WRITE 0x1
|
||||
#define FXP_MDI_READ 0x2
|
||||
|
||||
/*
|
||||
* PHY device types
|
||||
*/
|
||||
#define FXP_PHY_NONE 0
|
||||
#define FXP_PHY_82553A 1
|
||||
#define FXP_PHY_82553C 2
|
||||
#define FXP_PHY_82503 3
|
||||
#define FXP_PHY_DP83840 4
|
||||
#define FXP_PHY_80C240 5
|
||||
#define FXP_PHY_80C24 6
|
||||
#define FXP_PHY_DP83840A 10
|
||||
|
||||
/*
|
||||
* DP84830 PHY, BMCR Basic Mode Control Register
|
||||
*/
|
||||
#define FXP_DP83840_BMCR 0x0
|
||||
#define FXP_DP83840_BMCR_FULLDUPLEX 0x0100
|
||||
#define FXP_DP83840_BMCR_AUTOEN 0x1000
|
||||
#define FXP_DP83840_BMCR_SPEED_100M 0x2000
|
||||
|
||||
/*
|
||||
* DP84830 PHY, PCS Configuration Register
|
||||
*/
|
||||
#define FXP_DP83840_PCR 0x17
|
||||
#define FXP_DP83840_PCR_LED4_MODE 0x0002 /* 1 = LED4 always indicates full duplex */
|
||||
#define FXP_DP83840_PCR_F_CONNECT 0x0020 /* 1 = force link disconnect function bypass */
|
||||
#define FXP_DP83840_PCR_BIT8 0x0100
|
||||
#define FXP_DP83840_PCR_BIT10 0x0400
|
||||
@@ -8,7 +8,7 @@
|
||||
* file.
|
||||
*
|
||||
* Written by Julian Elischer (julian@dialix.oz.au)
|
||||
* $Id: scsi_base.c,v 1.39.4.1 1997/01/12 22:09:53 joerg Exp $
|
||||
* $Id: scsi_base.c,v 1.39.4.2 1997/01/30 22:49:29 joerg Exp $
|
||||
*/
|
||||
|
||||
#include "opt_bounce.h"
|
||||
@@ -615,7 +615,9 @@ retry:
|
||||
* check if anyone else needs to be started up.
|
||||
*/
|
||||
bad:
|
||||
s = splbio();
|
||||
free_xs(xs, sc_link, flags); /* includes the 'start' op */
|
||||
splx(s);
|
||||
if (bp && retval) {
|
||||
bp->b_error = retval;
|
||||
bp->b_flags |= B_ERROR;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mfs_vfsops.c 8.4 (Berkeley) 4/16/94
|
||||
* $Id: mfs_vfsops.c,v 1.22 1996/06/12 03:37:57 davidg Exp $
|
||||
* $Id: mfs_vfsops.c,v 1.22.2.1 1997/03/07 09:21:36 joerg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -375,7 +375,7 @@ mfs_mount(mp, path, data, ndp, p)
|
||||
*/
|
||||
MALLOC(mfsp, struct mfsnode *, sizeof *mfsp, M_MFSNODE, M_WAITOK);
|
||||
|
||||
err = getnewvnode(VT_MFS, mp, mfs_vnodeop_p, &devvp);
|
||||
err = getnewvnode(VT_MFS, (struct mount *)0, mfs_vnodeop_p, &devvp);
|
||||
if (err) {
|
||||
FREE(mfsp, M_MFSNODE);
|
||||
goto error_1;
|
||||
|
||||
+2
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vm_extern.h 8.2 (Berkeley) 1/12/94
|
||||
* $Id: vm_extern.h,v 1.26 1996/09/14 11:54:54 bde Exp $
|
||||
* $Id: vm_extern.h,v 1.27 1996/09/15 11:24:21 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _VM_EXTERN_H_
|
||||
@@ -80,6 +80,7 @@ int vm_fault __P((vm_map_t, vm_offset_t, vm_prot_t, boolean_t));
|
||||
void vm_fault_copy_entry __P((vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t));
|
||||
void vm_fault_unwire __P((vm_map_t, vm_offset_t, vm_offset_t));
|
||||
int vm_fault_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
|
||||
int vm_fault_user_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
|
||||
int vm_fork __P((struct proc *, struct proc *));
|
||||
int vm_mmap __P((vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, caddr_t, vm_ooffset_t));
|
||||
vm_offset_t vm_page_alloc_contig __P((vm_offset_t, vm_offset_t, vm_offset_t, vm_offset_t));
|
||||
|
||||
+70
-3
@@ -66,7 +66,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_fault.c,v 1.57 1996/09/08 20:44:37 dyson Exp $
|
||||
* $Id: vm_fault.c,v 1.57.2.1 1996/12/15 09:57:11 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -197,11 +197,37 @@ RetryFault:;
|
||||
return (result);
|
||||
}
|
||||
|
||||
if (entry->nofault) {
|
||||
if (entry->eflags & MAP_ENTRY_NOFAULT) {
|
||||
panic("vm_fault: fault on nofault entry, addr: %lx",
|
||||
vaddr);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are user-wiring a r/w segment, and it is COW, then
|
||||
* we need to do the COW operation. Note that we don't COW
|
||||
* currently RO sections now, because it is NOT desirable
|
||||
* to COW .text. We simply keep .text from ever being COW'ed
|
||||
* and take the heat that one cannot debug wired .text sections.
|
||||
*/
|
||||
if ((change_wiring == VM_FAULT_USER_WIRE) && (entry->eflags & MAP_ENTRY_NEEDS_COPY)) {
|
||||
if(entry->protection & VM_PROT_WRITE) {
|
||||
int tresult;
|
||||
vm_map_lookup_done(map, entry);
|
||||
|
||||
tresult = vm_map_lookup(&map, vaddr, VM_PROT_READ|VM_PROT_WRITE,
|
||||
&entry, &first_object, &first_pindex, &prot, &wired, &su);
|
||||
if (tresult != KERN_SUCCESS)
|
||||
return tresult;
|
||||
} else {
|
||||
/*
|
||||
* If we don't COW now, on a user wire, the user will never
|
||||
* be able to write to the mapping. If we don't make this
|
||||
* restriction, the bookkeeping would be nearly impossible.
|
||||
*/
|
||||
entry->max_protection &= ~VM_PROT_WRITE;
|
||||
}
|
||||
}
|
||||
|
||||
vp = vnode_pager_lock(first_object);
|
||||
|
||||
lookup_still_valid = TRUE;
|
||||
@@ -839,7 +865,48 @@ vm_fault_wire(map, start, end)
|
||||
*/
|
||||
|
||||
for (va = start; va < end; va += PAGE_SIZE) {
|
||||
rv = vm_fault(map, va, VM_PROT_READ|VM_PROT_WRITE, TRUE);
|
||||
rv = vm_fault(map, va, VM_PROT_READ|VM_PROT_WRITE,
|
||||
VM_FAULT_CHANGE_WIRING);
|
||||
if (rv) {
|
||||
if (va != start)
|
||||
vm_fault_unwire(map, start, va);
|
||||
return (rv);
|
||||
}
|
||||
}
|
||||
return (KERN_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* vm_fault_user_wire:
|
||||
*
|
||||
* Wire down a range of virtual addresses in a map. This
|
||||
* is for user mode though, so we only ask for read access
|
||||
* on currently read only sections.
|
||||
*/
|
||||
int
|
||||
vm_fault_user_wire(map, start, end)
|
||||
vm_map_t map;
|
||||
vm_offset_t start, end;
|
||||
{
|
||||
|
||||
register vm_offset_t va;
|
||||
register pmap_t pmap;
|
||||
int rv;
|
||||
|
||||
pmap = vm_map_pmap(map);
|
||||
|
||||
/*
|
||||
* Inform the physical mapping system that the range of addresses may
|
||||
* not fault, so that page tables and such can be locked down as well.
|
||||
*/
|
||||
pmap_pageable(pmap, start, end, FALSE);
|
||||
|
||||
/*
|
||||
* We simulate a fault to get the page and enter it in the physical
|
||||
* map.
|
||||
*/
|
||||
for (va = start; va < end; va += PAGE_SIZE) {
|
||||
rv = vm_fault(map, va, VM_PROT_READ, VM_FAULT_USER_WIRE);
|
||||
if (rv) {
|
||||
if (va != start)
|
||||
vm_fault_unwire(map, start, va);
|
||||
|
||||
+16
-2
@@ -59,7 +59,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_glue.c,v 1.55.2.1 1996/12/22 23:21:25 joerg Exp $
|
||||
* $Id: vm_glue.c,v 1.55.2.2 1997/02/13 08:17:31 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_rlimit.h"
|
||||
@@ -126,7 +126,9 @@ kernacc(addr, len, rw)
|
||||
|
||||
saddr = trunc_page(addr);
|
||||
eaddr = round_page(addr + len);
|
||||
vm_map_lock_read(kernel_map);
|
||||
rv = vm_map_check_protection(kernel_map, saddr, eaddr, prot);
|
||||
vm_map_unlock_read(kernel_map);
|
||||
return (rv == TRUE);
|
||||
}
|
||||
|
||||
@@ -137,6 +139,8 @@ useracc(addr, len, rw)
|
||||
{
|
||||
boolean_t rv;
|
||||
vm_prot_t prot = rw == B_READ ? VM_PROT_READ : VM_PROT_WRITE;
|
||||
vm_map_t map;
|
||||
vm_map_entry_t save_hint;
|
||||
|
||||
/*
|
||||
* XXX - check separately to disallow access to user area and user
|
||||
@@ -151,8 +155,18 @@ useracc(addr, len, rw)
|
||||
|| (vm_offset_t) addr + len < (vm_offset_t) addr) {
|
||||
return (FALSE);
|
||||
}
|
||||
rv = vm_map_check_protection(&curproc->p_vmspace->vm_map,
|
||||
map = &curproc->p_vmspace->vm_map;
|
||||
vm_map_lock_read(map);
|
||||
/*
|
||||
* We save the map hint, and restore it. Useracc appears to distort
|
||||
* the map hint unnecessarily.
|
||||
*/
|
||||
save_hint = map->hint;
|
||||
rv = vm_map_check_protection(map,
|
||||
trunc_page(addr), round_page(addr + len), prot);
|
||||
map->hint = save_hint;
|
||||
vm_map_unlock_read(map);
|
||||
|
||||
return (rv == TRUE);
|
||||
}
|
||||
|
||||
|
||||
+14
-18
@@ -61,7 +61,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_kern.c,v 1.27 1996/07/02 02:08:02 dyson Exp $
|
||||
* $Id: vm_kern.c,v 1.27.2.1 1997/01/17 19:28:38 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -89,17 +89,17 @@
|
||||
#include <vm/vm_kern.h>
|
||||
#include <vm/vm_extern.h>
|
||||
|
||||
vm_map_t buffer_map;
|
||||
vm_map_t kernel_map;
|
||||
vm_map_t kmem_map;
|
||||
vm_map_t mb_map;
|
||||
int mb_map_full;
|
||||
vm_map_t io_map;
|
||||
vm_map_t clean_map;
|
||||
vm_map_t phys_map;
|
||||
vm_map_t exec_map;
|
||||
vm_map_t exech_map;
|
||||
vm_map_t u_map;
|
||||
vm_map_t kernel_map=0;
|
||||
vm_map_t kmem_map=0;
|
||||
vm_map_t exec_map=0;
|
||||
vm_map_t exech_map=0;
|
||||
vm_map_t clean_map=0;
|
||||
vm_map_t u_map=0;
|
||||
vm_map_t buffer_map=0;
|
||||
vm_map_t mb_map=0;
|
||||
int mb_map_full=0;
|
||||
vm_map_t io_map=0;
|
||||
vm_map_t phys_map=0;
|
||||
|
||||
/*
|
||||
* kmem_alloc_pageable:
|
||||
@@ -199,11 +199,6 @@ kmem_alloc(map, size)
|
||||
|
||||
(void) vm_map_pageable(map, (vm_offset_t) addr, addr + size, FALSE);
|
||||
|
||||
/*
|
||||
* Try to coalesce the map
|
||||
*/
|
||||
vm_map_simplify(map, addr);
|
||||
|
||||
return (addr);
|
||||
}
|
||||
|
||||
@@ -362,6 +357,8 @@ retry:
|
||||
panic("kmem_malloc: entry not found or misaligned");
|
||||
entry->wired_count++;
|
||||
|
||||
vm_map_simplify_entry(map, entry);
|
||||
|
||||
/*
|
||||
* Loop thru pages, entering them in the pmap. (We cannot add them to
|
||||
* the wired count without wrapping the vm_page_queue_lock in
|
||||
@@ -377,7 +374,6 @@ retry:
|
||||
}
|
||||
vm_map_unlock(map);
|
||||
|
||||
vm_map_simplify(map, addr);
|
||||
return (addr);
|
||||
}
|
||||
|
||||
|
||||
+240
-171
@@ -61,7 +61,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_map.c,v 1.57.2.2 1997/01/26 03:14:59 dyson Exp $
|
||||
* $Id: vm_map.c,v 1.57.2.3 1997/01/31 04:17:20 dyson Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -153,6 +153,7 @@ vm_size_t kentry_data_size;
|
||||
static vm_map_entry_t kentry_free;
|
||||
static vm_map_t kmap_free;
|
||||
extern char kstack[];
|
||||
extern int inmprotect;
|
||||
|
||||
static int kentry_count;
|
||||
static vm_offset_t mapvm_start, mapvm, mapvmmax;
|
||||
@@ -170,7 +171,6 @@ static void vm_map_entry_dispose __P((vm_map_t, vm_map_entry_t));
|
||||
static void vm_map_entry_unwire __P((vm_map_t, vm_map_entry_t));
|
||||
static void vm_map_copy_entry __P((vm_map_t, vm_map_t, vm_map_entry_t,
|
||||
vm_map_entry_t));
|
||||
static void vm_map_simplify_entry __P((vm_map_t, vm_map_entry_t));
|
||||
|
||||
void
|
||||
vm_map_startup()
|
||||
@@ -606,6 +606,7 @@ vm_map_insert(map, object, offset, start, end, prot, max, cow)
|
||||
register vm_map_entry_t prev_entry;
|
||||
vm_map_entry_t temp_entry;
|
||||
vm_object_t prev_object;
|
||||
u_char protoeflags;
|
||||
|
||||
if ((object != NULL) && (cow & MAP_NOFAULT)) {
|
||||
panic("vm_map_insert: paradoxical MAP_NOFAULT request");
|
||||
@@ -637,48 +638,61 @@ vm_map_insert(map, object, offset, start, end, prot, max, cow)
|
||||
(prev_entry->next->start < end))
|
||||
return (KERN_NO_SPACE);
|
||||
|
||||
if ((prev_entry != &map->header) &&
|
||||
(prev_entry->end == start) &&
|
||||
(object == NULL) &&
|
||||
(prev_entry->is_a_map == FALSE) &&
|
||||
(prev_entry->is_sub_map == FALSE) &&
|
||||
(prev_entry->inheritance == VM_INHERIT_DEFAULT) &&
|
||||
(prev_entry->protection == prot) &&
|
||||
(prev_entry->max_protection == max) &&
|
||||
(prev_entry->wired_count == 0)) {
|
||||
protoeflags = 0;
|
||||
if (cow & MAP_COPY_NEEDED)
|
||||
protoeflags |= MAP_ENTRY_NEEDS_COPY;
|
||||
|
||||
if (cow & MAP_COPY_ON_WRITE)
|
||||
protoeflags |= MAP_ENTRY_COW;
|
||||
|
||||
if (cow & MAP_NOFAULT)
|
||||
protoeflags |= MAP_ENTRY_NOFAULT;
|
||||
|
||||
|
||||
/*
|
||||
* See if we can avoid creating a new entry by extending one of our
|
||||
* neighbors.
|
||||
* neighbors. Or at least extend the object.
|
||||
*/
|
||||
u_char needs_copy = (cow & MAP_COPY_NEEDED) != 0;
|
||||
u_char copy_on_write = (cow & MAP_COPY_ON_WRITE) != 0;
|
||||
u_char nofault = (cow & MAP_NOFAULT) != 0;
|
||||
|
||||
if ((needs_copy == prev_entry->needs_copy) &&
|
||||
(copy_on_write == prev_entry->copy_on_write) &&
|
||||
(nofault == prev_entry->nofault) &&
|
||||
(nofault || vm_object_coalesce(prev_entry->object.vm_object,
|
||||
OFF_TO_IDX(prev_entry->offset),
|
||||
(vm_size_t) (prev_entry->end
|
||||
- prev_entry->start),
|
||||
(vm_size_t) (end - prev_entry->end)))) {
|
||||
if ((object == NULL) &&
|
||||
(prev_entry != &map->header) &&
|
||||
(( prev_entry->eflags & (MAP_ENTRY_IS_A_MAP | MAP_ENTRY_IS_SUB_MAP)) == 0) &&
|
||||
(prev_entry->end == start) &&
|
||||
(prev_entry->wired_count == 0)) {
|
||||
|
||||
|
||||
if ((protoeflags == prev_entry->eflags) &&
|
||||
((cow & MAP_NOFAULT) ||
|
||||
vm_object_coalesce(prev_entry->object.vm_object,
|
||||
OFF_TO_IDX(prev_entry->offset),
|
||||
(vm_size_t) (prev_entry->end - prev_entry->start),
|
||||
(vm_size_t) (end - prev_entry->end)))) {
|
||||
|
||||
/*
|
||||
* Coalesced the two objects. Can we extend the
|
||||
* previous map entry to include the new range?
|
||||
*/
|
||||
if ((prev_entry->inheritance == VM_INHERIT_DEFAULT) &&
|
||||
(prev_entry->protection == prot) &&
|
||||
(prev_entry->max_protection == max)) {
|
||||
|
||||
/*
|
||||
* Coalesced the two objects - can extend the
|
||||
* previous map entry to include the new
|
||||
* range.
|
||||
*/
|
||||
map->size += (end - prev_entry->end);
|
||||
prev_entry->end = end;
|
||||
if (!nofault) {
|
||||
if ((cow & MAP_NOFAULT) == 0) {
|
||||
prev_object = prev_entry->object.vm_object;
|
||||
default_pager_convert_to_swapq(prev_object);
|
||||
}
|
||||
return (KERN_SUCCESS);
|
||||
}
|
||||
else {
|
||||
object = prev_entry->object.vm_object;
|
||||
offset = prev_entry->offset + (prev_entry->end -
|
||||
prev_entry->start);
|
||||
|
||||
vm_object_reference(object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a new entry
|
||||
*/
|
||||
@@ -687,26 +701,10 @@ vm_map_insert(map, object, offset, start, end, prot, max, cow)
|
||||
new_entry->start = start;
|
||||
new_entry->end = end;
|
||||
|
||||
new_entry->is_a_map = FALSE;
|
||||
new_entry->is_sub_map = FALSE;
|
||||
new_entry->eflags = protoeflags;
|
||||
new_entry->object.vm_object = object;
|
||||
new_entry->offset = offset;
|
||||
|
||||
if (cow & MAP_COPY_NEEDED)
|
||||
new_entry->needs_copy = TRUE;
|
||||
else
|
||||
new_entry->needs_copy = FALSE;
|
||||
|
||||
if (cow & MAP_COPY_ON_WRITE)
|
||||
new_entry->copy_on_write = TRUE;
|
||||
else
|
||||
new_entry->copy_on_write = FALSE;
|
||||
|
||||
if (cow & MAP_NOFAULT)
|
||||
new_entry->nofault = TRUE;
|
||||
else
|
||||
new_entry->nofault = FALSE;
|
||||
|
||||
if (map->is_main_map) {
|
||||
new_entry->inheritance = VM_INHERIT_DEFAULT;
|
||||
new_entry->protection = prot;
|
||||
@@ -838,28 +836,19 @@ vm_map_find(map, object, offset, addr, length, find_space, prot, max, cow)
|
||||
}
|
||||
|
||||
/*
|
||||
* vm_map_simplify_entry: [ internal use only ]
|
||||
* vm_map_simplify_entry:
|
||||
*
|
||||
* Simplify the given map entry by:
|
||||
* removing extra sharing maps
|
||||
* [XXX maybe later] merging with a neighbor
|
||||
* Simplify the given map entry by merging with either neighbor.
|
||||
*/
|
||||
static void
|
||||
void
|
||||
vm_map_simplify_entry(map, entry)
|
||||
vm_map_t map;
|
||||
vm_map_entry_t entry;
|
||||
{
|
||||
vm_map_entry_t next, prev;
|
||||
vm_size_t nextsize, prevsize, esize;
|
||||
vm_size_t prevsize, esize;
|
||||
|
||||
/*
|
||||
* If this entry corresponds to a sharing map, then see if we can
|
||||
* remove the level of indirection. If it's not a sharing map, then it
|
||||
* points to a VM object, so see if we can merge with either of our
|
||||
* neighbors.
|
||||
*/
|
||||
|
||||
if (entry->is_sub_map || entry->is_a_map || entry->wired_count)
|
||||
if (entry->eflags & (MAP_ENTRY_IS_SUB_MAP|MAP_ENTRY_IS_A_MAP))
|
||||
return;
|
||||
|
||||
prev = entry->prev;
|
||||
@@ -870,14 +859,11 @@ vm_map_simplify_entry(map, entry)
|
||||
(!prev->object.vm_object || (prev->object.vm_object->behavior == entry->object.vm_object->behavior)) &&
|
||||
(!prev->object.vm_object ||
|
||||
(prev->offset + prevsize == entry->offset)) &&
|
||||
(prev->needs_copy == entry->needs_copy) &&
|
||||
(prev->copy_on_write == entry->copy_on_write) &&
|
||||
(prev->eflags == entry->eflags) &&
|
||||
(prev->protection == entry->protection) &&
|
||||
(prev->max_protection == entry->max_protection) &&
|
||||
(prev->inheritance == entry->inheritance) &&
|
||||
(prev->is_a_map == FALSE) &&
|
||||
(prev->is_sub_map == FALSE) &&
|
||||
(prev->wired_count == 0)) {
|
||||
(prev->wired_count == entry->wired_count)) {
|
||||
if (map->first_free == prev)
|
||||
map->first_free = entry;
|
||||
if (map->hint == prev)
|
||||
@@ -893,21 +879,17 @@ vm_map_simplify_entry(map, entry)
|
||||
|
||||
next = entry->next;
|
||||
if (next != &map->header) {
|
||||
nextsize = next->end - next->start;
|
||||
esize = entry->end - entry->start;
|
||||
if ((entry->end == next->start) &&
|
||||
(next->object.vm_object == entry->object.vm_object) &&
|
||||
(!next->object.vm_object || (next->object.vm_object->behavior == entry->object.vm_object->behavior)) &&
|
||||
(!entry->object.vm_object ||
|
||||
(entry->offset + esize == next->offset)) &&
|
||||
(next->needs_copy == entry->needs_copy) &&
|
||||
(next->copy_on_write == entry->copy_on_write) &&
|
||||
(next->eflags == entry->eflags) &&
|
||||
(next->protection == entry->protection) &&
|
||||
(next->max_protection == entry->max_protection) &&
|
||||
(next->inheritance == entry->inheritance) &&
|
||||
(next->is_a_map == FALSE) &&
|
||||
(next->is_sub_map == FALSE) &&
|
||||
(next->wired_count == 0)) {
|
||||
(next->wired_count == entry->wired_count)) {
|
||||
if (map->first_free == next)
|
||||
map->first_free = entry;
|
||||
if (map->hint == next)
|
||||
@@ -962,7 +944,7 @@ _vm_map_clip_start(map, entry, start)
|
||||
|
||||
vm_map_entry_link(map, entry->prev, new_entry);
|
||||
|
||||
if (entry->is_a_map || entry->is_sub_map)
|
||||
if (entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP))
|
||||
vm_map_reference(new_entry->object.share_map);
|
||||
else
|
||||
vm_object_reference(new_entry->object.vm_object);
|
||||
@@ -1006,7 +988,7 @@ _vm_map_clip_end(map, entry, end)
|
||||
|
||||
vm_map_entry_link(map, entry, new_entry);
|
||||
|
||||
if (entry->is_a_map || entry->is_sub_map)
|
||||
if (entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP))
|
||||
vm_map_reference(new_entry->object.share_map);
|
||||
else
|
||||
vm_object_reference(new_entry->object.vm_object);
|
||||
@@ -1068,11 +1050,9 @@ vm_map_submap(map, start, end, submap)
|
||||
vm_map_clip_end(map, entry, end);
|
||||
|
||||
if ((entry->start == start) && (entry->end == end) &&
|
||||
(!entry->is_a_map) &&
|
||||
(entry->object.vm_object == NULL) &&
|
||||
(!entry->copy_on_write)) {
|
||||
entry->is_a_map = FALSE;
|
||||
entry->is_sub_map = TRUE;
|
||||
((entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_COW)) == 0) &&
|
||||
(entry->object.vm_object == NULL)) {
|
||||
entry->eflags |= MAP_ENTRY_IS_SUB_MAP;
|
||||
vm_map_reference(entry->object.sub_map = submap);
|
||||
result = KERN_SUCCESS;
|
||||
}
|
||||
@@ -1106,8 +1086,9 @@ vm_map_protect(map, start, end, new_prot, set_max)
|
||||
|
||||
if (vm_map_lookup_entry(map, start, &entry)) {
|
||||
vm_map_clip_start(map, entry, start);
|
||||
} else
|
||||
} else {
|
||||
entry = entry->next;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a first pass to check for protection violations.
|
||||
@@ -1115,7 +1096,7 @@ vm_map_protect(map, start, end, new_prot, set_max)
|
||||
|
||||
current = entry;
|
||||
while ((current != &map->header) && (current->start < end)) {
|
||||
if (current->is_sub_map) {
|
||||
if (current->eflags & MAP_ENTRY_IS_SUB_MAP) {
|
||||
vm_map_unlock(map);
|
||||
return (KERN_INVALID_ARGUMENT);
|
||||
}
|
||||
@@ -1152,11 +1133,11 @@ vm_map_protect(map, start, end, new_prot, set_max)
|
||||
*/
|
||||
|
||||
if (current->protection != old_prot) {
|
||||
#define MASK(entry) ((entry)->copy_on_write ? ~VM_PROT_WRITE : \
|
||||
#define MASK(entry) (((entry)->eflags & MAP_ENTRY_COW) ? ~VM_PROT_WRITE : \
|
||||
VM_PROT_ALL)
|
||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
if (current->is_a_map) {
|
||||
if (current->eflags & MAP_ENTRY_IS_A_MAP) {
|
||||
vm_map_entry_t share_entry;
|
||||
vm_offset_t share_end;
|
||||
|
||||
@@ -1229,9 +1210,22 @@ vm_map_madvise(map, pmap, start, end, advise)
|
||||
for(current = entry;
|
||||
(current != &map->header) && (current->start < end);
|
||||
current = current->next) {
|
||||
if (current->is_a_map || current->is_sub_map) {
|
||||
vm_size_t size = current->end - current->start;
|
||||
|
||||
if (current->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an object if needed
|
||||
*/
|
||||
if (current->object.vm_object == NULL) {
|
||||
vm_object_t object;
|
||||
object = vm_object_allocate(OBJT_DEFAULT, OFF_TO_IDX(size));
|
||||
current->object.vm_object = object;
|
||||
current->offset = 0;
|
||||
}
|
||||
|
||||
vm_map_clip_end(map, current, end);
|
||||
switch (advise) {
|
||||
case MADV_NORMAL:
|
||||
@@ -1252,7 +1246,7 @@ vm_map_madvise(map, pmap, start, end, advise)
|
||||
{
|
||||
vm_pindex_t pindex;
|
||||
int count;
|
||||
vm_size_t size = current->end - current->start;
|
||||
size = current->end - current->start;
|
||||
pindex = OFF_TO_IDX(entry->offset);
|
||||
count = OFF_TO_IDX(size);
|
||||
/*
|
||||
@@ -1268,7 +1262,7 @@ vm_map_madvise(map, pmap, start, end, advise)
|
||||
{
|
||||
vm_pindex_t pindex;
|
||||
int count;
|
||||
vm_size_t size = current->end - current->start;
|
||||
size = current->end - current->start;
|
||||
pindex = OFF_TO_IDX(current->offset);
|
||||
count = OFF_TO_IDX(size);
|
||||
vm_object_madvise(current->object.vm_object,
|
||||
@@ -1340,6 +1334,137 @@ vm_map_inherit(map, start, end, new_inheritance)
|
||||
return (KERN_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Implement the semantics of mlock
|
||||
*/
|
||||
int
|
||||
vm_map_user_pageable(map, start, end, new_pageable)
|
||||
register vm_map_t map;
|
||||
register vm_offset_t start;
|
||||
register vm_offset_t end;
|
||||
register boolean_t new_pageable;
|
||||
{
|
||||
register vm_map_entry_t entry;
|
||||
vm_map_entry_t start_entry;
|
||||
register vm_offset_t failed = 0;
|
||||
int rv;
|
||||
|
||||
vm_map_lock(map);
|
||||
VM_MAP_RANGE_CHECK(map, start, end);
|
||||
|
||||
if (vm_map_lookup_entry(map, start, &start_entry) == FALSE) {
|
||||
vm_map_unlock(map);
|
||||
return (KERN_INVALID_ADDRESS);
|
||||
}
|
||||
|
||||
if (new_pageable) {
|
||||
|
||||
entry = start_entry;
|
||||
vm_map_clip_start(map, entry, start);
|
||||
|
||||
/*
|
||||
* Now decrement the wiring count for each region. If a region
|
||||
* becomes completely unwired, unwire its physical pages and
|
||||
* mappings.
|
||||
*/
|
||||
lock_set_recursive(&map->lock);
|
||||
|
||||
entry = start_entry;
|
||||
while ((entry != &map->header) && (entry->start < end)) {
|
||||
if (entry->eflags & MAP_ENTRY_USER_WIRED) {
|
||||
vm_map_clip_end(map, entry, end);
|
||||
entry->eflags &= ~MAP_ENTRY_USER_WIRED;
|
||||
entry->wired_count--;
|
||||
if (entry->wired_count == 0)
|
||||
vm_fault_unwire(map, entry->start, entry->end);
|
||||
}
|
||||
entry = entry->next;
|
||||
}
|
||||
vm_map_simplify_entry(map, start_entry);
|
||||
lock_clear_recursive(&map->lock);
|
||||
} else {
|
||||
|
||||
/*
|
||||
* Because of the possiblity of blocking, etc. We restart
|
||||
* through the process's map entries from beginning so that
|
||||
* we don't end up depending on a map entry that could have
|
||||
* changed.
|
||||
*/
|
||||
rescan:
|
||||
|
||||
entry = start_entry;
|
||||
|
||||
while ((entry != &map->header) && (entry->start < end)) {
|
||||
|
||||
if (entry->eflags & MAP_ENTRY_USER_WIRED) {
|
||||
entry = entry->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entry->wired_count != 0) {
|
||||
entry->wired_count++;
|
||||
entry->eflags |= MAP_ENTRY_USER_WIRED;
|
||||
entry = entry->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Here on entry being newly wired */
|
||||
|
||||
if ((entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) == 0) {
|
||||
int copyflag = entry->eflags & MAP_ENTRY_NEEDS_COPY;
|
||||
if (copyflag && ((entry->protection & VM_PROT_WRITE) != 0)) {
|
||||
|
||||
vm_object_shadow(&entry->object.vm_object,
|
||||
&entry->offset,
|
||||
OFF_TO_IDX(entry->end
|
||||
- entry->start));
|
||||
entry->eflags &= ~MAP_ENTRY_NEEDS_COPY;
|
||||
|
||||
} else if (entry->object.vm_object == NULL) {
|
||||
|
||||
entry->object.vm_object =
|
||||
vm_object_allocate(OBJT_DEFAULT,
|
||||
OFF_TO_IDX(entry->end - entry->start));
|
||||
entry->offset = (vm_offset_t) 0;
|
||||
|
||||
}
|
||||
default_pager_convert_to_swapq(entry->object.vm_object);
|
||||
}
|
||||
|
||||
vm_map_clip_start(map, entry, start);
|
||||
vm_map_clip_end(map, entry, end);
|
||||
|
||||
entry->wired_count++;
|
||||
entry->eflags |= MAP_ENTRY_USER_WIRED;
|
||||
|
||||
/* First we need to allow map modifications */
|
||||
lock_set_recursive(&map->lock);
|
||||
lock_write_to_read(&map->lock);
|
||||
|
||||
rv = vm_fault_user_wire(map, entry->start, entry->end);
|
||||
if (rv) {
|
||||
|
||||
entry->wired_count--;
|
||||
entry->eflags &= ~MAP_ENTRY_USER_WIRED;
|
||||
|
||||
lock_clear_recursive(&map->lock);
|
||||
vm_map_unlock(map);
|
||||
|
||||
(void) vm_map_user_pageable(map, start, entry->start, TRUE);
|
||||
return rv;
|
||||
}
|
||||
|
||||
lock_clear_recursive(&map->lock);
|
||||
vm_map_unlock(map);
|
||||
vm_map_lock(map);
|
||||
|
||||
goto rescan;
|
||||
}
|
||||
}
|
||||
vm_map_unlock(map);
|
||||
return KERN_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* vm_map_pageable:
|
||||
*
|
||||
@@ -1467,8 +1592,8 @@ vm_map_pageable(map, start, end, new_pageable)
|
||||
* point to sharing maps, because we won't
|
||||
* hold the lock on the sharing map.
|
||||
*/
|
||||
if (!entry->is_a_map && !entry->is_sub_map) {
|
||||
int copyflag = entry->needs_copy;
|
||||
if ((entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) == 0) {
|
||||
int copyflag = entry->eflags & MAP_ENTRY_NEEDS_COPY;
|
||||
if (copyflag &&
|
||||
((entry->protection & VM_PROT_WRITE) != 0)) {
|
||||
|
||||
@@ -1476,7 +1601,7 @@ vm_map_pageable(map, start, end, new_pageable)
|
||||
&entry->offset,
|
||||
OFF_TO_IDX(entry->end
|
||||
- entry->start));
|
||||
entry->needs_copy = FALSE;
|
||||
entry->eflags &= ~MAP_ENTRY_NEEDS_COPY;
|
||||
} else if (entry->object.vm_object == NULL) {
|
||||
entry->object.vm_object =
|
||||
vm_object_allocate(OBJT_DEFAULT,
|
||||
@@ -1568,6 +1693,7 @@ vm_map_pageable(map, start, end, new_pageable)
|
||||
(void) vm_map_pageable(map, start, failed, TRUE);
|
||||
return (rv);
|
||||
}
|
||||
vm_map_simplify_entry(map, start_entry);
|
||||
}
|
||||
|
||||
vm_map_unlock(map);
|
||||
@@ -1608,7 +1734,7 @@ vm_map_clean(map, start, end, syncio, invalidate)
|
||||
* Make a first pass to check for holes.
|
||||
*/
|
||||
for (current = entry; current->start < end; current = current->next) {
|
||||
if (current->is_sub_map) {
|
||||
if (current->eflags & MAP_ENTRY_IS_SUB_MAP) {
|
||||
vm_map_unlock_read(map);
|
||||
return (KERN_INVALID_ARGUMENT);
|
||||
}
|
||||
@@ -1627,7 +1753,7 @@ vm_map_clean(map, start, end, syncio, invalidate)
|
||||
for (current = entry; current->start < end; current = current->next) {
|
||||
offset = current->offset + (start - current->start);
|
||||
size = (end <= current->end ? end : current->end) - start;
|
||||
if (current->is_a_map || current->is_sub_map) {
|
||||
if (current->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) {
|
||||
register vm_map_t smap;
|
||||
vm_map_entry_t tentry;
|
||||
vm_size_t tsize;
|
||||
@@ -1718,7 +1844,7 @@ vm_map_entry_delete(map, entry)
|
||||
vm_map_entry_unlink(map, entry);
|
||||
map->size -= entry->end - entry->start;
|
||||
|
||||
if (entry->is_a_map || entry->is_sub_map) {
|
||||
if (entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) {
|
||||
vm_map_deallocate(entry->object.share_map);
|
||||
} else {
|
||||
vm_object_deallocate(entry->object.vm_object);
|
||||
@@ -1915,7 +2041,8 @@ vm_map_copy_entry(src_map, dst_map, src_entry, dst_entry)
|
||||
vm_map_t src_map, dst_map;
|
||||
register vm_map_entry_t src_entry, dst_entry;
|
||||
{
|
||||
if (src_entry->is_sub_map || dst_entry->is_sub_map)
|
||||
if ((dst_entry->eflags|src_entry->eflags) &
|
||||
(MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP))
|
||||
return;
|
||||
|
||||
if (src_entry->wired_count == 0) {
|
||||
@@ -1924,7 +2051,7 @@ vm_map_copy_entry(src_map, dst_map, src_entry, dst_entry)
|
||||
* If the source entry is marked needs_copy, it is already
|
||||
* write-protected.
|
||||
*/
|
||||
if (!src_entry->needs_copy) {
|
||||
if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) {
|
||||
|
||||
boolean_t su;
|
||||
|
||||
@@ -1957,11 +2084,8 @@ vm_map_copy_entry(src_map, dst_map, src_entry, dst_entry)
|
||||
src_entry->object.vm_object->type == OBJT_SWAP))
|
||||
vm_object_collapse(src_entry->object.vm_object);
|
||||
++src_entry->object.vm_object->ref_count;
|
||||
src_entry->copy_on_write = TRUE;
|
||||
src_entry->needs_copy = TRUE;
|
||||
|
||||
dst_entry->needs_copy = TRUE;
|
||||
dst_entry->copy_on_write = TRUE;
|
||||
src_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY);
|
||||
dst_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY);
|
||||
dst_entry->object.vm_object =
|
||||
src_entry->object.vm_object;
|
||||
dst_entry->offset = src_entry->offset;
|
||||
@@ -2015,14 +2139,14 @@ vmspace_fork(vm1)
|
||||
old_entry = old_map->header.next;
|
||||
|
||||
while (old_entry != &old_map->header) {
|
||||
if (old_entry->is_sub_map)
|
||||
if (old_entry->eflags & MAP_ENTRY_IS_SUB_MAP)
|
||||
panic("vm_map_fork: encountered a submap");
|
||||
|
||||
switch (old_entry->inheritance) {
|
||||
case VM_INHERIT_NONE:
|
||||
break;
|
||||
|
||||
case VM_INHERIT_SHARE:
|
||||
case VM_INHERIT_SHARE:
|
||||
/*
|
||||
* Clone the entry, creating the shared object if necessary.
|
||||
*/
|
||||
@@ -2033,13 +2157,13 @@ vmspace_fork(vm1)
|
||||
old_entry->start));
|
||||
old_entry->object.vm_object = object;
|
||||
old_entry->offset = (vm_offset_t) 0;
|
||||
} else if (old_entry->needs_copy) {
|
||||
} else if (old_entry->eflags & MAP_ENTRY_NEEDS_COPY) {
|
||||
vm_object_shadow(&old_entry->object.vm_object,
|
||||
&old_entry->offset,
|
||||
OFF_TO_IDX(old_entry->end -
|
||||
old_entry->start));
|
||||
old_entry->start));
|
||||
|
||||
old_entry->needs_copy = 0;
|
||||
old_entry->eflags &= ~MAP_ENTRY_NEEDS_COPY;
|
||||
object = old_entry->object.vm_object;
|
||||
}
|
||||
|
||||
@@ -2077,7 +2201,7 @@ vmspace_fork(vm1)
|
||||
*new_entry = *old_entry;
|
||||
new_entry->wired_count = 0;
|
||||
new_entry->object.vm_object = NULL;
|
||||
new_entry->is_a_map = FALSE;
|
||||
new_entry->eflags &= ~MAP_ENTRY_IS_A_MAP;
|
||||
vm_map_entry_link(new_map, new_map->header.prev,
|
||||
new_entry);
|
||||
vm_map_copy_entry(old_map, new_map, old_entry,
|
||||
@@ -2173,11 +2297,12 @@ RetryLookup:;
|
||||
entry = tmp_entry;
|
||||
*out_entry = entry;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle submaps.
|
||||
*/
|
||||
|
||||
if (entry->is_sub_map) {
|
||||
if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) {
|
||||
vm_map_t old_map = map;
|
||||
|
||||
*var_map = map = entry->object.sub_map;
|
||||
@@ -2205,7 +2330,7 @@ RetryLookup:;
|
||||
* If we don't already have a VM object, track it down.
|
||||
*/
|
||||
|
||||
su = !entry->is_a_map;
|
||||
su = (entry->eflags & MAP_ENTRY_IS_A_MAP) == 0;
|
||||
if (su) {
|
||||
share_map = map;
|
||||
share_offset = vaddr;
|
||||
@@ -2237,7 +2362,7 @@ RetryLookup:;
|
||||
* If the entry was copy-on-write, we either ...
|
||||
*/
|
||||
|
||||
if (entry->needs_copy) {
|
||||
if (entry->eflags & MAP_ENTRY_NEEDS_COPY) {
|
||||
/*
|
||||
* If we want to write the page, we may as well handle that
|
||||
* now since we've got the sharing map locked.
|
||||
@@ -2264,7 +2389,7 @@ RetryLookup:;
|
||||
&entry->offset,
|
||||
OFF_TO_IDX(entry->end - entry->start));
|
||||
|
||||
entry->needs_copy = FALSE;
|
||||
entry->eflags &= ~MAP_ENTRY_NEEDS_COPY;
|
||||
|
||||
lock_write_to_read(&share_map->lock);
|
||||
} else {
|
||||
@@ -2333,7 +2458,7 @@ vm_map_lookup_done(map, entry)
|
||||
* If this entry references a map, unlock it first.
|
||||
*/
|
||||
|
||||
if (entry->is_a_map)
|
||||
if (entry->eflags & MAP_ENTRY_IS_A_MAP)
|
||||
vm_map_unlock_read(entry->object.share_map);
|
||||
|
||||
/*
|
||||
@@ -2343,62 +2468,6 @@ vm_map_lookup_done(map, entry)
|
||||
vm_map_unlock_read(map);
|
||||
}
|
||||
|
||||
/*
|
||||
* Routine: vm_map_simplify
|
||||
* Purpose:
|
||||
* Attempt to simplify the map representation in
|
||||
* the vicinity of the given starting address.
|
||||
* Note:
|
||||
* This routine is intended primarily to keep the
|
||||
* kernel maps more compact -- they generally don't
|
||||
* benefit from the "expand a map entry" technology
|
||||
* at allocation time because the adjacent entry
|
||||
* is often wired down.
|
||||
*/
|
||||
void
|
||||
vm_map_simplify(map, start)
|
||||
vm_map_t map;
|
||||
vm_offset_t start;
|
||||
{
|
||||
vm_map_entry_t this_entry;
|
||||
vm_map_entry_t prev_entry;
|
||||
|
||||
vm_map_lock(map);
|
||||
if ((vm_map_lookup_entry(map, start, &this_entry)) &&
|
||||
((prev_entry = this_entry->prev) != &map->header) &&
|
||||
(prev_entry->end == start) &&
|
||||
(prev_entry->object.vm_object == this_entry->object.vm_object) &&
|
||||
((prev_entry->offset + (prev_entry->end - prev_entry->start))
|
||||
== this_entry->offset) &&
|
||||
|
||||
(map->is_main_map) &&
|
||||
|
||||
(prev_entry->is_a_map == FALSE) &&
|
||||
(prev_entry->is_sub_map == FALSE) &&
|
||||
|
||||
(this_entry->is_a_map == FALSE) &&
|
||||
(this_entry->is_sub_map == FALSE) &&
|
||||
|
||||
(prev_entry->inheritance == this_entry->inheritance) &&
|
||||
(prev_entry->protection == this_entry->protection) &&
|
||||
(prev_entry->max_protection == this_entry->max_protection) &&
|
||||
(prev_entry->wired_count == this_entry->wired_count) &&
|
||||
|
||||
(prev_entry->copy_on_write == this_entry->copy_on_write) &&
|
||||
(prev_entry->needs_copy == this_entry->needs_copy)) {
|
||||
if (map->first_free == this_entry)
|
||||
map->first_free = prev_entry;
|
||||
if (map->hint == this_entry)
|
||||
SAVE_HINT(map, prev_entry);
|
||||
vm_map_entry_unlink(map, this_entry);
|
||||
prev_entry->end = this_entry->end;
|
||||
if (this_entry->object.vm_object)
|
||||
vm_object_deallocate(this_entry->object.vm_object);
|
||||
vm_map_entry_dispose(map, this_entry);
|
||||
}
|
||||
vm_map_unlock(map);
|
||||
}
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#ifdef DDB
|
||||
#include <sys/kernel.h>
|
||||
@@ -2440,12 +2509,12 @@ DB_SHOW_COMMAND(map, vm_map_print)
|
||||
if (entry->wired_count != 0)
|
||||
db_printf("wired, ");
|
||||
}
|
||||
if (entry->is_a_map || entry->is_sub_map) {
|
||||
if (entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) {
|
||||
db_printf("share=0x%x, offset=0x%x\n",
|
||||
(int) entry->object.share_map,
|
||||
(int) entry->offset);
|
||||
if ((entry->prev == &map->header) ||
|
||||
(!entry->prev->is_a_map) ||
|
||||
((entry->prev->eflags & MAP_ENTRY_IS_A_MAP) == 0) ||
|
||||
(entry->prev->object.share_map !=
|
||||
entry->object.share_map)) {
|
||||
db_indent += 2;
|
||||
@@ -2457,13 +2526,13 @@ DB_SHOW_COMMAND(map, vm_map_print)
|
||||
db_printf("object=0x%x, offset=0x%x",
|
||||
(int) entry->object.vm_object,
|
||||
(int) entry->offset);
|
||||
if (entry->copy_on_write)
|
||||
if (entry->eflags & MAP_ENTRY_COW)
|
||||
db_printf(", copy (%s)",
|
||||
entry->needs_copy ? "needed" : "done");
|
||||
(entry->eflags & MAP_ENTRY_NEEDS_COPY) ? "needed" : "done");
|
||||
db_printf("\n");
|
||||
|
||||
if ((entry->prev == &map->header) ||
|
||||
(entry->prev->is_a_map) ||
|
||||
(entry->prev->eflags & MAP_ENTRY_IS_A_MAP) ||
|
||||
(entry->prev->object.vm_object !=
|
||||
entry->object.vm_object)) {
|
||||
db_indent += 2;
|
||||
|
||||
+18
-6
@@ -61,7 +61,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_map.h,v 1.15 1996/07/30 03:08:11 dyson Exp $
|
||||
* $Id: vm_map.h,v 1.15.2.1 1996/12/15 09:57:14 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -104,11 +104,7 @@ struct vm_map_entry {
|
||||
vm_offset_t end; /* end address */
|
||||
union vm_map_object object; /* object I point to */
|
||||
vm_ooffset_t offset; /* offset into object */
|
||||
u_char is_a_map:1, /* Is "object" a map? */
|
||||
is_sub_map:1, /* Is "object" a submap? */
|
||||
copy_on_write:1, /* is data copy-on-write */
|
||||
needs_copy:1, /* does object need to be copied */
|
||||
nofault:1; /* should never fault */
|
||||
u_char eflags; /* map entry flags */
|
||||
/* Only in task maps: */
|
||||
vm_prot_t protection; /* protection code */
|
||||
vm_prot_t max_protection; /* maximum protection */
|
||||
@@ -116,6 +112,13 @@ struct vm_map_entry {
|
||||
int wired_count; /* can be paged if = 0 */
|
||||
};
|
||||
|
||||
#define MAP_ENTRY_IS_A_MAP 0x1
|
||||
#define MAP_ENTRY_IS_SUB_MAP 0x2
|
||||
#define MAP_ENTRY_COW 0x4
|
||||
#define MAP_ENTRY_NEEDS_COPY 0x8
|
||||
#define MAP_ENTRY_NOFAULT 0x10
|
||||
#define MAP_ENTRY_USER_WIRED 0x20
|
||||
|
||||
/*
|
||||
* Maps are doubly-linked lists of map entries, kept sorted
|
||||
* by address. A single hint is provided to start
|
||||
@@ -210,6 +213,13 @@ typedef struct {
|
||||
#define MAP_COPY_ON_WRITE 0x2
|
||||
#define MAP_NOFAULT 0x4
|
||||
|
||||
/*
|
||||
* vm_fault option flags
|
||||
*/
|
||||
#define VM_FAULT_NORMAL 0
|
||||
#define VM_FAULT_CHANGE_WIRING 1
|
||||
#define VM_FAULT_USER_WIRE 2
|
||||
|
||||
#ifdef KERNEL
|
||||
extern vm_offset_t kentry_data;
|
||||
extern vm_size_t kentry_data_size;
|
||||
@@ -230,6 +240,7 @@ int vm_map_lookup __P((vm_map_t *, vm_offset_t, vm_prot_t, vm_map_entry_t *, vm_
|
||||
void vm_map_lookup_done __P((vm_map_t, vm_map_entry_t));
|
||||
boolean_t vm_map_lookup_entry __P((vm_map_t, vm_offset_t, vm_map_entry_t *));
|
||||
int vm_map_pageable __P((vm_map_t, vm_offset_t, vm_offset_t, boolean_t));
|
||||
int vm_map_user_pageable __P((vm_map_t, vm_offset_t, vm_offset_t, boolean_t));
|
||||
int vm_map_clean __P((vm_map_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t));
|
||||
int vm_map_protect __P((vm_map_t, vm_offset_t, vm_offset_t, vm_prot_t, boolean_t));
|
||||
void vm_map_reference __P((vm_map_t));
|
||||
@@ -238,6 +249,7 @@ void vm_map_simplify __P((vm_map_t, vm_offset_t));
|
||||
void vm_map_startup __P((void));
|
||||
int vm_map_submap __P((vm_map_t, vm_offset_t, vm_offset_t, vm_map_t));
|
||||
void vm_map_madvise __P((vm_map_t, pmap_t, vm_offset_t, vm_offset_t, int));
|
||||
void vm_map_simplify_entry __P((vm_map_t, vm_map_entry_t));
|
||||
|
||||
#endif
|
||||
#endif /* _VM_MAP_ */
|
||||
+2
-2
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vm_meter.c 8.4 (Berkeley) 1/4/94
|
||||
* $Id: vm_meter.c,v 1.15 1996/05/18 03:37:47 dyson Exp $
|
||||
* $Id: vm_meter.c,v 1.16 1996/09/08 20:44:39 dyson Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -179,7 +179,7 @@ vmtotal SYSCTL_HANDLER_ARGS
|
||||
paging = 0;
|
||||
for (map = &p->p_vmspace->vm_map, entry = map->header.next;
|
||||
entry != &map->header; entry = entry->next) {
|
||||
if (entry->is_a_map || entry->is_sub_map ||
|
||||
if ((entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) ||
|
||||
entry->object.vm_object == NULL)
|
||||
continue;
|
||||
entry->object.vm_object->flags |= OBJ_ACTIVE;
|
||||
|
||||
+25
-8
@@ -38,7 +38,7 @@
|
||||
* from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$
|
||||
*
|
||||
* @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94
|
||||
* $Id: vm_mmap.c,v 1.53 1996/10/29 22:07:11 dyson Exp $
|
||||
* $Id: vm_mmap.c,v 1.53.2.1 1996/12/22 23:21:26 joerg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -475,6 +475,10 @@ mprotect(p, uap, retval)
|
||||
addr = (vm_offset_t) uap->addr;
|
||||
size = uap->len;
|
||||
prot = uap->prot & VM_PROT_ALL;
|
||||
#if defined(VM_PROT_READ_IS_EXEC)
|
||||
if (prot & VM_PROT_READ)
|
||||
prot |= VM_PROT_EXECUTE;
|
||||
#endif
|
||||
|
||||
pageoff = (addr & PAGE_MASK);
|
||||
addr -= pageoff;
|
||||
@@ -648,7 +652,7 @@ mincore(p, uap, retval)
|
||||
/*
|
||||
* ignore submaps (for now) or null objects
|
||||
*/
|
||||
if (current->is_a_map || current->is_sub_map ||
|
||||
if ((current->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) ||
|
||||
current->object.vm_object == NULL)
|
||||
continue;
|
||||
|
||||
@@ -787,7 +791,7 @@ mlock(p, uap, retval)
|
||||
return (error);
|
||||
#endif
|
||||
|
||||
error = vm_map_pageable(&p->p_vmspace->vm_map, addr, addr + size, FALSE);
|
||||
error = vm_map_user_pageable(&p->p_vmspace->vm_map, addr, addr + size, FALSE);
|
||||
return (error == KERN_SUCCESS ? 0 : ENOMEM);
|
||||
}
|
||||
|
||||
@@ -825,7 +829,7 @@ munlock(p, uap, retval)
|
||||
return (error);
|
||||
#endif
|
||||
|
||||
error = vm_map_pageable(&p->p_vmspace->vm_map, addr, addr + size, TRUE);
|
||||
error = vm_map_user_pageable(&p->p_vmspace->vm_map, addr, addr + size, TRUE);
|
||||
return (error == KERN_SUCCESS ? 0 : ENOMEM);
|
||||
}
|
||||
|
||||
@@ -905,9 +909,14 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
|
||||
type = OBJT_VNODE;
|
||||
}
|
||||
}
|
||||
object = vm_pager_allocate(type, handle, OFF_TO_IDX(objsize), prot, foff);
|
||||
if (object == NULL)
|
||||
return (type == OBJT_DEVICE ? EINVAL : ENOMEM);
|
||||
|
||||
if (handle == NULL) {
|
||||
object = NULL;
|
||||
} else {
|
||||
object = vm_pager_allocate(type, handle, OFF_TO_IDX(objsize), prot, foff);
|
||||
if (object == NULL)
|
||||
return (type == OBJT_DEVICE ? EINVAL : ENOMEM);
|
||||
}
|
||||
|
||||
/*
|
||||
* Force device mappings to be shared.
|
||||
@@ -922,6 +931,14 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
|
||||
docow = MAP_COPY_ON_WRITE | MAP_COPY_NEEDED;
|
||||
}
|
||||
|
||||
#if defined(VM_PROT_READ_IS_EXEC)
|
||||
if (prot & VM_PROT_READ)
|
||||
prot |= VM_PROT_EXECUTE;
|
||||
|
||||
if (maxprot & VM_PROT_READ)
|
||||
maxprot |= VM_PROT_EXECUTE;
|
||||
#endif
|
||||
|
||||
rv = vm_map_find(map, object, foff, addr, size, fitit,
|
||||
prot, maxprot, docow);
|
||||
|
||||
@@ -939,7 +956,7 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
|
||||
/*
|
||||
* "Pre-fault" resident pages.
|
||||
*/
|
||||
if ((type == OBJT_VNODE) && (map->pmap != NULL)) {
|
||||
if ((type == OBJT_VNODE) && (map->pmap != NULL) && (object != NULL)) {
|
||||
pmap_object_init_pt(map->pmap, *addr,
|
||||
object, (vm_pindex_t) OFF_TO_IDX(foff), size, 1);
|
||||
}
|
||||
|
||||
+55
-17
@@ -61,7 +61,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_object.c,v 1.81 1996/09/14 11:54:57 bde Exp $
|
||||
* $Id: vm_object.c,v 1.82 1996/09/28 03:33:26 dyson Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -681,6 +681,8 @@ vm_object_pmap_remove(object, start, end)
|
||||
if (p->pindex >= start && p->pindex < end)
|
||||
vm_page_protect(p, VM_PROT_NONE);
|
||||
}
|
||||
if ((start == 0) && (object->size == end))
|
||||
object->flags &= ~OBJ_WRITEABLE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -695,7 +697,9 @@ vm_object_madvise(object, pindex, count, advise)
|
||||
int count;
|
||||
int advise;
|
||||
{
|
||||
vm_pindex_t end;
|
||||
int s;
|
||||
vm_pindex_t end, tpindex;
|
||||
vm_object_t tobject;
|
||||
vm_page_t m;
|
||||
|
||||
if (object == NULL)
|
||||
@@ -704,34 +708,60 @@ vm_object_madvise(object, pindex, count, advise)
|
||||
end = pindex + count;
|
||||
|
||||
for (; pindex < end; pindex += 1) {
|
||||
m = vm_page_lookup(object, pindex);
|
||||
|
||||
relookup:
|
||||
tobject = object;
|
||||
tpindex = pindex;
|
||||
shadowlookup:
|
||||
m = vm_page_lookup(tobject, tpindex);
|
||||
if (m == NULL) {
|
||||
if (tobject->type != OBJT_DEFAULT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tobject = tobject->backing_object;
|
||||
if ((tobject == NULL) || (tobject->ref_count != 1)) {
|
||||
continue;
|
||||
}
|
||||
tpindex += OFF_TO_IDX(tobject->backing_object_offset);
|
||||
goto shadowlookup;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the page is busy or not in a normal active state,
|
||||
* we skip it. Things can break if we mess with pages
|
||||
* in any of the below states.
|
||||
*/
|
||||
if (m == NULL || m->busy || (m->flags & PG_BUSY) ||
|
||||
m->hold_count || m->wire_count ||
|
||||
m->valid != VM_PAGE_BITS_ALL)
|
||||
if (m->hold_count || m->wire_count ||
|
||||
m->valid != VM_PAGE_BITS_ALL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m->busy || (m->flags & PG_BUSY)) {
|
||||
s = splvm();
|
||||
if (m->busy || (m->flags & PG_BUSY)) {
|
||||
m->flags |= PG_WANTED;
|
||||
tsleep(m, PVM, "madvpw", 0);
|
||||
}
|
||||
splx(s);
|
||||
goto relookup;
|
||||
}
|
||||
|
||||
if (advise == MADV_WILLNEED) {
|
||||
if (m->queue != PQ_ACTIVE)
|
||||
vm_page_activate(m);
|
||||
} else if ((advise == MADV_DONTNEED) ||
|
||||
((advise == MADV_FREE) &&
|
||||
((object->type != OBJT_DEFAULT) &&
|
||||
(object->type != OBJT_SWAP)))) {
|
||||
} else if (advise == MADV_DONTNEED) {
|
||||
vm_page_deactivate(m);
|
||||
} else if (advise == MADV_FREE) {
|
||||
pmap_clear_modify(VM_PAGE_TO_PHYS(m));
|
||||
m->dirty = 0;
|
||||
/*
|
||||
* Force a demand-zero on next ref
|
||||
* Force a demand zero if attempt to read from swap.
|
||||
* We currently don't handle vnode files correctly,
|
||||
* and will reread stale contents unnecessarily.
|
||||
*/
|
||||
if (object->type == OBJT_SWAP)
|
||||
swap_pager_dmzspace(object, m->pindex, 1);
|
||||
vm_page_protect(m, VM_PROT_NONE);
|
||||
vm_page_free(m);
|
||||
swap_pager_dmzspace(tobject, m->pindex, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -853,6 +883,7 @@ vm_object_qcollapse(object)
|
||||
swap_pager_freespace(backing_object,
|
||||
backing_object_paging_offset_index + p->pindex, 1);
|
||||
vm_page_rename(p, object, new_pindex);
|
||||
vm_page_protect(p, VM_PROT_NONE);
|
||||
p->dirty = VM_PAGE_BITS_ALL;
|
||||
}
|
||||
}
|
||||
@@ -968,7 +999,9 @@ vm_object_collapse(object)
|
||||
PAGE_WAKEUP(p);
|
||||
vm_page_free(p);
|
||||
} else {
|
||||
vm_page_protect(p, VM_PROT_NONE);
|
||||
vm_page_rename(p, object, new_pindex);
|
||||
p->dirty = VM_PAGE_BITS_ALL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1299,13 +1332,18 @@ vm_object_coalesce(prev_object, prev_pindex, prev_size, next_size)
|
||||
* pages not mapped to prev_entry may be in use anyway)
|
||||
*/
|
||||
|
||||
if (prev_object->ref_count > 1 ||
|
||||
prev_object->backing_object != NULL) {
|
||||
if (prev_object->backing_object != NULL) {
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
prev_size >>= PAGE_SHIFT;
|
||||
next_size >>= PAGE_SHIFT;
|
||||
|
||||
if ((prev_object->ref_count > 1) &&
|
||||
(prev_object->size != prev_pindex + prev_size)) {
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove any pages that may still be in the object from a previous
|
||||
* deallocation.
|
||||
@@ -1360,7 +1398,7 @@ _vm_object_in_map(map, object, entry)
|
||||
}
|
||||
tmpe = tmpe->next;
|
||||
}
|
||||
} else if (entry->is_sub_map || entry->is_a_map) {
|
||||
} else if (entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) {
|
||||
tmpm = entry->object.share_map;
|
||||
tmpe = tmpm->header.next;
|
||||
entcount = tmpm->nentries;
|
||||
|
||||
+38
-17
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
|
||||
* $Id: vm_page.c,v 1.69.2.1 1996/11/09 21:16:08 phk Exp $
|
||||
* $Id: vm_page.c,v 1.69.2.2 1996/11/12 09:10:16 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -98,16 +98,16 @@ static struct pglist *vm_page_buckets; /* Array of buckets */
|
||||
static int vm_page_bucket_count; /* How big is array? */
|
||||
static int vm_page_hash_mask; /* Mask for hash function */
|
||||
|
||||
struct pglist vm_page_queue_free[PQ_L2_SIZE];
|
||||
struct pglist vm_page_queue_zero[PQ_L2_SIZE];
|
||||
struct pglist vm_page_queue_active;
|
||||
struct pglist vm_page_queue_inactive;
|
||||
struct pglist vm_page_queue_cache[PQ_L2_SIZE];
|
||||
struct pglist vm_page_queue_free[PQ_L2_SIZE] = {0};
|
||||
struct pglist vm_page_queue_zero[PQ_L2_SIZE] = {0};
|
||||
struct pglist vm_page_queue_active = {0};
|
||||
struct pglist vm_page_queue_inactive = {0};
|
||||
struct pglist vm_page_queue_cache[PQ_L2_SIZE] = {0};
|
||||
|
||||
int no_queue;
|
||||
int no_queue=0;
|
||||
|
||||
struct vpgqueues vm_page_queues[PQ_COUNT];
|
||||
int pqcnt[PQ_COUNT];
|
||||
struct vpgqueues vm_page_queues[PQ_COUNT] = {0};
|
||||
int pqcnt[PQ_COUNT] = {0};
|
||||
|
||||
static void
|
||||
vm_page_queue_init(void) {
|
||||
@@ -142,13 +142,13 @@ vm_page_queue_init(void) {
|
||||
}
|
||||
}
|
||||
|
||||
vm_page_t vm_page_array;
|
||||
int vm_page_array_size;
|
||||
long first_page;
|
||||
vm_page_t vm_page_array = 0;
|
||||
int vm_page_array_size = 0;
|
||||
long first_page = 0;
|
||||
static long last_page;
|
||||
static vm_size_t page_mask;
|
||||
static int page_shift;
|
||||
int vm_page_zero_count;
|
||||
int vm_page_zero_count = 0;
|
||||
|
||||
/*
|
||||
* map of contiguous valid DEV_BSIZE chunks in a page
|
||||
@@ -734,7 +734,7 @@ vm_page_alloc(object, pindex, page_req)
|
||||
{
|
||||
register vm_page_t m;
|
||||
struct vpgqueues *pq;
|
||||
int queue;
|
||||
int queue, qtype;
|
||||
int s;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
@@ -835,15 +835,16 @@ vm_page_alloc(object, pindex, page_req)
|
||||
}
|
||||
|
||||
queue = m->queue;
|
||||
if (queue == PQ_ZERO)
|
||||
qtype = queue - m->pc;
|
||||
if (qtype == PQ_ZERO)
|
||||
--vm_page_zero_count;
|
||||
pq = &vm_page_queues[queue];
|
||||
TAILQ_REMOVE(pq->pl, m, pageq);
|
||||
--(*pq->cnt);
|
||||
--(*pq->lcnt);
|
||||
if ((m->queue - m->pc) == PQ_ZERO) {
|
||||
if (qtype == PQ_ZERO) {
|
||||
m->flags = PG_ZERO|PG_BUSY;
|
||||
} else if ((m->queue - m->pc) == PQ_CACHE) {
|
||||
} else if (qtype == PQ_CACHE) {
|
||||
vm_page_remove(m);
|
||||
m->flags = PG_BUSY;
|
||||
} else {
|
||||
@@ -874,6 +875,26 @@ vm_page_alloc(object, pindex, page_req)
|
||||
return (m);
|
||||
}
|
||||
|
||||
void
|
||||
vm_wait()
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splvm();
|
||||
if (curproc == pageproc) {
|
||||
vm_pageout_pages_needed = 1;
|
||||
tsleep(&vm_pageout_pages_needed, PSWP, "vmwait", 0);
|
||||
} else {
|
||||
if (!vm_pages_needed) {
|
||||
vm_pages_needed++;
|
||||
wakeup(&vm_pages_needed);
|
||||
}
|
||||
tsleep(&cnt.v_free_count, PVM, "vmwait", 0);
|
||||
}
|
||||
splx(s);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* vm_page_activate:
|
||||
*
|
||||
|
||||
+19
-7
@@ -65,7 +65,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_pageout.c,v 1.86 1996/09/28 03:33:40 dyson Exp $
|
||||
* $Id: vm_pageout.c,v 1.86.2.1 1997/02/13 08:17:32 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -221,6 +221,7 @@ vm_pageout_clean(m, sync)
|
||||
if (!sync && object->backing_object) {
|
||||
vm_object_collapse(object);
|
||||
}
|
||||
|
||||
mc[vm_pageout_page_count] = m;
|
||||
pageout_count = 1;
|
||||
page_base = vm_pageout_page_count;
|
||||
@@ -517,7 +518,7 @@ vm_pageout_map_deactivate_pages(map, desired)
|
||||
*/
|
||||
tmpe = map->header.next;
|
||||
while (tmpe != &map->header) {
|
||||
if ((tmpe->is_sub_map == 0) && (tmpe->is_a_map == 0)) {
|
||||
if ((tmpe->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) == 0) {
|
||||
obj = tmpe->object.vm_object;
|
||||
if ((obj != NULL) && (obj->shadow_count <= 1) &&
|
||||
((bigobj == NULL) ||
|
||||
@@ -539,7 +540,7 @@ vm_pageout_map_deactivate_pages(map, desired)
|
||||
while (tmpe != &map->header) {
|
||||
if (vm_map_pmap(map)->pm_stats.resident_count <= desired)
|
||||
break;
|
||||
if ((tmpe->is_sub_map == 0) && (tmpe->is_a_map == 0)) {
|
||||
if ((tmpe->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP)) == 0) {
|
||||
obj = tmpe->object.vm_object;
|
||||
if (obj)
|
||||
vm_pageout_object_deactivate_pages(map, obj, desired, 0);
|
||||
@@ -810,10 +811,12 @@ rescan0:
|
||||
if (vm_pageout_algorithm_lru ||
|
||||
(m->object->ref_count == 0) || (m->act_count == 0)) {
|
||||
--page_shortage;
|
||||
vm_page_protect(m, VM_PROT_NONE);
|
||||
if ((m->dirty == 0) &&
|
||||
(m->object->ref_count == 0)) {
|
||||
vm_page_cache(m);
|
||||
if (m->object->ref_count == 0) {
|
||||
vm_page_protect(m, VM_PROT_NONE);
|
||||
if (m->dirty == 0)
|
||||
vm_page_cache(m);
|
||||
else
|
||||
vm_page_deactivate(m);
|
||||
} else {
|
||||
vm_page_deactivate(m);
|
||||
}
|
||||
@@ -1013,6 +1016,15 @@ vm_pageout()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
pagedaemon_wakeup()
|
||||
{
|
||||
if (!vm_pages_needed && curproc != pageproc) {
|
||||
vm_pages_needed++;
|
||||
wakeup(&vm_pages_needed);
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(NO_SWAPPING)
|
||||
static void
|
||||
vm_req_vmdaemon()
|
||||
|
||||
+3
-32
@@ -61,7 +61,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_pageout.h,v 1.16 1995/11/20 12:19:22 phk Exp $
|
||||
* $Id: vm_pageout.h,v 1.17 1995/11/21 12:55:26 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef _VM_VM_PAGEOUT_H_
|
||||
@@ -91,38 +91,9 @@ extern int vm_pageout_pages_needed;
|
||||
* Signal pageout-daemon and wait for it.
|
||||
*/
|
||||
|
||||
static void pagedaemon_wakeup __P((void));
|
||||
static inline void
|
||||
pagedaemon_wakeup()
|
||||
{
|
||||
if (!vm_pages_needed && curproc != pageproc) {
|
||||
vm_pages_needed++;
|
||||
wakeup(&vm_pages_needed);
|
||||
}
|
||||
}
|
||||
|
||||
extern void pagedaemon_wakeup __P((void));
|
||||
#define VM_WAIT vm_wait()
|
||||
|
||||
static void vm_wait __P((void));
|
||||
static inline void
|
||||
vm_wait()
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splhigh();
|
||||
if (curproc == pageproc) {
|
||||
vm_pageout_pages_needed = 1;
|
||||
tsleep(&vm_pageout_pages_needed, PSWP, "vmwait", 0);
|
||||
} else {
|
||||
if (!vm_pages_needed) {
|
||||
vm_pages_needed++;
|
||||
wakeup(&vm_pages_needed);
|
||||
}
|
||||
tsleep(&cnt.v_free_count, PVM, "vmwait", 0);
|
||||
}
|
||||
splx(s);
|
||||
}
|
||||
|
||||
extern void vm_wait __P((void));
|
||||
|
||||
#ifdef KERNEL
|
||||
void vm_pageout_page __P((vm_page_t, vm_object_t));
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
|
||||
* $Id: vnode_pager.c,v 1.64 1996/09/10 05:28:23 dyson Exp $
|
||||
* $Id: vnode_pager.c,v 1.65 1996/10/17 02:49:35 dyson Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -148,6 +148,8 @@ vnode_pager_alloc(handle, size, prot, offset)
|
||||
else
|
||||
object->flags = 0;
|
||||
|
||||
if (vp->v_usecount == 0)
|
||||
panic("vnode_pager_alloc: no vnode reference");
|
||||
/*
|
||||
* Hold a reference to the vnode and initialize object data.
|
||||
*/
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
# copyright, but this file is "published" as witness the following:
|
||||
#
|
||||
0 string \<MakerFile FrameMaker document
|
||||
>11 string 5.0 (5.0
|
||||
>11 string 4.0 (4.0
|
||||
>11 string 3.0 (3.0
|
||||
>11 string 2.0 (2.0
|
||||
|
||||
+39
-26
@@ -94,6 +94,8 @@ int klogin __P((struct passwd *, char *, char *, char *));
|
||||
extern void login __P((struct utmp *));
|
||||
|
||||
#define TTYGRPNAME "tty" /* name of group to own ttys */
|
||||
#define DEFAULT_RETRIES 3
|
||||
#define DEFAULT_BACKOFF 10
|
||||
|
||||
/*
|
||||
* This bounds the time given to login. Not a define so it can
|
||||
@@ -111,7 +113,7 @@ int authok;
|
||||
|
||||
struct passwd *pwd;
|
||||
int failures;
|
||||
char term[64], *envinit[1], *hostname, *username, *tty;
|
||||
char *term, *envinit[1], *hostname, *username, *tty;
|
||||
char full_hostname[MAXHOSTNAMELEN];
|
||||
|
||||
int
|
||||
@@ -124,6 +126,7 @@ main(argc, argv)
|
||||
struct stat st;
|
||||
struct timeval tp;
|
||||
struct utmp utmp;
|
||||
int rootok;
|
||||
int ask, ch, cnt, fflag, hflag, pflag, quietlog, rootlogin, rval;
|
||||
int changepass;
|
||||
uid_t uid;
|
||||
@@ -222,6 +225,7 @@ main(argc, argv)
|
||||
getloginname();
|
||||
}
|
||||
rootlogin = 0;
|
||||
rootok = rootterm(tty);
|
||||
#ifdef KERBEROS
|
||||
if ((instance = strchr(username, '.')) != NULL) {
|
||||
if (strncmp(instance, ".root", 5) == 0)
|
||||
@@ -264,9 +268,11 @@ main(argc, argv)
|
||||
/* already authenticated */
|
||||
break;
|
||||
} else if (pwd->pw_passwd[0] == '\0') {
|
||||
/* pretend password okay */
|
||||
rval = 0;
|
||||
goto ttycheck;
|
||||
if (rootlogin && !rootok) {
|
||||
/* pretend password okay */
|
||||
rval = 0;
|
||||
goto ttycheck;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,32 +324,37 @@ main(argc, argv)
|
||||
* If trying to log in as root without Kerberos,
|
||||
* but with insecure terminal, refuse the login attempt.
|
||||
*/
|
||||
if (pwd && !rval) {
|
||||
#ifdef KERBEROS
|
||||
if (authok == 0)
|
||||
if (authok == 0 && rootlogin && !rootok) {
|
||||
#else
|
||||
if (rootlogin && !rootok) {
|
||||
#endif
|
||||
if (pwd && !rval && rootlogin && !rootterm(tty)) {
|
||||
(void)fprintf(stderr,
|
||||
"%s login refused on this terminal.\n",
|
||||
pwd->pw_name);
|
||||
if (hostname)
|
||||
syslog(LOG_NOTICE,
|
||||
"LOGIN %s REFUSED FROM %s ON TTY %s",
|
||||
pwd->pw_name, full_hostname, tty);
|
||||
else
|
||||
syslog(LOG_NOTICE,
|
||||
"LOGIN %s REFUSED ON TTY %s",
|
||||
pwd->pw_name, tty);
|
||||
continue;
|
||||
/*
|
||||
* Fall through to standard failure message
|
||||
* and standard backoff behaviour
|
||||
*/
|
||||
if (hostname)
|
||||
syslog(LOG_NOTICE,
|
||||
"LOGIN %s REFUSED FROM %s ON TTY %s",
|
||||
pwd->pw_name, full_hostname, tty);
|
||||
else
|
||||
syslog(LOG_NOTICE,
|
||||
"LOGIN %s REFUSED ON TTY %s",
|
||||
pwd->pw_name, tty);
|
||||
}
|
||||
else /* valid password & authenticated */
|
||||
break;
|
||||
}
|
||||
|
||||
if (pwd && !rval)
|
||||
break;
|
||||
|
||||
(void)printf("Login incorrect\n");
|
||||
failures++;
|
||||
/* we allow 10 tries, but after 3 we start backing off */
|
||||
if (++cnt > 3) {
|
||||
if (cnt >= 10) {
|
||||
|
||||
/*
|
||||
* we allow 10 tries, but after 3 we start backing off
|
||||
*/
|
||||
if (++cnt > DEFAULT_BACKOFF) {
|
||||
if (cnt >= DEFAULT_RETRIES) {
|
||||
badlogin(username);
|
||||
sleepexit(1);
|
||||
}
|
||||
@@ -418,13 +429,15 @@ main(argc, argv)
|
||||
if (*pwd->pw_shell == '\0')
|
||||
pwd->pw_shell = _PATH_BSHELL;
|
||||
|
||||
if ((term = getenv("TERM")) != NULL)
|
||||
term = strdup(term);
|
||||
/* Destroy environment unless user has requested its preservation. */
|
||||
if (!pflag)
|
||||
environ = envinit;
|
||||
(void)setenv("HOME", pwd->pw_dir, 1);
|
||||
(void)setenv("SHELL", pwd->pw_shell, 1);
|
||||
if (term[0] == '\0')
|
||||
(void)strncpy(term, stypeof(tty), sizeof(term));
|
||||
if (term == NULL || *term == '\0')
|
||||
term = stypeof(tty);
|
||||
(void)setenv("TERM", term, 0);
|
||||
(void)setenv("LOGNAME", pwd->pw_name, 1);
|
||||
(void)setenv("USER", pwd->pw_name, 1);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)write.1 8.1 (Berkeley) 6/6/93
|
||||
.\" $Id$
|
||||
.\" $Id: write.1,v 1.5 1997/03/22 17:19:32 mpp Exp $
|
||||
.\"
|
||||
.Dd June 6, 1993
|
||||
.Dt WRITE 1
|
||||
@@ -72,11 +72,6 @@ You can prevent people (other than the super-user) from writing to you
|
||||
with the
|
||||
.Xr mesg 1
|
||||
command.
|
||||
Some commands, for example
|
||||
.Xr nroff 1
|
||||
and
|
||||
.Xr pr 1 ,
|
||||
disallow writing automatically, so that your output isn't overwritten.
|
||||
.Pp
|
||||
If the user you want to write to is logged in on more than one terminal,
|
||||
you can specify which terminal to write to by specifying the terminal
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
*
|
||||
* @(#)nfs_start.c 8.1 (Berkeley) 6/6/93
|
||||
*
|
||||
* $Id: nfs_start.c,v 1.1.1.1 1994/05/26 05:22:00 rgrimes Exp $
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -64,10 +64,13 @@ unsigned short nfs_port;
|
||||
SVCXPRT *nfsxprt;
|
||||
|
||||
extern int fwd_sock;
|
||||
int max_fds = -1;
|
||||
|
||||
#define MASKED_SIGS (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGCHLD)|sigmask(SIGHUP))
|
||||
|
||||
#ifndef FD_SET
|
||||
#define FD_SETSIZE 32 /* XXX kludge. bind does it this way */
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* Check that we are not burning resources
|
||||
@@ -173,7 +176,7 @@ static int rpc_pending_now()
|
||||
#endif /* FD_SET */
|
||||
|
||||
tvv.tv_sec = tvv.tv_usec = 0;
|
||||
nsel = select(max_fds+1, &readfds, (int *) 0, (int *) 0, &tvv);
|
||||
nsel = select(FD_SETSIZE, &readfds, (int *) 0, (int *) 0, &tvv);
|
||||
if (nsel < 1)
|
||||
return(0);
|
||||
#ifdef FD_SET
|
||||
@@ -188,7 +191,6 @@ static int rpc_pending_now()
|
||||
|
||||
static serv_state run_rpc(P_void)
|
||||
{
|
||||
int dtbsz = max_fds + 1;
|
||||
int smask = sigblock(MASKED_SIGS);
|
||||
|
||||
next_softclock = clocktime();
|
||||
@@ -251,7 +253,7 @@ static serv_state run_rpc(P_void)
|
||||
dlog("Select waits for Godot");
|
||||
#endif /* DEBUG */
|
||||
|
||||
nsel = do_select(smask, dtbsz, &readfds, &tvv);
|
||||
nsel = do_select(smask, FD_SETSIZE, &readfds, &tvv);
|
||||
|
||||
|
||||
switch (nsel) {
|
||||
@@ -337,6 +339,7 @@ int mount_automounter(ppid)
|
||||
int ppid;
|
||||
{
|
||||
int so = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
int so2 = socket(AF_INET, SOCK_STREAM, 0);
|
||||
SVCXPRT *amqp;
|
||||
int nmount;
|
||||
|
||||
@@ -345,11 +348,18 @@ int ppid;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((nfsxprt = svcudp_create(so)) == NULL ||
|
||||
(amqp = svcudp_create(so)) == NULL) {
|
||||
if (so2 < 0 || bind_resv_port(so2, NULL) < 0) {
|
||||
perror("Can't create privileged port");
|
||||
return 1;
|
||||
}
|
||||
if ((nfsxprt = svcudp_create(so)) == NULL) {
|
||||
plog(XLOG_FATAL, "cannot create rpc/udp service");
|
||||
return 2;
|
||||
}
|
||||
if ((amqp = svctcp_create(so2, 0, 0)) == NULL) {
|
||||
plog(XLOG_FATAL, "cannot create rpc/tcp service");
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (!svc_register(nfsxprt, NFS_PROGRAM, NFS_VERSION, nfs_program_2, 0)) {
|
||||
plog(XLOG_FATAL, "unable to register (NFS_PROGRAM, NFS_VERSION, 0)");
|
||||
@@ -362,16 +372,6 @@ int ppid;
|
||||
if (fwd_init() != 0)
|
||||
return 3;
|
||||
|
||||
/*
|
||||
* One or other of so, fwd_sock
|
||||
* must be the highest fd on
|
||||
* which to select.
|
||||
*/
|
||||
if (so > max_fds)
|
||||
max_fds = so;
|
||||
if (fwd_sock > max_fds)
|
||||
max_fds = fwd_sock;
|
||||
|
||||
/*
|
||||
* Construct the root automount node
|
||||
*/
|
||||
@@ -410,8 +410,8 @@ int ppid;
|
||||
*/
|
||||
unregister_amq();
|
||||
|
||||
if (!svc_register(amqp, AMQ_PROGRAM, AMQ_VERSION, amq_program_1, IPPROTO_UDP)) {
|
||||
plog(XLOG_FATAL, "unable to register (AMQ_PROGRAM, AMQ_VERSION, udp)");
|
||||
if (!svc_register(amqp, AMQ_PROGRAM, AMQ_VERSION, amq_program_1, IPPROTO_TCP)) {
|
||||
plog(XLOG_FATAL, "unable to register (AMQ_PROGRAM, AMQ_VERSION, tcp)");
|
||||
return 3;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
*
|
||||
* @(#)amq.c 8.1 (Berkeley) 6/7/93
|
||||
*
|
||||
* $Id: amq.c,v 1.1.1.1 1994/05/26 05:22:04 rgrimes Exp $
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -54,7 +54,7 @@ char copyright[] = "\
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$Id: amq.c,v 1.1.1.1 1994/05/26 05:22:04 rgrimes Exp $";
|
||||
static char rcsid[] = "$Id$";
|
||||
static char sccsid[] = "@(#)amq.c 8.1 (Berkeley) 6/7/93";
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -409,7 +409,7 @@ Usage: %s [-h host] [[-f] [-m] [-v] [-s]] | [[-u] directory ...]] |\n\
|
||||
/*
|
||||
* Create RPC endpoint
|
||||
*/
|
||||
s = privsock(SOCK_STREAM);
|
||||
s = RPC_ANYSOCK;
|
||||
clnt = clnttcp_create(&server_addr, AMQ_PROGRAM, AMQ_VERSION, &s, 0, 0);
|
||||
if (clnt == 0) {
|
||||
close(s);
|
||||
|
||||
@@ -113,7 +113,7 @@ main(argc, argv)
|
||||
cflag = 1;
|
||||
break;
|
||||
case 'd':
|
||||
strcpy(prefix, optarg);
|
||||
strncpy(prefix, optarg, sizeof prefix - 1);
|
||||
break;
|
||||
case 'p': /* create V7 "file.orig" */
|
||||
makeold = 1;
|
||||
|
||||
@@ -53,14 +53,14 @@ Options and operands available for
|
||||
The
|
||||
.Fl d
|
||||
option causes debugging information to be written to syslog, recording
|
||||
all RPC transations to the daemon. These messages are logged with level
|
||||
all RPC transactions to the daemon. These messages are logged with level
|
||||
LOG_DEBUG and facility LOG_DAEMON. If debug_level is not specified,
|
||||
level 1 is assumed, giving one log line per protocol operation. Higher
|
||||
debug levels can be specified, causing display of operation arguments
|
||||
and internal operations of the daemon.
|
||||
.El
|
||||
.Pp
|
||||
Error conditions are logged to syslog, irrespecive of the debug level,
|
||||
Error conditions are logged to syslog, irrespective of the debug level,
|
||||
using log level LOG_ERR and facility LOG_DAEMON.
|
||||
.Pp
|
||||
The
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
.Nm rpc.statd
|
||||
.Op Fl d
|
||||
.Sh DESCRIPTION
|
||||
.Nm rpc.rstatd
|
||||
.Nm rpc.statd
|
||||
is a daemon which co-operates with rpc.statd daemons on other hosts to provide
|
||||
a status monitoring service. The daemon accepts requests from
|
||||
programs running on the local host (typically,
|
||||
@@ -63,13 +63,13 @@ Options and operands available for
|
||||
The
|
||||
.Fl d
|
||||
option causes debugging information to be written to syslog, recording
|
||||
all RPC transations to the daemon. These messages are logged with level
|
||||
all RPC transactions to the daemon. These messages are logged with level
|
||||
LOG_DEBUG and facility LOG_DAEMON. Error conditions are logged irrespective
|
||||
of this option, using level LOG_ERR.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm rpc.rstatd
|
||||
.Nm rpc.statd
|
||||
daemon must NOT be invoked by
|
||||
.Xr inetd 8
|
||||
because the protocol assumes that the daemon will run from system start time.
|
||||
@@ -89,7 +89,7 @@ RPC protocol specification used by local applications to register monitoring req
|
||||
.Xr rpc.lockd 8
|
||||
.Sh BUGS
|
||||
There is no means for the daemon to tell when a monitored host has
|
||||
disappeared permanently (eg. catastrophic harware failure), as opposed
|
||||
disappeared permanently (eg. catastrophic hardware failure), as opposed
|
||||
to transient failure of the host or an intermediate router. At present,
|
||||
it will re-try notification attempts at frequent intervals for 10 minutes,
|
||||
then hourly, and finally gives up after 24 hours.
|
||||
|
||||
Reference in new issue
Block a user