Commit graph

65902 commits

Author SHA1 Message Date
Jeff Roberson a57decdf32 - In sysctl_kern_file skip fdps with negative lastfiles. This can
happen if there are no files open.  Accounting for these can
   eventually return a negative value for olenp causing sysctl to
   crash with a bad malloc.

Reported by:	Pawel Worach <pawel.worach@gmail.com>
2008-01-03 01:26:59 +00:00
Poul-Henning Kamp 24ecb0cb15 If the disk reports that it support the Compact Flash Association command
set, announce BIO_DELETE capability and issue ATA_CFA_ERASE when we get one.

Once we issue more BIO_DELETE, this will improve lifetime, and
possibly write speed of Flash based devices which have usable flash
adaptation layers.

For now, about the only usage is the newfs(1) -E flag.

Approved by:	sos
2008-01-02 20:33:54 +00:00
Poul-Henning Kamp 08d2425f6f Follow the current fashion of gratuitously stomping into other
peoples code with irrelevant changes[1]:

Use bus_{read|write_*() instead of bus_space_{read|write}_*() for
purely stylistic reasons.

Due to compiler optimizations and inlining, this is for all practical
purposes without effect in the compiled code.

[1] NB: Approved by:	sos
2008-01-02 20:31:14 +00:00
David E. O'Brien bedff79a00 Note what is too {short,long}. 2008-01-02 18:48:27 +00:00
John Baldwin c0cfd9d113 A few whitespace fixes. 2008-01-02 17:09:15 +00:00
Alan Cox 86f1449310 Provide a legitimate pindex to vm_page_alloc() in pmap_growkernel()
instead of writing apologetic comments.  As it turns out, I need every
kernel page table page to have a legitimate pindex to support superpage
promotion on kernel memory.

Correct a nearby style error: Pointers should be compared to NULL.
2008-01-02 08:54:39 +00:00
Alan Cox 273bf93c8d Defer setting either PG_CACHED or PG_FREE until after the free page
queues lock is acquired.  Otherwise, the state of a reservation's
pages' flags and its population count can be inconsistent.  That could
result in a page being freed twice.

Reported by:	kris
2008-01-02 04:43:47 +00:00
David E. O'Brien b028141f0a style(9) 2008-01-02 01:45:31 +00:00
David E. O'Brien 029839a449 style(9) 2008-01-02 01:19:17 +00:00
Alan Cox af6ce1660a Correct a style error that was introduced in revision 1.77. 2008-01-01 20:36:04 +00:00
Jeff Roberson 41e0f66d41 - Place the fhold() in unp_internalize_fp to be more consistent with refs.
- Clear all of the gc flags before doing a run.  Stale flags were causing
   us to skip some descriptors.
 - If a unp socket has been marked REF in a gc pass it can't be dead.

Found by:	rwatson's test tool.
2008-01-01 01:46:42 +00:00
Julian Elischer b6ae6984e8 Don't duplicate the whole of arpresolve to arpresolve 2 for the sake
of two compares against 0. The negative effect of cache flushing
is probably more than the gain by not doing the two compares (the
value is almost certainly in register or at worst, cache).
Note that the uses of m_freem() are in error cases and m_freem()
handles NULL anyhow. So fast-path really isn't changed much at all.
2007-12-31 23:48:06 +00:00
Craig Rodrigues 450ea867c5 In vfs_scanopt(), make sure that the mount option value is not NULL
before calling vsscanf().

PR:		118531
Submitted by:	Jaakko Heinonen <jh saunalahti fi>
MFC after:	3 days
2007-12-31 23:44:53 +00:00
John Baldwin 0deabe7e53 Actually declare the kern.features sysctl node.
Pointy hat to:	jhb
2007-12-31 22:03:57 +00:00
John Baldwin 1abeef854d Include a "pae" feature if an i386 kernel is built with PAE support.
Obtained from:	Yahoo!
2007-12-31 21:12:45 +00:00
John Baldwin df67e9f2f7 Add very basic support for the kernel to export a list of features. Each
feature is represented by a node in the new 'kern.features' sysctl node.
A feature is present if the corresponding node is present and evaluates to
true.

A FEATURE() wrapper macro is added which takes the sysctl node name and
a description of the feature as the sole arguments and creates a read-only
sysctl node with a value of 1.

Discussed on:	arch
2007-12-31 21:12:05 +00:00
Robert Watson 315f04614c Update netisr comment for the SMPng world order: netisr is no longer
implemented using the ISR facility, and cannot be triggered by calling
splnet()/splx().

MFC after:	3 weeks
2007-12-31 20:58:50 +00:00
John Baldwin c903c5fbae Use devclass_get_count() instead of devclass_get_maxunit() to get the
correct number of acpi_thermalX devices.  Having this wrong caused the
acpi_thermal thread to realloc the array of devices on each loop iteration.

MFC after:	1 week
PR:		kern/118497
Submitted by:	Pasi Parviainen
2007-12-31 15:56:03 +00:00
Dag-Erling Smørgrav 89dbcee8ce Add device IDs for the ICH9 family.
PR:		i386/119126
Submitted by:	Dan Lukes <dan@obluda.cz>
MFC after:	1 week
2007-12-31 11:44:01 +00:00
Dag-Erling Smørgrav abb75f864a Tabify. 2007-12-31 11:42:31 +00:00
Jeff Roberson 0c66dc6758 - Pause a while after disabling lock profiling and before resetting it
to be sure that all participating CPUs have stopped updating it.
 - Restore the behavior of printing the name of the lock type in the output.
2007-12-31 03:45:51 +00:00
Jeff Roberson 6f552cb098 - Check the correct variable against NULL in two places.
- If the unp_file is NULL that means it has never been internalized and it
   must be reachable.
2007-12-31 03:44:54 +00:00
Warner Losh 8ac3902acc Add Winbond W89C940F to the list. Also, stub in some entries for two
Holtek cards that will need some special support later, but leave them
commented out for now.

These ID's are transcribed from the Linux ne2k-pci.c
2007-12-31 03:29:02 +00:00
Warner Losh ac13f66337 Add missing 'sc->chip_type ==' to an ugly switch statement expression
so that for RealTek 8019 cards, we consider AUI as well as BNC bits.
2007-12-31 03:27:21 +00:00
Andrew Thompson af0084c92e Pass any unmatched slowprotocols frames up the stack instead of dropping them,
there are more subtypes than just LACP.
2007-12-31 01:16:35 +00:00
Yoshihiro Takahashi a0db222644 Use kbdd_* macros. 2007-12-30 12:27:31 +00:00
Warner Losh c94a7cac1f Rather than not redirting the bp when we get ENXIO, only redirty it
when the error is EIO.  This catches a much larger class of errors
that are unlikely to succeed if retried.

Submitted by: bde
2007-12-30 05:53:45 +00:00
Jeff Roberson 397c19d175 Remove explicit locking of struct file.
- Introduce a finit() which is used to initailize the fields of struct file
   in such a way that the ops vector is only valid after the data, type,
   and flags are valid.
 - Protect f_flag and f_count with atomic operations.
 - Remove the global list of all files and associated accounting.
 - Rewrite the unp garbage collection such that it no longer requires
   the global list of all files and instead uses a list of all unp sockets.
 - Mark sockets in the accept queue so we don't incorrectly gc them.

Tested by:	kris, pho
2007-12-30 01:42:15 +00:00
Marius Strobl 2a79fd39b4 o In preparation for basing a new driver on this one:
- ANSIfy
  - try to bring closer to style(9)
  - remove banal comments.
o Add my copyright for having done lots of fixes and improvements.
2007-12-30 01:32:03 +00:00
Marius Strobl d2d9ab366b Correct the comments in am7990_intr() and am79900_intr(); it's not
possible to end up in the interrupt handler again while processing the
previous RX interrupt in ifp->if_input() because the MD interrupt code
disables the delivery of the respective interrupt until all associated
handlers were called (in the INTR_FILTER case the MI code supposedly
does the same). Toggling the NIC interrupt enable bit in these handlers
still is necessary though as some chips (f.e. the VMware emulated one)
require this to be done in order to keep issuing interrupts.

MFC after:	1 month
2007-12-30 00:23:38 +00:00
Wojciech A. Koszek 9336e0699b Replace explicit calls to video methods with their respective variants
implemented with macros. This patch improves code readability. Reasoning
behind vidd_* is a sort of "video discipline".

List of macros is supposed to be complete--all methods of video_switch
ought to have their respective macros from now on.

Functionally, this code should be no-op. My intention is to leave current
behaviour of touched code as is.

No objections:	rwatson
Silence on:	freebsd-current@
Approved by:	cognet
2007-12-29 23:26:59 +00:00
Wojciech A. Koszek 259699b294 Remove explicit calls to keyboard methods with their respective variants
implemented with macros. This patch improves code readability. Reasoning
behind kbdd_* is a "keyboard discipline".

List of macros is supposed to be complete--all methods of keyboard_switch
should have their respective macros from now on.

Functionally, this code should be no-op. My intention is to leave current
behaviour of code as is.

Glanced at by:	rwatson
Reviewed by:	emax, marcel
Approved by:	cognet
2007-12-29 21:55:25 +00:00
Alan Cox f8a47341fe Add the superpage reservation system. This is "part 2 of 2" of the
machine-independent support for superpages.  (The earlier part was
the rewrite of the physical memory allocator.)  The remainder of the
code required for superpages support is machine-dependent and will
be added to the various pmap implementations at a later date.

Initially, I am only supporting one large page size per architecture.
Moreover, I am only enabling the reservation system on amd64.  (In
an emergency, it can be disabled by setting VM_NRESERVLEVELS to 0
in amd64/include/vmparam.h or your kernel configuration file.)
2007-12-29 19:53:04 +00:00
Alexander Motin 098ff746f8 Add support for optional "AC-Name\Service-Name" syntax at NGM_PPPOE_CONNECT
argument. It allows ppp, mpd or any other node consumer to request
connection to specified access concentrator.

Proposed by:	Alexander A. Burylov <burylov@mail.ru>
2007-12-29 19:44:41 +00:00
Konstantin Belousov 93eba2d50d Plug the leaks in the present (hopefully, soon to be replaced)
implementation of the linux_openat() for the quick MFC.

Reported and tested by: Peter Holm
MFC after:      3 days
2007-12-29 14:28:01 +00:00
Konstantin Belousov 15b78ac5d1 Apply the LCONVPATH() to the (old) linux_stat() and linux_lstat() syscalls.
Without it, code has two problems:
- behaviour of the old and new [l]stat are different with regard of
  the /compat/linux
- directly accessing the userspace data from the kernel asks for
  the panics.

Reported and tested by:	Peter Holm
Reviewed by:	rdivacky
MFC after:	3 days
2007-12-29 14:25:29 +00:00
Konstantin Belousov e7627b2c62 The ffs_balloc() routines, whan allocating the indirect blocks for
the inode, do the rollback in case the allocation failed (due to
insufficient free space or quota limits). But, the code does leaves the
buffers corresponding to the inoirect blocks on the vnode bufobj list.
This causes several assertion failures (for instance, "ffs_truncate3"
in ffs_truncate()) to fail, and could result in the indirect block
aliasing problem, like writing the context of such blocks to random
disk location.

Remove the buffers from the bufobj properly.

Reported and tested by:	Peter Holm
Reviewed by:	tegge
MFC after:	3 weeks
2007-12-29 13:31:27 +00:00
Rui Paulo d9aa6eb4fe Add asmc(4).
Requested by:	njl (mentor)
2007-12-28 22:50:04 +00:00
Jason Evans 8e4fd0a138 Implement RB_PREV() AND RB_FOREACH_REVERSE(). 2007-12-28 07:03:26 +00:00
Robert Watson c5f1beb02a In "show lockedvnods" DDB command, use db_printf() rather than printf()
so that the results end up in the DDB output stream rather than the
console output stream.

This should likely also be done for the vprint() function it calls.

MFC after:	3 months
2007-12-28 00:47:31 +00:00
Attilio Rao 100f241571 Trimm out now unused option LK_EXCLUPGRADE from the lockmgr namespace.
This option just adds complexity and the new implementation no longer
will support it, so axing it now that it is unused is probabilly the
better idea.

FreeBSD version is bumped in order to reflect the KPI breakage introduced
by this patch.

In the ports tree, kris found that only old OSKit code uses it, but as
it is thought to work only on 2.x kernels serie, version bumping will
solve any problem.
2007-12-28 00:38:13 +00:00
Dag-Erling Smørgrav 24550d155f Unbreak LINT on non-i386/amd64 platforms. 2007-12-27 23:19:03 +00:00
Attilio Rao 7a1d78fa3f In order to avoid a huge class of deadlocks (in particular in interactions
with the interlock), owner of the lock should be only curthread or at
least, for its limited usage, NULL which identifies LK_KERNPROC.

The thread "extra argument" for the lockmgr interface is going to be
removed in the near future, but for the moment, just let kernel run for
some days with this check on in order to find potential deadlocking
places around the kernel and fix them.
2007-12-27 22:56:57 +00:00
Robert Watson 0417fe5421 Return ESRCH when a kernel stack is queried on a process in execve() --
p_candebug() will return EAGAIN which, if the other process never
leaves execve(), will result in the sysctl spinning and never returning
to userspace.  Processes should always eventually leave execve(), but
spinning in kernel while we wait is bad for countless reasons, and
particularly harmful if execve() itself is deadlocked.

Possibly we should return another error, or return a marker indicating
the thread is in execve() so it can be reported that way in userspace.

Reported by:	kris
2007-12-27 22:44:01 +00:00
Attilio Rao 98e4f2e2bf As LK_EXCLUPGRADE is used in conjuction with LK_NOWAIT, LK_UPGRADE becames
equivalent with this and so operate the switch.

That call is the only one remaining LK_EXCLUPGRADE consumer and removing
it will prepare the ground for LK_EXCLUPGRADE axing and further
lockmgr improvements.

Discussed with: jeff, ups
2007-12-27 20:52:05 +00:00
Rui Paulo 716a237292 Add asmc(4).
Approved by:	njl (mentor)
2007-12-27 18:26:48 +00:00
Alan Cox 3df92083af Add a list of reservations to the vm object structure.
Recycle the vm object's "pg_color" field to represent the color of the
first virtual page address at which the object is mapped instead of the
color of the object's first physical page.  Since an object may not be
mapped, introduce a flag "OBJ_COLORED" that indicates whether "pg_color"
is valid.
2007-12-27 17:56:35 +00:00
Alan Cox ae0fee95e1 Add the superpage reservation type. 2007-12-27 17:08:11 +00:00
Alan Cox b8e7fc24fe Add configuration knobs for the superpage reservation system. Initially,
the reservation will only be enabled on amd64.
2007-12-27 16:45:39 +00:00
Warner Losh b27aa20e8d A partial solution to some of the 'pull the umass device with a
mounted FS' problems.  These are more along the lines of 'avoiding an
avoidable panic' than a complete solution to removable devices.  We
now close the barn door after the horse has gotten lose and has been
hit by a truck, as it were.  The barn no longer catches fire in this
case, but the horse is still dead :-).

The vfs_bio.c fix causes us not to put a failed write back into the
dirty pool if the error returned was ENXIO.  In that case, the buffer
is treated like any other clean buffer that's being retured.  ENXIO
means the device isn't there anymore and will never be there again in
the future, so retrying is futile.

The vfs_mount.c fix treats 'ENXIO' as success for unmounting a file
system.  If the device is gone, retrying later won't help and we'll
never be able to unmount the device.

These two are part of a larger patch set submitted by the author.  The
other patches will be forth coming.  I added comments to these two
patches.

Submitted by: Henrik Gulbrandsen
Reviewed by: phk@
PR: usb/46176 (partial)
2007-12-27 16:38:28 +00:00
Maxime Henrion f321ff1561 Add a workaround for a deadlock between the rt_setgate() and rt_check()
functions.  It is easily triggered by running routed, and, I expect, by
running any other daemon that uses routing sockets.

Reviewed by:	net@
MFC after:	1 week
2007-12-27 10:00:57 +00:00
Alan Cox c07f36f742 Update two tracepoints, i.e., CTRx() invocations, to reflect the demise of
page coloring a few months ago.
2007-12-27 03:52:14 +00:00
Marius Strobl c5860546c4 Fix some bugs in the FreeBSD 4/5/6 pci(4) IOCTLs compatibility code:
- Use the correct offsets when copying out the results of PCIOCGETCONF_OLD.
  This happened to not affect the 64-bit architectures because there the
  addition of pc_domain to struct pcisel didn't change the overall size of
  struct pci_conf. [1]
- Always copy the name and unit information to conf_old so it's also part
  of the output once this information is cached in dinfo.
- Use the correct type for flags in struct pci_match_conf_old. This
  change is more or less cosmetic though.

Reported and tested by:	bde [1]
Reviewed by:		imp
MFC after:		3 days
Committed from:		24C3
2007-12-26 21:50:59 +00:00
Alexander Motin 97b4f83bb3 Fix incorrectly placed bracket in pppoe_find_svc(). 2007-12-26 19:33:53 +00:00
Marcel Moolenaar ed04c6bea1 "FreeBSD/Open Firmware/PowerPC ..." is confusing and non-standard.
Use "FreeBSD/powerpc Open Firmware ..." instead.
2007-12-26 19:15:58 +00:00
Alexander Motin b06ccdeab3 Remove some prehistoric never used defines. 2007-12-26 19:15:07 +00:00
Warner Losh 93ee5a96ef Update to 2008.
MFC After: 1s
2007-12-26 16:45:35 +00:00
Rui Paulo 12b98c52dd Sync with rev 1.63 of NetBSD's ums.c:
If a mouse has both a wheel and a Z direction we report both.
     XXX Due to tradition the wheel is reported as the Z direction (and the Z
     direction as W).
     Now Apple's Mighty Mouse is fully supported, except the X11 mouse driver
     doesn't know what to do with the new coordinate.

MFC after:   3 months

Approved by:   njl (mentor), imp
2007-12-26 14:31:16 +00:00
Robert Watson 618c7db30a Add textdump(4) facility, which provides an alternative form of kernel
dump using mechanically generated/extracted debugging output rather than
a simple memory dump.  Current sources of debugging output are:

- DDB output capture buffer, if there is captured output to save
- Kernel message buffer
- Kernel configuration, if included in kernel
- Kernel version string
- Panic message

Textdumps are stored in swap/dump partitions as with regular dumps, but
are laid out as ustar files in order to allow multiple parts to be stored
as a stream of sequentially written blocks.  Blocks are written out in
reverse order, as the size of a textdump isn't known a priori.  As with
regular dumps, they will be extracted using savecore(8).

One new DDB(4) command is added, "textdump", which accepts "set",
"unset", and "status" arguments.  By default, normal kernel dumps are
generated unless "textdump set" is run in order to schedule a textdump.
It can be canceled using "textdump unset" to restore generation of a
normal kernel dump.

Several sysctls exist to configure aspects of textdumps;
debug.ddb.textdump.pending can be set to check whether a textdump is
pending, or set/unset in order to control whether the next kernel dump
will be a textdump from userspace.

While textdumps don't have to be generated as a result of a DDB script
run automatically as part of a kernel panic, this is a particular useful
way to use them, as instead of generating a complete memory dump, a
simple transcript of an automated DDB session can be captured using the
DDB output capture and textdump facilities.  This can be used to
generate quite brief kernel bug reports rich in debugging information
but not dependent on kernel symbol tables or precisely synchronized
source code.  Most textdumps I generate are less than 100k including
the full message buffer.  Using textdumps with an interactive debugging
session is also useful, with capture being enabled/disabled in order to
record some but not all of the DDB session.

MFC after:	3 months
2007-12-26 11:32:33 +00:00
Robert Watson 7bf5359e5c Define a new kernel dump "architecture", TEXTDUMPMAGIC, which is used
to identify textdumps in the swap/dump partition.  While textdumps
aren't really an architecture, they are architecture-neutral and so
don't really correspond to any existing architecture.

Define a version number for textdumps, KERNELDUMP_TEXT_VERSION, of 1.

MFC after:	3 months
2007-12-26 10:57:35 +00:00
Robert Watson 44daa2da55 Remove duplicate $FreeBSD$ that snuck in.
MFC after:	3 months
2007-12-26 10:51:07 +00:00
Robert Watson c9b0cc3b96 Add a simple scripting facility to DDB(4), allowing the user to
define a set of named scripts.  Each script consists of a list of DDB
commands separated by ";"s that will be executed verbatim.  No higher
level language constructs, such as branching, are provided for:
scripts are executed by sequentially injecting commands into the DDB
input buffer.

Four new commands are present in DDB: "run" to run a specific script,
"script" to define or print a script, "scripts" to list currently
defined scripts, and "unscript" to delete a script, modeled on shell
alias commands.  Scripts may also be manipulated using sysctls in the
debug.ddb.scripting MIB space, although users will prefer to use the
soon-to-be-added ddb(8) tool for usability reasons.

Scripts with certain names are automatically executed on various DDB
events, such as entering the debugger via a panic, a witness error,
watchdog, breakpoint, sysctl, serial break, etc, allowing customized
handling.

MFC after:	3 months
2007-12-26 09:33:19 +00:00
Andrew Thompson e361d7d421 Fix a panic where if the mbuf was consumed by the filter for requeueing
(dummynet), ipsec_filter() would return the empty error code and the ipsec code
would continue to forward/deference the null mbuf.

Found by:       m0n0wall
Reviewed by:    bz
MFC after:      3 days
2007-12-26 08:41:58 +00:00
Robert Watson 086fec574e Add a new DDB(4) facility, output capture. Input and output from DDB may be
captured to a memory buffer for later inspection using sysctl(8), or in the
future, to a textdump.

A new DDB command, "capture", is added, which accepts arguments "on", "off",
"reset", and "status".

A new DDB sysctl tree, debug.ddb.capture, is added, which can be used to
resize the capture buffer and extract buffer contents.

MFC after:	3 months
2007-12-25 23:06:51 +00:00
Wojciech A. Koszek 45044461a8 "vt" doesn't refer to any existing device anymore. Remove it.
Reviewed by:	cognet@ (mentor)
Approved by:	cognet@ (mentor)
2007-12-25 22:41:29 +00:00
Wojciech A. Koszek 4ffcc89aa6 Rewrite kern.console handling in sbuf(9). My intention is to leave
kern.console format as is. Thus, no difference in output format should
appear after this commit.

Reviewed by:	cognet@ (mentor)
Approved by:	cognet@ (mentor)
2007-12-25 21:17:34 +00:00
Remko Lodder effef9789a Add support for the BMC5722.
Reported by:		Chris Shenton <chris at shenton dot org> on current@
Approved by:		imp (mentor)
2007-12-25 19:51:18 +00:00
Robert Watson 9d422200a2 Bump __FreeBSD_version to 800007 to reflect kdb_enter change. 2007-12-25 18:40:05 +00:00
Robert Watson 55c3064e78 Add a new kernel startup event for DDB services, which will include DDB
output capture, scripting, and textdumps.
2007-12-25 18:36:43 +00:00
Robert Watson 3a2669e435 Add a new privilage category for DDB(4), and add PRIV_DDB_CAPTURE to
control access to the DDB capture buffer.
2007-12-25 18:36:12 +00:00
Robert Watson 3de213cc00 Add a new 'why' argument to kdb_enter(), and a set of constants to use
for that argument.  This will allow DDB to detect the broad category of
reason why the debugger has been entered, which it can use for the
purposes of deciding which DDB script to run.

Assign approximate why values to all current consumers of the
kdb_enter() interface.
2007-12-25 17:52:02 +00:00
Wojciech A. Koszek e8404eeb4d Rename "mbuf_jumbo_pagesize" to "mbuf_jumbo_page". It makes it aligned correctly
within ddb(4) and in the vmstat(8) output.

This change requires netstat(8) to be recompiled.

Reviewed by:	rwatson@
  Tested by:	make LINT
2007-12-25 14:17:16 +00:00
Robert Watson c786600793 Use __FBSDID() in the kernel BPF implementation.
MFC after:	3 days
2007-12-25 13:24:02 +00:00
Wojciech A. Koszek 7a9d5a45e7 Change "audit_pipe_preselect" to "audit_pipe_presel" to make it print
with proper alignment in ddb(4) and vmstat(8).

Reviewed by:	rwatson@
2007-12-25 13:23:19 +00:00
Oleg Bulyzhin 5254af0cf1 Workaround p->numbytes overflow, which can result in infinite loop inside
dummynet module (prerequisite is using queues with "fat" pipe).

PR:		kern/113548
2007-12-25 09:36:51 +00:00
Hajimu UMEMOTO 0c3e489dce Add sysctl mibs for _TSP, _TC1 and _TC2 which is user overridable
but is blocked on user_override mib.
Not a few people want to use a passive cooling without their ACPI
BIOS support.

Reviewed by:	njl
2007-12-24 16:32:14 +00:00
Konstantin Belousov 316d90a37b Move the check for the snp device being already attached after the
fget() call, that is sleeping point, and possibly dropping Giant.

The snp_target == NULL implies the snp_tty == NULL. Remove the code
that is put under snp_target == NULL and snp_tty != NULL clause.

In snpclose(), do the snp_detach() before scheduling the snp device
destruction. Otherwise, after the return from snpclose(), the snp
device is already removed from the snp_list, but tty is still in
snooped state. Any attempt to do i/o on such tty cause panic because
ttytosnp() returns NULL.

Tested by:	Peter Holm
MFC after:	1 week
2007-12-24 13:47:16 +00:00
Marcel Moolenaar 392ffade03 Various fixes:
o  BSD disklabels have relative offsets. Even for the BSD in MBR slice
   setup, except when the mbroffset ioctl is supported. Since we don't
   support that ioctl, bsdlabel(8) expects relative offsets. So, when
   reading an existing disklabel, correct for disklabels that mistakenly
   have the mbroffset offsets.
o  Don't take the geometry seriously, because it's untrustworthy. We do
   expect the numbers to be within range. This means that the secperunit
   field will not be computed from secpercyl and ncyls, but simply is
   the mediasize in sectors.
o  Don't enforce partitions to be aligned to track boundaries. The
   default label, constructed by bsdlabel(8), puts partition a at offset
   BBSIZE bytes, which commonly means sector 16.
2007-12-24 01:01:59 +00:00
Stanislav Sedov 05a824e9fa - Fix a typo in comments.
MFC after:	1 week
Approved by:	cognet
2007-12-23 23:31:27 +00:00
Bernd Walter 36782b8ef3 - remove code from oroginal file, which is not required on BWCT boards
- Be more chatty on startup, since we have enough code space on
  AT91RM9200
- init DS1672 charging
- init USART GPIO
2007-12-23 14:57:35 +00:00
Bernd Walter fc29b8c535 BWCT boards uses two different SPI flash chips
check for both status codes
2007-12-23 14:46:30 +00:00
Robert Watson 2a0a392e1c Remove trailing whitespace from lines in BPF.
MFC after:	3 days
2007-12-23 14:10:33 +00:00
Robert Watson 0bffde27b2 When IPSEC fails to allocate policy state for an inpcb, and MAC is in use,
free the MAC label on the inpcb before freeing the inpcb.

MFC after:	3 days
Submitted by:	tanyong <tanyong at ercist dot iscas dot ac dot cn>,
		zhouzhouyi
2007-12-22 10:06:11 +00:00
Julian Elischer 6829a5c59e give thread0 the tid 100000 and bumpt the others to start at 100001
MFC after:	1 week
2007-12-22 04:56:48 +00:00
Wojciech A. Koszek 731016fe36 Make SCHED_ULE buildable with gcc3.
Reviewed by:	cognet (mentor), jeffr
Approved by:	cognet (mentor), jeffr
2007-12-21 23:30:18 +00:00
John Baldwin 69296991a2 More properly handle links who only have 1 valid IRQ in their bitmask. The
old code special cased them too early which caused a few differences for
these sort of links relative to other PCI links:

- They were always re-routed via the BIOS call instead of assuming that
  they were already routed if the BIOS had programmed the IRQ into a
  matching device during POST.
- If the BIOS did route that link to a different IRQ that was marked as
  invalid, we trusted the $PIR table rather than the BIOS IRQ.

This change moves the special casing for "unique IRQ" links to only take
that into account when picking an IRQ for an unrouted link so that these
links will now not be routed if the BIOS appears to have routed it already
(some BIOSen have problems with that) and so that if the BIOS uses a
different IRQ than the $PIR, we trust the BIOS routing instead (this is
what we do for all other links as well).

Reported by:	Bruce Walter  walter of fortean com
MFC after:	1 week
2007-12-21 16:53:27 +00:00
Alan Cox 9742373a92 Update the comment describing vm_phys_unfree_page(). 2007-12-21 02:44:31 +00:00
Marcel Moolenaar 69643a41ac Apply missing s/rv/res/g in previous commit. 2007-12-21 00:23:23 +00:00
Alan Cox e35395ce21 Modify vm_phys_unfree_page() so that it no longer requires the given
page to be in the free lists.  Instead, it now returns TRUE if it
removed the page from the free lists and FALSE if the page was not
in the free lists.

This change is required to support superpage reservations.  Specifically,
once reservations are introduced, a cached page can either be in the
free lists or a reservation.
2007-12-20 22:45:54 +00:00
John Baldwin 7439d1d9f0 MFamd64/ia64/i386: Only set the rman bus tags and handles in
bus_activate_resource() methods instead of splitting it up between
bus_alloc_resource() and bus_activate_resource().

Glanced at by:	marcel
2007-12-20 21:42:43 +00:00
Ed Maste f16627aadc Avoid holding the aac_io_lock over copyout.
Submitted by: Achim Leubner @ Adaptec.
2007-12-20 21:13:58 +00:00
Pyun YongHyeon a0637caa3f By definition promiscuous mode should see all unicast frames as well
as multicast/broadcast frames. Previously re(4) ignored multicast
frames in promiscuous mode. The RTL8169 datasheet was not clear
how it handles multicast frames in promiscuous mode.

PR:	kern/118572
MFC after:	3 days
2007-12-20 07:26:20 +00:00
Marius Strobl 75d63045d9 In openprom_ioctl() ensure appropriate permissions and that data isn't
NULL and doesn't point to a NULL pointer before dereferencing it. This
fixes a panic triggered by Xorg 7.3.

Reported and tested by:	Bill Green
MFC after:		3 days
2007-12-20 00:31:04 +00:00
Alan Cox bc8794a12a Correct one half of a loop continuation condition in vm_phys_unfree_page().
At present, this error is inconsequential; the other half of the loop
continuation condition is sufficient to achieve correct execution.
2007-12-19 23:09:45 +00:00
Alexander Motin 673f5a8b44 Add option to set packets per second limits instead of default
bits per second ones.
2007-12-19 22:50:14 +00:00
Warner Losh d4277fef7b When devclass_get_maxunit is passed a NULL, return -1 to indicate that
there's nothing allocated at all yet.
2007-12-19 22:05:07 +00:00
Marcel Moolenaar de2fa7b8af Redefine bus_space_tag_t on PowerPC from a 32-bit integral to
a pointer to struct bus_space. The structure contains function
pointers that do the actual bus space access.

The reason for this change is that previously all bus space
accesses were little endian (i.e. had an explicit byte-swap
for multi-byte accesses), because all busses on Macs are little
endian.
The upcoming support for Book E, and in particular the E500
core, requires support for big-endian busses because all
embedded peripherals are in the native byte-order.

With this change, there's no distinction between I/O port
space and memory mapped I/O. PowerPC doesn't have I/O port
space. Busses assign tags based on the byte-order only.
For that purpose, two global structures exist (bs_be_tag and
bs_le_tag), of which the address can be taken to get a valid
tag.

Obtained from: Juniper, Semihalf
2007-12-19 18:00:50 +00:00
Warner Losh 1981bc3b8a Actually program the interrupt controller for priorities. As we
support more AT91 platforms, we'll need to move this into some
platform init routine.
2007-12-19 17:34:17 +00:00
Doug Ambrisko 4844f5c009 Add Dell's sub-vendor id to identify PERC6 RAID controller which has LSI
vendor id's.
2007-12-19 17:23:47 +00:00
Doug Ambrisko 9df7763bf3 I incorrectly assumed the log buffer started from the beginning when it
is actually a circular log.  Deal with it rolling around.  Fortunately,
the log area is big and I haven't seen any roll over yet.  Update and
get rid of the obsolete comment.
2007-12-19 17:22:07 +00:00