diff options
author | Rodney W. Grimes <rgrimes@FreeBSD.org> | 1995-06-11 19:33:05 +0000 |
---|---|---|
committer | Rodney W. Grimes <rgrimes@FreeBSD.org> | 1995-06-11 19:33:05 +0000 |
commit | d3628763db3974826e46a036aa54333147fbe238 (patch) | |
tree | ba998dfb4fcad03e00a5cbf58e2a0ad648bab6e6 /sys | |
parent | 67eb1e0ed1fb11c703392e562440c67d3b44b094 (diff) | |
download | src-d3628763db3974826e46a036aa54333147fbe238.tar.gz src-d3628763db3974826e46a036aa54333147fbe238.zip |
Merge RELENG_2_0_5 into HEAD
Notes
Notes:
svn path=/head/; revision=9202
Diffstat (limited to 'sys')
36 files changed, 377 insertions, 368 deletions
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 5d4f4695807a..be6cfb3d3e5c 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exception.s,v 1.7 1995/01/14 13:20:05 bde Exp $ + * $Id: exception.s,v 1.8.2.1 1995/06/05 00:22:02 davidg Exp $ */ #include "npx.h" /* NNPX */ @@ -251,34 +251,26 @@ IDTVEC(syscall) */ SUPERALIGN_TEXT IDTVEC(linux_syscall) - pushl $0 - pushl $0 + pushfl /* Room for tf_err */ + pushfl /* Room for tf_trapno */ pushal pushl %ds pushl %es - movl $KDSEL,%eax + movl $KDSEL,%eax /* switch to kernel segments */ movl %ax,%ds movl %ax,%es + movl TF_ERR(%esp),%eax /* copy eflags from tf_err to fs_eflags */ + movl %eax,TF_EFLAGS(%esp) FAKE_MCOUNT(12*4(%esp)) incl _cnt+V_SYSCALL - orl $SWI_AST_MASK,_cpl + movl $SWI_AST_MASK,_cpl call _linux_syscall /* - * There was no place to save the cpl so we have to recover it - * indirectly. For traps from user mode it was 0, and for traps - * from kernel mode Oring SWI_AST_MASK into it didn't change it. - */ - subl %eax,%eax - testb $SEL_RPL_MASK,TRAPF_CS_OFF(%esp) - jne 1f - movl _cpl,%eax -1: - /* - * Return via _doreti to handle ASTs. Have to change trap frame - * to interrupt frame. + * Return via _doreti to handle ASTs. */ - pushl %eax + pushl $0 /* cpl to restore */ subl $4,%esp + movb $1,_intr_nesting_level MEXITCOUNT jmp _doreti #endif /* COMPAT_LINUX */ diff --git a/sys/amd64/amd64/exception.s b/sys/amd64/amd64/exception.s index 5d4f4695807a..be6cfb3d3e5c 100644 --- a/sys/amd64/amd64/exception.s +++ b/sys/amd64/amd64/exception.s @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exception.s,v 1.7 1995/01/14 13:20:05 bde Exp $ + * $Id: exception.s,v 1.8.2.1 1995/06/05 00:22:02 davidg Exp $ */ #include "npx.h" /* NNPX */ @@ -251,34 +251,26 @@ IDTVEC(syscall) */ SUPERALIGN_TEXT IDTVEC(linux_syscall) - pushl $0 - pushl $0 + pushfl /* Room for tf_err */ + pushfl /* Room for tf_trapno */ pushal pushl %ds pushl %es - movl $KDSEL,%eax + movl $KDSEL,%eax /* switch to kernel segments */ movl %ax,%ds movl %ax,%es + movl TF_ERR(%esp),%eax /* copy eflags from tf_err to fs_eflags */ + movl %eax,TF_EFLAGS(%esp) FAKE_MCOUNT(12*4(%esp)) incl _cnt+V_SYSCALL - orl $SWI_AST_MASK,_cpl + movl $SWI_AST_MASK,_cpl call _linux_syscall /* - * There was no place to save the cpl so we have to recover it - * indirectly. For traps from user mode it was 0, and for traps - * from kernel mode Oring SWI_AST_MASK into it didn't change it. - */ - subl %eax,%eax - testb $SEL_RPL_MASK,TRAPF_CS_OFF(%esp) - jne 1f - movl _cpl,%eax -1: - /* - * Return via _doreti to handle ASTs. Have to change trap frame - * to interrupt frame. + * Return via _doreti to handle ASTs. */ - pushl %eax + pushl $0 /* cpl to restore */ subl $4,%esp + movb $1,_intr_nesting_level MEXITCOUNT jmp _doreti #endif /* COMPAT_LINUX */ diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 5e1489aaadce..997b2f20b5d2 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.51 1995/03/21 07:16:12 davidg Exp $ + * $Id: trap.c,v 1.52.2.1 1995/06/05 00:22:04 davidg Exp $ */ /* @@ -885,22 +885,18 @@ linux_syscall(frame) int rval[2]; int code; struct linux_syscall_args { - int ebx; - int ecx; - int edx; - int esi; - int edi; - int ebp; - int eax; + int arg1; + int arg2; + int arg3; + int arg4; + int arg5; } args; - args.ebx = frame.tf_ebx; - args.ecx = frame.tf_ecx; - args.edx = frame.tf_edx; - args.esi = frame.tf_esi; - args.edi = frame.tf_edi; - args.ebp = frame.tf_ebp; - args.eax = frame.tf_eax; + args.arg1 = frame.tf_ebx; + args.arg2 = frame.tf_ecx; + args.arg3 = frame.tf_edx; + args.arg4 = frame.tf_esi; + args.arg5 = frame.tf_edi; sticks = p->p_sticks; if (ISPL(frame.tf_cs) != SEL_UPL) @@ -910,12 +906,8 @@ linux_syscall(frame) p->p_md.md_regs = (int *)&frame; params = (caddr_t)frame.tf_esp + sizeof (int) ; - /* - * Reconstruct pc, assuming lcall $X,y is 7 bytes, as it is always. - * THIS IS WRONG FOR LINUX XXX SOS - * SIZE OF INT 0x80 (2??) NEEDED HERE !!! - */ - opc = frame.tf_eip - 2; /* was 7 */ + /* Reconstruct pc, subtract size of int 0x80 */ + opc = frame.tf_eip - 2; if (code == 0) { code = fuword(params); params += sizeof (int); diff --git a/sys/amd64/amd64/tsc.c b/sys/amd64/amd64/tsc.c index e1bc372f176f..bf8b8eff8026 100644 --- a/sys/amd64/amd64/tsc.c +++ b/sys/amd64/amd64/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ + * $Id: clock.c,v 1.34.2.1 1995/06/09 03:29:17 davidg Exp $ */ /* @@ -453,7 +453,7 @@ inittodr(time_t base) splx(s); /* Look if we have a RTC present and the time is valid */ - if (rtcin(RTC_STATUSD) != RTCSD_PWR) + if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) goto wrong_time; /* wait for time update to complete */ diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 675c405007f8..3de583d25294 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -1,7 +1,7 @@ # # GENERIC -- Generic machine with WD/AHx/NCR/BTx family disks # -# $Id: GENERIC,v 1.44 1995/05/02 04:40:06 phk Exp $ +# $Id: GENERIC,v 1.45.2.3 1995/06/05 21:50:41 jkh Exp $ # machine "i386" @@ -88,12 +88,15 @@ device lpt0 at isa? port? tty irq 7 vector lptintr device lpt1 at isa? port? tty device lpt2 at isa? port? tty +# Order is important here due to intrusive probes, do *not* alphabetize +# this list of network interfaces until the probes have been fixed. +# Right now it appears that the ie0 must be probed before ep0. See +# revision 1.20 of this file. device de0 device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000 vector edintr device ed1 at isa? port 0x300 net irq 5 iomem 0xd8000 vector edintr -device eg0 at isa? port 0x310 net irq 5 vector egintr -device ep0 at isa? port 0x300 net irq 10 vector epintr device ie0 at isa? port 0x360 net irq 7 iomem 0xd0000 vector ieintr +device ep0 at isa? port 0x300 net irq 10 vector epintr device ix0 at isa? port 0x300 net irq 10 iomem 0xd0000 iosiz 32768 vector ixintr device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr @@ -105,9 +108,8 @@ pseudo-device loop pseudo-device ether pseudo-device log pseudo-device sl 1 -pseudo-device ppp 1 +# ijppp uses tun instead of ppp device +#pseudo-device ppp 1 +pseudo-device tun 1 pseudo-device pty 16 -pseudo-device speaker pseudo-device gzip # Exec gzipped a.out's -pseudo-device vn -pseudo-device tun 1 diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index e1bc372f176f..bf8b8eff8026 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ + * $Id: clock.c,v 1.34.2.1 1995/06/09 03:29:17 davidg Exp $ */ /* @@ -453,7 +453,7 @@ inittodr(time_t base) splx(s); /* Look if we have a RTC present and the time is valid */ - if (rtcin(RTC_STATUSD) != RTCSD_PWR) + if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) goto wrong_time; /* wait for time update to complete */ diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 7a0eee7ca165..756bef0e9e40 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -21,7 +21,7 @@ * (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: if_de.c,v 1.27 1995/05/26 02:02:44 davidg Exp $ + * $Id: if_de.c,v 1.28.2.1 1995/06/02 10:44:24 davidg Exp $ * */ @@ -916,7 +916,7 @@ tulip_start( addr += slen; clsize = CLBYTES; } - } while ((m0 = m0->m_next) != NULL); + } while ((m0 != NULL) && ((m0 = m0->m_next) != NULL)); /* * The packet exceeds the number of transmit buffer diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index be36035d3d42..3c468238f2ac 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.60 1995/05/09 12:25:52 rgrimes Exp $ + * $Id: fd.c,v 1.61.2.1 1995/06/08 10:26:23 davidg Exp $ * */ @@ -1080,12 +1080,11 @@ fdstrategy(struct buf *bp) fd = &fd_data[fdu]; fdc = fd->fdc; fdcu = fdc->fdcu; - fdblk = 128 << (fd->ft->secsize); #if NFT > 0 if (FDTYPE(minor(bp->b_dev)) & F_TAPE_TYPE) { /* ft tapes do not (yet) support strategy i/o */ - bp->b_error = ENXIO; + bp->b_error = ENODEV; bp->b_flags |= B_ERROR; goto bad; } @@ -1096,6 +1095,7 @@ fdstrategy(struct buf *bp) goto bad; } #endif + fdblk = 128 << (fd->ft->secsize); if (!(bp->b_flags & B_FORMAT)) { if ((fdu >= NFD) || (bp->b_blkno < 0)) { printf( diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 047eea0bcb0f..2c41c9c0a88a 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.15 1995/05/09 16:30:45 bde Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.16.2.3 1995/06/02 11:03:15 davidg Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -946,8 +946,6 @@ msdosfs_link(ap) * be sure dest is not a child of src directory * write entry in dest directory * update "." and ".." in moved directory - * update offset and dirclust in denode - * move denode to new hash chain * clear old directory entry for moved directory * } * } @@ -981,8 +979,6 @@ msdosfs_rename(ap) int error; int newparent = 0; int sourceisadirectory = 0; - u_long to_dirclust; - u_long to_diroffset; u_long cn; daddr_t bn; struct vnode *tvp = ap->a_tvp; @@ -1091,25 +1087,18 @@ msdosfs_rename(ap) error = ENOTEMPTY; goto bad; } + cache_purge(DETOV(tddep)); } else { /* destination is file */ if (sourceisadirectory) { error = EISDIR; goto bad; } } - to_dirclust = tdep->de_dirclust; - to_diroffset = tdep->de_diroffset; error = removede(tddep,tdep); if (error) goto bad; vput(ap->a_tvp); tdep = NULL; - - /* - * Remember where the slot was for createde(). - */ - tddep->de_fndclust = to_dirclust; - tddep->de_fndoffset = to_diroffset; } /* @@ -1181,9 +1170,11 @@ msdosfs_rename(ap) VOP_UNLOCK(ap->a_fdvp); goto bad; } - fdep->de_dirclust = tddep->de_fndclust; - fdep->de_diroffset = tddep->de_fndoffset; - reinsert(fdep); + if (!sourceisadirectory) { + fdep->de_dirclust = tddep->de_fndclust; + fdep->de_diroffset = tddep->de_fndoffset; + reinsert(fdep); + } VOP_UNLOCK(ap->a_fdvp); } /* fdep is still locked here */ diff --git a/sys/i386/boot/biosboot/boot.c b/sys/i386/boot/biosboot/boot.c index 8ff7d8e34c51..723a829b9031 100644 --- a/sys/i386/boot/biosboot/boot.c +++ b/sys/i386/boot/biosboot/boot.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, [92/04/03 16:51:14 rvb] - * $Id: boot.c,v 1.42 1995/04/21 22:20:34 julian Exp $ + * $Id: boot.c,v 1.43.2.1 1995/05/31 21:42:38 jkh Exp $ */ @@ -76,6 +76,7 @@ boot(int drive) int ret; char *t; +#if 0 #ifndef FORCE_COMCONSOLE if (probe_keyboard()) { init_serial(); @@ -87,6 +88,7 @@ boot(int drive) loadflags |= RB_SERIAL; printf("\nSerial console forced."); #endif +#endif /* Pick up the story from the Bios on geometry of disks */ diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 675c405007f8..3de583d25294 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -1,7 +1,7 @@ # # GENERIC -- Generic machine with WD/AHx/NCR/BTx family disks # -# $Id: GENERIC,v 1.44 1995/05/02 04:40:06 phk Exp $ +# $Id: GENERIC,v 1.45.2.3 1995/06/05 21:50:41 jkh Exp $ # machine "i386" @@ -88,12 +88,15 @@ device lpt0 at isa? port? tty irq 7 vector lptintr device lpt1 at isa? port? tty device lpt2 at isa? port? tty +# Order is important here due to intrusive probes, do *not* alphabetize +# this list of network interfaces until the probes have been fixed. +# Right now it appears that the ie0 must be probed before ep0. See +# revision 1.20 of this file. device de0 device ed0 at isa? port 0x280 net irq 5 iomem 0xd8000 vector edintr device ed1 at isa? port 0x300 net irq 5 iomem 0xd8000 vector edintr -device eg0 at isa? port 0x310 net irq 5 vector egintr -device ep0 at isa? port 0x300 net irq 10 vector epintr device ie0 at isa? port 0x360 net irq 7 iomem 0xd0000 vector ieintr +device ep0 at isa? port 0x300 net irq 10 vector epintr device ix0 at isa? port 0x300 net irq 10 iomem 0xd0000 iosiz 32768 vector ixintr device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr @@ -105,9 +108,8 @@ pseudo-device loop pseudo-device ether pseudo-device log pseudo-device sl 1 -pseudo-device ppp 1 +# ijppp uses tun instead of ppp device +#pseudo-device ppp 1 +pseudo-device tun 1 pseudo-device pty 16 -pseudo-device speaker pseudo-device gzip # Exec gzipped a.out's -pseudo-device vn -pseudo-device tun 1 diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 5d4f4695807a..be6cfb3d3e5c 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exception.s,v 1.7 1995/01/14 13:20:05 bde Exp $ + * $Id: exception.s,v 1.8.2.1 1995/06/05 00:22:02 davidg Exp $ */ #include "npx.h" /* NNPX */ @@ -251,34 +251,26 @@ IDTVEC(syscall) */ SUPERALIGN_TEXT IDTVEC(linux_syscall) - pushl $0 - pushl $0 + pushfl /* Room for tf_err */ + pushfl /* Room for tf_trapno */ pushal pushl %ds pushl %es - movl $KDSEL,%eax + movl $KDSEL,%eax /* switch to kernel segments */ movl %ax,%ds movl %ax,%es + movl TF_ERR(%esp),%eax /* copy eflags from tf_err to fs_eflags */ + movl %eax,TF_EFLAGS(%esp) FAKE_MCOUNT(12*4(%esp)) incl _cnt+V_SYSCALL - orl $SWI_AST_MASK,_cpl + movl $SWI_AST_MASK,_cpl call _linux_syscall /* - * There was no place to save the cpl so we have to recover it - * indirectly. For traps from user mode it was 0, and for traps - * from kernel mode Oring SWI_AST_MASK into it didn't change it. - */ - subl %eax,%eax - testb $SEL_RPL_MASK,TRAPF_CS_OFF(%esp) - jne 1f - movl _cpl,%eax -1: - /* - * Return via _doreti to handle ASTs. Have to change trap frame - * to interrupt frame. + * Return via _doreti to handle ASTs. */ - pushl %eax + pushl $0 /* cpl to restore */ subl $4,%esp + movb $1,_intr_nesting_level MEXITCOUNT jmp _doreti #endif /* COMPAT_LINUX */ diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 5e1489aaadce..997b2f20b5d2 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.51 1995/03/21 07:16:12 davidg Exp $ + * $Id: trap.c,v 1.52.2.1 1995/06/05 00:22:04 davidg Exp $ */ /* @@ -885,22 +885,18 @@ linux_syscall(frame) int rval[2]; int code; struct linux_syscall_args { - int ebx; - int ecx; - int edx; - int esi; - int edi; - int ebp; - int eax; + int arg1; + int arg2; + int arg3; + int arg4; + int arg5; } args; - args.ebx = frame.tf_ebx; - args.ecx = frame.tf_ecx; - args.edx = frame.tf_edx; - args.esi = frame.tf_esi; - args.edi = frame.tf_edi; - args.ebp = frame.tf_ebp; - args.eax = frame.tf_eax; + args.arg1 = frame.tf_ebx; + args.arg2 = frame.tf_ecx; + args.arg3 = frame.tf_edx; + args.arg4 = frame.tf_esi; + args.arg5 = frame.tf_edi; sticks = p->p_sticks; if (ISPL(frame.tf_cs) != SEL_UPL) @@ -910,12 +906,8 @@ linux_syscall(frame) p->p_md.md_regs = (int *)&frame; params = (caddr_t)frame.tf_esp + sizeof (int) ; - /* - * Reconstruct pc, assuming lcall $X,y is 7 bytes, as it is always. - * THIS IS WRONG FOR LINUX XXX SOS - * SIZE OF INT 0x80 (2??) NEEDED HERE !!! - */ - opc = frame.tf_eip - 2; /* was 7 */ + /* Reconstruct pc, subtract size of int 0x80 */ + opc = frame.tf_eip - 2; if (code == 0) { code = fuword(params); params += sizeof (int); diff --git a/sys/i386/i386/tsc.c b/sys/i386/i386/tsc.c index e1bc372f176f..bf8b8eff8026 100644 --- a/sys/i386/i386/tsc.c +++ b/sys/i386/i386/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ + * $Id: clock.c,v 1.34.2.1 1995/06/09 03:29:17 davidg Exp $ */ /* @@ -453,7 +453,7 @@ inittodr(time_t base) splx(s); /* Look if we have a RTC present and the time is valid */ - if (rtcin(RTC_STATUSD) != RTCSD_PWR) + if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) goto wrong_time; /* wait for time update to complete */ diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index e1bc372f176f..bf8b8eff8026 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ + * $Id: clock.c,v 1.34.2.1 1995/06/09 03:29:17 davidg Exp $ */ /* @@ -453,7 +453,7 @@ inittodr(time_t base) splx(s); /* Look if we have a RTC present and the time is valid */ - if (rtcin(RTC_STATUSD) != RTCSD_PWR) + if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) goto wrong_time; /* wait for time update to complete */ diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index be36035d3d42..3c468238f2ac 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.60 1995/05/09 12:25:52 rgrimes Exp $ + * $Id: fd.c,v 1.61.2.1 1995/06/08 10:26:23 davidg Exp $ * */ @@ -1080,12 +1080,11 @@ fdstrategy(struct buf *bp) fd = &fd_data[fdu]; fdc = fd->fdc; fdcu = fdc->fdcu; - fdblk = 128 << (fd->ft->secsize); #if NFT > 0 if (FDTYPE(minor(bp->b_dev)) & F_TAPE_TYPE) { /* ft tapes do not (yet) support strategy i/o */ - bp->b_error = ENXIO; + bp->b_error = ENODEV; bp->b_flags |= B_ERROR; goto bad; } @@ -1096,6 +1095,7 @@ fdstrategy(struct buf *bp) goto bad; } #endif + fdblk = 128 << (fd->ft->secsize); if (!(bp->b_flags & B_FORMAT)) { if ((fdu >= NFD) || (bp->b_blkno < 0)) { printf( diff --git a/sys/i386/isa/if_el.c b/sys/i386/isa/if_el.c index 2232a7042e5e..0571a8a62e2c 100644 --- a/sys/i386/isa/if_el.c +++ b/sys/i386/isa/if_el.c @@ -6,7 +6,7 @@ * * Questions, comments, bug reports and fixes to kimmel@cs.umass.edu. * - * $Id: if_el.c,v 1.12 1995/04/12 20:47:48 wollman Exp $ + * $Id: if_el.c,v 1.13.2.1 1995/06/09 18:12:09 davidg Exp $ */ /* Except of course for the portions of code lifted from other FreeBSD * drivers (mainly elread, elget and el_ioctl) @@ -768,6 +768,7 @@ el_ioctl(ifp, command, data) ((ifp->if_flags & IFF_RUNNING) == 0)) el_init(ifp->if_unit); } + break; case SIOCSIFMTU: diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c index 1809ec925a96..e57f387773f2 100644 --- a/sys/i386/isa/matcd/matcd.c +++ b/sys/i386/isa/matcd/matcd.c @@ -2405,9 +2405,21 @@ static int matcd_toc_entries(int ldrive, int cdrive, int controller, array from the kernel address space into the user address space */ - if (copyout(entries, ioc_entry->data, - (trk)*sizeof(struct cd_toc_entry)) != 0) { - return(EFAULT); + { + int len = ioc_entry->data_len; + int i = ioc_entry->starting_track - 1; + struct cd_toc_entry* from = &entries[i]; + struct cd_toc_entry* to = ioc_entry->data; + + while (i < trk && len >= sizeof(struct cd_toc_entry)) { + if (copyout(from, to, sizeof(struct cd_toc_entry)) != 0) { + return (EFAULT); + } + i++; + len -= sizeof(struct cd_toc_entry); + from++; + to++; + } } return(0); diff --git a/sys/i386/scsi/aic7xxx.c b/sys/i386/scsi/aic7xxx.c index 8d8f2131a474..08e31f63691d 100644 --- a/sys/i386/scsi/aic7xxx.c +++ b/sys/i386/scsi/aic7xxx.c @@ -24,7 +24,7 @@ * * commenced: Sun Sep 27 18:14:01 PDT 1992 * - * $Id: aic7xxx.c,v 1.27 1995/05/17 07:06:00 davidg Exp $ + * $Id: aic7xxx.c,v 1.28.2.3 1995/06/09 18:06:45 davidg Exp $ */ /* * TODO: @@ -193,8 +193,17 @@ struct scsi_device ahc_dev = #define REQO 0x02 #define ACKO 0x01 -/* XXX document this thing */ +/* + * 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 0xc04ul +#define WIDEXFER 0x80 /* Wide transfer control */ +#define SXFR 0x70 /* Sync transfer rate */ +#define SOFS 0x0f /* Sync offset */ /* * SCSI ID (p. 3-18). @@ -785,42 +794,49 @@ ahcintr(unit) (inb(SEQADDR1 + iobase) << 8) | inb(SEQADDR0 + iobase)); } - if (intstat & SEQINT) { - unsigned char transfer; - + if (intstat & SEQINT) { + u_short targ_mask; + u_char target = (inb(SCSIID + iobase) >> 4) & 0x0f; + u_char scratch_offset = target; + char channel = + inb(SBLKCTL + iobase) & SELBUSB ? 'B': 'A'; + + if (channel == 'B') + scratch_offset += 8; + targ_mask = (0x01 << scratch_offset); + switch (intstat & SEQINT_MASK) { case BAD_PHASE: - panic("ahc%d: unknown scsi bus phase. " - "Attempting to continue\n", unit); - break; - case SEND_REJECT: - printf("ahc%d: Warning - " - "message reject, message type: 0x%x\n", unit, + panic("ahc%d:%c:%d: unknown scsi bus phase. " + "Attempting to continue\n", + unit, channel, target); + break; + case SEND_REJECT: + printf("ahc%d:%c:%d: Warning - " + "message reject, message type: 0x%x\n", + unit, channel, target, inb(HA_REJBYTE + iobase)); - break; - case NO_IDENT: - panic("ahc%d: No IDENTIFY message from reconnecting " - "target %d at seqaddr = 0x%lx " - "SAVED_TCL == 0x%x\n", - unit, (inb(SELID + iobase) >> 4) & 0xf, - (inb(SEQADDR1 + iobase) << 8) | - inb(SEQADDR0 + iobase), + break; + case NO_IDENT: + panic("ahc%d:%c:%d: Target did not send an IDENTIFY " + "message. SAVED_TCL == 0x%x\n", + unit, channel, target, inb(SAVED_TCL + iobase)); break; case NO_MATCH: { u_char active; int active_port = HA_ACTIVE0 + iobase; - int tcl = inb(SCBARRAY+1 + iobase); - int target = (tcl >> 4) & 0x0f; - printf("ahc%d: no active SCB for reconnecting " - "target %d, channel %c - issuing ABORT\n", - unit, target, tcl & 0x08 ? 'B' : 'A'); + printf("ahc%d:%c:%d: no active SCB - " + "issuing ABORT\n", unit, channel, + target); printf("SAVED_TCL == 0x%x\n", inb(SAVED_TCL + iobase)); - if( tcl & 0x88 ) { - /* Second channel stores its info - * in byte two of HA_ACTIVE + if(targ_mask & 0xff00) { + /* + * targets on the Second channel or + * above id 7 store info in byte two + * of HA_ACTIVE */ active_port++; } @@ -834,36 +850,32 @@ ahcintr(unit) } case MSG_SDTR: { - u_char scsi_id, offset, rate, targ_scratch; - u_char maxoffset, mask; - /* - * Help the sequencer to translate the - * negotiated transfer rate. Transfer is - * 1/4 the period in ns as is returned by - * the sync negotiation message. So, we must + u_char period, offset, rate; + u_char targ_scratch; + u_char maxoffset; + /* + * Help the sequencer to translate the + * negotiated transfer rate. Transfer is + * 1/4 the period in ns as is returned by + * the sync negotiation message. So, we must * multiply by four */ - transfer = inb(HA_ARG_1 + iobase) << 2; - /* The bottom half of SCSIXFER */ + period = inb(HA_ARG_1 + iobase) << 2; offset = inb(ACCUM + iobase); - scsi_id = inb(SCSIID + iobase) >> 0x4; - if(inb(SBLKCTL + iobase) & 0x08) - /* B channel */ - scsi_id += 8; - mask = (0x01 << scsi_id); - targ_scratch = inb(HA_TARG_SCRATCH + iobase - + scsi_id); - if(targ_scratch & 0x80) + targ_scratch = inb(HA_TARG_SCRATCH + iobase + + scratch_offset); + if(targ_scratch & WIDEXFER) maxoffset = 0x08; else maxoffset = 0x0f; - ahc_scsirate(&rate, transfer, - MIN(offset,maxoffset), unit, scsi_id); + ahc_scsirate(&rate, period, + MIN(offset,maxoffset), unit, target); /* Preserve the WideXfer flag */ - rate |= targ_scratch & 0x80; - outb(HA_TARG_SCRATCH + iobase + scsi_id, rate); - outb(SCSIRATE + iobase, rate); - if( (rate & 0x0f) == 0 ) + targ_scratch = rate | (targ_scratch & WIDEXFER); + outb(HA_TARG_SCRATCH + iobase + scratch_offset, + targ_scratch); + outb(SCSIRATE + iobase, targ_scratch); + if( (targ_scratch & 0x0f) == 0 ) { /* * The requested rate was so low @@ -877,7 +889,7 @@ ahcintr(unit) outb(HA_RETURN_1 + iobase, SEND_REJ); } /* See if we initiated Sync Negotiation */ - else if(ahc->sdtrpending & mask) + else if(ahc->sdtrpending & targ_mask) { /* * Don't send an SDTR back to @@ -898,25 +910,20 @@ ahcintr(unit) /* * Negate the flags */ - ahc->needsdtr &= ~mask; - ahc->sdtrpending &= ~mask; + ahc->needsdtr &= ~targ_mask; + ahc->sdtrpending &= ~targ_mask; break; } case MSG_WDTR: { - u_char scsi_id, scratch, bus_width; + u_char scratch, bus_width; bus_width = inb(ACCUM + iobase); - scsi_id = inb(SCSIID + iobase) >> 0x4; - - if(inb(SBLKCTL + iobase) & 0x08) - /* B channel */ - scsi_id += 8; - scratch = inb(HA_TARG_SCRATCH + iobase - + scsi_id); + scratch = inb(HA_TARG_SCRATCH + iobase + + scratch_offset); - if(ahc->wdtrpending & (0x01 << scsi_id)) + if(ahc->wdtrpending & targ_mask) { /* * Don't send a WDTR back to the @@ -932,8 +939,8 @@ ahcintr(unit) printf("ahc%d: target " "%d using 16Bit " "transfers\n", - unit, scsi_id); - scratch |= 0x80; + unit, target); + scratch |= 0x80; break; } } @@ -954,17 +961,18 @@ ahcintr(unit) printf("ahc%d: target " "%d using 16Bit " "transfers\n", - unit, scsi_id); - scratch |= 0x80; + unit, target); + scratch |= 0x80; break; } outb(HA_RETURN_1 + iobase, bus_width | SEND_WDTR); } - ahc->needwdtr &= ~(0x01 << scsi_id); - ahc->wdtrpending &= ~(0x01 << scsi_id); - outb(HA_TARG_SCRATCH + iobase + scsi_id, scratch); - outb(SCSIRATE + iobase, scratch); + ahc->needwdtr &= ~targ_mask; + ahc->wdtrpending &= ~targ_mask; + outb(HA_TARG_SCRATCH + iobase + scratch_offset, + scratch); + outb(SCSIRATE + iobase, scratch); break; } case MSG_REJECT: @@ -977,36 +985,29 @@ ahcintr(unit) */ u_char targ_scratch; - u_char scsi_id = inb(SCSIID + iobase) >> 0x4; - u_short mask; - - if(inb(SBLKCTL + iobase) & 0x08) - /* B channel */ - scsi_id += 8; targ_scratch = inb(HA_TARG_SCRATCH + iobase - + scsi_id); + + scratch_offset); - mask = (0x01 << scsi_id); - if(ahc->wdtrpending & mask){ + if(ahc->wdtrpending & targ_mask){ /* note 8bit xfers and clear flag */ targ_scratch &= 0x7f; - ahc->needwdtr &= ~mask; - ahc->wdtrpending &= ~mask; - printf("ahc%d: target %d refusing " + ahc->needwdtr &= ~targ_mask; + ahc->wdtrpending &= ~targ_mask; + printf("ahc%d:%c:%d: refusing " "WIDE negotiation. Using " "8bit transfers\n", - unit, scsi_id); + unit, channel, target); } - else if(ahc->sdtrpending & mask){ + else if(ahc->sdtrpending & targ_mask){ /* note asynch xfers and clear flag */ targ_scratch &= 0xf0; - ahc->needsdtr &= ~mask; - ahc->sdtrpending &= ~mask; - printf("ahc%d: target %d refusing " + ahc->needsdtr &= ~targ_mask; + ahc->sdtrpending &= ~targ_mask; + printf("ahc%d:%c:%d: refusing " "syncronous negotiation. Using " "asyncronous transfers\n", - unit, scsi_id); + unit, channel, target); } else { /* @@ -1014,12 +1015,13 @@ ahcintr(unit) */ #ifdef AHC_DEBUG if(ahc_debug & AHC_SHOWMISC) - printf("Message reject -- " - "ignored\n"); + printf("ahc%d:%c:%d: Message + reject -- ignored\n", + unit, channel, target); #endif break; } - outb(HA_TARG_SCRATCH + iobase + scsi_id, + outb(HA_TARG_SCRATCH + iobase + scratch_offset, targ_scratch); outb(SCSIRATE + iobase, targ_scratch); break; @@ -1046,9 +1048,9 @@ ahcintr(unit) */ outb(HA_RETURN_1 + iobase, 0); if (!scb || !(scb->flags & SCB_ACTIVE)) { - printf("ahc%d: ahcintr - referenced scb not " - "valid during seqint 0x%x scb(%d)\n", - unit, intstat, scb_index); + printf("ahc%d:%c:%d: ahcintr - referenced scb " + "not valid during seqint 0x%x scb(%d)\n", + unit, channel, target, intstat, scb_index); goto clear; } @@ -1068,12 +1070,8 @@ ahcintr(unit) break; case SCSI_CHECK: #ifdef AHC_DEBUG - printf("ahc%d: target %d, lun %d (%s%d) " - "requests Check Status\n", unit - ,xs->sc_link->target - ,xs->sc_link->lun - ,xs->sc_link->device->name - ,xs->sc_link->dev_unit); + sc_print_addr(xs->sc_link); + printf("requests Check Status\n"); #endif if((xs->error == XS_NOERROR) && @@ -1083,19 +1081,13 @@ ahcintr(unit) u_char tail; struct ahc_dma_seg *sg = scb->ahc_dma; struct scsi_sense *sc = &(scb->sense_cmd); - u_char control = scb->control; u_char tcl = scb->target_channel_lun; #ifdef AHC_DEBUG - printf("ahc%d: target %d, lun %d " - "(%s%d) Sending Sense\n", unit - ,xs->sc_link->target - ,xs->sc_link->lun - ,xs->sc_link->device->name - ,xs->sc_link->dev_unit); + sc_print_addr(xs->sc_link); + printf("Sending Sense\n"); #endif bzero(scb, SCB_DOWN_SIZE); scb->flags |= SCB_SENSE; - scb->control = (control & SCB_TE); sc->op_code = REQUEST_SENSE; sc->byte2 = xs->sc_link->lun << 5; sc->length = sizeof(struct scsi_sense_data); @@ -1157,17 +1149,20 @@ ahcintr(unit) break; case SCSI_BUSY: xs->error = XS_BUSY; - printf("ahc%d: Target Busy\n", unit); + sc_print_addr(xs->sc_link); + printf("Target Busy\n"); break; case SCSI_QUEUE_FULL: /* * The upper level SCSI code will eventually * handle this properly. */ - printf("ahc%d: Queue Full\n", unit); + sc_print_addr(xs->sc_link); + printf("Queue Full\n"); xs->error = XS_BUSY; break; default: + sc_print_addr(xs->sc_link); printf("unexpected targ_status: %x\n", scb->target_status); xs->error = XS_DRIVER_STUFFUP; @@ -1180,18 +1175,23 @@ ahcintr(unit) int scb_index; scb_index = inb(SCBPTR + iobase); scb = ahc->scbarray[scb_index]; + xs = scb->xs; /* * Don't clobber valid resid info with * a resid coming from a check sense * operation. */ - if(!(scb->flags & SCB_SENSE)) + if(!(scb->flags & SCB_SENSE)) { scb->xs->resid = (inb(iobase+SCBARRAY+17) << 16) | (inb(iobase+SCBARRAY+16) << 8) | inb(iobase+SCBARRAY+15); + xs->flags |= SCSI_RESID_VALID; #ifdef AHC_DEBUG - printf("ahc: Handled Residual\n"); + sc_print_addr(xs->sc_link); + printf("Handled Residual of %d bytes\n", + scb->xs->resid); #endif + } break; } case ABORT_TAG: @@ -1199,16 +1199,13 @@ ahcintr(unit) int scb_index; scb_index = inb(SCBPTR + iobase); scb = ahc->scbarray[scb_index]; + xs = scb->xs; /* * We didn't recieve a valid tag back from * the target on a reconnect. */ - printf("ahc%d: invalid tag recieved on channel %c " - "target %d, lun %d -- sending ABORT_TAG\n", - unit, - ((u_long)xs->sc_link->fordriver & 0x08)? 'B':'A', - xs->sc_link->target, - xs->sc_link->lun); + sc_print_addr(xs->sc_link); + printf("invalid tag recieved -- sending ABORT_TAG\n"); scb->xs->error = XS_DRIVER_STUFFUP; untimeout(ahc_timeout, (caddr_t)scb); ahc_done(unit, scb); @@ -1311,15 +1308,11 @@ clear: outb(WAITING_SCBH + iobase, waiting); RESTART_SEQUENCER(ahc); - } - - else if (status & SCSIPERR) { - printf("ahc%d: parity error on channel %c " - "target %d, lun %d\n", - unit, - ((u_long)xs->sc_link->fordriver & 0x08)? 'B':'A', - xs->sc_link->target, - xs->sc_link->lun); + } + + else if (status & SCSIPERR) { + sc_print_addr(xs->sc_link); + printf("parity error\n"); xs->error = XS_DRIVER_STUFFUP; outb(CLRSINT1 + iobase, CLRSCSIPERR); @@ -1329,8 +1322,8 @@ clear: scb = NULL; } else if (!(status & BUSFREE)) { - printf("ahc%d: Unknown SCSIINT. Status = 0x%x\n", - unit, status); + sc_print_addr(xs->sc_link); + printf("Unknown SCSIINT. Status = 0x%x\n", status); outb(CLRSINT1 + iobase, status); UNPAUSE_SEQUENCER(ahc); outb(CLRINT + iobase, CLRSCSIINT); @@ -1477,13 +1470,18 @@ ahc_init(unit) printf("ahc%d: 284x ", unit); ahc->maxscbs = 0x4; break; + case AHC_AIC7850: case AHC_AIC7870: case AHC_294: - if( ahc->type == AHC_AIC7870) + ahc->maxscbs = 0x10; + if(ahc->type == AHC_AIC7850){ + printf("ahc%d: aic7850 ", unit); + ahc->maxscbs = 0x03; + } + else if(ahc->type == AHC_AIC7870) printf("ahc%d: aic7870 ", unit); else printf("ahc%d: 294x ", unit); - ahc->maxscbs = 0x10; #define DFTHRESH 3 outb(DSPCISTATUS + iobase, DFTHRESH << 6); /* @@ -1530,7 +1528,7 @@ ahc_init(unit) * Number of SCBs that will be used. Rev E aic7770s and * aic7870s have 16. The rest have 4. */ - if(!(ahc->type & AHC_AIC7870)) + if(!(ahc->type & AHC_AIC78X0)) { /* * See if we have a Rev E or higher @@ -1559,7 +1557,7 @@ ahc_init(unit) printf("aic7870, "); printf("%d SCBs\n", ahc->maxscbs); - if(!(ahc->type & AHC_AIC7870)) { + if(!(ahc->type & AHC_AIC78X0)) { if(ahc->pause & IRQMS) printf("ahc%d: Using Level Sensitive Interrupts\n", unit); @@ -1567,7 +1565,7 @@ ahc_init(unit) printf("ahc%d: Using Edge Triggered Interrupts\n", unit); } - if(!(ahc->type & AHC_AIC7870)){ + if(!(ahc->type & AHC_AIC78X0)){ /* * The 294x cards are PCI, so we get their interrupt from the PCI * BIOS. @@ -1701,7 +1699,7 @@ ahc_init(unit) printf("Done\n"); outb(SEQCTL + iobase, FASTMODE); - if (!(ahc->type & AHC_AIC7870)) + if (!(ahc->type & AHC_AIC78X0)) outb(BCTL + iobase, ENABLE); /* Reset the bus */ @@ -1800,6 +1798,7 @@ ahc_scsi_cmd(xs) scb->cmdlen = xs->cmdlen; scb->cmdpointer = KVTOPHYS(xs->cmd); xs->resid = 0; + xs->status = 0; if (xs->datalen) { /* should use S/G only if not zero length */ scb->SG_list_pointer = KVTOPHYS(scb->ahc_dma); sg = scb->ahc_dma; diff --git a/sys/i386/scsi/aic7xxx.h b/sys/i386/scsi/aic7xxx.h index 7623be77d634..bd7a8656684c 100644 --- a/sys/i386/scsi/aic7xxx.h +++ b/sys/i386/scsi/aic7xxx.h @@ -20,7 +20,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: aic7xxx.h,v 1.8 1995/05/17 07:06:02 davidg Exp $ + * $Id: aic7xxx.h,v 1.9.2.1 1995/06/04 09:15:29 davidg Exp $ */ #ifndef _AIC7XXX_H_ @@ -45,14 +45,18 @@ struct ahc_dma_seg { long len; }; -typedef u_char ahc_type; -#define AHC_NONE 0x00 -#define AHC_WIDE 0x02 /* Wide Channel */ -#define AHC_TWIN 0x08 /* Twin Channel */ -#define AHC_274 0x10 /* EISA Based Controller */ -#define AHC_284 0x20 /* VL/ISA Based Controller */ -#define AHC_AIC7870 0x40 /* PCI Based Controller */ -#define AHC_294 0xc0 /* PCI Based Controller */ +typedef enum { + AHC_NONE = 0x000, + AHC_WIDE = 0x002, /* Wide Channel */ + AHC_TWIN = 0x008, /* Twin Channel */ + AHC_AIC7770 = 0x010, + AHC_AIC7850 = 0x020, + AHC_AIC7870 = 0x040, + AHC_AIC78X0 = 0x060, /* PCI Based Controller */ + AHC_274 = 0x110, /* EISA Based Controller */ + AHC_284 = 0x210, /* VL/ISA Based Controller */ + AHC_294 = 0x440 /* PCI Based Controller */ +}ahc_type; /* * The driver keeps up to MAX_SCB scb structures per card in memory. Only the diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index e1bc372f176f..bf8b8eff8026 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.33 1995/05/11 07:44:40 bde Exp $ + * $Id: clock.c,v 1.34.2.1 1995/06/09 03:29:17 davidg Exp $ */ /* @@ -453,7 +453,7 @@ inittodr(time_t base) splx(s); /* Look if we have a RTC present and the time is valid */ - if (rtcin(RTC_STATUSD) != RTCSD_PWR) + if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) goto wrong_time; /* wait for time update to complete */ diff --git a/sys/isa/fd.c b/sys/isa/fd.c index be36035d3d42..3c468238f2ac 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.60 1995/05/09 12:25:52 rgrimes Exp $ + * $Id: fd.c,v 1.61.2.1 1995/06/08 10:26:23 davidg Exp $ * */ @@ -1080,12 +1080,11 @@ fdstrategy(struct buf *bp) fd = &fd_data[fdu]; fdc = fd->fdc; fdcu = fdc->fdcu; - fdblk = 128 << (fd->ft->secsize); #if NFT > 0 if (FDTYPE(minor(bp->b_dev)) & F_TAPE_TYPE) { /* ft tapes do not (yet) support strategy i/o */ - bp->b_error = ENXIO; + bp->b_error = ENODEV; bp->b_flags |= B_ERROR; goto bad; } @@ -1096,6 +1095,7 @@ fdstrategy(struct buf *bp) goto bad; } #endif + fdblk = 128 << (fd->ft->secsize); if (!(bp->b_flags & B_FORMAT)) { if ((fdu >= NFD) || (bp->b_blkno < 0)) { printf( diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 082088c81d1c..ed8fce137ce6 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: imgact_aout.c,v 1.12 1995/03/16 18:12:25 bde Exp $ + * $Id: imgact_aout.c,v 1.13.2.1 1995/06/04 16:58:44 davidg Exp $ */ #include <sys/param.h> @@ -57,10 +57,11 @@ exec_aout_imgact(iparams) /* * Linux and *BSD binaries look very much alike, * only the machine id is different: - * 0x64 for Linux, 0x86 for *BSD. + * 0x64 for Linux, 0x86 for *BSD, 0x00 for BSDI. */ - if (((a_out->a_magic >> 16) & 0xff) != 0x86) - return -1; + if (((a_out->a_magic >> 16) & 0xff) != 0x86 && + ((a_out->a_magic >> 16) & 0xff) != 0) + return -1; #endif /* COMPAT_LINUX */ /* diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 5e1489aaadce..997b2f20b5d2 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.51 1995/03/21 07:16:12 davidg Exp $ + * $Id: trap.c,v 1.52.2.1 1995/06/05 00:22:04 davidg Exp $ */ /* @@ -885,22 +885,18 @@ linux_syscall(frame) int rval[2]; int code; struct linux_syscall_args { - int ebx; - int ecx; - int edx; - int esi; - int edi; - int ebp; - int eax; + int arg1; + int arg2; + int arg3; + int arg4; + int arg5; } args; - args.ebx = frame.tf_ebx; - args.ecx = frame.tf_ecx; - args.edx = frame.tf_edx; - args.esi = frame.tf_esi; - args.edi = frame.tf_edi; - args.ebp = frame.tf_ebp; - args.eax = frame.tf_eax; + args.arg1 = frame.tf_ebx; + args.arg2 = frame.tf_ecx; + args.arg3 = frame.tf_edx; + args.arg4 = frame.tf_esi; + args.arg5 = frame.tf_edi; sticks = p->p_sticks; if (ISPL(frame.tf_cs) != SEL_UPL) @@ -910,12 +906,8 @@ linux_syscall(frame) p->p_md.md_regs = (int *)&frame; params = (caddr_t)frame.tf_esp + sizeof (int) ; - /* - * Reconstruct pc, assuming lcall $X,y is 7 bytes, as it is always. - * THIS IS WRONG FOR LINUX XXX SOS - * SIZE OF INT 0x80 (2??) NEEDED HERE !!! - */ - opc = frame.tf_eip - 2; /* was 7 */ + /* Reconstruct pc, subtract size of int 0x80 */ + opc = frame.tf_eip - 2; if (code == 0) { code = fuword(params); params += sizeof (int); diff --git a/sys/kern/tty.c b/sys/kern/tty.c index b5b5f67e6f1f..1df2b4a8d321 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)tty.c 8.8 (Berkeley) 1/21/94 - * $Id: tty.c,v 1.44 1995/05/07 23:53:36 ache Exp $ + * $Id: tty.c,v 1.45.2.3 1995/06/05 01:23:10 davidg Exp $ */ #include "snp.h" @@ -1037,7 +1037,25 @@ ttywait(tp) while ((tp->t_outq.c_cc || ISSET(tp->t_state, TS_BUSY)) && (ISSET(tp->t_state, TS_CARR_ON) || ISSET(tp->t_cflag, CLOCAL)) && tp->t_oproc) { - (*tp->t_oproc)(tp); + /* + * XXX the call to t_oproc() can cause livelock. + * + * If two processes wait for output to drain from the same + * tty, and the amount of output to drain is <= tp->t_lowat, + * then the processes will take turns uselessly waking each + * other up until the output drains, all running at spltty() + * so that even interrupts on other terminals are blocked. + * + * Skipping the call when TS_BUSY is set avoids the problem + * for current drivers but isn't "right". There is no + * problem for ptys - we only get woken up when the output + * queue is actually reduced. Hardware ttys should be + * handled similarly. There would still be excessive + * wakeups for output below low water when we only care + * about output complete. + */ + if (!ISSET(tp->t_state, TS_BUSY)) + (*tp->t_oproc)(tp); if ((tp->t_outq.c_cc || ISSET(tp->t_state, TS_BUSY)) && (ISSET(tp->t_state, TS_CARR_ON) || ISSET(tp->t_cflag, CLOCAL))) { SET(tp->t_state, TS_ASLEEP); @@ -1812,8 +1830,7 @@ ovhiwat: return (uio->uio_resid == cnt ? EWOULDBLOCK : 0); } SET(tp->t_state, TS_ASLEEP); - error = ttysleep(tp, &tp->t_outq, TTOPRI | PCATCH, "ttywri", - tp->t_timeout); + error = ttysleep(tp, &tp->t_outq, TTOPRI | PCATCH, "ttywri", tp->t_timeout); splx(s); if (error) goto out; diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 047eea0bcb0f..2c41c9c0a88a 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.15 1995/05/09 16:30:45 bde Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.16.2.3 1995/06/02 11:03:15 davidg Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -946,8 +946,6 @@ msdosfs_link(ap) * be sure dest is not a child of src directory * write entry in dest directory * update "." and ".." in moved directory - * update offset and dirclust in denode - * move denode to new hash chain * clear old directory entry for moved directory * } * } @@ -981,8 +979,6 @@ msdosfs_rename(ap) int error; int newparent = 0; int sourceisadirectory = 0; - u_long to_dirclust; - u_long to_diroffset; u_long cn; daddr_t bn; struct vnode *tvp = ap->a_tvp; @@ -1091,25 +1087,18 @@ msdosfs_rename(ap) error = ENOTEMPTY; goto bad; } + cache_purge(DETOV(tddep)); } else { /* destination is file */ if (sourceisadirectory) { error = EISDIR; goto bad; } } - to_dirclust = tdep->de_dirclust; - to_diroffset = tdep->de_diroffset; error = removede(tddep,tdep); if (error) goto bad; vput(ap->a_tvp); tdep = NULL; - - /* - * Remember where the slot was for createde(). - */ - tddep->de_fndclust = to_dirclust; - tddep->de_fndoffset = to_diroffset; } /* @@ -1181,9 +1170,11 @@ msdosfs_rename(ap) VOP_UNLOCK(ap->a_fdvp); goto bad; } - fdep->de_dirclust = tddep->de_fndclust; - fdep->de_diroffset = tddep->de_fndoffset; - reinsert(fdep); + if (!sourceisadirectory) { + fdep->de_dirclust = tddep->de_fndclust; + fdep->de_diroffset = tddep->de_fndoffset; + reinsert(fdep); + } VOP_UNLOCK(ap->a_fdvp); } /* fdep is still locked here */ diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 18c45f47b660..ff63303ae010 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ethersubr.c,v 1.7 1995/05/09 13:35:39 davidg Exp $ + * $Id: if_ethersubr.c,v 1.8.2.1 1995/06/03 04:46:21 davidg Exp $ */ #include <sys/param.h> @@ -523,6 +523,7 @@ ether_addmulti(ifr, ac) struct sockaddr_in *sin; u_char addrlo[6]; u_char addrhi[6]; + int set_allmulti = 0; int s = splimp(); switch (ifr->ifr_addr.sa_family) { @@ -543,6 +544,7 @@ ether_addmulti(ifr, ac) */ bcopy(ether_ipmulticast_min, addrlo, 6); bcopy(ether_ipmulticast_max, addrhi, 6); + set_allmulti = 1; } else { ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo); @@ -592,6 +594,9 @@ ether_addmulti(ifr, ac) ac->ac_multiaddrs = enm; ac->ac_multicnt++; splx(s); + if (set_allmulti) + ac->ac_if.if_flags |= IFF_ALLMULTI; + /* * Return ENETRESET to inform the driver that the list has changed * and its reception filter should be adjusted accordingly. @@ -612,6 +617,7 @@ ether_delmulti(ifr, ac) struct sockaddr_in *sin; u_char addrlo[6]; u_char addrhi[6]; + int unset_allmulti = 0; int s = splimp(); switch (ifr->ifr_addr.sa_family) { @@ -632,6 +638,7 @@ ether_delmulti(ifr, ac) */ bcopy(ether_ipmulticast_min, addrlo, 6); bcopy(ether_ipmulticast_max, addrhi, 6); + unset_allmulti = 1; } else { ETHER_MAP_IP_MULTICAST(&sin->sin_addr, addrlo); @@ -671,6 +678,9 @@ ether_delmulti(ifr, ac) free(enm, M_IFMADDR); ac->ac_multicnt--; splx(s); + if (unset_allmulti) + ac->ac_if.if_flags &= ~IFF_ALLMULTI; + /* * Return ENETRESET to inform the driver that the list has changed * and its reception filter should be adjusted accordingly. diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index c0672cace3fb..8cf302dd2dfa 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -69,7 +69,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: if_ppp.c,v 1.12 1995/03/29 20:34:17 ache Exp $ */ +/* $Id: if_ppp.c,v 1.13.2.1 1995/06/04 16:12:49 davidg Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ #include "ppp.h" @@ -200,7 +200,7 @@ pppattach() sc->sc_if.if_name = "ppp"; sc->sc_if.if_unit = i++; sc->sc_if.if_mtu = PPP_MTU; - sc->sc_if.if_flags = IFF_POINTOPOINT; + sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST; sc->sc_if.if_type = IFT_PPP; sc->sc_if.if_hdrlen = PPP_HDRLEN; sc->sc_if.if_ioctl = pppioctl; @@ -1526,6 +1526,18 @@ pppioctl(ifp, cmd, data) case SIOCGIFMTU: ifr->ifr_mtu = sc->sc_if.if_mtu; break; + case SIOCADDMULTI: + case SIOCDELMULTI: + switch(ifr->ifr_addr.sa_family) { +#ifdef INET + case AF_INET: + break; +#endif + default: + error = EAFNOSUPPORT; + break; + } + break; default: error = EINVAL; diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index b2bc22c8b233..2a74394431c6 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 - * $Id: tcp_usrreq.c,v 1.13 1995/04/09 01:29:28 davidg Exp $ + * $Id: tcp_usrreq.c,v 1.14.2.1 1995/06/09 03:21:13 davidg Exp $ */ #include <sys/param.h> @@ -408,6 +408,8 @@ tcp_connect(tp, nam) * TIME_WAIT state, creating an ADDRINUSE error. */ error = in_pcbladdr(inp, nam, &ifaddr); + if (error) + return error; oinp = in_pcblookup(inp->inp_pcbinfo->listhead, sin->sin_addr, sin->sin_port, inp->inp_laddr.s_addr != INADDR_ANY ? inp->inp_laddr diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 366a076de640..033dae4c8741 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.13 1995/05/29 04:01:08 davidg Exp $ + * $Id: nfs_serv.c,v 1.14.2.1 1995/06/07 07:25:09 davidg Exp $ */ /* @@ -1124,14 +1124,9 @@ nfsrv_link(nfsd, mrep, md, dpos, cred, nam, mrq) error = EXDEV; out: if (!error) { - int deallocobj = 0; nqsrv_getl(vp, NQL_WRITE); nqsrv_getl(xp, NQL_WRITE); - if ((vp->v_flag & VVMIO) && vp->v_vmdata) - deallocobj = 1; error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); - if (error == 0 && deallocobj) - vm_object_deallocate((vm_object_t) vp->v_vmdata); } else { VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == nd.ni_vp) diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index 037d0dd35bcd..2daa89117aa1 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_vfsops.c,v 1.13 1995/05/14 03:00:01 davidg Exp $ + * $Id: nfs_vfsops.c,v 1.14.2.1 1995/06/02 11:13:15 davidg Exp $ */ #include <sys/param.h> @@ -260,6 +260,10 @@ nfs_mountroot() } if (nd->swap_nblks) { + + /* Convert to DEV_BSIZE instead of Kilobyte */ + nd->swap_nblks *= 2; + /* * Create a fake mount point just for the swap vnode so that the * swap file can be on a different server from the rootfs. @@ -273,6 +277,9 @@ nfs_mountroot() (void) nfs_mountdiskless(buf, "/swap", 0, &nd->swap_saddr, &nd->swap_args, &vp); + VTONFS(vp)->n_size = VTONFS(vp)->n_vattr.va_size = + nd->swap_nblks * DEV_BSIZE ; + /* * Since the swap file is not the root dir of a file system, * hack it to a regular file. @@ -280,7 +287,7 @@ nfs_mountroot() vp->v_type = VREG; vp->v_flag = 0; VREF(vp); - swaponvp(p, vp, NODEV, nd->swap_nblks * 2); + swaponvp(p, vp, NODEV, nd->swap_nblks); } /* diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 037d0dd35bcd..2daa89117aa1 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_vfsops.c,v 1.13 1995/05/14 03:00:01 davidg Exp $ + * $Id: nfs_vfsops.c,v 1.14.2.1 1995/06/02 11:13:15 davidg Exp $ */ #include <sys/param.h> @@ -260,6 +260,10 @@ nfs_mountroot() } if (nd->swap_nblks) { + + /* Convert to DEV_BSIZE instead of Kilobyte */ + nd->swap_nblks *= 2; + /* * Create a fake mount point just for the swap vnode so that the * swap file can be on a different server from the rootfs. @@ -273,6 +277,9 @@ nfs_mountroot() (void) nfs_mountdiskless(buf, "/swap", 0, &nd->swap_saddr, &nd->swap_args, &vp); + VTONFS(vp)->n_size = VTONFS(vp)->n_vattr.va_size = + nd->swap_nblks * DEV_BSIZE ; + /* * Since the swap file is not the root dir of a file system, * hack it to a regular file. @@ -280,7 +287,7 @@ nfs_mountroot() vp->v_type = VREG; vp->v_flag = 0; VREF(vp); - swaponvp(p, vp, NODEV, nd->swap_nblks * 2); + swaponvp(p, vp, NODEV, nd->swap_nblks); } /* diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 366a076de640..033dae4c8741 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.13 1995/05/29 04:01:08 davidg Exp $ + * $Id: nfs_serv.c,v 1.14.2.1 1995/06/07 07:25:09 davidg Exp $ */ /* @@ -1124,14 +1124,9 @@ nfsrv_link(nfsd, mrep, md, dpos, cred, nam, mrq) error = EXDEV; out: if (!error) { - int deallocobj = 0; nqsrv_getl(vp, NQL_WRITE); nqsrv_getl(xp, NQL_WRITE); - if ((vp->v_flag & VVMIO) && vp->v_vmdata) - deallocobj = 1; error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); - if (error == 0 && deallocobj) - vm_object_deallocate((vm_object_t) vp->v_vmdata); } else { VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == nd.ni_vp) diff --git a/sys/pci/aic7870.c b/sys/pci/aic7870.c index 60284550571c..e0e4733f2d98 100644 --- a/sys/pci/aic7870.c +++ b/sys/pci/aic7870.c @@ -1,6 +1,6 @@ /* * Product specific probe and attach routines for: - * 294X and aic7870 motherboard SCSI controllers + * 2940, aic7870, and aic7850 motherboard SCSI controllers * * Copyright (c) 1995 Justin T. Gibbs * All rights reserved. @@ -19,7 +19,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: aic7870.c,v 1.9 1995/04/15 21:38:34 gibbs Exp $ + * $Id: aic7870.c,v 1.10.2.2 1995/06/09 18:06:53 davidg Exp $ */ #include <pci.h> @@ -37,6 +37,7 @@ #define PCI_BASEADR0 PCI_MAP_REG_START #define PCI_DEVICE_ID_ADAPTEC_2940 0x71789004ul #define PCI_DEVICE_ID_ADAPTEC_AIC7870 0x70789004ul +#define PCI_DEVICE_ID_ADAPTEC_AIC7850 0x70759004ul static char* aic7870_probe __P((pcici_t tag, pcidi_t type)); void aic7870_attach __P((pcici_t config_id, int unit)); @@ -63,6 +64,9 @@ aic7870_probe (pcici_t tag, pcidi_t type) case PCI_DEVICE_ID_ADAPTEC_AIC7870: return ("Adaptec aic7870 SCSI host adapter"); break; + case PCI_DEVICE_ID_ADAPTEC_AIC7850: + return ("Adaptec aic7850 SCSI host adapter"); + break; default: break; } @@ -95,6 +99,9 @@ aic7870_attach(config_id, unit) case PCI_DEVICE_ID_ADAPTEC_AIC7870: ahc_t = AHC_AIC7870; break; + case PCI_DEVICE_ID_ADAPTEC_AIC7850: + ahc_t = AHC_AIC7850; + break; default: break; } diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c index 7a0eee7ca165..756bef0e9e40 100644 --- a/sys/pci/if_de.c +++ b/sys/pci/if_de.c @@ -21,7 +21,7 @@ * (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: if_de.c,v 1.27 1995/05/26 02:02:44 davidg Exp $ + * $Id: if_de.c,v 1.28.2.1 1995/06/02 10:44:24 davidg Exp $ * */ @@ -916,7 +916,7 @@ tulip_start( addr += slen; clsize = CLBYTES; } - } while ((m0 = m0->m_next) != NULL); + } while ((m0 != NULL) && ((m0 = m0->m_next) != NULL)); /* * The packet exceeds the number of transmit buffer diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 730903413ccc..3c601b49fb4a 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -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.46 1995/05/21 21:39:30 davidg Exp $ + * $Id: vm_object.c,v 1.47.2.1 1995/06/04 13:53:25 davidg Exp $ */ /* @@ -616,9 +616,9 @@ vm_object_page_clean(object, start, end, syncio) struct vnode *vp; vp = vnp->vnp_vp; - vget(vp, 1); + VOP_LOCK(vp); _vm_object_page_clean(object, start, end, syncio); - vput(vp); + VOP_UNLOCK(vp); } else { _vm_object_page_clean(object, start, end, syncio); } |