]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoFor AIM, have cpu_idle() set MSR_POW when the powerpc_pow_enabled
Marcel Moolenaar [Fri, 7 Mar 2008 22:27:06 +0000 (22:27 +0000)]
For AIM, have cpu_idle() set MSR_POW when the powerpc_pow_enabled
variable is set. On my Mac Mini this puts the CPU in NAP mode when
the kernel is idle and, any technical or environmental reasons
aside, avoids that I have to listen to the fan all day :-)

16 years agoAdd support for the BUS_CONFIG_INTR() method to the platform and to
Marcel Moolenaar [Fri, 7 Mar 2008 22:08:43 +0000 (22:08 +0000)]
Add support for the BUS_CONFIG_INTR() method to the platform and to
openpic(4). Make use of it in ocpbus(4). On the MPC85xxCDS, IRQ0:4
are active-low.

16 years agoSend only one incoming notification at a time to reduce queue
Alexander Motin [Fri, 7 Mar 2008 21:12:56 +0000 (21:12 +0000)]
Send only one incoming notification at a time to reduce queue
trashing and improve performance.
Remove waitflag argument from ng_ksocket_incoming2(), it means nothing
as function call was queued by netgraph.
Remove node validity check, as node validity guarantied by netgraph.
Update comments.

16 years agoUpdate ddb.4 to reflect addition of /S (symbol name) printing mode for
Robert Watson [Fri, 7 Mar 2008 18:14:29 +0000 (18:14 +0000)]
Update ddb.4 to reflect addition of /S (symbol name) printing mode for
examine.

MFC after: 3 days
PR: 57976

16 years agoAdd a /S mode to DDB "ex" command, which interprets and prints the
Robert Watson [Fri, 7 Mar 2008 18:09:07 +0000 (18:09 +0000)]
Add a /S mode to DDB "ex" command, which interprets and prints the
value at the requested address as a symbol.  For example, "ex /S
aio_swake" prints the name of the function currently registered in
via aio_swake hook.

The change as committed differs slightly from the patch in the PR,
as I force the size of the retrieved value (and the automatic
address increment) to be sizeof(void *).  This seems to provide
the most useful auto-increment behavior, and defaults using the
default size (4), which is not sizeof(void *) on 64-bit platforms.

MFC after: 3 days
PR: 57976
Submitted by: Dan Strick <strick at covad.net>

16 years agoMinor spelling/grammer fixes.
Robert Watson [Fri, 7 Mar 2008 17:02:34 +0000 (17:02 +0000)]
Minor spelling/grammer fixes.

MFC after: 3 days

16 years agoApply le*toh() or htole*() to the variables of which we use the address
Marcel Moolenaar [Fri, 7 Mar 2008 16:55:24 +0000 (16:55 +0000)]
Apply le*toh() or htole*() to the variables of which we use the address
as the buffer pointer in the call to axe_cmd(). This is needed to make
the code work on big-endian machines.

Ok'd: imp@

16 years agoRemove stale #include <machine/atomic.h>, which as needed by lazy
Jason Evans [Fri, 7 Mar 2008 16:54:03 +0000 (16:54 +0000)]
Remove stale #include <machine/atomic.h>, which as needed by lazy
deallocation.

16 years agoMove IFF_NEEDSGIANT warning from if_ethersubr.c to if.c so it is displayed
Robert Watson [Fri, 7 Mar 2008 16:00:44 +0000 (16:00 +0000)]
Move IFF_NEEDSGIANT warning from if_ethersubr.c to if.c so it is displayed
for all network interfaces, not just ethernet-like ones.

Upgrade it to a louder WARNING and be explicit that the flag is obsolete.
Support for IFF_NEEDSGIANT will be removed in a few months (see arch@ for
details) and will not appear in 8.0.

Upgrade if_watchdog to a WARNING.

16 years agoAdd __FBSDID() tag.
Robert Watson [Fri, 7 Mar 2008 15:27:08 +0000 (15:27 +0000)]
Add __FBSDID() tag.

MFC after: 3 days
Pointed out by: antoine

16 years agoAdd __FBSDID() tags.
Robert Watson [Fri, 7 Mar 2008 15:25:56 +0000 (15:25 +0000)]
Add __FBSDID() tags.

MFC after: 3 days

16 years agoWhen killing a user process from DDB, check that the requested signal is
Robert Watson [Fri, 7 Mar 2008 14:26:30 +0000 (14:26 +0000)]
When killing a user process from DDB, check that the requested signal is
> 0 rather than >= 0, or we will panic when trying to deliver the signal.

MFC after: 3 days
PR: 100802
Submitted by: Valerio Daelli <valerio.daelli at gmail.com>

16 years agoCalculate the number of pages the GATT spans when reading from each page
John Baldwin [Fri, 7 Mar 2008 13:36:38 +0000 (13:36 +0000)]
Calculate the number of pages the GATT spans when reading from each page
to flush the TLB instead of hardcoding a size of 33 pages.  Apertures of
32MB and 64MB only use a 16 page GATT and an aperture of 128MB only uses
a 32 page GATT, so without this the code could walk off the end of the
pointer and cause a page fault if the next page was unmapped.  Also, for
aperture sizes > 128MB, not all of the pages would be read.  The Linux
driver has the same bug.

MFC after: 1 week
Tested by: Frédéric PRACA  frederic.praca of freebsd-fr.org

16 years agoReserve two bytes at the end of the DDB input line in db_readline() to
Robert Watson [Fri, 7 Mar 2008 13:13:17 +0000 (13:13 +0000)]
Reserve two bytes at the end of the DDB input line in db_readline() to
hold the newline and nul terminator.  Otherwise, there are cases where
garbage may end up in the command history due to a lack of a nul
terminator, or input may end up without room for a newline.

MFC after: 3 days
PR: 119079
Submitted by: Michael Plass <mfp49_freebsd@plass-family.net>

16 years agoThis commit was generated by cvs2svn to compensate for changes in r176892,
Shteryana Shopova [Fri, 7 Mar 2008 09:33:29 +0000 (09:33 +0000)]
This commit was generated by cvs2svn to compensate for changes in r176892,
which included commits to RCS files with non-trunk default branches.

16 years agoVendor patch: Prevent bsnmpd from dumping core when a module's init hook
Shteryana Shopova [Fri, 7 Mar 2008 09:33:29 +0000 (09:33 +0000)]
Vendor patch: Prevent bsnmpd from dumping core when a module's init hook
returns an error.

Approved by: bz (mentor), harti

16 years agoAdd proper support for the SATA/AHCI part of IXP[67]00
Søren Schmidt [Fri, 7 Mar 2008 09:29:19 +0000 (09:29 +0000)]
Add proper support for the SATA/AHCI part of IXP[67]00

16 years agoTo overcome hardware checksum offload bug msk(4) used to compute
Pyun YongHyeon [Fri, 7 Mar 2008 04:55:58 +0000 (04:55 +0000)]
To overcome hardware checksum offload bug msk(4) used to compute
TCP/UDP checksum in driver for short frames. For frames that requires
hardware VLAN tag insertion, the checksum offload trick does not
work due to changes of checksum offset in mbuf after the VLAN tag.

Disable hardware checksum offload for VLAN interface to fix the bug.

Reported by: Christopher Cowart < ccowart AT rescomp DOT berkeley DOT edu >
Tested by: Christopher Cowart < ccowart AT rescomp DOT berkeley DOT edu >
MFC after: 5 days

16 years agoUse intmax_t instead of long when casting time_t.
Jung-uk Kim [Fri, 7 Mar 2008 00:01:24 +0000 (00:01 +0000)]
Use intmax_t instead of long when casting time_t.

Suggested by: mlaier
Tested with: make universe

16 years agoMerge revisions 1.10 and 1.11 from DragonFly:
Xin LI [Fri, 7 Mar 2008 00:01:19 +0000 (00:01 +0000)]
Merge revisions 1.10 and 1.11 from DragonFly:

 - Use real getopt() handling instead of the hand-rolled and
   IOCCC-worthy "Micro getopt()" macros, plus clean up to the
   option handling code:
    * Sort the options in the switch statement;
    * Plug piddling memory leaks when processing repeated options
      by freeing strings before allocating them for a second time;
    * Die with a fatal error if the requested report file cannot
      be opened for appending;
    * Don't call init() before usage() (to prevent the usage
      message being mangled by changes to the terminal settings;)
 - Clean up the usage message, both in usage() and in the main
   program comment, both stylistically (sort and combine options)
   and for accuracy (following the manual page, make note of the -s
   and -S flags, and use the term 'send' instead of 'say' to reduce
   confusion (SAY is the name of a command for output to the user,
   not the connection.))

Obtained from: DragonFly

16 years agoChange auditon(2) so that if somebody supplies an invalid command, it
Christian S.J. Peron [Thu, 6 Mar 2008 22:57:03 +0000 (22:57 +0000)]
Change auditon(2) so that if somebody supplies an invalid command, it
returns EINVAL. Right now we return 0 or success for invalid commands,
which could be quite problematic in certain conditions.

MFC after: 1 week
Discussed with: rwatson

16 years agoMFi386:
Olivier Houchard [Thu, 6 Mar 2008 22:27:35 +0000 (22:27 +0000)]
MFi386:
revision 1.6
date: 2004/08/21 18:50:34;  author: alc;  state: Exp;  lines: +3 -1
Properly free the temporary sf_buf in uiomove_fromphys() if a copyin or
copyout fails.

Obtained from: DragonFlyBSD

Spotted out by: Mark Tinguely
MFC After: 3 days

16 years agoRemove unused pv_list_count from the vm_page, and pm_count from the struct
Olivier Houchard [Thu, 6 Mar 2008 21:59:47 +0000 (21:59 +0000)]
Remove unused pv_list_count from the vm_page, and pm_count from the struct
pmap.

Submitted by: Mark Tinguely

16 years agoMFP4:
Paolo Pisati [Thu, 6 Mar 2008 21:50:41 +0000 (21:50 +0000)]
MFP4:
restrict the utilization of direct pointers to the content of
ip packet. These modifications are functionally nop()s thus
can be merged with no side effects.

16 years agoStyle tweak to the 5722 chipid to match the rest of this file.
John Baldwin [Thu, 6 Mar 2008 21:48:34 +0000 (21:48 +0000)]
Style tweak to the 5722 chipid to match the rest of this file.

16 years agoIn the PROBE_KEYBOARD case, always enable multiple consoles and set the
John Baldwin [Thu, 6 Mar 2008 21:43:56 +0000 (21:43 +0000)]
In the PROBE_KEYBOARD case, always enable multiple consoles and set the
serial console as the primary console if the keyboard probe fails.

MFC after: 1 week

16 years agoFlesh out support for the BCM5722 by recognizing the phy on the 5722 and
John Baldwin [Thu, 6 Mar 2008 21:42:48 +0000 (21:42 +0000)]
Flesh out support for the BCM5722 by recognizing the phy on the 5722 and
the specific ASIC revision.

MFC after: 1 week
Obtained from: OpenBSD (mii/phy bits)

16 years ago - Add a missing unlock to cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID)
Jeff Roberson [Thu, 6 Mar 2008 20:11:24 +0000 (20:11 +0000)]
 - Add a missing unlock to cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID)

Found by: gallatin

16 years agoImprove EtherIP interaction with the bridge
Andrew Thompson [Thu, 6 Mar 2008 19:02:37 +0000 (19:02 +0000)]
Improve EtherIP interaction with the bridge
 - Set M_BCAST|M_MCAST for incoming frames
 - Send the frame to a local interface if the bridge returns the mbuf

Submitted by: Eugene Grosbein
Tested by: Boris Kochergin

16 years agoMove the PCPU_MD_FIELDS last in struct pcpu. While this header is
Marcel Moolenaar [Thu, 6 Mar 2008 17:24:28 +0000 (17:24 +0000)]
Move the PCPU_MD_FIELDS last in struct pcpu. While this header is
private to the kernel, some ports define _KERNEL and include this
header. While arguably this is wrong, it's also reality. By having
the MD fields last, architectures that have CPU-specific variations
of PCPU_MD_FIELDS will at least have the MI fields at a constant
offset.  Of course, having all MI fields first helps kernel debugging
as well, so this is not a change without some benefits to us.

This change does not result in an ABI breakage, because this header
is not part of the ABI. Recompilation of lsof is required though :-)

16 years agoAdd a catch-all for PCPU_MD_FIELDS. While we expect this to be
Marcel Moolenaar [Thu, 6 Mar 2008 16:59:36 +0000 (16:59 +0000)]
Add a catch-all for PCPU_MD_FIELDS. While we expect this to be
used in the kernel only (by virtue of checking for _KERNEL),
ports like lsof (part of gtop) cheat. It sets _KERNEL, but does
not set either AIM or E500. As such, PCPU_MD_FIELDS didn't get
defined and the build broke.
The catch-all is to define PCPU_MD_FIELDS with a dummy integer
when at the end of line we ended up without a definition for it.

16 years agoThe check for errors from the mount command did not work as intended
Mike Makonnen [Thu, 6 Mar 2008 14:39:33 +0000 (14:39 +0000)]
The check for errors from the mount command did not work as intended
because another command (echo) is executed between the mount command
and the check.

Reported by: Sergey Baturov <sergey@toor.org.ru>
MFC after: 2 weeks

16 years agoThe rarpd(8) daemon must be instructed to start on all interfaces or a
Mike Makonnen [Thu, 6 Mar 2008 14:01:10 +0000 (14:01 +0000)]
The rarpd(8) daemon must be instructed to start on all interfaces or a
specific one. Instruct it to listen on all interfaces so that enabling
it in rc.conf(5) works "out of the box."

PR: conf/121406
Submited by: trasz
MFC after: 1 week

16 years agoWhen redrawing an input line, count backspaces to get to the beginning of
Robert Watson [Thu, 6 Mar 2008 10:10:43 +0000 (10:10 +0000)]
When redrawing an input line, count backspaces to get to the beginning of
the input field from the current cursor location, rather than the end of
the input line, as the cursor may not be at the end of the line.
Otherwise, we may overshoot, overwriting a bit of the previous line and
failing to fully overwrite the current line.

MFC after: 3 days
PR: 119079
Submitted by: Michael Plass <mfp49_freebsd@plass-family.net>

16 years agoAdded missing BSD license text to the cmx.4 manpage.
Rink Springer [Thu, 6 Mar 2008 08:47:16 +0000 (08:47 +0000)]
Added missing BSD license text to the cmx.4 manpage.

Noticed by: brueffer

16 years agoCommit cmx(4), a driver for Omnikey CardMan 4040 PCMCIA smartcard readers.
Rink Springer [Thu, 6 Mar 2008 08:09:45 +0000 (08:09 +0000)]
Commit cmx(4), a driver for Omnikey CardMan 4040 PCMCIA smartcard readers.

PR: kern/114582
Submitted by: Daniel Roethlisberger <daniel@roe.ch>
Reviewed by: imp, myself
Tested by: johans, myself
MFC after: 2 weeks

16 years agoThe breakage from increased warns has been fixed, back out my back out
Warner Losh [Thu, 6 Mar 2008 04:09:06 +0000 (04:09 +0000)]
The breakage from increased warns has been fixed, back out my back out

16 years agoFix a bug when calculating remnant size.
David Xu [Thu, 6 Mar 2008 03:24:03 +0000 (03:24 +0000)]
Fix a bug when calculating remnant size.

16 years agoCast time_t to long to mute tinderbox build failure.
Jung-uk Kim [Thu, 6 Mar 2008 02:14:45 +0000 (02:14 +0000)]
Cast time_t to long to mute tinderbox build failure.

16 years agoThis breaks the arm build, back it out until that's fixed
Warner Losh [Thu, 6 Mar 2008 02:13:52 +0000 (02:13 +0000)]
This breaks the arm build, back it out until that's fixed

16 years agoDon't report death event to debugger if it is a forced exit.
David Xu [Thu, 6 Mar 2008 02:07:18 +0000 (02:07 +0000)]
Don't report death event to debugger if it is a forced exit.

16 years agoRestore code setting new thread's scheduler parameters, I was thinking
David Xu [Thu, 6 Mar 2008 01:59:08 +0000 (01:59 +0000)]
Restore code setting new thread's scheduler parameters, I was thinking
that there might be starvations, but because we have already locked the
thread, the cpuset settings will always be done before the new thread
does real-world work.

16 years agoNuke local jumbo allocator and switch to use of UMA backed page
Pyun YongHyeon [Thu, 6 Mar 2008 01:47:53 +0000 (01:47 +0000)]
Nuke local jumbo allocator and switch to use of UMA backed page
allocator for jumbo frame. Also remove unneeded jlist lock which
is no longer required to protect jumbo buffers.
With these changes jumbo frame performance of nfe(4) was slightly
increased and users should not encounter jumbo buffer allocation
failure anymore.

16 years agoAdd an option to register DUN (Dial-Up Networking) service on the same
Maksim Yevmenkin [Thu, 6 Mar 2008 00:37:29 +0000 (00:37 +0000)]
Add an option to register DUN (Dial-Up Networking) service on the same
RFCOMM channel if needed. There is really no good reason to not to support
this. AT-command exchange can be faked with chat script in ppp.conf.

MFC after: 1 week

16 years agoMark moused(8) WARNS=6 clean.
Jung-uk Kim [Thu, 6 Mar 2008 00:25:16 +0000 (00:25 +0000)]
Mark moused(8) WARNS=6 clean.

16 years agoFix compiler warnings and style(9) bugs.
Jung-uk Kim [Thu, 6 Mar 2008 00:24:11 +0000 (00:24 +0000)]
Fix compiler warnings and style(9) bugs.

16 years agoPrefer clock_gettime(2) over gettimeofday(2) and use CLOCK_MONOTONIC_FAST.
Jung-uk Kim [Thu, 6 Mar 2008 00:22:17 +0000 (00:22 +0000)]
Prefer clock_gettime(2) over gettimeofday(2) and use CLOCK_MONOTONIC_FAST.
It is only used to track elapsed time and it does not have to be precise.

16 years agoAdd an alias for glabel(8).
Xin LI [Wed, 5 Mar 2008 23:32:12 +0000 (23:32 +0000)]
Add an alias for glabel(8).

16 years agoMake it possible to build glabel into rescue geom(8) utility.
Xin LI [Wed, 5 Mar 2008 23:31:49 +0000 (23:31 +0000)]
Make it possible to build glabel into rescue geom(8) utility.

Ok'ed by: marcel
No objection: -current@

16 years agoUse calloc().
Xin LI [Wed, 5 Mar 2008 23:17:19 +0000 (23:17 +0000)]
Use calloc().

16 years ago- Add PHY ID for BCM5709C 1000Base-T controllers.
David Christensen [Wed, 5 Mar 2008 22:58:02 +0000 (22:58 +0000)]
- Add PHY ID for BCM5709C 1000Base-T controllers.

MFC after: 1 week

16 years agoIncrease default queue items allocation limit from 512 to 4096 items
Alexander Motin [Wed, 5 Mar 2008 22:12:34 +0000 (22:12 +0000)]
Increase default queue items allocation limit from 512 to 4096 items
to avoid terrible unpredicted effects for netgraph operation of their
exhaustion while allocating control messages.
Add separate configurable 512 items limit for data items allocation
for DoS/overload protection.

Discussed with: julian

16 years agoFor users of FreeBSD <= 6.2 we recommend during the x.org 7.x upgrade
Kris Kennaway [Wed, 5 Mar 2008 20:58:15 +0000 (20:58 +0000)]
For users of FreeBSD <= 6.2 we recommend during the x.org 7.x upgrade
that they add X11BASE=${LOCALBASE} to /etc/make.conf since X11BASE was
hard-wired to the now-wrong location in old releases.

However, both X11BASE and LOCALBASE have moved out of scope of src/
into ports/ now, which causes problems for upgraded users who have old
make.conf files still containing the above setting.  X11BASE becomes
null and we instruct ssh and sshd to look for xauth in /bin/xauth
where it is unlikely to be found.

Instead, provide a copy of the default LOCALBASE?=/usr/local setting
here.

We also have to deal with the case where the user only overrides
LOCALBASE and doesn't set an explicit X11BASE (in ports it will be set
implicitly but not here), which will also move the location of xauth.

MFC after:  3 days
Reported by:  rwatson

16 years agoThe non-POSIX environment variable MAKE was superseded
Yaroslav Tykhiy [Wed, 5 Mar 2008 20:24:38 +0000 (20:24 +0000)]
The non-POSIX environment variable MAKE was superseded
by MAKEFLAGS ages ago, so don't mention it in comments.

Tested with: cmp(1)

16 years agoDon't forget to set MAKEFLAGS in the childs' environment
Yaroslav Tykhiy [Wed, 5 Mar 2008 20:11:04 +0000 (20:11 +0000)]
Don't forget to set MAKEFLAGS in the childs' environment
from the .MAKEFLAGS global variable even if it's empty or
unset.  This means setting MAKEFLAGS to just an empty string
in the latter case.

If not doing so, make(1) behaved inconsistently WRT MAKEFLAGS.
In particular, it would let a `-f foo' option down to sub-makes
if .MAKEFLAGS was unset.  E.g.,

env MAKEFLAGS="-f mymakefile" make

would pass `-f mymakefile' down to sub-makes via their environment
(unless mymakefile added something to .MAKEFLAGS).
But any additional options appearing would change this behaviour to
not passing `-f mymakefile' to sub-makes, as in:

env MAKEFLAGS="-f mymakefile" make -D DUMMY

or

env MAKEFLAGS="-f mymakefile -D DUMMY" make

(unless mymakefile cleared .MAKEFLAGS).

Also make(1) would leave MAKEFLAGS at its initial value if the
makefile set .MAKEFLAGS to an empty value.  I.e., it was impossible
to override MAKEFLAGS with an empty value.  (Note well that makefiles
are not to touch MAKEFLAGS directly, they alter .MAKEFLAGS instead.
So make(1) can filter out things such as -f when copying MAKEFLAGS
to .MAKEFLAGS at startup.  Direct modifications to MAKEFLAGS just go
nowhere.)

While the original intentions of the BSD make authors are somewhat
unclear here, the bug proves that NOT passing -f options down is
the settled behaviour because the opposite behaviour is totally
unreliable in the presence of any other options.  In addition, not
passing down -f's found in the environment is consistent with doing
so WRT the command line.

Update the manpage accordingly and make the whole description of
MAKEFLAGS and .MAKEFLAGS more consistent as this change indeed
brings more consistency into the reliable behaviour of make(1).

Submitted by: ru (main.c)
Tested with: make world

16 years agoo We don't have to keep track of the PIC, nor do we have to make sure
Marcel Moolenaar [Wed, 5 Mar 2008 18:39:01 +0000 (18:39 +0000)]
o  We don't have to keep track of the PIC, nor do we have to make sure
   it's probed first. The PowerPC platform code deals with everything.
   As such, probe devices in order of their location in the memory map.
o  Refactor the ocpbus_alloc_resource for readability and make sure we
   set the RID in the resource as per the new convention.

16 years agoUse the new command file feature of ddb(8) to support setting ddb(4)
Brooks Davis [Wed, 5 Mar 2008 18:32:58 +0000 (18:32 +0000)]
Use the new command file feature of ddb(8) to support setting ddb(4)
scripts at boot.  This is currently disabled by default. /etc/ddb.conf
contains some potentially reasonable default scripts.

PR: conf/119995
Submitted by: Scot Hetzel <swhetzel at gmail dot com> (Earlier version)
X-MFC after: textdumps

16 years agomdoc changes to make this manpage consistent with our other section 4 manpages.
Christian Brueffer [Wed, 5 Mar 2008 18:04:21 +0000 (18:04 +0000)]
mdoc changes to make this manpage consistent with our other section 4 manpages.

16 years agoAdd the ability to read a file of commands to ddb(8) modeled after the
Brooks Davis [Wed, 5 Mar 2008 17:51:06 +0000 (17:51 +0000)]
Add the ability to read a file of commands to ddb(8) modeled after the
feature in ipfw(8).

16 years agoo Various fixes related to PCI Express:
Marcel Moolenaar [Wed, 5 Mar 2008 16:46:38 +0000 (16:46 +0000)]
o  Various fixes related to PCI Express:
   - Even for the PCI Express host controller we need to use bus 0
     for configuration space accesses to devices directly on the
     host controller's bus.
   - Pass the maximum number of slots to pci_ocp_init() because the
     caller knows how many slots the bus has. Previously a PCI or
     PCI-X bus underneath a PCI Express host controller would not
     be enumerated properly.
o  Pull the interrupt routing logic out of pci_ocp_init() and into
   its own function. The logic is not quite right and is expected
   to be a bit more complex.
o  Fix/add support for PCI domains. The PCI domain is the unit
   number as per other PCI host controller drivers. As such, we
   can use logical bus numbers again and don't have to guarantee
   globally unique bus numbers. Remove pci_ocp_busnr. Return the
   highest bus number ito the caller of pci_ocp_init() now that
   we don't have a global variable anymore.
o  BAR programming fixes:
   - Non-type0 headers have at most 1 BAR, not 0.
   - First write ~0 to the BAR in question and then read back its
     size.

Obtained from: Juniper Networks (mostly)

16 years agoInitialize mnt_stat.f_iosize before autostarting UFS1 extattrs.
Konstantin Belousov [Wed, 5 Mar 2008 16:34:03 +0000 (16:34 +0000)]
Initialize mnt_stat.f_iosize before autostarting UFS1 extattrs.
It is normally initialized by ffs_statfs() after ffs_mount finished.

The extattr autostart code calls the ufs_lookup(), that uses value above
to iterate over the directory blocks, see bmask initialization in the
ufs_lookup() and ufsdirhash. Having the filesystem with root directory
spanning more then one block would result in reading a random kernel
memory.

PR: kern/120781
Test case provided by: rwatson
MFC after: 1 week

16 years agoOops, I accidently concatenated uslcom.[c4] multiple times before the
Rink Springer [Wed, 5 Mar 2008 14:18:29 +0000 (14:18 +0000)]
Oops, I accidently concatenated uslcom.[c4] multiple times before the
commit :-/ Quickly fix before things get broken...

Pointyhat to: me

16 years agoImport uslcom(4) from OpenBSD - this is a driver for Silicon Laboratories
Rink Springer [Wed, 5 Mar 2008 14:13:30 +0000 (14:13 +0000)]
Import uslcom(4) from OpenBSD - this is a driver for Silicon Laboratories
CP2101/CP2102 based USB serial adapters.

Reviewed by: imp, emaste
Obtained from: OpenBSD
MFC after: 2 weeks

16 years agoAdd info about few missing GEOM classes that use geom(8).
Pawel Jakub Dawidek [Wed, 5 Mar 2008 11:51:13 +0000 (11:51 +0000)]
Add info about few missing GEOM classes that use geom(8).

16 years agoChange float_t and double_t to long double on i386. All floating point
Bruce Evans [Wed, 5 Mar 2008 11:21:14 +0000 (11:21 +0000)]
Change float_t and double_t to long double on i386.  All floating point
expressions on i386 are evaluated in the range of the long double type,
so this is wrong in a different but hopefully less worse way than
before.  Since expressions are evaluated in long double registers,
there is no runtime cost to using long double instead of double to
declare intermediate values (except in cases where this avoids compiler
bugs), and by careful use of float_t or double_t it is possible to
avoid some of the compiler bugs in this area, provided these types are
declared as long double.

I was going to change float.h to be less broken and more usable in
combination with the change here (in particular, it is more necessary
to know the effective number of bits in a double_t when double_t !=
double, since DBL_MANT_DIG no longer logically gives this, and
LDBL_MANT_DIG doesn't give it either with FreeBSD-i386's default
rounding precision.  However, this was too hard for now.  In particular,
LDBL_MANT_DIG is used a lot in libm, so it cannot be changed.  One
thing that is completely broken now is LDBL_MAX.  This may have sort
of worked when it was changed from DBL_MAX in 2002 (adding 0 to it at
runtime gave +Inf, but you could at least compare with it), but starting
with gcc-3.3.1 in 2003, it is always +Inf due to evaluating it at
compile time in the default rounding precision.

16 years agoOops, back out previous commit since it was to the wrong file.
Bruce Evans [Wed, 5 Mar 2008 11:17:20 +0000 (11:17 +0000)]
Oops, back out previous commit since it was to the wrong file.

16 years agoChange float_t and double_t to long double on i386. All floating point
Bruce Evans [Wed, 5 Mar 2008 11:11:53 +0000 (11:11 +0000)]
Change float_t and double_t to long double on i386.  All floating point
expressions on i386 are evaluated in the range of the long double type,
so this is wrong in a different but hopefully less worse way than
before.  Since expressions are evaluated in long double registers,
there is no runtime cost to using long double instead of double to
declare intermediate values (except in cases where this avoids compiler
bugs), and by careful use of float_t or double_t it is possible to
avoid some of the compiler bugs in this area, provided these types are
declared as long double.

I was going to change float.h to be less broken and more usable in
combination with the change here (in particular, it is more necessary
to know the effective number of bits in a double_t when double_t !=
double, since DBL_MANT_DIG no longer logically gives this, and
LDBL_MANT_DIG doesn't give it either with FreeBSD-i386's default
rounding precision.  However, this was too hard for now.  In particular,
LDBL_MANT_DIG is used a lot in libm, so it cannot be changed.  One
thing that is completely broken now is LDBL_MAX.  This may have sort
of worked when it was changed from DBL_MAX in 2002 (adding 0 to it at
runtime gave +Inf, but you could at least compare with it), but starting
with gcc-3.3.1 in 2003, it is always +Inf due to evaluating it at
compile time in the default rounding precision.

16 years agoExpand the nfs_opts array to include all possible string
Craig Rodrigues [Wed, 5 Mar 2008 10:09:29 +0000 (10:09 +0000)]
Expand the nfs_opts array to include all possible string
mount options that mount_nfs could pass down, if it passed
down string mount options.  Right now, mount_nfs jut passes
down a single mount option named "nfs_args" with a fully
initialized 'struct nfs_args'.

In future commits, we will add code to the kernel for parsing stringified
NFS mount options, so that we can convert mount_nfs to pass string options
from userspace to kernel, instead of an initialized struct nfs_args.

16 years agoIn nfs_mount(), default initialize struct nfs_args
Craig Rodrigues [Wed, 5 Mar 2008 09:41:22 +0000 (09:41 +0000)]
In nfs_mount(), default initialize struct nfs_args
the same way that it is default initialized in revision 1.77 of mount_nfs.c.

Right now, this is a no-op, because currently we initialize
struct nfs_args in mount_nfs in userspace, and pass it
down into the kernel via nmount(), so we overwrite whatever we initialize
here with the value passed in from userspace.

However, this lays the groundwork for moving away from passing
struct nfs_args from userspace to kernel via nmount(), so that we
can instead pass string mount options via nmount() which can be parsed in
the kernel.  This will make it easier to add new NFS mount options.

16 years agoFor a mounted file system which is read-only, when
Craig Rodrigues [Wed, 5 Mar 2008 08:25:49 +0000 (08:25 +0000)]
For a mounted file system which is read-only, when
doing the MNT_RELOAD, pass in "ro" and "update"
string mount options to nmount() instead of MNT_RDONLY and MNT_UPDATE flags.

Due to the complexity of the mount parsing code especially
with respect to the root file system, passing in MNT_RDONLY and MNT_UPDATE
flags would do weird things and would cause fsck to convert the root
file system from a read-only mount to read-write.

To test:
 - boot into single user mode
 - show mounted file systems with: mount
 - root file system should be mounted read-only
 - fsck /
 - show mounted file systems with: mount
 - root file system should still be mounted read-only

PR: 120319
MFC after: 1 month
Reported by: yar

16 years ago - Don't overwrite the recently allocated 'nset' in cpuset_setthread() by
Jeff Roberson [Wed, 5 Mar 2008 08:08:32 +0000 (08:08 +0000)]
 - Don't overwrite the recently allocated 'nset' in cpuset_setthread() by
   passing it to cpuset_which().  Pass in 'set' instead.  This argument
   is not used but for convenience cpuset_which() nulls all incoming
   parameters.

Submitted by: davidxu

16 years agoAdd rl(4) support
Kevin Lo [Wed, 5 Mar 2008 07:55:45 +0000 (07:55 +0000)]
Add rl(4) support

16 years agoRemove hacks which filter out MNT_ROOTFS.
Craig Rodrigues [Wed, 5 Mar 2008 07:55:07 +0000 (07:55 +0000)]
Remove hacks which filter out MNT_ROOTFS.
They are no longer needed now that we filter out MNT_ROOTFS
inside the nmount() call in revision 1.267 of vfs_mount.c.

Reviewed by: rink

16 years agoIncrease and decrease in_sigcancel_handler accordingly to avoid possible
David Xu [Wed, 5 Mar 2008 07:04:55 +0000 (07:04 +0000)]
Increase and decrease in_sigcancel_handler accordingly to avoid possible
error caused by nested SIGCANCEL stack, it is a bit complex.

16 years agoUse cpuset defined in pthread_attr for newly created thread, for now,
David Xu [Wed, 5 Mar 2008 07:01:20 +0000 (07:01 +0000)]
Use cpuset defined in pthread_attr for newly created thread, for now,
we set scheduling parameters and cpu binding fully in userland, and
because default scheduling policy is SCHED_RR (time-sharing), we set
default sched_inherit to PTHREAD_SCHED_INHERIT, this saves a system
call.

16 years agoAdd more cpu affinity function's symbols.
David Xu [Wed, 5 Mar 2008 06:56:35 +0000 (06:56 +0000)]
Add more cpu affinity function's symbols.

16 years agoCheck actual size of cpuset kernel is using and define underscore version
David Xu [Wed, 5 Mar 2008 06:55:48 +0000 (06:55 +0000)]
Check actual size of cpuset kernel is using and define underscore version
of API.

16 years agoRemove hacks to filter out MNT_ROOTFS, since we now
Craig Rodrigues [Wed, 5 Mar 2008 06:24:42 +0000 (06:24 +0000)]
Remove hacks to filter out MNT_ROOTFS, since we now
do that internally inside nmount() in revision 1.267 of vfs_mount.c.

16 years agoPlug memory leak in jumbo buffer allocation failure path.
Pyun YongHyeon [Wed, 5 Mar 2008 05:36:09 +0000 (05:36 +0000)]
Plug memory leak in jumbo buffer allocation failure path.
Patch in the PR was modified to check active jumbo buffers in use
and other possible jumbo buffer leak.

Jumbo buffer usage in lge(4) still wouldn't be reliable due to lack
of driver lock in local jumbo buffer allocator. Either introduce
a new lock to protect jumbo buffer or switch to UMA backed page
allocator for jumbo frame is required.

PR: kern/78072

16 years ago - Remove the -i argument when running a command to simplify things a
Jeff Roberson [Wed, 5 Mar 2008 02:10:43 +0000 (02:10 +0000)]
 - Remove the -i argument when running a command to simplify things a
   little bit and to prevent users from specifying a private mask that may
   later restrict other group changes.
 - Add a man page which brueffer generously contributed to.

Sponsored by:   Nokia

16 years ago - Verify that when a user supplies a mask that is bigger than the kernel
Jeff Roberson [Wed, 5 Mar 2008 01:49:20 +0000 (01:49 +0000)]
 - Verify that when a user supplies a mask that is bigger than the kernel
   mask none of the upper bits are set.
 - Be more careful about enforcing the boundaries of masks and child sets.
 - Introduce a few more CPU_* macros for implementing these tests.
 - Change the cpusetsize argument to be bytes rather than bits to match
   other apis.

Sponsored by: Nokia

16 years ago- add '-f' option to force root node.
Hidetoshi Shimokawa [Wed, 5 Mar 2008 01:30:48 +0000 (01:30 +0000)]
- add '-f' option to force root node.
- fix byte order in read_write_quad()
- show hostnames in the list
- fix typo in manpage

MFC after: 1 week

16 years agoAdd detection of isolation state.
Pyun YongHyeon [Wed, 5 Mar 2008 01:15:10 +0000 (01:15 +0000)]
Add detection of isolation state.

PR: kern/76710

16 years agoIt seems some don't care for the anchient joke. Add WITHOUT_OLD_JOKE
David E. O'Brien [Tue, 4 Mar 2008 22:51:37 +0000 (22:51 +0000)]
It seems some don't care for the anchient joke.  Add WITHOUT_OLD_JOKE
to your CFLAGS if you fall into this camp.

16 years agoNo need to tell make to DTRT with "make love", just do it.
David E. O'Brien [Tue, 4 Mar 2008 22:32:58 +0000 (22:32 +0000)]
No need to tell make to DTRT with "make love", just do it.
Also remove the 2002/08/31 bootstrapping aid for upgrades from
year old (mid-2001) systems.

16 years agoTemporarily back out revision 1.98 to give Portmgr some time to
David E. O'Brien [Tue, 4 Mar 2008 20:26:03 +0000 (20:26 +0000)]
Temporarily back out revision 1.98 to give Portmgr some time to
address PR ports/121363 (current day re-opening of PR ports/73797)
to make ports CFLAGS more independent of src/'s CFLAGS WRT aliasing.

Discussed with: brooks

16 years agoChange the default port range for outgoing connections by introducing
Rui Paulo [Tue, 4 Mar 2008 19:16:21 +0000 (19:16 +0000)]
Change the default port range for outgoing connections by introducing
IPPORT_EPHEMERALFIRST and IPPORT_EPHEMERALLAST with values
10000 and 65535 respectively.
The rationale behind is that it makes the attacker's life more
difficult if he/she wants to guess the ephemeral port range and
also lowers the probability of a port colision (described in
draft-ietf-tsvwg-port-randomization-01.txt).

While there, remove code duplication in in_pcbbind_setup().

Submitted by: Fernando Gont <fernando at gont.com.ar>
Approved by: njl (mentor)
Reviewed by: silby, bms
Discussed on: freebsd-net

16 years agoBack out revision 1.97, which backed out part of revision 1.96.
David E. O'Brien [Tue, 4 Mar 2008 19:00:11 +0000 (19:00 +0000)]
Back out revision 1.97, which backed out part of revision 1.96.
Change the default CFLAGS to match the simple defaults that the
tinderboxes use.  By using -fno-strict-aliasing by default we are
choosing to ignore problems in code which had the potential to
shoot ourselves in the foot.

16 years agoAdd support for automatic promotion of 4KB page mappings to 2MB page
Alan Cox [Tue, 4 Mar 2008 18:50:15 +0000 (18:50 +0000)]
Add support for automatic promotion of 4KB page mappings to 2MB page
mappings.  Automatic promotion can be enabled by setting the tunable
"vm.pmap.pg_ps_enabled" to a non-zero value.  By default, automatic
promotion is disabled.  (Expect this to change.)

Reviewed by: ups
Tested by: kris, Peter Holm

16 years agoImplement 128 items node name hash for faster name search.
Alexander Motin [Tue, 4 Mar 2008 18:22:18 +0000 (18:22 +0000)]
Implement 128 items node name hash for faster name search.
Increase node ID hash size from 32 to 128 items.

16 years agoForce an explicit dependency on opt_global.h for all module object files
John Baldwin [Tue, 4 Mar 2008 16:54:31 +0000 (16:54 +0000)]
Force an explicit dependency on opt_global.h for all module object files
when building modules as part of a kernel build just as we do for kernel
object files.

MFC after: 1 week
Reported by: kmacy, kris
Reviewed by: ru

16 years ago<limits.h> is necessary for using INT_MIN, so included it here
Warner Losh [Tue, 4 Mar 2008 15:56:17 +0000 (15:56 +0000)]
<limits.h> is necessary for using INT_MIN, so included it here
explicitly rather than relying on name space pollution to pull it in
for us.

NB: The usage of INT_MIN is somewhat bogus and suspect to my eye, but this
commit doesn't address that issue.

16 years agoContinue on-going campaign to replace lockmgr locks with sx locks where
Robert Watson [Tue, 4 Mar 2008 12:50:11 +0000 (12:50 +0000)]
Continue on-going campaign to replace lockmgr locks with sx locks where
the specific semantics of ockmgr aren't required: update UFS1 extended
attributes to protect its data structures using an sx lock.

While here, update comments on lock granularity.

MFC after: 2 weeks

16 years agoMove setting of MNTK_MPSAFE flag before UFS1 extended attribute
Robert Watson [Tue, 4 Mar 2008 12:10:03 +0000 (12:10 +0000)]
Move setting of MNTK_MPSAFE flag before UFS1 extended attribute
auto-start so that the flag is set before we start performing I/O
in the auto-start routine.

MFC after: 2 weeks
Suggested by: kib

16 years agoMove a stray paragraph on .Ev MAKEFLAGS to where it belongs.
Yaroslav Tykhiy [Tue, 4 Mar 2008 11:28:54 +0000 (11:28 +0000)]
Move a stray paragraph on .Ev MAKEFLAGS to where it belongs.

16 years agoRevise the description of how .Ev MAKEFILE and .Va .MAKEFILE relate.
Yaroslav Tykhiy [Tue, 4 Mar 2008 11:25:23 +0000 (11:25 +0000)]
Revise the description of how .Ev MAKEFILE and .Va .MAKEFILE relate.
The most important point is that -f option(s) are never copied from
.Ev MAKEFILE to .Va .MAKEFILE by make(1), which is consistent with
handling the command line.  (-f silently sit in .Ev MAKEFILE and go
to make's children unless overwritten via .Va .MAKEFILE)

Bump .Dd.

16 years agoFix incorrect field name.
Alexander Motin [Tue, 4 Mar 2008 11:10:54 +0000 (11:10 +0000)]
Fix incorrect field name.

16 years agoFix the Giant leak in the nfsrv_remove().
Konstantin Belousov [Tue, 4 Mar 2008 11:05:03 +0000 (11:05 +0000)]
Fix the Giant leak in the nfsrv_remove().

Reported by: pluknet <pluknet gmail com>
MFC after: 1 week

16 years agoSplit descriptions of .Ev MAKEFILE and .Va .MAKEFLAGS for clarity.
Yaroslav Tykhiy [Tue, 4 Mar 2008 10:33:42 +0000 (10:33 +0000)]
Split descriptions of .Ev MAKEFILE and .Va .MAKEFLAGS for clarity.

16 years agoMake it possible to continue working after calling doadump()
Ruslan Ermilov [Tue, 4 Mar 2008 07:39:31 +0000 (07:39 +0000)]
Make it possible to continue working after calling doadump()
manually from debugger.  (This got broken in rev. 1.122.)