Commit Graph

65949 Commits

Author SHA1 Message Date
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
Doug Ambrisko
c609b15425 Allow negative values to be specified in the loader. 2007-12-19 17:06:32 +00:00
Ruslan Ermilov
9eb1b6aabb Fix bugs in the TCP syncache timeout code. including:
When system ticks are positive, for entries in the cache
bucket, syncache_timer() ran on every tick (doing nothing
useful) instead of the supposed 3, 6, 12, and 24 seconds
later (when it's time to retransmit SYN,ACK).

When ticks are negative, syncache_timer() was scheduled
for the too far future (up to ~25 days on systems with
HZ=1000), no SYN,ACK retransmits were attempted at all,
and syncache entries added in that period that correspond
to non-established connections stay there forever.

Only HEAD and RELENG_7 are affected.

Reviewed by:	silby, kmacy (earlier version)
Submitted by:	Maxim Dounin, ru
2007-12-19 16:56:28 +00:00
Ed Maste
0c40d5be19 Do not recursively acquire aac_io_lock in aac_ioctl_event.
MFC After: 3 days
2007-12-19 14:33:40 +00:00
Alan Cox
0349775790 Eliminate redundant code from vm_page_startup(). 2007-12-19 05:47:50 +00:00
Kip Macy
d29a9a83fd Remove extraneous debug statements.
Noticed by: Andrey Chernov
2007-12-19 05:17:40 +00:00
Kip Macy
b96ebbf2e8 Don't overload tcp_usrreqs unless the kernel doesn't provide offload support. 2007-12-18 23:00:25 +00:00
Kip Macy
bc65987ade Incorporate TCP offload hooks in to core TCP code.
- Rename output routines tcp_gen_* -> tcp_output_*.
  - Rename notification routines that turn in to no-ops in the absence of TOE
    from tcp_gen_* -> tcp_offload_*.
  - Fix some minor comment nits.
  - Add a /* FALLTHROUGH */

Reviewed by: Sam Leffler, Robert Watson, and Mike Silbersack
2007-12-18 22:59:07 +00:00
David E. O'Brien
10c2b8e128 Be more exact with sigaction SA_SIGINFO handling.
Reviewed by:	marcel
2007-12-18 20:39:13 +00:00
Andrew Thompson
8411d52a93 Simplify the error handling and use the dereferenced sc->sc_ifp pointer. 2007-12-18 09:13:04 +00:00
Andrew Thompson
155f68d1aa When the bridge has an address and a packet comes in for it then drop it if the
link has been marked discarding by Spanning Tree. This would cause the bridge
to see duplicate packets to itself even if STP has correctly calculated the
topology and blocked redundant links.

Reported by:	trasz
Tested by:	trasz
MFC after:	3 days
2007-12-18 07:04:50 +00:00
Andrew Thompson
1f019d8381 - Use the macro to check the port status has it will also test if its
administratively down (!IFF_UP)
 - Use the same parameters to lagg_link_active() to get the backup port as in
   the output path, this didnt actually matter in practice as sc_primary is
   always the first on the port list.

MFC after:	3 days
2007-12-18 02:12:03 +00:00
Randall Stewart
83073fcba3 - sctp-iterator should run at PI_NET priority ...not 0.
MFC after:	1 week
2007-12-18 01:24:15 +00:00
Kip Macy
81186fb40c only include intr_machdep.h when it is needed for intr_bind
ia64 doesn't have an intr_machdep.h
2007-12-17 23:39:28 +00:00
Marcel Moolenaar
6d86273c0a Remove file after being repocopied to ../ofw, where it lives on.
Repocopy by: simon@
2007-12-17 22:50:39 +00:00
Marcel Moolenaar
22f4c5e3d9 Build the OFW loader from its new location after the sources
were repocopied from ./loader to ./ofw.
2007-12-17 22:19:44 +00:00
Andrew Thompson
f51133ee3f Add myself to the copyright. 2007-12-17 18:49:44 +00:00
Robert Watson
b5f992b93d Fix a MAC label leak for POSIX semaphores, in which per-policy labels
would be properly disposed of, but the global label structure for the
semaphore wouldn't be freed.

MFC after:	3 days
Reported by:	tanyong <tanyong at ercist dot iscas dot ac dot cn>,
		zhouzhouyi
2007-12-17 17:26:32 +00:00
Robert Watson
8b953b3f9d Fix leaking MAC labels for IPv6 inpcbs by adding missing MAC label
destroy call; this transpired because the inpcb alloc path for IPv4/IPv6
is the same code, but IPv6 has a separate free path.  The results was
that as new IPv6 TCP connections were created, kernel memory would
gradually leak.

MFC after:	3 days
Reported by:	tanyong <tanyong at ercist dot iscas dot ac dot cn>,
		zhouzhouyi
2007-12-17 17:20:57 +00:00
Kip Macy
c662126d0c disable update in place on transmit 2007-12-17 10:02:29 +00:00
Kip Macy
5e0f5cfaed Add SB_NOCOALESCE flag to disable socket buffer update in place 2007-12-17 10:02:01 +00:00
Kip Macy
8090c9f504 Make TCP offload work on HEAD (modulo negative interaction between sbcompress
and t3_push_frames).
 - Import latest changes to cxgb_main.c and cxgb_sge.c from toestack p4 branch
 - make driver local copy of tcp_subr.c and tcp_usrreq.c and override tcp_usrreqs so
   TOE can also functions on versions with unmodified TCP

- add cxgb back to the build
2007-12-17 08:17:51 +00:00
David Xu
7fab871d8c Check NULL pointer. 2007-12-17 08:09:37 +00:00
Kip Macy
228d1e266e build tcp_offload.c instead of tcp_ofld.c 2007-12-17 08:00:08 +00:00
Kip Macy
8b5709dfab incorporate feedback since initial commit
- rename tcp_ofld.[ch] to tcp_offload.[ch]
- document usage and locking conventions of the functions in the
  toe_usrreqs function vector
- document tcpcb, inpcb, and socket fields used by toe
- widen the listen interface into 2 functions
- rename DISABLE_TCP_OFFLOAD to TCP_OFFLOAD_DISABLE
- shrink conditional compilation to reduce the likelihood of bitrot
- replace sc->sc_toepcb checks in tcp_syncache.c with TOEPCB_ISSET
2007-12-17 07:56:27 +00:00
Kip Macy
29910a5a77 widen the routing event interface (arp update, redirect, and eventually pmtu change)
into separate functions

revert previous commit's changes to arpresolve and add a new interface
arpresolve2 which does arp resolution without an mbuf
2007-12-17 07:40:34 +00:00
David Xu
9514dcc041 Add missing changes for fixing LOR of umtx lock and thread lock, follow
the committing of files:
	kern_resource.c revision 1.181
	sched_4bsd.c	revision 1.111
	sched_ule.c	revision 1.218
2007-12-17 05:55:07 +00:00
Kevin Lo
5497f4c53e Use M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL
Reviewed by: imp
2007-12-17 05:08:54 +00:00
Kip Macy
58505389d1 Don't panic in arpresolve if we're given a null mbuf. We could
insist that the caller just pass in an initialized mbuf even
if didn't have any data - but that seems rather contrived.
2007-12-17 04:19:25 +00:00
Kip Macy
ea6ee7d60a Include cdefs.h and param.h for architectures with less header pollution 2007-12-16 21:22:24 +00:00
Poul-Henning Kamp
164a5044a9 Add the magic word 0 value for CFA compliant devices. 2007-12-16 21:18:13 +00:00
Rui Paulo
de272a0a53 Fix previous commit. The code ended up in the wrong function.
Approved by:	     njl (mentor)
2007-12-16 20:37:27 +00:00
Poul-Henning Kamp
015a11e695 Chop DIOCGDELETE from userland up in 1024 sector chunks to give geom_disk
or any other bio chopping geom a reasonable size of work.

Check for delivered signals between chunks, because the request size
and service time is unbounded.
2007-12-16 19:38:26 +00:00
Kip Macy
bfa0795b00 Add back in cxgb now that the includes are believed to be fixed 2007-12-16 18:45:23 +00:00
Kip Macy
fc5a2e51fb Use the vm include convention of busdma 2007-12-16 18:43:57 +00:00
Kip Macy
04b25f8e3e need M_IOVEC define 2007-12-16 18:36:57 +00:00
Kip Macy
01cf8d43b8 Don't globally include mvec.h its only needed by cxgb_sge.c 2007-12-16 18:26:04 +00:00
Poul-Henning Kamp
eed6cda966 Don't limit BIO_DELETE requests to MAXPHYS, they perform no data
transfers, so they are not subject to the VM system limitation.
2007-12-16 18:03:31 +00:00
Kip Macy
3bd3bd76b5 Remove cxgb module from build until I can compensate for the lack of header
pollution on architectures other than amd64
2007-12-16 17:43:40 +00:00
Stanislav Sedov
1e6774a44e - Don't return 0xffff if PHY id isn't equal 0. This allows PHYs with
non-zero addresses to be used.

Approved by:	cognet
MFC after:	2 weeks
2007-12-16 12:57:12 +00:00
Stanislav Sedov
64425c8f7b - Add quirk for the TrendNet TU-S9 adapter, which uses new version of PL2303
chip (revision 0x400). This allows it to be correctly identified as PL2303X.

Approved by:	maxim
MFC after:	1 week
2007-12-16 12:39:50 +00:00
Scott Long
469f9f4498 Add a missing mutex unlock.
Reported by: Michael Jung
2007-12-16 07:49:44 +00:00
Kip Macy
a47aeca9c0 turn off building of cxgb properly ... sigh 2007-12-16 07:44:08 +00:00
Kip Macy
d202ae29cf Don't use old-style mbuf iovecs 2007-12-16 07:41:57 +00:00
Kip Macy
bdca760906 Update tod_connect call to reflect updated interface 2007-12-16 07:37:48 +00:00
Kip Macy
6dbb9276dc disable cxgb build to prevent tinderbox whining 2007-12-16 07:36:35 +00:00
Kip Macy
b3e761e5c8 Move arp update upcall to always be called for ARP replies - previous invocation
would not always get called at the appropriate times
2007-12-16 06:42:33 +00:00
Jeff Roberson
ace8398da0 Refactor select to reduce contention and hide internal implementation
details from consumers.

 - Track individual selecters on a per-descriptor basis such that there
   are no longer collisions and after sleeping for events only those
   descriptors which triggered events must be rescaned.
 - Protect the selinfo (per descriptor) structure with a mtx pool mutex.
   mtx pool mutexes were chosen to preserve api compatibility with
   existing code which does nothing but bzero() to setup selinfo
   structures.
 - Use a per-thread wait channel rather than a global wait channel.
 - Hide select implementation details in a seltd structure which is
   opaque to the rest of the kernel.
 - Provide a 'selsocket' interface for those kernel consumers who wish to
   select on a socket when they have no fd so they no longer have to
   be aware of select implementation details.

Tested by:	kris
Reviewed on:	arch
2007-12-16 06:21:20 +00:00
Jeff Roberson
53bfc2ecaf - Don't depend on header pollution to declare struct thread. 2007-12-16 06:12:53 +00:00
Kip Macy
53f37d1908 Fix tinderbox on sun4v
include cpufunc.h so that nanoseconds(void) is defined
2007-12-16 06:07:34 +00:00
Kip Macy
3b10e74aa9 Makefile for the TCP offload module 2007-12-16 05:40:18 +00:00
Kip Macy
64e4fdfff0 Don't use old style mbuf iovec interface 2007-12-16 05:34:18 +00:00
Kip Macy
a9420d282f Update the toedev's connect interface to reflect the fact that the inpcb
doesn't cache the rtentry in HEAD.
2007-12-16 05:30:21 +00:00
Kip Macy
280b95e8b5 Add driver for TCP offload
Sponsored by: Chelsio Inc.
2007-12-16 05:27:26 +00:00