Commit Graph

207 Commits

Author SHA1 Message Date
pooka
052fd49d29 Fix locking botches: take vm object lock before calling pager,
not inside the pager.
2008-01-27 00:16:22 +00:00
pooka
b7b052548e Nuke local copy of getcwd_common(), we compile in the real thing now. 2008-01-25 06:43:30 +00:00
pooka
22b1964406 Include vfs_getcwd.c too. It isn't used currently, but it's linked. 2008-01-25 06:42:29 +00:00
pooka
2b1b5d29b8 Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation.  This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().
2008-01-24 22:41:07 +00:00
pooka
daadf5acef Make work again by repairing spec_node_init() and not being afraid
to use it.
2008-01-24 20:06:46 +00:00
ad
703069c0e9 specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
  vnode can describe a block device. Instead, prohibit concurrent opens of
  block devices. As a bonus remove the unreliable code that prevents
  multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
  goes away, instead of abusing vnode::v_usecount to tell if the device is
  open.
2008-01-24 17:32:52 +00:00
pooka
d25a6ab97f Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time.  We could init it runtime, but it's just a random
number anyway.
2008-01-24 15:02:16 +00:00
pooka
9af1c338e2 Default physmem was too tight, increase to 256megs from 0 bytes. 2008-01-24 08:34:49 +00:00
pooka
2310c71b91 Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround.  If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.
2008-01-22 09:23:39 +00:00
pooka
65a36d9ef8 In case cv_timedwait() gets ticks == 0, make sure we sleep eternally
(or at least until wakeup) instead of immediately waking up.

In other words, fix this after it broke when another piece of the
code was fixed.  Ain't programming fun?
2008-01-21 17:56:48 +00:00
pooka
fdedd21efc Implement dummy bmap which just does 1:1 translation. 2008-01-21 03:40:59 +00:00
joerg
3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
reinoud
ef25457ba7 pthread_cond_timedwait() needs an absolute time to wait for instead of the
relative time in ticks.
2008-01-18 14:12:19 +00:00
pooka
fd1f386de1 fix incorrect tick -> timespec calculation. noticed by reinoud 2008-01-17 21:05:36 +00:00
ad
cd7be76fdb Add a dummy vrevoke(). 2008-01-17 17:31:48 +00:00
ad
5080b2dad0 Pull in my modules code for review/test/hacking. 2008-01-16 13:22:29 +00:00
pooka
d7412d56b1 Introduce PUFFS_STACKSIZE_MIN to avoid overloading 0 and getting
a warning from the library when really wanting to say "just the
minimum, please".
2008-01-14 13:57:26 +00:00
he
7d83a06dfc Declare nbpg if we're building for sparc, and initialize to the
smallest sparc pagesize.  This should deal with the IOCPARM_MAX
build problem, which occurs on sparc because various models have
different page size, so it's run-time determined instead.

pooka says that rump doesn't use ioctl(), so the value is apparently
of no consequence.
2008-01-09 13:59:43 +00:00
pooka
72b3924d8b Set stacksize to minimum acceptable (two pages, one for cc, one
for actual stack) to mimic kernel stack size better.
2008-01-08 00:23:15 +00:00
ad
77e0b2120f Patch up sysctl locking:
- Lock processes, credentials, filehead etc correctly.
- Acquire a read hold on sysctl_treelock if only doing a query.
- Don't wire down the output buffer. It doesn't work correctly and the code
  regularly does long term sleeps with it held - it's not worth it.
- Don't hold locks other than sysctl_lock while doing copyout().
- Drop sysctl_lock while doing copyout / allocating memory in a few places.
- Don't take kernel_lock for sysctl.
- Fix a number of bugs spotted along the way
2008-01-07 16:12:52 +00:00
riz
f28eb587da Add #include <sys/simplelock.h> 2008-01-05 04:03:01 +00:00
pooka
9b30791f86 Print "panic: " before panicstr when panicking. 2008-01-04 00:38:24 +00:00
pooka
deeebf9713 Theoretically this is supposed to be interchangeable with real
kernel code.  Use kmem_alloc/free instead of some wily homerolled
rump interfaces for memory allocation.
2008-01-03 02:48:02 +00:00
pooka
2c7914f588 use UVM_OBJ_INIT/DESTROY() 2008-01-03 02:44:05 +00:00
pooka
daaf5e53c9 initialize error value 2008-01-03 02:38:23 +00:00
pooka
d53e261066 valloc -> vnalloc, vfree -> vnfree
Avoids collision with userland valloc(3).

no functional change
ad ok
2008-01-03 01:26:28 +00:00
pooka
f8ff426bbb fix build for OBJDIR case. noticed by plenty 2008-01-02 22:01:41 +00:00
pooka
4f69d01d2f Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

    golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

    ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs
2008-01-02 18:15:12 +00:00
pooka
3c068d8021 fix vmlocking2 fallout:
* I heard a wild rumor that vp_interlock is a mutex these days (hi ad!)
* init new locks (hi ad)
* observe that with simple_locks only deadlocks would be caught while
  releasing unlocked locks would go unnoticed.  make locking work (hi pooka)
2008-01-02 15:44:03 +00:00
ad
ae47be00a8 Provide valloc(), fix vfree(). 2008-01-02 13:42:47 +00:00
ad
896ac1329e Build intr.c. 2008-01-02 12:49:53 +00:00
ad
888ef28a4d Fix merge error. 2008-01-02 12:46:07 +00:00
ad
4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
pooka
ffd37c1db1 pass mmap to file systems 2008-01-01 22:31:42 +00:00
pooka
d89e3e05a2 emulate a couple more locking interfaces 2008-01-01 22:03:24 +00:00
pooka
312cc39e60 pull in atomic ops from vmlocking2 2007-12-30 23:30:26 +00:00
pooka
7baf23bce3 fake sigcantmask 2007-12-30 23:29:06 +00:00
pooka
ec137c87f4 steal 1.4.2.1 from vmlocking2: cv_xwait_sig() 2007-12-30 03:35:20 +00:00
perry
b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
pooka
6db2b1c100 LFS_KERNEL_RFW 2007-12-13 16:08:12 +00:00
elad
021227aa78 Don't compile lfs_rfw.c, suggested by cube@. 2007-12-12 18:52:00 +00:00
pooka
db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
ad
4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
hannken
b1446c225c Make it compile again. 2007-12-02 18:24:34 +00:00
yamt
e8abff70f2 constify pagerops. 2007-12-01 10:40:27 +00:00
dsl
956bff160a Temporarily make 'atomic_add_int()' a non-atomic add so the build suceeds.
At some point the functions will (presumably) make their way into either
libc or libutil.
2007-11-30 21:48:40 +00:00
pooka
21913eabe5 Rototill.
Ok, ok, a few more words about it: stop holding puffs_cc as a holy
value and passing it around to almost every possible place (popquiz:
which kernel variable does this remind you of?).  Instead, pass
the natural choice, puffs_usermount, and fetch puffs_cc via
puffs_cc_getcc() only in routines which actually need it.  This
not only simplifies code, but (thanks to the introduction of
puffs_cc_getcc()) enables constructs which weren't previously sanely
possible, say layering as a curious example.

There's still a little to do on this front, but this was the major
fs interface blast.
2007-11-30 19:02:28 +00:00
pooka
6a3d9a187d Remove "puffs_cid" from the puffs interface following l-removal
from the kernel vfs interfaces.  puffs_cc_getcaller(pcc) can be
used now should the same information be desired.
2007-11-27 11:31:17 +00:00
dogcow
1e02f40f0f fallout from the not-quite-complete curlwp removal.
I'm not sure why I had to monkey about with the includes to get VFS_SYNC to
reappear.
2007-11-27 09:14:21 +00:00
pooka
61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00