Index: boot/i386/btx/btx/Makefile =================================================================== RCS file: /usr/cvs/src/sys/boot/i386/btx/btx/Makefile,v retrieving revision 1.13 diff -u -r1.13 Makefile --- boot/i386/btx/btx/Makefile 17 Sep 2002 01:48:54 -0000 1.13 +++ boot/i386/btx/btx/Makefile 7 Oct 2002 20:31:15 -0000 @@ -14,6 +14,14 @@ AFLAGS+= --defsym BTX_FLAGS=${BOOT_BTX_FLAGS} +.if defined(BTX_VERBOSE) +M4FLAGS+= -DBTX_VERBOSE +.endif + +.if defined(BTX_PARANOID) +M4FLAGS+= -DBTX_PARANOID +.endif + .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x3f8 BOOT_COMCONSOLE_SPEED?= 9600 Index: boot/i386/btx/btx/btx.s =================================================================== RCS file: /usr/cvs/src/sys/boot/i386/btx/btx/btx.s,v retrieving revision 1.32 diff -u -r1.32 btx.s --- boot/i386/btx/btx/btx.s 8 Oct 2002 18:19:02 -0000 1.32 +++ boot/i386/btx/btx/btx.s 9 Oct 2002 19:29:07 -0000 @@ -122,6 +122,10 @@ # # Initialize memory. # +ifdef(`oBTX_VERBOSE',` + mov $msg_start,%si # Display "starting" + call bios_putstr # message +') mov $MEM_IDT,%di # Memory to initialize mov $(MEM_ORG-MEM_IDT)/2,%cx # Words to zero push %di # Save @@ -131,6 +135,10 @@ # # Create IDT. # +ifdef(`BTX_VERBOSE',` + mov $msg_idt,%si # Display "setup IDT" + call bios_putstr # message +') mov $idtctl,%si # Control string init.1: lodsb # Get entry cbw # count @@ -154,7 +162,12 @@ # # Initialize TSS. # -init.4: movb $_ESP0H,TSS_ESP0+1(%di) # Set ESP0 +init.4: +ifdef(`BTX_VERBOSE',` + mov $msg_tss,%si # Display "init TSS" + call bios_putstr # message +') + movb $_ESP0H,TSS_ESP0+1(%di) # Set ESP0 movb $SEL_SDATA,TSS_SS0(%di) # Set SS0 movb $_ESP1H,TSS_ESP1+1(%di) # Set ESP1 movb $_TSSIO,TSS_MAP(%di) # Set I/O bit map base @@ -424,6 +437,9 @@ intrtn: cld # String ops inc pushl %ds # Address popl %es # data +ifdef(`BTX_PARANOID',` + call check_tss # Verify the TSS I/O bitmap +') leal 0x3c(%ebp),%edx # V86 Segment registers movl MEM_TSS+TSS_ESP1,%esi # Link stack pointer lodsl # INT_V86 args pointer @@ -467,6 +483,9 @@ pushl $SEL_SDATA # Set up for popl %ds # flat addressing pusha # Save registers +ifdef(`BTX_PARANOID',` + call check_tss # Verify the TSS I/O bitmap +') movl %esp,%ebp # Address stack frame movzwl 0x2c(%ebp),%edi # Load V86 CS shll $0x4,%edi # To linear @@ -523,13 +542,21 @@ movl %ebx,0x34(%ebp) # SP v86mon.7: subl %edi,%esi # From linear movl %esi,0x28(%ebp) # Save V86 IP +ifdef(`BTX_PARANOID',` + call check_tss # Verify the TSS I/O bitmap +') popa # Restore leal 0x8(%esp,1),%esp # Discard int no, error iret # To V86 mode # # Emulate MOV EAX,CR0. # -v86mov: movl %cr0,%eax # CR0 to +v86mov: +ifdef(`BTX_VERBOSE',` + pushl $msg_movcr0 # Display "mov cr0, %eax" + call verbose_msg # message +') + movl %cr0,%eax # CR0 to movl %eax,0x1c(%ebp) # saved EAX incl %esi # Adjust IP # @@ -562,17 +589,32 @@ # # Emulate CLI. # -v86cli: andb $~0x2,0x31(%ebp) # Clear IF +v86cli: +ifdef(`oBTX_VERBOSE',` + pushl $msg_cli # Display "cli" + call verbose_msg # message +') + andb $~0x2,0x31(%ebp) # Clear IF jmp v86mon.7 # Finish up # # Emulate STI. # -v86sti: orb $0x2,0x31(%ebp) # Set IF +v86sti: +ifdef(`oBTX_VERBOSE',` + pushl $msg_sti # Display "sti" + call verbose_msg # message +') + orb $0x2,0x31(%ebp) # Set IF jmp v86mon.7 # Finish up # # Emulate PUSHF/PUSHFD. # -v86pushf: subl %ecx,%ebx # Adjust SP +v86pushf: +ifdef(`oBTX_VERBOSE',` + pushl $msg_pushf # Display "pushf" + call verbose_msg # message +') + subl %ecx,%ebx # Adjust SP cmpb $0x4,%cl # 32-bit je v86pushf.1 # Yes data16 # 16-bit @@ -581,15 +623,28 @@ # # Emulate IRET/IRETD. # -v86iret: movzwl (%ebx),%esi # Load V86 IP +v86iret: +ifdef(`oBTX_VERBOSE',` + pushl $msg_iret # Display "iret" + call verbose_msg # message +') + movzwl (%ebx),%esi # Load V86 IP movzwl 0x2(%ebx),%edi # Load V86 CS leal 0x4(%ebx),%ebx # Adjust SP movl %edi,0x2c(%ebp) # Save V86 CS xorl %edi,%edi # No ESI adjustment +ifdef(`oBTX_VERBOSE',` + jmp v86popf.0 # skip popf message +') # # Emulate POPF/POPFD (and remainder of IRET/IRETD). # -v86popf: cmpb $0x4,%cl # 32-bit? +v86popf: +ifdef(`oBTX_VERBOSE',` + pushl $msg_popf # Display "popf" + call verbose_msg # message +') +v86popf.0: cmpb $0x4,%cl # 32-bit? je v86popf.1 # Yes movl %edx,%eax # Initialize data16 # 16-bit @@ -606,7 +661,11 @@ # reads count of words from saved %cx # returns success by setting %ah to 0 # -int15_87: pushl %eax # Save +int15_87: +ifdef(`BTX_PARANOID',` + call check_tss # Verify the TSS I/O bitmap +') + pushl %eax # Save pushl %ebx # some information pushl %esi # onto the stack. pushl %edi @@ -634,8 +693,41 @@ movw 0x18(%ebp),%cx # Get user's ECX shll $0x1,%ecx # Convert from num words to num # bytes +ifdef(`oBTX_VERBOSE',` + pushl %eax # save %eax + pushl %edi # save %edi + movl %edi,%eax # copy dest to %eax + movl $msg_int15_dest,%edi # output dest + call hex32 # in hex + movl %esi,%eax # copy src to %eax + movl $msg_int15_src,%edi # output src + call hex32 # in hex + movl %ecx,%eax # copy length to %eax + movl $msg_int15_len,%edi # output length + call hex32 # in hex + popl %edi # restore %edi + popl %eax # restore %eax + pushl $msg_int15 # display "int 15_87" + call verbose_msg # message +int15_copy: lodsb # get the next byte + pushl %eax # Save + pushl %edi # registers + pushl %esi # " + movl $msg_int15_byte+1,%edi # where to output %al + call hex8 # hexify %al + movl $msg_int15_byte,%esi # now display + call putstr # %al + popl %esi # Restore + popl %edi # registers + popl %eax # " + stosb # save the next byte + loop int15_copy # keep looping over each byte + movb $0xa,%al # terminate this line + call putchr # with a new line +',` rep # repeat... movsb # perform copy. +') popl %ecx # Restore popl %edi popl %esi # previous @@ -644,6 +736,9 @@ movb $0x0,0x1d(%ebp) # set ah = 0 to indicate # success andb $0xfe,%dl # clear CF +ifdef(`BTX_PARANOID',` + call check_tss # Verify the TSS I/O bitmap +') jmp v86mon.5 # Finish up # @@ -656,6 +751,22 @@ # Emulate INT imm8... also make sure to check if it's int 15/87 # v86intn: lodsb # Get int no +ifdef(`oBTX_VERBOSE',` + pushl %es # Save %es + pushl %ds # Copy %ds + popl %es # to %es + pushl %edi # Save %edi + pushl %eax # Save %eax + movl 0x1c(%ebp),%eax # Get saved value of %eax + movl $msg_int3, %edi # Where to display %ax + call hex16 # Display %ax + popl %eax # Restore %eax + popl %edi # Restore %edi + popl %es # Restore %es + pushl $msg_int2 # where to display int number + pushl $msg_int # display "int" + call verbose_data_msg # message +') cmpb $0x19,%al # is it int 19? je reboot # yes, reboot the machine cmpb $0x15,%al # is it int 15? @@ -731,6 +842,14 @@ pushl $SEL_SDATA # Address popl %ds # data xchgl %eax,(%esp,1) # Swap EAX, int no +ifdef(`oBTX_VERBOSE',` + cmpb $0x8, %al # is this the timer interrupt? + je skip_irq0 # if so, skip it + pushl $msg_inthw2 # where to display %ax to print + pushl $msg_inthw # message to print + call verbose_data_msg # output message +skip_irq0: +') pushl %ebp # Address movl %esp,%ebp # stack frame pushl %ebx # Save @@ -774,6 +893,9 @@ popl %ds # to pushl %ds # address popl %es # data +ifdef(`BTX_PARANOID',` + call check_tss # Verify the TSS I/O bitmap +') movl $MEM_USR,%ebx # User base movl %ebx,%edx # address jc intusr.1 # If btx_v86 @@ -790,6 +912,11 @@ movsl # link stack xchgl %eax,%esi # Saved seg regs movl 0x40(%esp,1),%eax # Get int no +ifdef(`oBTX_VERBOSE',` + pushl $msg_intusr2 # display + pushl $msg_intusr # "int user" + call verbose_data_msg # message +') testl %edx,%edx # Have btx_v86? jz intusr.2 # No movl (%ebx),%ebp # btx_v86 pointer @@ -1086,7 +1213,95 @@ popa # Restore ret # To caller ') + +ifdef(`BTX_VERBOSE',` +# +# This method saves all necessary registers and then displays the message whose +# offset is the parameter on the stack. +# +verbose_msg: xchgl %esi,4(%esp) # Save %esi and %esi -> message + pushl %es # Save %es + pushl %ds # Copy %ds + popl %es # to %es + pushl %eax # Save %eax + call putstr # Display the message + popl %eax # Restore %eax + popl %es # Restore %es + movl 4(%esp),%esi # Restore %esi + ret $0x4 # Return and discard parameter + +# +# This method takes two parameters, the first is where to display the hex +# representation of %al. The second is the main string to display. +# +verbose_data_msg: xchgl %edi,8(%esp) # Save %edi and %edi -> %al dest + xchgl %esi,4(%esp) # Save %esi and %esi -> message + pushl %es # Save %es + pushl %ds # Copy %ds + popl %es # to %es + pushl %eax # Save %eax + call hex8 # Output %al in hex + call putstr # Display the message + popl %eax # Restore %eax + popl %es # Restore %es + movl 4(%esp),%esi # Restore %esi + movl 8(%esp),%edi # Restore %edi + ret $0x8 # Return and discard parameters + +# +# Real mode putstr routine that calls the BIOS, outputs ASCIZ [si] to the screen +# + .code16 +bios_putstr: pushw %ax # Save + pushw %bx # registers + movb $0xe, %ah # BIOS: output teletype char + movw $0x7, %bx # setup the page and color +bios_loop: lodsb # get char + orb %al,%al # is it null? + jnz bios_display # if not, display it + popw %bx # Restore + popw %ax # registers + ret # if it is, return +bios_display: pushf # emulate an int 0x10 since we + lcall *%ds:0x40 # the IDT may not be setup + jmp bios_loop # do the next char + .code32 +') +ifdef(`BTX_PARANOID',` +# +# This function checks the integrity of the TSS I/O bitmap +# +check_tss: pushl %eax # Save + pushl %ecx # registers + pushfl # " + pushl %edi # " + pushl %esi # " + pushl %es # " + pushl %ds # Setup %es with + popl %es # the flat selector + movl $MEM_MAP, %edi # (%edi) -> I/O bitmap + xorl %eax, %eax # %eax = 0 + movl $((MEM_DIR-MEM_MAP)/4), %ecx # size of bitmap + cld # going forward + repe # check the + scasl # bitmap + jecxz tss_ok # if ok, just exit + movl %edi, %eax # save address of bad dword + movl $msg_tssbad2, %edi # display the low word + call hex16 # of the address + movl $msg_tssbad, %esi # now display the + call putstr # error message + jmp exit # reboot or hang +tss_ok: popl %es # Restore + popl %esi # registers + popl %edi # " + popfl # " + popl %ecx # " + popl %eax # " + ret # return +') + .p2align 4 # # Global descriptor table. @@ -1166,6 +1381,41 @@ .ascii "ss:esp" # "ss:esp=" .byte 0x80|DMP_MEM|DMP_EOL,0x0 # "00 00 ... 00 00\n" .asciz "BTX halted\n" # End + +ifdef(`BTX_VERBOSE',` +# +# Extra messages +# +msg_start: .ascii "BTX started\r\n" + .asciz "Clearing memory...\r\n" +msg_idt: .asciz "Setting up IDT...\r\n" +msg_tss: .asciz "Initializing TSS...\r\n" +msg_movcr0: .asciz "v86: mov %cr0, %eax\n" +msg_cli: .asciz "v86: cli\n" +msg_sti: .asciz "v86: sti\n" +msg_pushf: .asciz "v86: pushf\n" +msg_iret: .asciz "v86: iret\n" +msg_popf: .asciz "v86: popf\n" +msg_int15: .ascii "v86: int 15, function 87\n" + .ascii " src=" +msg_int15_src: .ascii "XXXXXXXX dest=" +msg_int15_dest: .ascii "XXXXXXXX length=" +msg_int15_len: .asciz "XXXXXXXX\n" +msg_int15_byte: .asciz " XX " +msg_int: .ascii "v86: int " +msg_int2: .ascii "XX %ax=" +msg_int3: .asciz "XXXX\n" +msg_inthw: .ascii "v86: int_hw " +msg_inthw2: .asciz "XX\n" +msg_intusr: .ascii "v86: int_usr " +msg_intusr2: .asciz "XX\n" +') + +ifdef(`BTX_PARANOID',` +msg_tssbad: .ascii "TSS corrupt @" +msg_tssbad2: .asciz "XXXX\n" +') + # # End of BTX memory. # Index: cam/scsi/scsi_da.c =================================================================== RCS file: /usr/cvs/src/sys/cam/scsi/scsi_da.c,v retrieving revision 1.144 diff -u -r1.144 scsi_da.c --- cam/scsi/scsi_da.c 10 Jun 2003 18:14:04 -0000 1.144 +++ cam/scsi/scsi_da.c 27 Jun 2003 18:10:24 -0000 @@ -685,6 +685,9 @@ &asc, &ascq); if (sense_key != SSD_KEY_ILLEGAL_REQUEST) scsi_sense_print(&ccb->csio); + } else if ((ccb->ccb_h.status & CAM_STATUS_MASK) == + CAM_REQ_INVALID) { + softc->quirks |= DA_Q_NO_SYNC_CACHE; } else { xpt_print_path(periph->path); printf("Synchronize cache failed, status " @@ -796,6 +799,7 @@ if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) return (ENXIO); + restart_ccb: if (length > 0) { xpt_setup_ccb(&csio.ccb_h, periph->path, /*priority*/1); csio.ccb_h.ccb_state = DA_CCB_DUMP; @@ -815,6 +819,12 @@ xpt_polled_action((union ccb *)&csio); if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if ((csio.ccb_h.status & CAM_STATUS_MASK) == + CAM_REQ_INVALID && softc->minimum_cmd_size == 6) { + softc->quirks |= DA_Q_NO_6_BYTE; + softc->minimum_cmd_size = 10; + goto restart_ccb; + } printf("Aborting dump due to I/O error.\n"); if ((csio.ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR) Index: ddb/db_ps.c =================================================================== RCS file: /usr/cvs/src/sys/ddb/db_ps.c,v retrieving revision 1.46 diff -u -r1.46 db_ps.c --- ddb/db_ps.c 15 Jun 2003 00:31:22 -0000 1.46 +++ ddb/db_ps.c 27 Jun 2003 18:10:35 -0000 @@ -48,6 +48,8 @@ static void dumpthread(volatile struct proc *p, volatile struct thread *td); +#define NUM_PROCS_PER_PAGE 18 + void db_ps(dummy1, dummy2, dummy3, dummy4) db_expr_t dummy1; @@ -56,12 +58,13 @@ char * dummy4; { int np; - int nl = 0; + int nl; volatile struct proc *p, *pp; volatile struct thread *td; char *state; np = nprocs; + nl = NUM_PROCS_PER_PAGE - 1; /* Count the header as a line. */ /* sx_slock(&allproc_lock); */ if (!LIST_EMPTY(&allproc)) @@ -71,10 +74,7 @@ db_printf(" pid proc addr uid ppid pgrp flag stat wmesg wchan cmd\n"); while (--np >= 0) { - /* - * XXX just take 20 for now... - */ - if (nl++ >= 20) { + if (nl-- <= 0) { int c; db_printf("--More--"); @@ -85,10 +85,11 @@ */ switch (c) { case '\n': /* just one line */ - nl = 20; + nl = 1; break; case ' ': - nl = 0; /* another screenfull */ + /* another screenfull */ + nl = NUM_PROCS_PER_PAGE; break; default: /* exit */ db_printf("\n"); @@ -131,7 +132,7 @@ db_printf("(threaded) %s\n", p->p_comm); FOREACH_THREAD_IN_PROC(p, td) { dumpthread(p, td); - nl++; + nl--; } /* PROC_UNLOCK(p); */ Index: dev/nge/if_nge.c =================================================================== RCS file: /usr/cvs/src/sys/dev/nge/if_nge.c,v retrieving revision 1.45 diff -u -r1.45 if_nge.c --- dev/nge/if_nge.c 16 Apr 2003 03:16:55 -0000 1.45 +++ dev/nge/if_nge.c 16 Apr 2003 17:14:12 -0000 @@ -141,6 +141,7 @@ static struct nge_type nge_devs[] = { { NGE_VENDORID, NGE_DEVICEID, "National Semiconductor Gigabit Ethernet" }, + { 0x1186, 0x4000, "D-Link DL2000 Gigabit Ethernet" }, { 0, 0, NULL } }; Index: dev/pci/pcivar.h =================================================================== RCS file: /usr/cvs/src/sys/dev/pci/pcivar.h,v retrieving revision 1.61 diff -u -r1.61 pcivar.h --- dev/pci/pcivar.h 16 Apr 2003 03:15:08 -0000 1.61 +++ dev/pci/pcivar.h 16 Apr 2003 17:14:12 -0000 @@ -163,7 +163,7 @@ #define PCI_RF_BWX 0x20000 enum pci_device_ivars { - PCI_IVAR_SUBVENDOR, + PCI_IVAR_SUBVENDOR = 0x20, PCI_IVAR_SUBDEVICE, PCI_IVAR_VENDOR, PCI_IVAR_DEVICE, Index: dev/rc/rc.c =================================================================== RCS file: /usr/cvs/src/sys/dev/rc/rc.c,v retrieving revision 1.80 diff -u -r1.80 rc.c --- dev/rc/rc.c 5 Mar 2003 08:16:28 -0000 1.80 +++ dev/rc/rc.c 6 Mar 2003 18:31:15 -0000 @@ -709,9 +709,7 @@ int chan, icnt; sc = (struct rc_softc *)arg; - if (sc->sc_scheduled_event == 0) - return; - do { + while (sc->sc_scheduled_event > 0) { rc = sc->sc_channels; for (chan = 0; chan < CD180_NCHAN; rc++, chan++) { tp = &rc->rc_tp; @@ -817,9 +815,9 @@ (*linesw[tp->t_line].l_start)(tp); } if (sc->sc_scheduled_event == 0) - break; + return; } - } while (sc->sc_scheduled_event >= LOTS_OF_EVENTS); + } } static void Index: dev/usb/usb.c =================================================================== RCS file: /usr/cvs/src/sys/dev/usb/usb.c,v retrieving revision 1.87 diff -u -r1.87 usb.c --- dev/usb/usb.c 14 Apr 2003 14:04:07 -0000 1.87 +++ dev/usb/usb.c 9 Jun 2003 19:03:20 -0000 @@ -323,7 +323,7 @@ if (!created) { created = 1; TAILQ_INIT(&usb_all_tasks); - if (usb_kthread_create2(usb_task_thread, NULL, + if (usb_kthread_create1(usb_task_thread, NULL, &usb_task_thread_proc, "usbtask")) { printf("unable to create task thread\n"); panic("usb_create_event_thread task"); Index: dev/usb/usb_port.h =================================================================== RCS file: /usr/cvs/src/sys/dev/usb/usb_port.h,v retrieving revision 1.59 diff -u -r1.59 usb_port.h --- dev/usb/usb_port.h 31 May 2003 19:38:43 -0000 1.59 +++ dev/usb/usb_port.h 9 Jun 2003 19:02:54 -0000 @@ -361,10 +361,8 @@ #define uio_procp uio_td -#define usb_kthread_create1(f, s, p, a0, a1) \ - kthread_create((f), (s), (p), RFHIGHPID, 0, (a0), (a1)) -#define usb_kthread_create2(f, s, p, a0) \ - kthread_create((f), (s), (p), RFHIGHPID, 0, (a0)) +#define usb_kthread_create1(f, s, p, ...) \ + kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__) #define usb_kthread_create kthread_create #define config_pending_incr() Index: i386/i386/legacy.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/legacy.c,v retrieving revision 1.51 diff -u -r1.51 legacy.c --- i386/i386/legacy.c 13 Jun 2003 00:43:57 -0000 1.51 +++ i386/i386/legacy.c 27 Jun 2003 18:11:17 -0000 @@ -134,7 +134,8 @@ * Fail to probe if ACPI is ok. */ acpi = devclass_get_device(devclass_find("acpi"), 0); - if (acpi != NULL && device_is_alive(acpi)) + if (acpi != NULL && device_is_alive(acpi) && + devclass_get_device(devclass_find("pcib"), 0) != NULL) return (ENXIO); device_set_desc(dev, "legacy system"); device_quiet(dev); Index: kern/kern_condvar.c =================================================================== RCS file: /usr/cvs/src/sys/kern/kern_condvar.c,v retrieving revision 1.42 diff -u -r1.42 kern_condvar.c --- kern/kern_condvar.c 11 Jun 2003 00:56:55 -0000 1.42 +++ kern/kern_condvar.c 27 Jun 2003 18:11:33 -0000 @@ -296,8 +296,6 @@ rval = ERESTART; } mtx_unlock(&p->p_sigacts->ps_mtx); - if (p->p_flag & P_WEXIT) - rval = EINTR; PROC_UNLOCK(p); #ifdef KTRACE @@ -461,8 +459,6 @@ rval = ERESTART; } mtx_unlock(&p->p_sigacts->ps_mtx); - if (p->p_flag & P_WEXIT) - rval = EINTR; PROC_UNLOCK(p); #ifdef KTRACE Index: kern/kern_intr.c =================================================================== RCS file: /usr/cvs/src/sys/kern/kern_intr.c,v retrieving revision 1.98 diff -u -r1.98 kern_intr.c --- kern/kern_intr.c 1 Jul 2003 16:00:38 -0000 1.98 +++ kern/kern_intr.c 1 Jul 2003 18:06:46 -0000 @@ -536,22 +536,20 @@ mtx_unlock(&Giant); } } + WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread"); + mtx_assert(&Giant, MA_NOTOWNED); + + if (ithd->it_enable != NULL) + ithd->it_enable(ithd->it_vector); /* * Processed all our interrupts. Now get the sched * lock. This may take a while and it_need may get * set again, so we have to check it again. */ - WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread"); - mtx_assert(&Giant, MA_NOTOWNED); mtx_lock_spin(&sched_lock); if (!ithd->it_need) { - /* - * Should we call this earlier in the loop above? - */ - if (ithd->it_enable != NULL) - ithd->it_enable(ithd->it_vector); - TD_SET_IWAIT(td); /* we're idle */ + TD_SET_IWAIT(td); p->p_stats->p_ru.ru_nvcsw++; CTR2(KTR_INTR, "%s: pid %d: done", __func__, p->p_pid); mi_switch(); Index: kern/kern_proc.c =================================================================== RCS file: /usr/cvs/src/sys/kern/kern_proc.c,v retrieving revision 1.190 diff -u -r1.190 kern_proc.c --- kern/kern_proc.c 17 Jun 2003 19:14:00 -0000 1.190 +++ kern/kern_proc.c 27 Jun 2003 18:11:34 -0000 @@ -911,10 +911,10 @@ return (EINVAL); p = pfind((pid_t)name[0]); if (!p) - return (0); + return (ESRCH); if (p_cansee(curthread, p)) { PROC_UNLOCK(p); - return (0); + return (ESRCH); } error = sysctl_out_proc(p, req, KERN_PROC_NOTHREADS); return (error); @@ -1090,11 +1090,11 @@ p = pfind((pid_t)name[0]); if (!p) - return (0); + return (ESRCH); if ((!ps_argsopen) && p_cansee(curthread, p)) { PROC_UNLOCK(p); - return (0); + return (ESRCH); } if (req->newptr && curproc != p) { Index: kern/subr_smp.c =================================================================== RCS file: /usr/cvs/src/sys/kern/subr_smp.c,v retrieving revision 1.176 diff -u -r1.176 subr_smp.c --- kern/subr_smp.c 12 Jun 2003 19:46:51 -0000 1.176 +++ kern/subr_smp.c 27 Jun 2003 18:11:35 -0000 @@ -90,7 +90,7 @@ static void (*smp_rv_action_func)(void *arg); static void (*smp_rv_teardown_func)(void *arg); static void *smp_rv_func_arg; -static volatile int smp_rv_waiters[2]; +static volatile int smp_rv_waiters[3]; static struct mtx smp_rv_mtx; static int mp_probe_status; @@ -273,19 +273,23 @@ smp_rendezvous_action(void) { + /* Ensure we have up-to-date values. */ + atomic_add_acq_int(&smp_rv_waiters[0], 1); + while (smp_rv_waiters[0] < mp_ncpus) + ; /* nothing */ /* setup function */ if (smp_rv_setup_func != NULL) smp_rv_setup_func(smp_rv_func_arg); /* spin on entry rendezvous */ - atomic_add_int(&smp_rv_waiters[0], 1); - while (atomic_load_acq_int(&smp_rv_waiters[0]) < mp_ncpus) + atomic_add_acq_int(&smp_rv_waiters[1], 1); + while (smp_rv_waiters[0] < mp_ncpus) ; /* nothing */ /* action function */ if (smp_rv_action_func != NULL) smp_rv_action_func(smp_rv_func_arg); /* spin on exit rendezvous */ - atomic_add_int(&smp_rv_waiters[1], 1); - while (atomic_load_acq_int(&smp_rv_waiters[1]) < mp_ncpus) + atomic_add_acq_int(&smp_rv_waiters[2], 1); + while (smp_rv_waiters[1] < mp_ncpus) ; /* nothing */ /* teardown function */ if (smp_rv_teardown_func != NULL) @@ -317,8 +321,9 @@ smp_rv_action_func = action_func; smp_rv_teardown_func = teardown_func; smp_rv_func_arg = arg; - smp_rv_waiters[0] = 0; - smp_rv_waiters[1] = 0; + atomic_store_rel_int(&smp_rv_waiters[0], 0); + atomic_store_rel_int(&smp_rv_waiters[1], 0); + atomic_store_rel_int(&smp_rv_waiters[2], 0); /* signal other processors, which will enter the IPI with interrupts off */ ipi_all_but_self(IPI_RENDEZVOUS); Index: kern/subr_witness.c =================================================================== RCS file: /usr/cvs/src/sys/kern/subr_witness.c,v retrieving revision 1.155 diff -u -r1.155 subr_witness.c --- kern/subr_witness.c 11 Jun 2003 00:56:57 -0000 1.155 +++ kern/subr_witness.c 27 Jun 2003 18:11:36 -0000 @@ -270,6 +270,9 @@ { "uidinfo struct", &lock_class_mtx_sleep }, { "allprison", &lock_class_mtx_sleep }, { NULL, NULL }, + { "pipe mutex", &lock_class_mtx_sleep }, + { "sigio lock", &lock_class_mtx_sleep }, + { NULL, NULL }, /* * spin locks */ Index: kern/vfs_syscalls.c =================================================================== RCS file: /usr/cvs/src/sys/kern/vfs_syscalls.c,v retrieving revision 1.323 diff -u -r1.323 vfs_syscalls.c --- kern/vfs_syscalls.c 22 Jun 2003 23:03:07 -0000 1.323 +++ kern/vfs_syscalls.c 27 Jun 2003 18:11:37 -0000 @@ -679,7 +679,7 @@ fp = nfp; cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT; NDINIT(&nd, LOOKUP, FOLLOW, pathseg, path, td); - td->td_dupfd = -indx - 1; /* XXX check for fdopen */ + td->td_dupfd = -1; /* XXX check for fdopen */ /* * Bump the ref count to prevent another process from closing * the descriptor while we are blocked in vn_open() Index: net/if_var.h =================================================================== RCS file: /usr/cvs/src/sys/net/if_var.h,v retrieving revision 1.58 diff -u -r1.58 if_var.h --- net/if_var.h 1 Jan 2003 18:48:54 -0000 1.58 +++ net/if_var.h 2 Jan 2003 17:08:21 -0000 @@ -80,6 +80,10 @@ #ifdef _KERNEL #include #endif /* _KERNEL */ +/* + * XXX: These should only be #ifdef _KERNEL. Mutexes are not exported + * to userland. + */ #include /* XXX */ #include /* XXX */ #include /* XXX */ @@ -128,7 +132,7 @@ */ struct ifnet { void *if_softc; /* pointer to driver state */ - char *if_name; /* name, e.g. ``en'' or ``lo'' */ + const char *if_name; /* name, e.g. ``en'' or ``lo'' */ TAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained */ struct ifaddrhead if_addrhead; /* linked list of addresses per if */ struct klist if_klist; /* events attached to this if */ Index: pci/if_dc.c =================================================================== RCS file: /usr/cvs/src/sys/pci/if_dc.c,v retrieving revision 1.111 diff -u -r1.111 if_dc.c --- pci/if_dc.c 8 Jun 2003 10:11:55 -0000 1.111 +++ pci/if_dc.c 27 Jun 2003 18:12:29 -0000 @@ -1364,8 +1364,12 @@ static void dc_setcfg(struct dc_softc *sc, int media) { +#if 0 int i, restart = 0, watchdogreg; u_int32_t isr; +#else + int restart = 0, watchdogreg; +#endif if (IFM_SUBTYPE(media) == IFM_NONE) return; @@ -1374,6 +1378,7 @@ restart = 1; DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_TX_ON | DC_NETCFG_RX_ON)); +#if 0 for (i = 0; i < DC_TIMEOUT; i++) { isr = CSR_READ_4(sc, DC_ISR); if (isr & DC_ISR_TX_IDLE && @@ -1386,6 +1391,7 @@ if (i == DC_TIMEOUT) printf("dc%d: failed to force tx and " "rx to idle state\n", sc->dc_unit); +#endif } if (IFM_SUBTYPE(media) == IFM_100_TX) { @@ -2851,6 +2857,11 @@ if (DC_IS_INTEL(sc)) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON); + + if (DC_IS_ADMTEK(sc)) { + /* Enable automatic TX underrun recovery. */ + DC_SETBIT(sc, DC_AL_CR, DC_AL_CR_ATUR); + } } #ifdef DEVICE_POLLING Index: pci/if_dcreg.h =================================================================== RCS file: /usr/cvs/src/sys/pci/if_dcreg.h,v retrieving revision 1.33 diff -u -r1.33 if_dcreg.h --- pci/if_dcreg.h 8 Jun 2003 10:11:55 -0000 1.33 +++ pci/if_dcreg.h 27 Jun 2003 18:12:29 -0000 @@ -539,8 +539,8 @@ #define DC_AL_LPAR 0xC8 /* bnilt in PHY link part. ability */ #define DC_AL_ANER 0xCC /* built in PHY autoneg expansion */ -#define DC_AL_CR_ATUR 0x00000001 /* automatic TX underrun recovery */ #define DC_ADMTEK_PHYADDR 0x1 +#define DC_AL_CR_ATUR 0x00000001 /* Automatic TX underrun recovery. */ #define DC_AL_EE_NODEADDR 4 /* End of ADMtek specific registers */ Index: sys/mdioctl.h =================================================================== RCS file: /usr/cvs/src/sys/sys/mdioctl.h,v retrieving revision 1.13 diff -u -r1.13 mdioctl.h --- sys/mdioctl.h 9 Apr 2003 11:59:28 -0000 1.13 +++ sys/mdioctl.h 9 Apr 2003 20:20:43 -0000 @@ -61,7 +61,7 @@ char *md_file; /* pathname of file to mount */ unsigned md_size; /* size of disk in DEV_BSIZE units */ unsigned md_options; /* options */ - u_int64_t md_base; /* base address */ + uintptr_t md_base; /* base address */ int md_secsize; /* sectorsize */ int md_fwheads; /* firmware heads */ int md_fwsectors; /* firmware sectors */ Index: vm/vm_page.h =================================================================== RCS file: /usr/cvs/src/sys/vm/vm_page.h,v retrieving revision 1.118 diff -u -r1.118 vm_page.h --- vm/vm_page.h 25 Mar 2003 00:07:06 -0000 1.118 +++ vm/vm_page.h 27 Mar 2003 22:50:22 -0000 @@ -71,7 +71,7 @@ #ifndef _VM_PAGE_ #define _VM_PAGE_ -#if !defined(KLD_MODULE) +#if defined(_KERNEL) && !defined(KLD_MODULE) #include "opt_vmpage.h" #endif @@ -219,7 +219,7 @@ extern struct vpgqueues vm_page_queues[PQ_COUNT]; extern struct mtx vm_page_queue_free_mtx; -#endif /* !defined(KLD_MODULE) */ +#endif /* defined(_KERNEL) && !defined(KLD_MODULE) */ /* * These are the flags defined for vm_page.