summaryrefslogtreecommitdiff
path: root/sys/kern/subr_hints.c
Commit message (Collapse)AuthorAgeFilesLines
* Use a sleep mutex instead of an sx lock for the kernel environment. ThisScott Long2006-07-091-6/+6
| | | | | | | | | allows greater flexibility for drivers that want to query the environment. Reviewed by: jhb, mux Notes: svn path=/head/; revision=160217
* The resource_xxx routines in subr_hints.c are called before and after theAlexander Leidinger2005-07-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | kenv environment in kern_environment.c switches to dynamic kenv. The prior call sets the static variable hintp to the static hints in subr_hints.c (hintmode==0). However, changes to the environment are not detected by the resource_xxx lookups after the change to dynamic kernel environment, so the lookup routines only report the old stuff of hintmode==0, even after the change to the dynamic kenv. This causes kenv users to see a different environment than the kernel routines. This is a problem in the mixer.c code that looks up initial mixer volume settings from the hints: If the hints are dynamic and not from the device.hints file, mixer.c doesn't see them, but kenv does. The patch from the PR (modified to comply to the style of the function) solves this. PR: 83686 Submitted by: Harry Coin <harrycoin@qconline.com> Notes: svn path=/head/; revision=148586
* Don't set ret_namelen and ret_resnamelen in res_find() unless both theJohn Baldwin2005-03-241-2/+2
| | | | | | | | | | corresponding pointer to the buffer (ret_name and ret_resname) is non-NULL to avoid possible NULL pointer derefs. Reported by: Coverity via sam Notes: svn path=/head/; revision=144077
* fix spelling of match in comment...John-Mark Gurney2005-03-101-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=143386
* Add a resource_disabled() helper function that returns true (non-zero) ifJohn Baldwin2003-07-021-0/+14
| | | | | | | | a specified resource has been disabled via a non-zero 'disabled' hint and false otherwise. Notes: svn path=/head/; revision=117166
* Use __FBSDID().David E. O'Brien2003-06-111-2/+3
| | | | Notes: svn path=/head/; revision=116182
* Cosmetic tweaks. Try and keep the style more consistent, catch some strayPeter Wemm2002-05-011-3/+2
| | | | | | | whitespace and update a comment. Notes: svn path=/head/; revision=95839
* Finish fixing hints. Remember the use_kenv state for the next run.Peter Wemm2002-04-271-8/+10
| | | | | | | | | | | | Otherwise we fall back to using the static hints the next time around. We still have the leftover fallback code there which meant that we skipped the use_hints checking on the second and subsequent calls. Also, be a bit more careful about walking off the end of the envp array. I've extracted this from a larger diff. I hope I didn't miss anything... Notes: svn path=/head/; revision=95593
* Partial fix for hintsPeter Wemm2002-04-271-2/+4
| | | | | | | Obtained from: mux Notes: svn path=/head/; revision=95592
* Rework the kernel environment subsystem. We now convert the staticMaxime Henrion2002-04-171-18/+54
| | | | | | | | | | | | | | | | | | | | environment needed at boot time to a dynamic subsystem when VM is up. The dynamic kernel environment is protected by an sx lock. This adds some new functions to manipulate the kernel environment : freeenv(), setenv(), unsetenv() and testenv(). freeenv() has to be called after every getenv() when you have finished using the string. testenv() only tests if an environment variable is present, and doesn't require a freeenv() call. setenv() and unsetenv() are self explanatory. The kenv(2) syscall exports these new functionalities to userland, mainly for kenv(1). Reviewed by: peter Notes: svn path=/head/; revision=94936
* Fix a fatal type mismatch (char *static_env; vs char static_env[]).Peter Wemm2001-09-171-2/+0
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=83595
* Go back to having either static OR dynamic hints, with fallbackPeter Wemm2001-07-141-15/+40
| | | | | | | | | | | support. Trying to fix the merged set where dynamic overrode static was getting more and more complicated by the day. This should fix the duplicate atkbd, psm, fd* etc in GENERIC. (which paniced the alpha, but not the i386) Notes: svn path=/head/; revision=79696
* Hints overhaul:Peter Wemm2001-06-121-0/+304
- Replace some very poorly thought out API hacks that should have been fixed a long while ago. - Provide some much more flexible search functions (resource_find_*()) - Use strings for storage instead of an outgrowth of the rather inconvenient temporary ioconf table from config(). We already had a fallback to using strings before malloc/vm was running anyway. Notes: svn path=/head/; revision=78135