summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Clean up RST ratelimiting. Previously, ratelimiting occured before testsbmilekic2001-02-115-78/+109
| | | | | | | | | | | were performed to determine if the received packet should be reset. This created erroneous ratelimiting and false alarms in some cases. The code has now been reorganized so that the checks for validity come before the call to badport_bandlim. Additionally, a few changes in the symbolic names of the bandlim types have been made, as well as a clarification of exactly which type each RST case falls under. Submitted by: Mike Silbersack <silby@silby.com>
* Long awaited style fixup in mbuf code. Get rid of K&R style prototypingbmilekic2001-02-113-187/+136
| | | | | | and function argument declarations. Make sure that functions that are supposed to return a pointer return NULL in case of failure. Don't cast NULL. Finally, get rid of annoying `register' uses.
* Eliminate ISP2100_FABRIC- we always allow for fabric now. Add anmjacob2001-02-111-19/+86
| | | | | | | | | isp_iid_set/isp_iid for fibre channel- this is because we now fake a port database entry for ourselves. Add the additional loop states between LOOP_PDB_RCVD and LOOP_READY. Change and comment on a wad of Fibre Channel isp_control functions. Change and comment on some of the ISPASYNC Fibre Channel events.
* Add structure defining FC-AL position maps. The only tool that I know ofmjacob2001-02-111-0/+16
| | | | that really uses this is luxadm(8) under Solaris.
* Shuffle around how we do isp_disable management- make sure we return 0 somjacob2001-02-111-21/+25
| | | | | | | | | the unit number doesn't get reused. Make sure that if we've compiled for ISP_TARGET_MODE we set the default role to be ISP_ROLE_INITIATOR|ISP_ROLE_TARGET. Do some misc other cleanups.
* Add isp_fc_runstate function- this function's purpose is to, in stages,mjacob2001-02-111-0/+54
| | | | | | | | and depending on role, make sure link is up, scan the fabric (if we're connected to a fabric), scan the local loop (if appropriate), merge the results into the local port database then, check once again to make sure we have f/w at FW_READY state and the the loopstate is LOOP_READY.
* Roll minor version. Remove ISP2100_FABRIC define (unneeded now).mjacob2001-02-111-2/+6
| | | | | | | Comment out usage of ISP_SMPLOCK- I have my doubts that this works sanely as yet because CAM itself still needs Giant. I *was* dropping my lock and grabbing Giant when doing the upcall for completion, but this is all seems ridiculous until CAM is fixed.
* Do some cleanup based upon adapter role- mainly not enabling interruptsmjacob2001-02-111-35/+33
| | | | | | | | | | | if we're ISP_ROLE_NONE. Change ISPASYNC_LOGGED_INOUT to ISPASYNC_PROMENADE. Make sure we note if something is a fabric device. Target mode: Finally fix (to a first approximation) SCSI Target Mode again- we needed to correctly check against CAM_TARGET_WILDCARD and CAM_LUN_WILDCARD so that targbh won't confuse us. Comment out the drainqueue stuff for now. Use isp_fc_runstate instead if isp_control/ISPCTL_FCLINK_TEST.
* Minor stuff:mjacob2001-02-111-370/+593
| | | | | | | | | | | | | | | | | | | | | | | Remove ISP2100_FABRIC defines- we always handle fabric now. Insert isp_getmap helper function (for getting Loop Position map). Make sure we (for our own benefit) mark req_state_flags with RQSF_GOT_SENSE for Fibre Channel if we got sense data- the !*$)!*$)~*$)*$ Qlogic f/w doesn't do so. Add ISPCTL_SCAN_FABRIC, ISPCTL_SCAN_LOOP, ISPCTL_SEND_LIP, and ISPCTL_GET_POSMAP isp_control functions. Correctly send async notifications upstream for changes in the name server, changes in the port database, and f/w crashes. Correctly set topology when we get a ASYNC_PTPMODE event. Major stuff: Quite massively redo how we handle Loop events- we've now added several intermediate states between LOOP_PDB_RCVD and LOOP_READY. This allows us a lot finer control about how we scan fabric, whether we go further than scanning fabric, how we look at the local loop, and whether we merge entries at the level or not. This is the next to last step for moving managing loop state out of the core module entirely (whereupon loop && fabric events will simply freeze the command queue and a thread will run to figure out what's changed and *it* will re-enable the queu). This fine amount of control also gets us closer to having an external policy engine decide which fabric devices we really want to log into.
* update to latest and greatest f/wmjacob2001-02-115-11570/+13592
|
* - Place back STR string declarations for lock/unlock strings used for KTR_LOCKbmilekic2001-02-114-45/+92
| | | | | | | | | | | | | | | tracing in order to avoid duplication. - Insert some tracepoints back into the mutex acq/rel code, thus ensuring that we can trace all lock acq/rel's again. - All CURPROC != NULL checks are MPASS()es (under MUTEX_DEBUG) because they signify a serious mutex corruption. - Change up some KASSERT()s to MPASS()es, and vice-versa, depending on the type of problem we're debugging (INVARIANTS is used here to check that the API is being used properly whereas MUTEX_DEBUG is used to ensure that something general isn't happening that will have bad impact on mutex locks). Reminded by: jhb, jake, asmodai
* Temporary workaround to get things to compile. I could have updatedmjacob2001-02-102-2/+9
| | | | | | | | genassym here, but what I've also noticed is that we're dorking with a mutex directly at assembler level- I'm not sure that this is wise at this stage in the SMP port- I think it's going to be much safer for a while to do things in C until SMP wunderkind figure out what works and slow down this 3 order differential...
* Clear the reschedule flag after finding it set in userret(). Thisjake2001-02-104-0/+4
| | | | | used to be in cpu_switch(), but I don't see any difference between doing it here.
* Acquire sched_lock around need_resched() in roundrobin() to satisfyjake2001-02-101-8/+4
| | | | | assertions that it is held. Since roundrobin() is a timeout there's no possible way that it could be called with sched_lock held.
* aic7xxx.c:gibbs2001-02-105-78/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Style nits. Make sure that our selection hardware is disabled as soon as possible after detecting a busfree and even go so far as to disable the selection hardware in advance of an event that will cause a busfree (ABORT or BUS DEVICE RESET message). The concern is that the selection hardware will select a target for which, after processing the bus free, there will be no commands pending. The sequencer idle loop will re-enable the selection should it still be necessary. In ahc_handle_scsiint(), clear SSTAT0 events several PCI transactions (most notably reads) prior to clearing SCSIINT. The newer chips seem to take a bit of time to see the change which can make the clearing of SCSIINT ineffective. Don't bother panicing at the end of ahc_handle_scsiint(). Getting to the final else just means we lost the race with clearing SCSIINT. In ahc_free(), handle init-level 0. This can happen when we fail the attach for RAID devices. While I'm here, also kill the parent dma tag. In ahc_match_scb(), consider initiator ccbs to be any that are not from the target mode group. This fixes a bug where an external target reset CCB was not getting cleaned up by the reset code. Don't bother freezing a ccb in any of our "abort" routines when the status is set to CAM_REQ_CMP. This can happen for a target reset ccb. aic7xxx.reg: Reserve space for a completion queue. This will be used to enhance performance in the near future. aic7xxx.seq: Remove an optimization for the 7890 autoflush bug that turned out to allow, in rare cases, some data to get lost. Implement a simpler, faster, fix for the PCI_2_1 retry bug that hangs the sequencer on an SCB dma for certain chips. Test against SAVED_SCSIID rather than SELID during target reselections. This is how we always did it in the past, but the code was modified while trying to work around an issue with the 7895. SAVED_SCSIID takes into account twin channel adapters such as the 2742T, whereas SELID does not have the channel bit. This caused invalid selection warnings and other strangeness on these cards. aic7xxx_pci.c Use the correct mask for checking the generic aic7892 entry.
* Add pc98 support.nyan2001-02-101-0/+4
|
* Reenable preemption on interrupts. My last commit accidentally revertedjhb2001-02-101-1/+13
| | | | | | | it as I was playing with some other ways of doing kernel preemption. You must still specify the PREEMPTION option in your config file to get a preemptive kernel.
* Re-enable preemption on interrupts. My last commit accidentally revertedjhb2001-02-102-2/+16
| | | | it as I was playing with some other ways of doing kernel preemption.
* - Make astpending and need_resched process attributes rather than CPUjhb2001-02-1032-227/+171
| | | | | | | | | | | attributes. This is needed for AST's to be properly posted in a preemptive kernel. They are backed by two new flags in p_sflag: PS_ASTPENDING and PS_NEEDRESCHED. They are still accesssed by their old macros: aston(), astoff(), etc. For completeness, an astpending() macro has been added to check for a pending AST, and clear_resched() has been added to clear need_resched(). - Rename syscall2() on the x86 back to syscall() to be consistent with other architectures.
* Add a macro mtx_intr_enable() to alter a spin lock such that interruptsjhb2001-02-104-0/+4
| | | | will be enabled when it is released.
* Sync with the bridge/dummynet/ipfw code already tested in stable.luigi2001-02-106-132/+113
| | | | | In ip_fw.[ch] change a couple of variable and field names to avoid having types, variables and fields with the same name.
* Revert the spin mutex for the cy(4) driver.jhb2001-02-093-207/+456
| | | | Requested by: bde
* Unify the two sleep lock order lists to enforce the process lock ->jhb2001-02-093-6/+6
| | | | uidinfo lock locking order.
* Revert the previous revision for two reasons:jhb2001-02-091-2/+0
| | | | | | | - I can't seem to reproduce the warning I got from WITNESS anymore. - The fix was wrong. Since a uidinfo struct is a member of proc, it makes sense for the locking order to be such that you are allowed to hold proc and then grab the uidinfo lock.
* Work around some sizeof(long) != sizeof(int) bogons.jhb2001-02-092-3/+3
|
* Catch up to the new swi API.jhb2001-02-092-14/+12
|
* - Use a spin mutex instead of COM_LOCK, since COM_LOCK is going away.jhb2001-02-093-495/+249
| | | | | | The same name from the sio(4) driver was used and an appropriate dictionary item added at the top to reduce diffs. - Catch up to the new swi API.
* Use the MI ithread helper functions in the alpha hardware interrupt code.jhb2001-02-099-266/+63
|
* Catch up to changes to inthand_add().jhb2001-02-095-40/+40
|
* Use the MI ithread helper functions in the x86 interrupt code.jhb2001-02-0912-886/+402
|
* - Catch up to the new swi API changes:jhb2001-02-098-41/+39
| | | | | | | - Use swi_* function names. - Use void * to hold cookies to handlers instead of struct intrhand *. - In sio.c, use 'driver_name' instead of "sio" as the name of the driver lock to minimize diffs with cy(4).
* - Move struct ithd to sys/interrupt.h.jhb2001-02-093-121/+364
| | | | | | | | | | | | | | | - Add a set of MI helper functions for interrupt threads: - ithread_create() creates a new interrupt thread - ithread_destroy() destroys an interrupt thread - ithread_add_handler() attaches a new handler to an interrupt thread - ithread_remove_handler() detaches a handler from an interrupt thread - Rename sinthand_add() and sched_swi() to swi_add() and swi_sched() respectively so that they live in a consistent namespace. - struct intrhand is no longer a public type. It would be private to kern_intr.c but the current implementation of fast interrupts on the alpha requires the type to be exported. However, all handlers should be treated as void * cookies in the way that new-bus treats them. This includes references to software interrupt handlers.
* Add a new SYSINIT for interrupt thread initialization and stickjhb2001-02-091-1/+2
| | | | initialization right after it.
* Axe INTR_HEAVY, INTR_LIGHT, and INTR_THREADED. Add in a INTR_TYPE_CLKjhb2001-02-091-4/+3
| | | | | priorirty for clock interrupt handlers and an INTR_ENTROPY flag to mark interrupt sources that are good sources of entropy.
* Release the proc lock around crfree() and uifree() in wait1(). It leads tojhb2001-02-091-0/+2
| | | | | a lock order violation, and since p is already a zombie at this point, I'm not sure that we even need all the locking currently in wait1().
* Unbreak EISA. The PCI-EISA bridge bus is named `eisab', not `isab'.joerg2001-02-091-1/+1
| | | | | | | | This mistake seems to have been benign until very recently, probably until msmith's PCI code reshuffle which cleaned up a lot of things. Still, my AIC7770 doesn't work again, but it at least probes the EISA bus now.
* Proc locking.jhb2001-02-091-14/+10
|
* Move the initailization of the proc lock for proc0 very early into the MDjhb2001-02-097-1/+6
| | | | startup code.
* Woops, remove an obsolete reference to gd_cpu_lockid.jhb2001-02-097-7/+0
|
* - Change the 'witness_list' ddb command to 'show mutexes'. Note that thisjhb2001-02-093-54/+177
| | | | | | | | | | | | | | will only display sleep mutexes held by the current process. - Clean up some nits in the witness_display() function and add a ddb command 'show witness' that dumps the hierarchy and order lists to the console. - Use queue(3) macros where appropriate. - Resort the spin lock order list so that "com" is before "sched_lock". Also, add appropriate #ifdef's around SMP and i386-specific mutexes. - Add two new mutexes used to protect the ithread lists and tables to the order list. Requested by: bde (1)
* Change the ktr ddb commands to be show commands. The commands are now asjhb2001-02-091-4/+4
| | | | | | | | | | | follows: - show ktr_first display the first entry - show ktr_next display the next entry - show ktr display the entire buffer The /v modifiers continue to work as described previously. Requested by: bde
* - Point out that we don't lock anything during the idle setup becausejhb2001-02-091-1/+6
| | | | | | | only the boot processor should be running in the comments. - Initialize curproc to point to each CPU's respective idleproc if their curproc is NULL. - Keep track of the number of context switches performed by idleproc.
* Remove bogus #if 0'd code that dinked with the saved interrupt state injhb2001-02-091-7/+0
| | | | sched_lock.
* Remove unused forward_irq counters.jhb2001-02-093-27/+0
|
* Axe gd_cpu_lockid as it is no longer used.jhb2001-02-093-3/+0
|
* Fix some problems that were introduced in revision 1.97. Insteadiedowse2001-02-092-92/+202
| | | | | | | | | | | | of returning an error code to the caller, NFS server op routines must themselves build an error reply and return 0 to the caller. This is achieved by replacing the erroneous return statements with code that jumps forward to the op function's reply code. We need to be careful to ensure that the 'struct mount' pointer is NULL though, so that the final vn_finished_write() call becomes a no-op. Reviewed by: mckusick, dillon
* Remove some leftovers. This is obviously unused, since the #definespeter2001-02-091-26/+0
| | | | referred to members that no longer exist.
* poll(2) array limits (take 2) - after some input from bde.peter2001-02-091-8/+7
|
* Change and clean the mutex lock interface.bmilekic2001-02-09200-3721/+3509
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Apply patch to add support for the intergrated ethernet in the SiS630Ewpaul2001-02-092-1/+105
| | | | | | | | | | chipset. The MAC address is stored in the APC CMOS RAM and we have to commit trememdous evil in order to read it. The code to do this is only activated on the i386 platform. Thanks to Cameron Grant for providing access to a test box for me to tinker with. This will fix the problem where the sis driver ends up with a station address of 00:00:00:00:00:00 on boards that use the 630E chipset.
OpenPOWER on IntegriCloud