summaryrefslogtreecommitdiff
path: root/sys/kern/subr_rman.c
Commit message (Collapse)AuthorAgeFilesLines
* Implement rman_get_deviceWarner Losh2003-02-121-0/+6
| | | | | | | | | # I though this was alredy implemented Pointy hat on my head shown by: peter Notes: svn path=/head/; revision=110753
* Correct an off-by-one in the boundary check. Otherwise, resourceThomas Moestl2003-01-211-1/+1
| | | | | | | | allocations would fail if the desired allocation size was equal to the boundary. Notes: svn path=/head/; revision=109646
* Make the rman_{get,set}_* macros into real functions. The macrosWarner Losh2002-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 Notes: svn path=/head/; revision=107296
* Add debug.rman_debug sysctl MIB and loader tunable instead of brokenMitsuru IWASAKI2002-09-051-5/+7
| | | | | | | | RMAN_DEBUG option. This would be useful for debugging resource manager code. Notes: svn path=/head/; revision=102962
* Add sanity check seeing if adjusted start address exceeds end addressMitsuru IWASAKI2002-08-291-0/+4
| | | | | | | after boundary and alignment adjustment. Notes: svn path=/head/; revision=102572
* Change callers of mtx_init() to pass in an appropriate lock type name. InJohn Baldwin2002-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 Notes: svn path=/head/; revision=93818
* Add a rman_reserve_resource_bound() function that takes an additionalThomas Moestl2001-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. Notes: svn path=/head/; revision=88372
* - No need for resetting values to 0 when M_ZERO flag is used.Andrew R. Reiter2001-11-101-6/+0
| | | | | | | Approved: jhb Notes: svn path=/head/; revision=86243
* Use msleep() to avoid lost wakeup's instead of doing an ineffectiveJohn Baldwin2001-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> Notes: svn path=/head/; revision=85519
* Malloc mutexes pre-zero'd as random garbage (including 0xdeadcode) myJohn Baldwin2001-10-101-1/+1
| | | | | | | trigget the check to make sure we don't initalize a mutex twice. Notes: svn path=/head/; revision=84781
* Handle NULL struct device *sBrian Somers2001-05-281-2/+2
| | | | Notes: svn path=/head/; revision=77288
* Change and clean the mutex lock interface.Bosko Milekic2001-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) Notes: svn path=/head/; revision=72200
* Convert all simplelocks to mutexes and remove the simplelock implementations.Jason Evans2001-01-241-30/+30
| | | | Notes: svn path=/head/; revision=71576
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-10/+5
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Bug fix for revision 1.14 on the replacement of CIRCLEQ with TAILQ.Kirk McKusick2000-11-151-6/+4
| | | | | | | Submitted by: Warner Losh <imp@village.org> Notes: svn path=/head/; revision=68764
* In preparation for deprecating CIRCLEQ macros in favor of TAILQKirk McKusick2000-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> Notes: svn path=/head/; revision=68727
* Cleanup the rman_make_alignment_flags function to be much clearer and shorterWarner Losh2000-10-221-12/+10
| | | | | | | than the prior version. Notes: svn path=/head/; revision=67425
* Implement resource alignment as discussed in arch@ a long time ago.Warner Losh2000-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. Notes: svn path=/head/; revision=67261
* Replace all the ifdef debugging spaghetti with a single ifdef andPaul Richards2000-05-031-40/+22
| | | | | | | a macro so that it is easier to read the flow of the code. Notes: svn path=/head/; revision=59910
* Commit the remaining part of PR14914:Poul-Henning Kamp1999-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 Notes: svn path=/head/; revision=53225
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Make sure that we record the flags in all cases.Doug Rabson1999-06-261-2/+2
| | | | | | | | Submitted by: Bernd Walter <ticso@cicely.de> PR: kern/12399 Notes: svn path=/head/; revision=48235
* Bring the 'new-bus' to the i386. This extensively changes the way thePeter Wemm1999-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 Notes: svn path=/head/; revision=45720
* Staticize.Eivind Eklund1999-04-111-2/+2
| | | | Notes: svn path=/head/; revision=45569
* Fix a bug which prevented more than two clients from sharing a resource.Doug Rabson1999-03-291-2/+2
| | | | Notes: svn path=/head/; revision=45106
* Ifdefed conditionally used simplock variables.Bruce Evans1999-01-021-1/+3
| | | | Notes: svn path=/head/; revision=42248
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticArchie Cobbs1998-12-071-2/+1
| | | | | | | and local variables, goto labels, and functions declared but not defined. Notes: svn path=/head/; revision=41591
* Fixed a missing include. `SYSININT(...);' garbage in gave null garbage out.Bruce Evans1998-11-231-1/+2
| | | | Notes: svn path=/head/; revision=41304
* The new resource manager, hopefully in a reasonably stable form.Garrett Wollman1998-10-291-0/+589
Notes: svn path=/head/; revision=40711