Commit Graph

179259 Commits

Author SHA1 Message Date
bouyer 1fd1b49685 Fix for if_start() and pfil_hook() being called from hardware interrupt
context (reported on various mailing-lists, and part of PR kern/41114,
causing panic in pf(4) and possibly ipf(4) when BRIDGE_IPF is used).
Defer bridge_forward() to a software interrupt; bridge_input() enqueues
mbufs to ifp->if_snd which is handled in bridge_forward().
2009-04-04 10:00:23 +00:00
ad 481ff5ace4 Fix problems with ccd:
- Pending async I/O was tossed on unconfigure (should not happen, but..)
- It could exhaust memory under heavy I/O load.
- If memory allocation failed, disk transfers could stall.
- v_numoutput was updated without v_interlock held.

Additionally:

- Make it MPSAFE.
- Use kmem_alloc().
2009-04-04 08:29:39 +00:00
ad 4307e10df2 Add disk_isbusy(), iostat_isbusy(). 2009-04-04 07:30:09 +00:00
perry 088cca6a88 add missing MLINKS for bitstring.3 2009-04-04 01:45:18 +00:00
perry 024260fb7b sort 2009-04-04 01:36:31 +00:00
jld 09d4e48298 Make vi's '@' command work again; a precedence warning fix in r1.2 added
parens in the wrong place such that '@' did nothing.  Needs pullup to -5.

Reported by Ed Ravin; fixes PR 41134.
2009-04-04 01:13:42 +00:00
perry 58e0c54cf3 Consistently use gzip with the -n flag so dates are not embedded.
Not tested on all platforms.
2009-04-03 22:36:34 +00:00
dyoung 211e21b653 Stop dereferencing a dangling device_t pointer and crashing: skip the
drives flagged DRIVE_ATAPI in atabus_activate(,DVACT_DEACTIVATE) just as
we skip them in atabus_detach() and in atabus_childdetched().

Make atabus_detach() parallel attachment more closely by calling
config_detach() on the child chp->ata_drives[i] instead of on
chp->ch_drive[i].drv_softc.  Assert that ata_drives[i] and
ch_drive[i].drv_softc are equal, and set them both to NULL in
atabus_childdetached().
2009-04-03 21:31:08 +00:00
apb 5e464841ab Make "mtree -C" sort its output.
As the input is read from a specfile into a tree of linked lists,
keep each linked list sorted.  The sort order is the same as that
already used by "mtree -c": directories sort after non-directories, but
otherwise names are sorted in the order used by strcmp().
2009-04-03 21:18:59 +00:00
ad 117500b9b2 workqueue_finiqueue: our stack could be swapped out while enqueued to
a worker thread.
2009-04-03 19:34:19 +00:00
sborrill 5547ed1734 Switch various printfs from %ld and %d to PRIu64, etc. to be more consistent
about types (for instance uint32_t was being printed with %d).
2009-04-03 16:23:41 +00:00
perry 35ecaecfb0 Remove the creation of the following symlinks to nowhere:
/usr/X11R7/lib/libXaw.so.6
/usr/X11R7/lib/libXaw.so.7
/usr/X11R7/lib/libXaw.so.8

Note that there is still some use of the "LIBOLD" variables in the
Makefiles associated with PKG* variables that I don't understand.

Discussed with mrg and martin
2009-04-03 16:21:08 +00:00
uebayasi 58141c8949 Include sys/device.h. Fix build. 2009-04-03 15:41:14 +00:00
uebayasi 8e4e2fe06d Include sys/evcnt.h for struct evcnt, not sys/device.h. 2009-04-03 14:47:48 +00:00
pooka bb78ae5d1b Fix yet another recent crashy bug in tmpfs rename: since the source
dirent is no longer cached in lookup and we do the lookup ourselves
in rename, we are most definitely not allowed to assert that it
matches the source vnode passed as an argument.  In case the source
node does not exist or has been replaced, punt with ENOENT.

Also, nuke some misleading prehistoric comments which haven't been
valid in over a year.

Fixes PR kern/41128 by Nicolas Joly
2009-04-03 14:47:40 +00:00
pooka 54f76d2fa4 Issue a better error message if attempting to create a file system
on a block device.  Inspired by PR kern/41127.
2009-04-03 13:22:05 +00:00
tsutsui ac465a42e7 Remove obsolete LIBSA_USE_MEMCPY and LIBSA_USE_MEMSET.
They were removed from <lib/libsa/stand.h> on December 2007.
2009-04-03 10:38:12 +00:00
pooka 3b219697ed Fix bug I introduced in rev 1.64: don't use stack space after
return.  pointed out by yamt.
2009-04-03 07:26:07 +00:00
uwe 30f9f983a3 Use dev/apm/files.apm for APM options in opt_apm.h.
Now both apm and apmdev files.apm can be included so you can switch
from apmdev0 to apm0 at hpcapm0 in your kernel config easily.
2009-04-03 05:01:09 +00:00
uwe 82442fe367 Treat OAPM_IOC_GETPOWER as APM_IOC_GETPOWER - from apmdev(4). 2009-04-03 04:25:40 +00:00
uwe c03d662b39 Config glue for attaching apm at apmdevif.
Unfortunately dev/apm/files.apm and dev/hpc/apm/files.apm cannot be
included both at the same time (they define same options and config(1)
complains), so you need to comment out old code and uncomment new code
to be able to replace "apmdev0 at hpcapm0" with "apm0 at hpcapm0" in
your kernel config.
2009-04-03 04:21:51 +00:00
uwe ea06597b80 Attachment glue to attach apm0 at hpcapm0.
Tested on Jornada 690.
2009-04-03 04:17:03 +00:00
uwe 9a25b0cb7f Switch apmdev to use apm(4) structures from dev/apm/apmvar.h.
Add batteryid argument to aa_get_powstat method implementations.
2009-04-03 04:13:17 +00:00
uwe 7cbde2c0d5 Further reduce diffs to dev/apm/apm.c.
Bring over remaining bits of logic not picked up in the first round.
Main semantic difference between the two that ramins is now basically
powerhooks vs. pmf.

Cosmetics to reduce diff noise: split apmattach into apmdevattach and
apm_attach, where the latter matches its counterpart in the real
apm.c.  Change local macros names from APMDEV* to APM*

Now that apmdev.c is demonstrably congruent to apm.c it should be
easier to switch hpc* and zaurus ports to apm.c from apmdev.c.
apmdev.c is one of the only two remaining drivers that call
dopowerhooks(9), the other one being arch/arm/xscale/pxa2x0_apm.c.

Ideally I would prefer for them to be interchangeable to smooth the
transition (in pmf world order *all* devices must have pmf hooks
registered), but they are attached differently - apmdev is separate
from its backend device (like hpcapm), while apm.c backends are
attachment glue, not separate devices.
2009-04-03 02:08:38 +00:00
dyoung 8f20e30696 Fix SIOCSIFFLAGS. Mark as safe to detach at shutdown. 2009-04-03 00:14:42 +00:00
tsutsui d28e46bb7b Explicitly sort entries on preparing set files from METALOG.
METALOG could have different order due to install(1) race
on parallel builds, and mtree(8) doesn't sort files.
Should fix inconsistent shared sets among builds as seen in
/pub/NetBSD-daily/netbsd-5/200904010000Z/shared/ and
/pub/NetBSD-daily/netbsd-5/200904010002Z/shared/ dirs.
Okay'ed by snj@.
2009-04-02 23:06:16 +00:00
dyoung e5320b0a17 Take out a noisy debug statement that slipped in with device-detachment
at shutdown.
2009-04-02 22:19:48 +00:00
apb 33c39aadf2 In addwhatis(), two items should not be treated as duplicates unless
both the "data" and "prefix" elements are identical.  For example, the
two lines

	amiga/boot (8) - system bootstrapping procedures
	amd64/boot (8) - system bootstrapping procedures

both appear with data = "boot (8) - system bootstrapping procedures" but
with different values for prefix, and we do not want to reject one of
them as a duplicate.
2009-04-02 21:39:33 +00:00
christos af069eb3c7 Centralize the ROUNDUP and ADVANCE macro in a header file, give them an
RT_ prefix and use them appropriately, instead of making copies. Make
pppd use the RT_ROUNDUP macro; fixes proxyarp setting on 64 bit hosts.

XXX: All this should be pulled up to 5.0
2009-04-02 21:02:06 +00:00
ad bbb900dedf banner: fix a minor bug. 2009-04-02 19:43:11 +00:00
mjf 63db8748b7 Continue my crusade - queueing -> queuing 2009-04-02 19:02:42 +00:00
perry d93da10e54 Clean up set files to make them consistent using mtree. Patch from lukem. 2009-04-02 18:06:54 +00:00
drochner eb4f9278bc In humanize_number(), avoid an integer overflow if the buffer
provided is "too large" (log10(2^64) = 19).
(It can still overflow if the input value is close to 2^64 but I don't
consider this a problem.)
fixes nonsense displayed as "total memory" on boot
2009-04-02 17:25:24 +00:00
tsutsui f2ca316138 Don't use relative path from <machine> in #include.
It won't work for symlinks.
2009-04-02 13:00:40 +00:00
drochner 6e71fa2242 add a test which exercises libpthread's ability to remember the
threads which were created, doing some random mallocs in between
so that threads are not equidistant in the address space
(bug fixed in libpthread/pthread.c rev. 1.109)
2009-04-02 12:58:44 +00:00
drochner 103beeac7d add a test which stresses the rbtree code with random numbers 2009-04-02 12:49:59 +00:00
pooka 095a7dd3b6 Release tdvp in an appropriate VOP_RENAME error branch to avoid
panic described in PR kern/40948.

As usual, all the error branches in rename live based on an unholy
amalgamation of prayer and the blood of cute, furry and tasty
quadrupeds, so I won't even attempt to audit the rest.

And this wapbl rename really really needs to be merged with the
standard rename.  That should be a fun PhD thesis topic ....
2009-04-02 11:33:04 +00:00
pooka c69ace3c05 ARGSUSED makes lindt a happy camper 2009-04-02 09:30:41 +00:00
dyoung 30156f20e6 Cosmetic changes, only, to clarify and to save a couple of lines: return
a constant, 0, instead of returning ret when it is always 0.  Wait to
initialize ret until we really need to.
2009-04-02 01:06:49 +00:00
dyoung b783d8bd8c Add the WEP capability to our net80211 capability flags, since we do
sort of support hardware WEP.  Only change the WEP key index in a Tx
descriptor from 0 if the type of our transmit key is _WEP, not _TKIP:
i.e., only if we're really doing WEP crypto in the hardware.

Ignore a watchdog timeout on any Tx ring if we can collect some packets
from that ring.  Restart both the receiver and the transmitter when a
watchdog timeout occurs instead of restarting only the transmitter.
2009-04-02 00:57:20 +00:00
dyoung 726f95dae4 I find myself making a lot of changes in this code to keep it compiling
and (let us hope) working in the 21st century, so I have put it through
unifdef -D__NetBSD__ -U__FreeBSD__ so that it is less of a chore to read
and to maintain.
2009-04-02 00:39:37 +00:00
enami 09fcc8b316 So that profile kernel runs again,
- Adjust the size of functions used to patch.
- Fix the jump offset of mcount call when patching functions.

Approved by Andrew Doran.
2009-04-02 00:19:02 +00:00
dyoung 0d1ba3e899 During shutdown, detach devices in an orderly fashion.
Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks.  For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown.  Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags.  Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag.  The default for kern.detachall is 0.  SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress.  In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs.  Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
2009-04-02 00:09:32 +00:00
darran 49d3640ae0 Also inherit the parent's TCP segmentation offload capability.
Note the vlan interface does not see updates to the parents capabilities
so if, for example, TSO is on in both, then turned off in the parent it
will remain on in the vlan interface.
2009-04-01 22:56:59 +00:00
drochner 23d4af832f sort out what is needed for crash(8) and what not, should fix
recent build errors
2009-04-01 21:15:45 +00:00
christos 802d07dbca cast segsz to int. 2009-04-01 21:15:23 +00:00
cube 7ad46619fb Make keypad return an int instead of nothing, as the SUS and even
curses_input(3) [!] say it should.

OK'd jdc@.  ABI lawyers say this doesn't need major bump.
2009-04-01 20:59:15 +00:00
perry 0e8e3df5ff More reproducible build fixes:
1) invoke objcopy with --preserve-dates or it will update all the
   dates in the .a file to the present date.
2) add an invocation of ar-as-ranlib or the object file index ends up
   with the date in it. (it might also end up with an incorrect
   index.)
2009-04-01 17:51:12 +00:00
perry 6b7db9a3b4 Add a _ARRANFL for the flags for invoking ar as ranlib.
Will be used only for Makefile.rump for now.
2009-04-01 17:47:39 +00:00
martin 4e59766728 Make the ddb.onpanic line acceptable even if commented out 2009-04-01 16:38:46 +00:00