Commit Graph

6711 Commits

Author SHA1 Message Date
pooka
3c58d5b25f My clever hack was not enough. Disable DELAY via ifndef _RUMPKERN in
subr_prf until I manage to get all archs in line with a proper MI
signature.
2009-01-02 22:03:00 +00:00
pooka
ff1136dede We use CPU_INFO_FOREACH here -> include sys/cpu.h 2009-01-02 11:08:32 +00:00
pooka
167269d42c Include kernel printf routines in rump instead of relying on the
magic libc symbol.  This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c.  The host kernel bridging
is now done via rumpuser_putchar().
2009-01-02 02:54:13 +00:00
pooka
2577e51e90 revert previous, disabled aliasing in offending build
(XXX: two evil casts in the original)
2009-01-01 22:17:55 +00:00
pooka
44a89fbb01 Squelch type-punning warnings with void * casts. We are allowed
to do this because the pointers do not have aliases.
2009-01-01 21:35:22 +00:00
pooka
f671460fc0 _KERNEL_OPT 2009-01-01 19:10:17 +00:00
pooka
0e983d35cf * unexpose kprintf locking internals
* migrate from simplelock to kmutex

Don't bother to bump kernel version, since nothing outside of subr_prf
used KPRINTF_MUTEX_ENXIT()
2009-01-01 15:10:20 +00:00
ad
a190625ad7 softint_disestablish: don't pass softint_lock to kpause, it's not held. 2009-01-01 12:26:46 +00:00
reinoud
339f5c5772 Add ISO partition detection enabling auto-detection of iso9660 and UDF
partitions on optical media like CD/DVD/BD but also on all other media if
there is no NetBSD disklabel or MBR label.

Also fix cd's readdisklabel arguments so the ioctl's arrive at the right
device (!) and update its default label to make more sense.
2008-12-30 19:38:36 +00:00
pooka
8583cae233 Rename specfs_lock as device_lock and move it from specfs to devsw.
Relaxes kernel dependency on vfs.
2008-12-29 17:41:18 +00:00
pooka
3cf15d2f4e Librate sysctl_setup_func typedef from the clutches of _MODULE and
stuff it in kern_sysctl.c where its only sensible use is.
2008-12-29 15:35:02 +00:00
ad
ab21fd5c10 Don't need to hold kernel_lock for most of this (and not into the swapper!). 2008-12-29 13:40:11 +00:00
ad
ed25a64ddf Don't do KM_NOSLEEP allocations. 2008-12-29 12:52:50 +00:00
reinoud
2b4d7aaa9a When reusing a directory free space slot and thus finding it on the free space
list, do free it back into the pool!
2008-12-28 17:11:26 +00:00
christos
55d90fae57 - Don't autounload modules loaded during boot. In my case, ffs got unloaded
because my cdrom takes too long to initialize.
- Consistently print error messages in all error cases.
2008-12-28 03:21:02 +00:00
rmind
d2fec2fc4f sys_shmat: initialise shmid of shmmap entry earlier. Now error path,
i.e. shm_delete_mapping, wont use random value.
2008-12-22 13:49:17 +00:00
cegger
beb4d1e5cc undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.
2008-12-21 17:49:55 +00:00
ad
74302d0fab Redo previous. Don't count deferrals due to raised IPL. It's not that
meaningful.
2008-12-21 13:26:58 +00:00
ad
ff0249c394 Prevent a potential deadlock from a multithreaded process doing:
t1	dup2(0, 1)
t2	dup2(1, 0)
2008-12-21 10:25:00 +00:00
ad
7ca206492d Don't try to sync if panicing:
- It doesn't work and a dead system that can't be reset from the console is
  worse than a system that has painced and rebooted. If you can make it work
  reliably please do so.

- If the system is paniced there is every reason to suspect VM structures
  and the contents of the buffer cache.
2008-12-21 10:23:10 +00:00
ad
6d599f4e1f - Fix a bug where we trashed descriptor zero in the old open files array
while ironically trying to preserve the same during copy. Would only have
  occurred if a multithreaded program expanded the descriptor table and,
  within a tiny window of exposure, another thread in the program tried to
  access descriptor zero.

- Convert to use kmem_alloc/kmem_free.
2008-12-21 09:58:22 +00:00
ad
82ae73e0b6 Don't increment the 'kpreempt defer: IPL' counter if a preemption is pending
and we try to process it from interrupt context. We can't process it, and
will be handled at EOI anyway. Can happen when kernel_lock is released.
2008-12-20 23:06:14 +00:00
cegger
378da548fc Turn malloc flags into an enum.
While here, move the flags definition into _KERNEL section.
2008-12-19 21:22:01 +00:00
pgoyette
81649575af When checking for "set-up is complete", look for the CTLFLAGS_PERMANENT
in the root of the tree being modified, rather than in the system default
tree.  This permits module compat_netbsd32 to initialize its shadow tree
at load time.

Discussed on tech-kern, with no objections.

Addresses my PR kern/40167
2008-12-19 17:28:59 +00:00
pgoyette
9c68331911 Store config(1)'s root filesystem type as a text string rather than
embedding the address of its xxx_mountroot() in swapnetbsd.c.  This
permits booting of kernels with hard-wired filesystem type even if the
filesystem is in a loadable module (ie, not linked into the kernel
image).

Discussed on current-users.  Tested on amd64 and i386 with both hard-
wired and '?' filesystem times, and on both modular and monolithic
kernels.

Thanks to pooka@ for code review and suggestions.

Addresses my PR kern/40167
2008-12-19 17:11:57 +00:00
thorpej
4730b27d42 Make condvars really opaque -- hide the wait message member from consumers
of the API.
2008-12-19 07:57:28 +00:00
cegger
9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
ad
7c89190b50 Start percpu allocation at (ALIGNBYTES + 1) to avoid problem with importing
offset zero to vmem.
2008-12-15 11:59:22 +00:00
ad
c1ef49a66f Back VMEM_ADDR_NULL change. It's too invasive. 2008-12-15 11:42:34 +00:00
ad
b8c27c5dfc Check for VMEM_ADDR_NULL, not NULL. 2008-12-15 11:33:13 +00:00
ad
f9b17a5200 Define VMEM_ADDR_NULL as UINTPTR_MAX, otherwise a vmem that can allocate
a block starting at zero will not work.

XXX pool_cache uses NULL to signify failed allocation.
XXX how did the percpu allocator work before?
2008-12-15 11:29:49 +00:00
ad
50f32f7a93 Put vm_lock into its own cache line. 2008-12-15 10:26:10 +00:00
elad
f4f1989ae8 PR/39559: Juan RP: veriexec(4): too easy to cause a NULL dereference
through it in kernel

Patch from PR applied with tiny modifications, thanks!

Discussed with blymn@ a while ago.
2008-12-14 23:20:23 +00:00
elad
48949a2a2a Fix length passed to strlcpy(): we used to get names one character shorter
than reality.

Should be pulled up to netbsd-5.
2008-12-14 23:12:58 +00:00
ad
024c36f64b vclean: be paranoid and set v_tag, v_op while holding v_interlock.
FS code could check their values while scrolling through mnt_vnodelist.
2008-12-14 11:15:59 +00:00
ad
31420e7959 - vrelel: fix broken "dead but not clean" assertion. The vnode can be
dead and dirty if cleaning is in progress.
- Add an assertion, fix some text.
2008-12-14 11:13:36 +00:00
ad
70a01ab869 softint_disestablish: the soft interrupt could still be running on a CPU
somewhere in the system. If it is, wait for it to complete before tearing
it down. The caller commits to not trigger the interrupt again once
disestablish is set in motion.
2008-12-13 21:13:30 +00:00
ad
7a3593355a Fix a comment. 2008-12-13 20:49:49 +00:00
ad
24da1f6ca4 PR kern/36183 problem with ptrace and multithreaded processes
Fix the famous "gdb + threads = panic" problem.
Also, fix another revivesa merge botch.
2008-12-13 20:43:38 +00:00
ad
2e606b7b1b sigchecktrace: process SIGKILL before everything else. 2008-12-13 18:55:01 +00:00
christos
15e362cca8 fix endif comment 2008-12-10 18:07:30 +00:00
christos
0bff293dd2 disable VMEM_DEBUG by default. 2008-12-10 17:32:32 +00:00
christos
10fdeaec16 vmem_check_sanity is just too expensive for DEBUG. Enable it only for
VMEM_DEBUG.
2008-12-10 16:59:12 +00:00
cegger
33d827105a vmem_check_sanity: refactor overlapping check for better readability.
Move use of vmem_check_sanity into locked sections. Pointed out by ad@
2008-12-09 07:54:59 +00:00
cegger
4dfe7b7870 ddb: make show vmem print exact span type
vmem_check_sanity: print exact span type
vmem_add1: KASSERT span types
2008-12-07 22:39:01 +00:00
pooka
54b9426187 Move some sysctl node creations away from linksets and into the
constructors for subsystems.

XXX: CTLFLAG_PERMANENT is non-sensible.
2008-12-07 20:58:46 +00:00
cegger
f001f650d6 make this compile with MALLOC_DEBUG but w/o DEBUG 2008-12-07 14:24:28 +00:00
cegger
f132fda3fe vmem_check_sanity: fix check to correctly detect even exactly duplicate spans. 2008-12-07 11:49:51 +00:00
ad
7ab182873b Add cpu_softintr_p() for assertions 2008-12-07 11:40:53 +00:00