Commit Graph

169644 Commits

Author SHA1 Message Date
joerg
1e127b8726 Remove some prototypes that are not implemented. Make some functions
static that are only used in intr.c.
2008-05-07 07:00:16 +00:00
jdc
fd15456f57 Correct Sbus register definitions. 2008-05-07 06:36:48 +00:00
simonb
4ec02db9e9 Fix a "#define<tab><tab>" that crept in to previous. 2008-05-07 05:40:01 +00:00
yamt
2f1a30af0d agrsetport: fix a use of uninitialized variable. 2008-05-07 01:13:51 +00:00
macallan
5572494305 Make the priority ordering code actually work.
Thanks to Izumi Tsutsui for bugging me repeatedly about the problem.
2008-05-07 00:39:12 +00:00
ad
39e9d8a066 doh 2008-05-06 23:03:03 +00:00
ad
cf45b9bae4 rw_tryenter: there is a few instruction race between reading rw_owner and
doing the cmpxchg, where another thread can successfully get a read hold
on the lock. That shouldn't fail anyone trying trying to get a read
hold. So for read locks, never bail just because the CAS fails, only bail
if we the status bits in the lock word say we can't have it.
2008-05-06 22:57:39 +00:00
xtraeme
35fe7cdcf1 prop_object_iterator_next() and prop_object_iterator_reset() were
acquiring the rwlock recursively in some paths.

Introduce _prop_rwlock_tryrdlock() and use it in these functions, so
that the rwlock is *always* acquired once, while here add some
_PROP_RWLOCK_OWNED asserts to verify.

This definitely fixes the "locking against myself" panics.
2008-05-06 22:57:26 +00:00
uwe
5e2fa55b72 For sh3 set default DBG to "-Os -freorder-blocks" which is almost like -O2
but without -falign-* that is too zealous for low-memory sh3 machines.
2008-05-06 22:19:11 +00:00
dyoung
f32d909d6e Use the right key, "ifcaps" not "ifcap", in do_setifcaps(). assert()
that the object associated with that key is the right size.
2008-05-06 21:58:05 +00:00
jdc
93d3122a7c Add more initialisation steps (read reset register; pause; set burst size
in config register).

This fixes the continuous interrupt stream previously seen.  It is now
possible to run `ifconfig gem0 up`.  However, "gem0: device timeout"
messages appear and we don't appear to receive any interrupts.
2008-05-06 21:24:40 +00:00
dyoung
1c6c1fd531 Extract subroutine do_setifcaps() and fix the bug that uwe@ reported
in capabilities-setting.

Use prop_dictionary_util(3).

Rename the parser snpaoffset to parse_snpaoffset.
2008-05-06 21:20:05 +00:00
dyoung
502f5a16a5 Use prop_dictionary_util(3).
Re-use set80211() some more.
2008-05-06 21:18:17 +00:00
dyoung
fac0aeb0a0 Use prop_dictionary_util(3). 2008-05-06 21:13:20 +00:00
jdc
cde723377a Add some Sbus-specific definitions (more registers and more values in the
Sbus Config register).
2008-05-06 21:09:34 +00:00
jdc
d91c968da7 Treat ledma the same way as sbus and dma when looking for the boot path.
Original Ultra 1's with sbus -> ledma -> le can now network boot again.
(From martin@).
2008-05-06 21:07:57 +00:00
njoly
24cbc2830b - Make semctl SETVAL/SETALL commands validate the semaphore value to
be set, which needs to be in the range [0,SEMVMX].
- Adjust the man page.
2008-05-06 20:25:09 +00:00
ad
82f138617e sys_unmount: drop ref to root dir before dounmount(), otherwise we'll
always get EBUSY.
2008-05-06 19:14:32 +00:00
dyoung
4e8b81ea3e Use prop_dictionary_util(3). 2008-05-06 18:58:47 +00:00
ad
42d0626726 PR kern/38141 lookup/vfs_busy acquire rwlock recursively
Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
  sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
  and is only ever write locked in dounmount(). A write hold can't be taken
  on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
  example when going r/o -> r/w, and is only present to serialize updates.
  In order to take this lock, a read hold must first be taken on
  mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.
2008-05-06 18:43:44 +00:00
ad
a4e0004be3 LOCKDEBUG: try to speed it up a bit by not using so much global state.
This will break the build briefly but will be followed by another commit
to fix that..
2008-05-06 18:40:57 +00:00
dyoung
55927815b6 Use prop_dictionary_util(3). 2008-05-06 18:35:38 +00:00
dyoung
42acbb2b0d Fix syntax error in last. 2008-05-06 18:16:34 +00:00
dyoung
990c1a7873 Cosmetic: use return rc ? 0 : -1;
Make sure to release a prop_object_t that I am no longer using.
2008-05-06 18:09:50 +00:00
dyoung
a2e4fb3562 Use prop_dictionary_util(3) some more.
When we read interface flags and capabilities from the kernel, take
care not to record them in our current environment (env), but record
them in the output environment (oenv), instead.  This helps us get
interface capabilities and flags right.
2008-05-06 17:29:04 +00:00
xtraeme
d69a8a8939 Xref prop_dictionary_util(3). 2008-05-06 17:23:38 +00:00
xtraeme
eab7dadfb7 Xref mount_tmpfs(8). 2008-05-06 17:21:56 +00:00
ad
81194e34f1 Allow rw_tryenter(&lock, RW_READER) to recurse, for vfs_busy(). 2008-05-06 17:11:45 +00:00
dyoung
32cf2beed0 Rename in_addr_commit() to commit_address(), and refactor slightly
to support IPv6 as well as IPv4 (a work in progress).

Make the second argument of af_status() a bool instead of an int.

Exit early with an error if the operator specifies an unsupported
address family on the command line.  The change should help rc
scripts to detect that IPv6 support is missing from the kernel,
with 'ifconfig lo0 inet6'.

Start using prop_dictionary_util(3).
2008-05-06 16:15:17 +00:00
dyoung
e51773dc79 Add a license. 2008-05-06 16:09:18 +00:00
dyoung
40b61e5050 Add WARNS=4 and a dependency on ${LIBPROP}. 2008-05-06 16:07:00 +00:00
dyoung
fdf6250eac Add -lprop to the LIBS line so that ifconfig will link. 2008-05-06 15:32:06 +00:00
skrll
2932f766a1 Deal with ifconfig lossage.
Looks like I picked the wrong week to quit netbsd.
2008-05-06 15:09:45 +00:00
ad
d63f54a366 lookup: Do a vfs_trybusy(). If the file system is being unmounted, then
just fail the operation.
2008-05-06 15:04:00 +00:00
dyoung
8db3a2f0ba If the address family is not set, assume AF_APPLETALK. Exit
at_status() quietly if the address family is set, and it is not
set to AF_APPLETALK.
2008-05-06 15:02:49 +00:00
xtraeme
771a05b730 Do not acquire the rwlock recursively in prop_{array,dictionary}_iterator_reset()
when prop_{array,dictionary}_copyout_ioctl() is called.

Introduce _PROP_RWLOCK_OWNED() which is a KASSERT(rw_lock_held(lock))
and use it in those two functions, also acquire the rwlock in other
places where it is required now.

This fixes a LOCKDEBUG panic "locking against myself", as reported by
Geoff C. Wing in current-users@.
2008-05-06 13:52:51 +00:00
xtraeme
f5b5967c0e Make this build again. 2008-05-06 13:31:02 +00:00
ad
39d40db63f PR kern/38141 lookup/vfs_busy acquire rwlock recursively
- sys_sync: acquire a write lock on the mount since the operation modifies
  the mount structure.
- sys_fchdir: use vfs_trybusy(). If an unmount is in progress, just fail it.
2008-05-06 12:54:25 +00:00
lukem
dab1996c70 Add a missing semicolon.
(mmm, compile before commit :)
2008-05-06 12:52:34 +00:00
ad
8384d709ae Fix a couple of problems with checkdirs():
- vnode and cwd locks were being taken with proc_lock held, which is bad
  because proc_lock can only be held for a short period of time.

- Processes could have continually forked and escaped notice, keeping
  a reference to the old directory on top of which a new mount exists.
2008-05-06 12:51:22 +00:00
ad
bdaf7ef5fc PR kern/38141 lookup/vfs_busy acquire rwlock recursively
vfs_busy: don't deadlock if curlwp is unmounting.
2008-05-06 12:39:32 +00:00
ad
f4d5a72c7b PR kern/38141 lookup/vfs_busy acquire rwlock recursively
getvnode: Use vfs_trybusy, not vfs_busy. If unmount is in progress we
could deadlock, because vnode locks can be held during getnewvnode().
dounmount() locks in the reverse order (vfs_busy -> vnode).
2008-05-06 12:37:04 +00:00
ad
ed8a08bae0 PR kern/37950 Unmounting psshfs immediately panics the machine
puffs_getvnode() was inserting vnodes into mnt_vnodelist without taking
a reference to the mount for each. When vnodes are scrubbed, refs to the
vnodes mount structure are dropped => boom.
2008-05-06 12:33:16 +00:00
apb
76807ad91e Add a note about the stupid behaviour of "%c" format. 2008-05-06 12:01:35 +00:00
tsutsui
2925cedf26 - use RTK_IDR[0-5] registers to get MAC address on RTL8168C
- change sc_rev numbers to match quirk numbers used in Realtek's driver
- tweak some register definitions
Taken from Realtek's FreeBSD driver.

Untested yet on 8168C, but no bad sideeffect on older chips.
2008-05-06 11:45:00 +00:00
tsutsui
b127908947 Rename some softc variables for readability. 2008-05-06 11:35:38 +00:00
yamt
73fd77741c obsolete getiobuf_nowait mlink. 2008-05-06 11:34:18 +00:00
yamt
9cbf394e66 update to match with the recent reality. 2008-05-06 11:32:46 +00:00
yamt
c331e3e5e9 getiobuf(false, NULL) -> getiobuf(NULL, false) 2008-05-06 11:08:19 +00:00
yamt
bb127cf870 ata_raid_config_block_rw: getiobuf(vp, NULL) -> getiobuf(vp, false) 2008-05-06 11:07:24 +00:00