Commit Graph

7293 Commits

Author SHA1 Message Date
martin
476c17bc5a This is using device_t, so it needs to include <sys/device.h>. 2010-01-31 09:27:40 +00:00
pooka
8288b650e5 uncommit part which wasn't supposed to get committed yet 2010-01-31 03:57:01 +00:00
pooka
3cba324816 Pass root device as a parameter to domountroothook(). 2010-01-31 02:04:43 +00:00
pooka
04b824ef52 Place *hook implementations in kern_hook.c instead of them floating
around in the kern_subr.c gruel.  Arrrrr.
2010-01-31 01:38:48 +00:00
pooka
3b780690a4 Use proper static initializers for *hooklist (currently they happened
to work accidentally anyway since the initializer is 0).
2010-01-31 00:48:07 +00:00
hubertf
af120bb199 Replace more printfs with aprint_normal / aprint_verbose
Makes "boot -z" go mostly silent for me.
2010-01-31 00:43:37 +00:00
pooka
92394bf5f3 Trade 200-something bytes for the death of an ifdef. 2010-01-30 23:19:55 +00:00
rmind
b8ea6ca48b aio_suspend1: remove wrong comment, add one new.
Tidy up a little, while here.
2010-01-30 21:23:46 +00:00
mlelstv
49be4d025a Add helper function that determines the size and block size of a disk device.
For now we query
- the disk label
- the wedge info and data from disk(9)
2010-01-30 11:57:17 +00:00
he
ce1061323d On a recursive panic(), don't try to take a dump, as that may very
well have triggered the recursive panic.
Fix the comment for panic() to reflect now-current reality: the code
was already changed never to sync() on panic(), now we avoid dumping
core on a recursive panic.
2010-01-26 12:59:50 +00:00
dholland
3c82208a56 Amplify comment about ultrix bits. 2010-01-24 19:56:26 +00:00
hubertf
739e259054 Let kernel build when MALLOCLOG is defined but DIAGNOSTIC is not.
Else, hitmlog() is defined but not used, which triggers a warning.
2010-01-22 08:32:05 +00:00
pgoyette
17d5113226 Remove unnecessary call to kauth_cred_free().
This resolves an occassional crash I'd been experiencing as reported on
current-users@

Fix suggested by and OK elad@
2010-01-21 04:40:22 +00:00
rmind
f6d80c92e0 pool_cache_invalidate: comment out invalidation of per-CPU caches (nobody depends
on it, at the moment) until we decide how to fix it (xcall(9) cannot be used from
interrupt context).  XXX: Perhaps implement XC_HIGHPRI.
2010-01-20 23:40:42 +00:00
pooka
654415b2b7 Get rid of last "easy" kernel symbols starting with __:
__assert -> kern_assert
__sigtimedwait1 -> sigtimedwait1
__wdstart -> wdstart1

The rest are MD and/or shared with userspace, so they will require
a little more involvement than what is available for this quick
"ride the 5.99.24 bump" action.
2010-01-19 22:28:30 +00:00
pooka
f32c83c1bd Rename a few routines from _file() to _vfs() for consistency.
Ride 5.99.24 bump.
2010-01-19 22:17:44 +00:00
pooka
10fe49d72c Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client.  This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached.  However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff.  ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
2010-01-19 22:06:18 +00:00
dyoung
71080992ef A new survey of the code indicates that the very highest interrupt
priority level where the kernel accesses alldevs is IPL_VM, where
some hardware interrupt handlers call config_deactivate(9).  Lower
the IPL of alldevs_mtx from IPL_HIGH to IPL_VM, accordingly.
2010-01-19 21:54:53 +00:00
dyoung
2905b5fc8d Refactor: as suggested by rmind@, extract duplicate code into
subroutines config_alldevs_enter() and config_alldevs_exit().  This
change amounts to textual substitution.  No functional change intended.

We do not collect garbage in device_lookup(), so there is no use dumping
it: get rid of the garbage list.  Do not call config_dump_garbage().

In device_lookup_private(), call device_lookup() instead of duplicating
the code from device_lookup().
2010-01-19 21:24:36 +00:00
pooka
27d8901688 Update comment: unloaded modules which were pumped up by the
bootloader are not freed at the end of bootstrap (there should be
none, although this is not asserted.  maybe it should be?).
2010-01-19 15:23:14 +00:00
bouyer
85e9e8e2b4 Revert previous. The KASSERT() is right and my analysis is wrong,
as pointed out by pooka@.
2010-01-15 19:28:26 +00:00
pooka
07df6e2689 Fix reference counting for vfsops in mount. Otherwise it's possible
(for an unprivileged user) to force vfs modules to remain loaded
forever.  Also, it's possible for an admin with fat fingers to have
to curse out loud (a lot) and reboot.

.. or at least fix things as much as seems to be possible without
involving 1000 zorkmids.  do_sys_mount() takes either struct vfsops
(which hopefully came properly referenced) or a userspace string
for file system type.  The standard in-kernel calling convention
of "do_sys_mount(l, vfs_getopsbyname("nfs"), NULL," is not to be
considered healthy, kosher, or even tasty (although if vfs_getopsbyname()
fails the whole thing *currently* fails without the program counter
pointing to hyperspace).
2010-01-15 01:00:46 +00:00
bouyer
7ffaf66ccb Remove KASSERT(vp->v_usecount == 1) in getnewvnode() and ungetnewvnode().
Another process could be vget()ing the vnode and bump v_usecount while
getcleanvnode() is vclean()ing it (as vclean drops the interlock).
vget() will then wait for VI_XLOCK or VI_FREEING to clear; and we could test
this assertion while the other process is still slepping. We could even
end up in ungetnewvnode() before this other process got a chance to run.
2010-01-14 22:41:52 +00:00
mrg
efc854cf68 introduce a new function that returns a unique string for each cpu:
char *cpu_name(struct cpu_info *);

and use it when setting up the runq event counters, avoiding an 8 byte
kmem(4) allocation for each cpu.  there are more places the cpuname is
used that can be converted to using this new interface, but that can
and will be done as future work.

as discussed with rmind.
2010-01-13 01:57:17 +00:00
pooka
065afcb61a Minimize unnecessary differences in rump. 2010-01-13 01:53:38 +00:00
rmind
17990e0041 Revert 1.194 rev. 2010-01-12 22:11:13 +00:00
martin
693845d2c3 Add a new optional function device_register_post_config(), symmetric to
device register, called after config is done with a device.
Only used if an arch defines  __HAVE_DEVICE_REGISTER_POSTCONFIG.
2010-01-10 13:42:34 +00:00
rmind
a4c32a06f6 softint_overlay: disable kernel preemption before curlwp->l_cpu use. 2010-01-09 19:02:17 +00:00
dyoung
cd6e1fbf91 Expand PMF_FN_* macros. 2010-01-08 19:53:10 +00:00
pooka
113544b039 vcount() lost its purpose when opening multiple block devices was
made impossible, oh, two years ago.  nuke it (yes, the interface
name is overgeneric).
2010-01-08 13:07:26 +00:00
rmind
8431ea0b5e softint_execute: release/re-acquire kernel-lock depending on SOFTINT_MPSAFE
flag.  Keeping it held for MP-safe cases break the lock order assumptions.
Per discussion with <martin>.
2010-01-08 12:10:46 +00:00
rmind
97bb57c79f Simplify device G/C: use global list and config_alldevs_unlock_gc(). 2010-01-08 12:07:08 +00:00
pooka
c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
dyoung
e94f23b742 Move all copies of ifattr_match() to sys/kern/subr_autoconf.c. 2010-01-08 00:09:44 +00:00
dyoung
bb333bec6f Add a do-nothing child-detachment hook, null_childdetached(device_t,
device_t).
2010-01-07 22:39:52 +00:00
pooka
8797d86fd0 Make sure struct vattr contains no random bits of kernel memory
after vattr_null().  This is especially nice considering things
like puffs, where the contents are copied to userspace.
2010-01-07 19:54:40 +00:00
dyoung
3fec0e6fa3 Call device_lookup() from device_lookup_private() instead of
duplicating code.

Per suggestions by rmind@:

Simplify some code that used "empty statements," ";".

Don't collect garbage in device_lookup{,_private}(), since they
are called in interrupt context from certain drivers.

Make config_collect_garbage() KASSERT() that it does not run in
interrupt or software-interrupt context.
2010-01-05 22:42:16 +00:00
skrll
7fe4e16803 Regen. 2010-01-05 15:25:32 +00:00
skrll
e359b65038 Check for dev_t and time_t arguments and mark them as 64bit. 2010-01-05 15:23:32 +00:00
uebayasi
80d41370e7 Use CTASSERT() for constant only assertions. 2010-01-04 16:01:42 +00:00
mlelstv
c0a2fae3f5 drop __predict micro optimization in pool_init for cleaner code. 2010-01-03 09:42:22 +00:00
mlelstv
0ca557be77 Pools are created way before the pool subsystem mutexes are
initialized.

Ignore also pool_allocator_lock while the system is in cold state.

When the system has left cold state, uvm_init() should have
also initialized the pool subsystem and the mutexes are
ready to use.
2010-01-03 01:07:19 +00:00
mlelstv
d5c1a554d8 Move initialization of pool_allocator_lock before its first use.
This failed on archs where a mutex isn't initialized to a zero
value.

Defer allocation of pool log to the logging action, if allocation
fails, it will be retried the next time something is logged.

Clear pool log on allocation so that ddb doesn't crash when showing
so far unused log entries.
2010-01-02 15:20:39 +00:00
tsutsui
9d6449710b Update default TOD value to 2010/01/01 12:00:00. 2010-01-02 10:57:35 +00:00
dholland
a4ce70f1ad typo in comment 2010-01-01 03:22:13 +00:00
elad
a0c694197e Tiny cosmetics... 2009-12-31 02:20:36 +00:00
rmind
ac4dea4ab5 - nextlwp: do not set l_cpu, it should be returned correct (add assert).
- resched_cpu: avoid double set of ci.
2009-12-30 23:54:30 +00:00
rmind
65265dedb7 sched_catchlwp: fix the case when other CPU might see curlwp->l_cpu != curcpu()
while LWP is finishing context switch.  Should fix PR/42539, tested by martin@.
2009-12-30 23:49:59 +00:00
rmind
ffb9a7ee3c sigactsunshare(): set reference count in a case of new sigacts allocation.
Bug (e.g. memory leak) can happen when using clone(2) call.
2009-12-30 23:31:56 +00:00
elad
097059fb23 Don't bother caching egid. It'll be removed soon. 2009-12-30 22:12:12 +00:00