summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_rman.c
Commit message (Collapse)AuthorAgeFilesLines
* Correct an off-by-one in the boundary check. Otherwise, resourcetmm2003-01-211-1/+1
| | | | | allocations would fail if the desired allocation size was equal to the boundary.
* Make the rman_{get,set}_* macros into real functions. The macrosimp2002-11-271-0/+72
| | | | | | | | | | | | | | | create an ABI that encodes offsets and sizes of structures into client drivers. The functions isolate the ABI from changes to the resource structure. Since these are used very rarely (once at startup), the speed penalty will be down in the noise. Also, add r_rid to the structure so that clients can save the 'rid' of the resource in the struct resource, plus accessor functions. Future additions to newbus will make use of this to present a simplified interface for resource specification. Approved by: re (jhb) Reviewed by: jhb, jake
* Add debug.rman_debug sysctl MIB and loader tunable instead of brokeniwasaki2002-09-051-5/+7
| | | | | RMAN_DEBUG option. This would be useful for debugging resource manager code.
* Add sanity check seeing if adjusted start address exceeds end addressiwasaki2002-08-291-0/+4
| | | | after boundary and alignment adjustment.
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-2/+2
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Add a rman_reserve_resource_bound() function that takes an additionaltmm2001-12-211-11/+35
| | | | | | argument specifying the boundary for the resource allocation. Use ulmin()/ulmax() instead of min()/max() in some places to correctly deal with the u_long resource range specifications.
* - No need for resetting values to 0 when M_ZERO flag is used.arr2001-11-101-6/+0
| | | | Approved: jhb
* Use msleep() to avoid lost wakeup's instead of doing an ineffectivejhb2001-10-261-15/+5
| | | | | | | | splhigh() before the mtx_unlock and tsleep(). The splhigh() was probably correct in the original code using simplelocks but is not correct in 5.0-current. Noticed by: Andrew Reiter <awr@FreeBSD.org>
* Malloc mutexes pre-zero'd as random garbage (including 0xdeadcode) myjhb2001-10-101-1/+1
| | | | trigget the check to make sure we don't initalize a mutex twice.
* Handle NULL struct device *sbrian2001-05-281-2/+2
|
* Change and clean the mutex lock interface.bmilekic2001-02-091-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Convert all simplelocks to mutexes and remove the simplelock implementations.jasone2001-01-241-30/+30
|
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-10/+5
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Bug fix for revision 1.14 on the replacement of CIRCLEQ with TAILQ.mckusick2000-11-151-6/+4
| | | | Submitted by: Warner Losh <imp@village.org>
* In preparation for deprecating CIRCLEQ macros in favor of TAILQmckusick2000-11-141-34/+29
| | | | | | | macros which provide the same functionality and are a bit more efficient, convert use of CIRCLEQ's in resource manager to TAILQ's. Approved by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
* Cleanup the rman_make_alignment_flags function to be much clearer and shorterimp2000-10-221-12/+10
| | | | than the prior version.
* Implement resource alignment as discussed in arch@ a long time ago.imp2000-10-171-1/+23
| | | | | | | This was implemented by Shigeru YAMAMOTO-san and Jonathan Chen. I've cleaned them up somewhat and they seem to work well enough to boot current (but given current's state it can be hard to tell). Doug Rabson also reviewed the design and signed off on it.
* Replace all the ifdef debugging spaghetti with a single ifdef andpaul2000-05-031-40/+22
| | | | a macro so that it is easier to read the flow of the code.
* Commit the remaining part of PR14914:phk1999-11-161-16/+15
| | | | | | | | | | | Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY structures for list operations. This patch makes all list operations in sys/kern use the queue(3) macros, rather than directly accessing the *Q_{HEAD,ENTRY} structures. Reviewed by: phk Submitted by: Jake Burkholder <jake@checker.org> PR: 14914
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Make sure that we record the flags in all cases.dfr1999-06-261-2/+2
| | | | | Submitted by: Bernd Walter <ticso@cicely.de> PR: kern/12399
* Bring the 'new-bus' to the i386. This extensively changes the way thepeter1999-04-161-9/+30
| | | | | | | | | | | | | | | | | | i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core
* Staticize.eivind1999-04-111-2/+2
|
* Fix a bug which prevented more than two clients from sharing a resource.dfr1999-03-291-2/+2
|
* Ifdefed conditionally used simplock variables.bde1999-01-021-1/+3
|
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-2/+1
| | | | and local variables, goto labels, and functions declared but not defined.
* Fixed a missing include. `SYSININT(...);' garbage in gave null garbage out.bde1998-11-231-1/+2
|
* The new resource manager, hopefully in a reasonably stable form.wollman1998-10-291-0/+589
OpenPOWER on IntegriCloud