summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Expand the mask for the Avlab Technology, PCI IO 2S entry to cover thejhb2004-02-041-1/+1
| | | | | | | | 2S-650 and 2S-850 variants. PR: kern/45285 Submitted by: Andrey Zakharchenko <avz AT jscc.ru> MFC after: 1 week
* Fixed editing error in a comment in previous commit.bde2004-02-041-1/+1
|
* Removed TIOCMODG and TIOCMODS. They were superseded by TIOCMGET andbde2004-02-041-13/+24
| | | | | | | | | | | | | TIOCMSET before FreeBSD existed and have never been implemented by any FreeBSD serial driver (not even as aliases). Moved the TIOCM bit definitions to be with TIOCMGET. Added more comments gaps between ioctl numbers. There are now a large number of conflicts with ppp, slip, tap and tun ioctls (especially ppp ones) from closing gaps that weren't there. This mainly breaks decoding of ioctl numbers in kdump, but there are some serious conflicts where the interpretation of a tty ioctl depends on the line discipline.
* aic7xxx.c:gibbs2004-02-041-4/+2
| | | | | | | Shorten a diagnostic printf to fit in 80 columns. In ahc_abort_scbs() remove an incorrect diagnostic test that printed a spurious warning.
* aic79xx.c:gibbs2004-02-046-135/+327
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aic79xx.seq: Convert the COMPLETE_DMA_SCB list to an "stailq". This allows us to safely keep the SCB that is currently being DMA'ed back the host on the head of the list while processing completions off of the bus. The newly completed SCBs are appended to the tail of the queue. In the past, we just dequeued the SCB that was in flight from the list, but this could result in a lost completion should the host perform certain types of error recovery that must cancel all in-flight SCB DMA operations. Switch from using a 16bit completion entry, holding just the tag and the completion valid bit, to a 64bit completion entry that also contains a "status packet valid" indicator. This solves two problems: o The SCB DMA engine on at least Rev B. silicon does not properly deal with a PCI disconnect that occurs at a non-64bit aligned offset in the chips "source buffer". When the transfer is resumed, the DMA engine continues at the correct offset, but may wrap to the head of the buffer causing duplicate completions to be reported to the host. By using a completion buffer in host memory that is 64bit aligned and using 64bit completion entries, such disconnects should only occur at aligned addresses. This assumes that the host bridge will only disconnect on cache-line boundaries and that cache-lines are multpiles of 64bits. o By embedding the status information in the completion entry we can avoid an extra memory reference to the HSCB for commands that complete without error. Use the comparison of a "host freeze count" and a "sequencer freeze count" to allow the host to process most SCBs that complete with non-zero status without having to clear critical sections. Instead the host can just pause the sequencer, performs any necessary cleanup in the waiting for selection list, increments its freeze count on the controller, and unpauses. This is only possible because the sequencer defers completions of SCBs with bad status until after all pending selections have completed. The sequencer then avoids referencing any data structures the host may touch during completion of the SCB until the freeze counts match. aic79xx.c: Change the strategy for allocating our sentinal HSCB for the QINFIFO. In the past, this allocation was tacked onto the QOUTFIFO allocation. Now that the qoutfifo has grown to accomodate larger completion entries, the old approach will result in a 64byte allocation that costs an extra page of coherent memory. We now do this extra allocation via ahd_alloc_scbs() where the "unused space" can be used to allocate "normal" HSCBs. In our packetized busfree handler, use the ENSELO bit to differentiate between packetized and non-packetized unexpected busfree events that occur just after selection, but before the sequencer has had the oportunity to service the selection. When cleaning out the waiting for selection list, use the SCSI mode instead of the command channel mode. The SCB pointer in the command channel mode may be referenced by the SCB dma engine even while the sequencer is paused, whereas the SCSI mode SCB pointer is only accessed by the sequencer. Print the "complete on qfreeze" sequencer SCB completion list in ahd_dump_card_state(). This list holds all SCB completions that are deferred until a pending select-out qfreeze event has taken effect. aic79xx.h: Add definitions and structures to handle the new SCB completion scheme. Add a controller flag that indicates if the controller is in HostRAID mode. aic79xx.reg: Remove macros used for toggling from one data fifo mode to the other. They have not been in use for some time. Add scratch ram fields for our new qfreeze count scheme, converting the complete dma list into an "stailq", and providing for the "complete on qfreeze" SCB completion list. Some other fields were moved to retain proper field alignment (alignment >= field size in bytes). aic79xx.seq: Add code to our idle loop to: o Process deferred completions once a qfreeze event has taken full effect. o Thaw the queue once the sequencer and host qfreeze counts match. Generate 64bit completion entries passing the SCB_SGPTR field as the "good status" indicator. The first bit in this field is only set if we have a valid status packet to send to the host. Convert the COMPLETE_DMA_SCB list to an "stailq". When using "setjmp" to register an idle loop handler, do not combine the "ret" with the block move to pop the stack address in the same instruction. At least on the A, this results in a return to the setjmp caller, not to the new address at the top of the stack. Since we want the latter (we want the newly registered handler to only be invoked from the idle loop), we must use a separate ret instruction. Add a few missing critical sections. Close a race condition that can occur on Rev A. silicon. If both FIFOs happen to be allocated before the sequencer has a chance to service the FIFO that was allocated first, we must take special care to service the FIFO that is not active on the SCSI bus first. This guarantees that a FIFO will be freed to handle any snapshot requests for the FIFO that is still on the bus. Chosing the incorrect FIFO will result in deadlock. Update comments. aic79xx_inline.h Correct the offset calculation for the syncing of our qoutfifo. Update ahd_check_cmdcmpltqueues() for the larger completion entries. aic79xx_pci.c: Attach to HostRAID controllers by default. In the future I may add a sysctl to modify the behavior, but since FreeBSD does not have any HostRAID drivers, failing to attach just results in more email and bug reports for the author. MFC After: 1week
* Include <sys/queue.h> before <sys/_lock.h> instead of depending onbde2004-02-041-8/+7
| | | | | | | | | | | | | namespace pollution in other headers. <sys/types.h> is now the only prerequisite for <sys/sx.h>. Fixed some style bugs: - removed bogus LOCORE ifdef. Including this C header in assembler sources is just nonsense. - removed unused include of <sys/_mutex.h>. It finished rotting when the mutex in struct sx became indirect in rev.1.15. - removed most comments on #else and #endif's and cleaned up the others. All were misindented...
* - add a description of what .gdbinit should contain.grehan2004-02-041-9/+25
| | | | | | | | | - add an option for the output device in the hope that this can be made non-blocking at some stage. - define an alias for the disk device, required by dev/ofw/ofw_disk.c - shift iobus to 0x9000000 so as not to clash with the OpenFirmware entry point of 0x8000400 when address decoding. - down-tone comments about the disk dev config :-)
* Remove pmap_pvo_allocf zone alloc function. It was a way ofgrehan2004-02-043-81/+12
| | | | | | | | | | | | using the direct-mapping of physmem to force PTE data structures to be physically addressable so the interrupt-time real-mode DSI trap handler could perform PTE spills. However, the memory may have been > 256Mb, which would have caused a BAT spill and double-interrupt. The new trap code no longer handles PTE spills, so the requirement that these pages be direct-mapped no longer applies. The irony is UMA_MD_SMALL_ALLOC will return direct mappings for these structs :-)
* Major overhaul of common trap codegrehan2004-02-042-1616/+710
| | | | | | | | | | | | | | | | | | | | | | | | | - remove unused 601 and tlb exception code - remove interrupt-time PTE spill code. The pmap code will now take care of pinning kernel PTEs, and there are no longer issues about physical mapping of PTE data structures - All segment registers are switched on kernel entry/exit, allowing the kernel to have more virtual space and for user virtual space to extend to 4G. - The temporary register save area has been shifted from unused exception vector space to the per-cpu data area. This allows interrupts to be delivered to multiple CPUs - ISI traps no longer spill to BAT tables. It is assumed that all of kernel instruction memory is pinned. - shift from 'ldmw/stmw' instructions to individual register loads/stores when saving context. All PPC manuals indicate this should be much faster. - use '%r' for register names throughout. TODO: need to test if DSI traps were the result of kernel stack guard-page hits. Reworked from: NetBSD
* - remove unused trap definitionsgrehan2004-02-042-12/+22
| | | | | | - ISI traps are now handled by the generic trap routine - direct diagnostic traps to DDB if defined - remove unused asngen pcpu init
* - Lots more symbols required by the new trap_subr codegrehan2004-02-041-0/+40
|
* - Add definition for GET_CPUINFO, required by new trap_subr codegrehan2004-02-042-12/+8
| | | | - garbage-collect unused defs
* Move temporary register save area from exception-vector memory togrehan2004-02-041-3/+15
| | | | | | per-CPU memory. This allows for interrupt handling on multiple CPUs. Obtained from: NetBSD
* KNFume2004-02-041-8/+7
| | | | Obtained from: KAME
* - add an identify method, since the disk device used to be pickedgrehan2004-02-041-3/+29
| | | | | | up in the recursive OpenFirmware node walk. Rely on the psim config file to have a "ofwdisk" device alias - minor white space nits
* Allow child devices to set the OpenFirmware device node ivargrehan2004-02-042-4/+10
|
* Do not aggressively unroll the AES implementation, in non-benchmarking usephk2004-02-041-2/+0
| | | | | | it is same speed on small cache cpus and slower on largecache cpus. Approved by: sam@
* Rename iov_to_uio to uiofromiov to be more consistent with othersilby2004-02-043-3/+3
| | | | | | uio* functions. Suggested by: bde
* Allow assert that the current thread does not hold the sx(9) lock.pjd2004-02-041-0/+11
| | | | | | Reviewed by: jhb In cooperation with: juli, jhb Approved by: jhb, scottl (mentor)
* Style fixessilby2004-02-042-35/+29
| | | | Submitted by: bde
* Add SX_UNLOCKED define. It will be used with sx_assert(9) to bepjd2004-02-041-0/+1
| | | | | | | sure that current thread does not hold given sx(9) lock. Reviewed by: jhb Approved by: jhb, scottl (mentor)
* A variety of further cleanups to ttyinfo():rwatson2004-02-041-77/+84
| | | | | | | | | | | | | | | | | | | | | | | | | - Rename temporary variable names ("tmp", "tmp2") to more informative names ("load", "pctcpu", "rss", ...) - Unclutter indentation and return paths: rather than lots of nested ifs, simply return earlier if it's not going to work out. Simplify general structure and avoid "deep" code. - Comment on the thread/process selection and locking. - Correct handling of "running"/"runnable" states, avoid "unknown" that people were seeing for running processes. This was due to a misunderstanding of the more complex state machine / inhibitors behavior of KSE. - Do perform ttyinfo() printing on KSE (P_SA) processes, it seems generally to work. While I initially attempted to formulate this as two commits (one layout, the other content), I concluded that the layout changes were really structural changes. Many elements submitted by: bde
* - removed debug printf that was a false positive on non-OpenPIC systemsgrehan2004-02-041-7/+5
| | | | - white space nits
* Correct/improve the implementation of NdisMAllocateSharedMemoryAsync().wpaul2004-02-041-13/+50
| | | | | | | | | | | Since we have a worker thread now, we can actually do the allocation asynchronously in that thread's context. Also, we need to return a status value: if we're unable to queue up the async allocation, we return NDIS_STATUS_FAILURE, otherwise we return NDIS_STATUS_PENDING to indicate the allocation has been queued and will occur later. This replaces the kludge where we just invoked the callback routine right away in the current context.
* Add the kernel side of network interface renaming support.brooks2004-02-042-23/+57
| | | | | | | | | | | | | | | The basic process is to send a routing socket announcement that the interface has departed, change if_xname, update the sockaddr_dl associated with the interface, and announce the arrival of the interface on the routing socket. As part of this change, ifunit() is greatly simplified by testing if_xname directly. if_clone_destroy() now uses if_dname to look up the cloner for the interface and if_dunit to identify the unit number. Reviewed by: ru, sam (concept) Vincent Jardin <vjardin AT free.fr> Max Laier <max AT love2party.net>
* The sem_timedwait() and ksem_timedwait() functions bothdeischen2004-02-034-0/+6
| | | | | | need struct timespec, so define it here. Discussed in: standards (wollman)
* Revert the skipping of segment register reloads as it appears to actuallyjhb2004-02-032-34/+40
| | | | | be a pessimization on non Pentium4 CPUs. More importantly, it is buggy as it can cause GPF's when using APM or vm86.
* pass pcb rather than so. it is expected that per socket policyume2004-02-0315-154/+84
| | | | works again.
* Remove a bogus assertion.jhb2004-02-031-1/+0
| | | | | Noticed by: bde Pointy hat to: jhb
* Add prototype for sem_timedwait().deischen2004-02-032-0/+2
| | | | Reviewed by: standards (Stefan Farfeleder)
* Use device alias "mpic" to locate the macio OpenPIC. This worksgrehan2004-02-031-6/+5
| | | | | | on the new 12/15/17" PowerBooks that don't have the "interrupt-controller" property underneath "/chosen", which was the previous way of searching.
* Implement support for single packet sends. The Intel Centrino driverwpaul2004-02-033-7/+65
| | | | | | | | | | | | | | | | | | | | | | | | that Asus provides on its CDs has both a MiniportSend() routine and a MiniportSendPackets() function. The Microsoft NDIS docs say that if a driver has both, only the MiniportSendPackets() routine will be used. Although I think I implemented the support correctly, calling the MiniportSend() routine seems to result in no packets going out on the air, even though no error status is returned. The MiniportSendPackets() function does work though, so at least in this case it doesn't matter. In if_ndis.c:ndis_getstate_80211(), if ndis_get_assoc() returns an error, don't bother trying to obtain any other state since the calls may fail, or worse cause the underlying driver to crash. (The above two changes make the Asus-supplied Centrino work.) Also, when calling the OID_802_11_CONFIGURATION OID, remember to initialize the structure lengths correctly. In subr_ndis.c:ndis_open_file(), set the current working directory to rootvnode if we're in a thread that doesn't have a current working directory set.
* Removed bogus checks that (PCPU_GET(curpcb) != NULL). Rev.1.586 ofbde2004-02-031-3/+1
| | | | | | | | | | | | | machdep.c fixed the missing early initialization of curpcb, so curpcb is now always set together with curthread and it cannot be NULL except before the IDT has been set up (so trap() is unreachable) or after a memory error. In any case, it was often used without checking. curcpb shouldn't exist anyway. It doesn't exist for most non-i386 arches. It just caches curthread->td_pcb in a global. This was a better idea before it was per-cpu. trap() and some other places can get at it more efficiently using td->td_pcb instead of PCPU_GET(curpcb). The main exception is support.s which mostly wants only curpcb->pcb_onfault.
* Regen.deischen2004-02-034-5/+7
|
* Sync with kern/syscalls.master.deischen2004-02-031-0/+1
|
* Regen after adding ksem_timedwait().deischen2004-02-035-7/+16
|
* Add ksem_timedwait() to complement ksem_wait().deischen2004-02-034-6/+64
| | | | Glanced at by: alfred
* Don't dec/inc the amountpipes counter every time we resize a pipe --rwatson2004-02-031-2/+3
| | | | | | | | | | instead, just dec/inc in the ctor/dtor. For now, increment/decrement in two's, since we're now performing the operation once per pair, not once per pipe. Not really any measurable performance change in my micro-benchmarks, but doing less work is good, especially when it comes to atomic operations. Suggested by: alc
* Notify the user (at kern.emerg) that the system will be shutting down ifnjl2004-02-031-5/+13
| | | | | | it is still above the critical temperature on the next poll cycle. This is a 10 second advance notice by default. Document the private (non-standard) notify we will be using with devd(8).
* Catch instances of (pipe == NULL) that were obsoleted with recentrwatson2004-02-031-6/+6
| | | | | | | | changes to jointly allocated pipe pairs. Replace these checks with pipe_present checks. This avoids a NULL pointer dereference when a pipe is half-closed. Submitted by: Peter Edwards <peter.edwards@openet-telecom.com>
* Drop the reference count on the old vmspace after fully switching thejhb2004-02-021-2/+2
| | | | | | current thread to the new vmspace. Suggested by: dillon
* Set PCPU_GET(curpcb) for the BSP to thread0's pcb. Otherwise, the boot CPUjhb2004-02-021-0/+1
| | | | | doesn't have a pcb until after it's first context switch. This can cause secondary panics if a page fault happens during bootup.
* Add sysctl net.inet.icmp.reply_src to specify the interface nameandre2004-02-021-0/+19
| | | | | | | | used for the ICMP reply source in reponse to packets which are not directly addressed to us. By default continue with with normal source selection. Reviewed by: bms
* More verbose description of the source ip address selection for ICMP replies.andre2004-02-021-5/+16
| | | | Reviewed by: bms
* - Assert that witness_cold is not true in enroll().jhb2004-02-021-1/+2
| | | | | | - Only check witness_watch once in enroll(). Reported by: ru (2)
* More macro cleanup. Use the system roundup2() macro instead of makingbrooks2004-02-021-3/+1
| | | | | | our own ROUNDUP() macro. Suggested by: bde
* Reserve 187 (twa) for the new 3ware ATA RAID controller.ps2004-02-021-0/+1
|
* Allow a GEOM class to unload if it has no geoms or a method function tophk2004-02-021-1/+6
| | | | | | get rid of them. Prodded by: pjd
* Fix many issues related to mount/unmount:pjd2004-02-021-8/+33
| | | | | | | | | | | | | | | | | | | | | 1. Root from inside a jail was able to unmount any file system (except /). 2. Unprivileged root was able to unmount file systems mounted by privileged root (execpt /). 3. User from inside a jail was able to mount file system when sysctl vfs.usermount was set to 1. 4. User was able to mount file system when vfs.usermount was set to 1 (that's ok) and unmount it even if vfs.usermount was equal to 0 (that's not correct). Possibility from point 1 was reported by: Dariusz Kowalski <darek@76.pl> Only a part of this fix will be MFC'ed (if approved). PR: kern/60149 Reviewed by: rwatson Approved by: scottl (mentor) MFC after: 3 days
* Added flag MNT_USER to MNT_UPDATEMASK, it will be used for detectingpjd2004-02-021-1/+1
| | | | | | | | file systems mounted by unprivileged users. Reviewed by: rwatson Approved by: scottl (mentor) MFC after: 3 days
OpenPOWER on IntegriCloud