]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoQuick fix to make this compile:
Warner Losh [Wed, 16 Dec 2009 03:26:37 +0000 (03:26 +0000)]
Quick fix to make this compile:
Remove redundant extern declearations.
If the maintainer has a better fix, then feel free to back this out.

14 years agoDocmuent NO_KERNEL{CLEAN,CONFIG,DEPEND,OBJ} as necessary. Update
Warner Losh [Wed, 16 Dec 2009 03:25:43 +0000 (03:25 +0000)]
Docmuent NO_KERNEL{CLEAN,CONFIG,DEPEND,OBJ} as necessary.  Update
documentation on KERNFAST meaning.

14 years agoAdd NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN},
Warner Losh [Wed, 16 Dec 2009 02:54:34 +0000 (02:54 +0000)]
Add NO_KERNELOBJ flag, similar to NO_KERNEL{CONFIG,DEPEND,CLEAN},
which disables doing a make obj.  Use it when you know it will work
only.  KERNFAST now implies NO_KERNELOBJ, since you don't need to keep
doing obj when doing incremental kernel builds.

14 years agoAdd INCLUDE_CONFIG_FILE, and a note in comments about how to also
Doug Barton [Wed, 16 Dec 2009 02:17:43 +0000 (02:17 +0000)]
Add INCLUDE_CONFIG_FILE, and a note in comments about how to also
include the comments with CONFIGARGS

14 years agoAdd two new debugging tunables for x86bios instead of abusing bootverbose,
Jung-uk Kim [Tue, 15 Dec 2009 22:44:28 +0000 (22:44 +0000)]
Add two new debugging tunables for x86bios instead of abusing bootverbose,
i.e., debug.x86bios.call and debug.x86bios.int.

14 years agomore splitting of ip_fw2.c, now extract the 'table' routines
Luigi Rizzo [Tue, 15 Dec 2009 21:24:12 +0000 (21:24 +0000)]
more splitting of ip_fw2.c, now extract the 'table' routines
and the sockopt routines (the upper half of the kernel).

Whoever is the author of the 'table' code (Ruslan/glebius/oleg ?)
please change the attribution in ip_fw_table.c. I have copied
the copyright line from ip_fw2.c but it carries my name and I have
neither written nor designed the feature so I don't deserve
the credit.

MFC after: 1 month

14 years agocpuset(2): fix a typo and a markup error in the man page
Jilles Tjoelker [Tue, 15 Dec 2009 21:02:29 +0000 (21:02 +0000)]
cpuset(2): fix a typo and a markup error in the man page

MFC after: 1 week

14 years agoifconfig(8) is documented to take a ISO 3166-1 country code to set the
Gavin Atkinson [Tue, 15 Dec 2009 20:44:12 +0000 (20:44 +0000)]
ifconfig(8) is documented to take a ISO 3166-1 country code to set the
regulatory domain with the "country" parameter, but will also take a full
country name.  The man page warns that only the ISO code is unambiguous.
In reality, however, the first match on either would be accepted, leading
to "DE" being interpreted as the "DEBUG" country rather than Germany, and
"MO" selecting Morocco rather than the correct country, Macau.

Fix this by always checking for an ISO CC match first, and only search on
the full country name if that fails.

PR: bin/140571
Tested by: Dirk Meyer dirk.meyer dinoex.sub.org
Reviewed by: sam
Approved by: ed (mentor)
MFC after: 1 month

14 years agoAttach dpms(4) to vgapm and make sure to restore DPMS state after
Jung-uk Kim [Tue, 15 Dec 2009 19:58:23 +0000 (19:58 +0000)]
Attach dpms(4) to vgapm and make sure to restore DPMS state after
VGA is resumed properly.

Reviewed by: jhb

14 years agoadd ip_fw_private.h to ng_ipfw.c, forgotten in previous commit;
Luigi Rizzo [Tue, 15 Dec 2009 18:33:12 +0000 (18:33 +0000)]
add ip_fw_private.h to ng_ipfw.c, forgotten in previous commit;
comment out remove ip_fw.h from ng_bridge.c, as it seems unused.

MFC after: 1 month

14 years agoStart splitting ip_fw2.c and ip_fw.h into smaller components.
Luigi Rizzo [Tue, 15 Dec 2009 16:15:14 +0000 (16:15 +0000)]
Start splitting ip_fw2.c and ip_fw.h into smaller components.
At this time we pull out from ip_fw2.c the logging functions, and
support for dynamic rules, and move kernel-only stuff into
netinet/ipfw/ip_fw_private.h

No ABI change involved in this commit, unless I made some mistake.
ip_fw.h has changed, though not in the userland-visible part.

Files touched by this commit:

conf/files
now references the two new source files

netinet/ip_fw.h
remove kernel-only definitions gone into netinet/ipfw/ip_fw_private.h.

netinet/ipfw/ip_fw_private.h
new file with kernel-specific ipfw definitions

netinet/ipfw/ip_fw_log.c
ipfw_log and related functions

netinet/ipfw/ip_fw_dynamic.c
code related to dynamic rules

netinet/ipfw/ip_fw2.c
removed the pieces that goes in the new files

netinet/ipfw/ip_fw_nat.c
minor rearrangement to remove LOOKUP_NAT from the
main headers. This require a new function pointer.

A bunch of other kernel files that included netinet/ip_fw.h now
require netinet/ipfw/ip_fw_private.h as well.
Not 100% sure i caught all of them.

MFC after: 1 month

14 years agontpd 4.2.4p8 is now in the tree, ntptrace is dead RIP.
Ollivier Robert [Tue, 15 Dec 2009 14:59:58 +0000 (14:59 +0000)]
ntpd 4.2.4p8 is now in the tree, ntptrace is dead RIP.

Security: CVE-2009-3563

14 years agoMerge 4.2.4p8 into contrib (r200452 & r200454).
Ollivier Robert [Tue, 15 Dec 2009 14:58:10 +0000 (14:58 +0000)]
Merge 4.2.4p8 into contrib (r200452 & r200454).

Subversion is being difficult here so take a hammer and get it in.

MFC after: 2 weeks
Security: CVE-2009-3563

14 years agoMerge libkqueue test suite through r119
Robert Watson [Tue, 15 Dec 2009 10:43:20 +0000 (10:43 +0000)]
Merge libkqueue test suite through r119

Submitted by: Mark Heily <mark@heily.com>

14 years agoAdd missing #include <sys/ktr.h>.
Bruce M Simpson [Tue, 15 Dec 2009 10:40:40 +0000 (10:40 +0000)]
Add missing #include <sys/ktr.h>.

Submitted by: Hideki Yamamoto
MFC after: 1 week

14 years agoimplement a new match option,
Luigi Rizzo [Tue, 15 Dec 2009 09:46:27 +0000 (09:46 +0000)]
implement a new match option,

    lookup {dst-ip|src-ip|dst-port|src-port|uid|jail} N

which searches the specified field in table N and sets tablearg
accordingly.
With dst-ip or src-ip the option replicates two existing options.
When used with other arguments, the option can be useful to
quickly dispatch traffic based on other fields.

Work supported by the Onelab project.

MFC after: 1 week

14 years agofix the indentation for addr: values
Luigi Rizzo [Tue, 15 Dec 2009 09:32:35 +0000 (09:32 +0000)]
fix the indentation for addr: values

MFC after: 3 days

14 years agoThe named process needs to have a "working directory" that it can
Doug Barton [Tue, 15 Dec 2009 05:14:39 +0000 (05:14 +0000)]
The named process needs to have a "working directory" that it can
write to. This is specified in "options { directory }" in named.conf.
So, create /etc/namedb/working with appropriate permissions, and
update the entry in named.conf to match.

In addition to specifying the working directory, file and path names
in named.conf can be specified relative to the directory listed.
However, since that directory is now different from /etc/namedb
(where the configuration, zone, rndc.*, and other files are located)
further update named.conf to specify all file names with fully
qualified paths. Also update the comment about file and path names
so users know this should be done for all file/path names in the file.

This change will eliminate the 'working directory is not writable'
messages at boot time without sacrificing security. It will also
allow for features in newer versions of BIND (9.7+) to work as
designed.

14 years agoTell upper layer vge(4) supports long frames. This should be done
Pyun YongHyeon [Mon, 14 Dec 2009 22:55:20 +0000 (22:55 +0000)]
Tell upper layer vge(4) supports long frames. This should be done
after ether_ifattach(), as ether_ifattach() initializes it with
ETHER_HDR_LEN.
While I'm here remove setting if_mtu, it's already handled in
ether_ifattach().

14 years agoAdd apple-boot and apple-ufs.
Rui Paulo [Mon, 14 Dec 2009 22:47:09 +0000 (22:47 +0000)]
Add apple-boot and apple-ufs.

Submitted by: nwhitehorn

14 years agoDon't report current link status if interface is not UP.
Pyun YongHyeon [Mon, 14 Dec 2009 22:30:07 +0000 (22:30 +0000)]
Don't report current link status if interface is not UP.
If interface is not UP, the current link status wouldn't
reflect the negotiated status.

14 years agoRemove _FDE quirk handling as these quirks are automatically repaired
Jung-uk Kim [Mon, 14 Dec 2009 22:28:32 +0000 (22:28 +0000)]
Remove _FDE quirk handling as these quirks are automatically repaired
by ACPICA layer since ACPICA 20091214.

14 years agoMerge ACPICA 20091214.
Jung-uk Kim [Mon, 14 Dec 2009 22:24:04 +0000 (22:24 +0000)]
Merge ACPICA 20091214.

14 years agoReport media change result to caller instead of returning success
Pyun YongHyeon [Mon, 14 Dec 2009 22:23:06 +0000 (22:23 +0000)]
Report media change result to caller instead of returning success
without regard to the result.

14 years agoWhenever link state change interrupt is raised, vge_tick() is
Pyun YongHyeon [Mon, 14 Dec 2009 22:20:05 +0000 (22:20 +0000)]
Whenever link state change interrupt is raised, vge_tick() is
called and vge(4) used to drive auto-negotiation timer(mii_tick) in
vge_tick(). Therefore the mii_tick was not called for every hz such
that auto-negotiation complete was never handled in vge(4).
Use mii_pollstat to extract current negotiated speed/duplex instead
of mii_tick. The latter is valid only for auto-negotiation case.
While I'm here change the confusing function name vge_tick() to
vge_link_statchg().

14 years agoImport ACPICA 20091214.
Jung-uk Kim [Mon, 14 Dec 2009 22:07:33 +0000 (22:07 +0000)]
Import ACPICA 20091214.

14 years agoSort function prototyes.
Pyun YongHyeon [Mon, 14 Dec 2009 22:00:11 +0000 (22:00 +0000)]
Sort function prototyes.

14 years agoWe don't have to reload EEPROM in vge_reset(). Because vge_reset()
Pyun YongHyeon [Mon, 14 Dec 2009 21:16:02 +0000 (21:16 +0000)]
We don't have to reload EEPROM in vge_reset(). Because vge_reset()
is called in vge_init_lock(), vge(4) always used to reload EEPROM.
Also add more comment why vge(4) clears VGE_CHIPCFG0_PACPI bit.
While I'm here add missing new line in vge_reset().

14 years agoSet ATA_CHECKS_CABLE when appropriate.
Marius Strobl [Mon, 14 Dec 2009 21:11:50 +0000 (21:11 +0000)]
Set ATA_CHECKS_CABLE when appropriate.

Reviewed by: mav
MFC after: 1 week

14 years agoIncrease output queue size from 64 to 255.
Pyun YongHyeon [Mon, 14 Dec 2009 20:59:18 +0000 (20:59 +0000)]
Increase output queue size from 64 to 255.

14 years agoImprove the markup
Doug Barton [Mon, 14 Dec 2009 20:59:01 +0000 (20:59 +0000)]
Improve the markup

Submitted by: ru

14 years agoAdd MSI support for VT613x controllers.
Pyun YongHyeon [Mon, 14 Dec 2009 20:49:50 +0000 (20:49 +0000)]
Add MSI support for VT613x controllers.

14 years agoSave PHY address by reading VGE_MIICFG register. For PCIe
Pyun YongHyeon [Mon, 14 Dec 2009 20:39:42 +0000 (20:39 +0000)]
Save PHY address by reading VGE_MIICFG register. For PCIe
controllers(VT613x), we assume the PHY address is 1.
Use the saved PHY address in MII register access routines and
remove accessing VGE_MIICFG register.
While I'm here save PCI express capability register which will be
used in near future.

14 years agoAdd Microsoft and NetBSD partition types handling.
Rui Paulo [Mon, 14 Dec 2009 20:26:27 +0000 (20:26 +0000)]
Add Microsoft and NetBSD partition types handling.

14 years agoIntroduce vge_flags member in softc. The vge_flags member will
Pyun YongHyeon [Mon, 14 Dec 2009 20:17:53 +0000 (20:17 +0000)]
Introduce vge_flags member in softc. The vge_flags member will
record device specific bits. Remove vge_link and use vge_flags.
While here, move clearing link state before mii_mediachg() as
mii_mediachg() may affect link state.

14 years agoMove the scan for max_keylen into route.c::route_init(),
Luigi Rizzo [Mon, 14 Dec 2009 20:12:51 +0000 (20:12 +0000)]
Move the scan for max_keylen into route.c::route_init(),
and make max_keylen an argument for rn_init().
This removes an unnecessary dependency on domain.h from radix.c

MFC after: 7 days

14 years agostyle(9).
Pyun YongHyeon [Mon, 14 Dec 2009 20:07:25 +0000 (20:07 +0000)]
style(9).

14 years agoAdd more Apple partition types.
Rui Paulo [Mon, 14 Dec 2009 20:04:28 +0000 (20:04 +0000)]
Add more Apple partition types.

14 years agoSimplify partition type parsing by using a data-oriented model.
Rui Paulo [Mon, 14 Dec 2009 20:04:06 +0000 (20:04 +0000)]
Simplify partition type parsing by using a data-oriented model.
While there add more Apple and Linux partition types.

14 years agos/u_intXX_t/uintXX_t/g
Pyun YongHyeon [Mon, 14 Dec 2009 19:53:57 +0000 (19:53 +0000)]
s/u_intXX_t/uintXX_t/g

14 years agoRemove unnecessary return statement.
Pyun YongHyeon [Mon, 14 Dec 2009 19:49:20 +0000 (19:49 +0000)]
Remove unnecessary return statement.

14 years agoUse ANSI function definations.
Pyun YongHyeon [Mon, 14 Dec 2009 19:44:54 +0000 (19:44 +0000)]
Use ANSI function definations.

14 years agoDon't panic on failure to attach if we fail before or during the
Gavin Atkinson [Mon, 14 Dec 2009 19:18:02 +0000 (19:18 +0000)]
Don't panic on failure to attach if we fail before or during the
if_alloc() of ifp.  This fixes the panic reported in the PR, but
not the attach failure.

PR: kern/139079
Tested by:      Steven Noonan <steven uplinklabs.net>
Reviewed by: thompsa
Approved by: ed (mentor)
MFC after: 2 weeks`

14 years agoClear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit
Pyun YongHyeon [Mon, 14 Dec 2009 19:08:11 +0000 (19:08 +0000)]
Clear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit
seems to work like a tag that indicates 'not list end' of queued
frames. Without having a VGE_TXDESC_Q bit indicates 'list end'. So
the last frame of multiple queued frames has no VGE_TXDESC_Q bit.
The hardware has peculiar behavior for VGE_TXDESC_Q bit handling.
If the VGE_TXDESC_Q bit of descriptor was set the controller would
fetch next descriptor. However if next descriptor's OWN bit was
cleared but VGE_TXDESC_Q was set, it could confuse controller.
Clearing VGE_TXDESC_Q bit for transmitted frames ensure correct
behavior.

14 years agoAdd old read_mac_addr routine to this module since
Jack F Vogel [Mon, 14 Dec 2009 19:05:16 +0000 (19:05 +0000)]
Add old read_mac_addr routine to this module since
a customer report of an Invalid MAC Address has occurred.

14 years agoFix typo in register definition.
Pyun YongHyeon [Mon, 14 Dec 2009 18:50:26 +0000 (18:50 +0000)]
Fix typo in register definition.

14 years agoUse PCIR_BAR instead of hard-coded value.
Pyun YongHyeon [Mon, 14 Dec 2009 18:49:16 +0000 (18:49 +0000)]
Use PCIR_BAR instead of hard-coded value.

14 years agoOverhaul bus_dma(9) usage and fix various things.
Pyun YongHyeon [Mon, 14 Dec 2009 18:44:23 +0000 (18:44 +0000)]
Overhaul bus_dma(9) usage and fix various things.
 o Separate TX/RX buffer DMA tag from TX/RX descriptor ring DMA tag.
 o Separate RX buffer DMA tag from common buffer DMA tag. RX DMA
   tag has different restriction compared to TX DMA tag.
 o Add 40bit DMA address support.
 o Adjust TX/RX descriptor ring alignment to 64 bytes from 256
   bytes as documented in datasheet.
 o Added check to ensure TX/RX ring reside within a 4GB boundary.
   Since TX/RX ring shares the same high address register they
   should have the same high address.
 o TX/RX side bus_dmamap_load_mbuf_sg(9) support.
 o Add lock assertion to vge_setmulti().
 o Add RX spare DMA map to recover from DMA map load failure.
 o Add optimized RX buffer handler, vge_discard_rxbuf which is
   activated when vge(4) sees bad frames.
 o Don't blindly update VGE_RXDESC_RESIDUECNT register. Datasheet
   says the register should be updated only when number of
   available RX descriptors are multiple of 4.
 o Use __NO_STRICT_ALIGNMENT instead of defining VGE_FIXUP_RX which
   is only set for i386 architecture. Previously vge(4) also
   performed expensive copy operation to align IP header on amd64.
   This change should give RX performance boost on amd64
   architecture.
 o Don't reinitialize controller if driver is already running. This
   should reduce number of link state flipping.
 o Since vge(4) drops a driver lock before passing received frame
   to upper layer, make sure vge(4) is still running after
   re-acquiring driver lock.
 o Add second argument count to vge_rxeof(). The argument will
   limit number of packets could be processed in RX handler.
 o Rearrange vge_rxeof() not to allocate RX buffer if received
   frame was bad packet.
 o Removed if_printf that prints DMA map failure. This type of
   message shouldn't be used in fast path of driver.
 o Reduce number of allowed TX buffer fragments to 6 from 7. A TX
   descriptor allows 7 fragments of a frame. However the CMZ field
   of descriptor has just 3bits and the controller wants to see
   fragment + 1 in the field. So if we have 7 fragments the field
   value would be 0 which seems to cause unexpected results under
   certain conditions. This change should fix occasional TX hang
   observed on vge(4).
 o Simplify vge_stat_locked() and add number of available TX
   descriptor check.
 o vge(4) controllers lack padding short frames. Make sure to fill
   zero for the padded bytes. This closes unintended information
   disclosure.
 o Don't set VGE_TDCTL_JUMBO flag. Datasheet is not clear whether
   this bit should be set by driver or write-back status bit after
   transmission. At least vendor's driver does not set this bit so
   remove it. Without this bit vge(4) still can send jumbo frames.
 o Don't start driver when vge(4) know there are not enough RX
   buffers.
 o Remove volatile keyword in RX descriptor structure. This should
   be handled by bus_dma(9).
 o Collapse two 16bits member of TX/RX descriptor into single 32bits
   member.
 o Reduce number of RX descriptors to 252 from 256. The
   VGE_RXDESCNUM is 16bits register but only lower 8bits are valid.
   So the maximum number of RX descriptors would be 255. However
   the number of should be multiple of 4 as controller wants to
   update 4 RX descriptors at a time. This limits the maximum
   number of RX descriptor to be 252.

Tested by: Dewayne Geraghty (dewayne.geraghty <> heuristicsystems dot com dot au)
Carey Jones (m.carey.jones <> gmail dot com)
Yoshiaki Kasahara (kasahara <> nc dor kyushu-u dot ac dotjp)

14 years agoPass all IEs to net80211.
Rui Paulo [Mon, 14 Dec 2009 18:43:27 +0000 (18:43 +0000)]
Pass all IEs to net80211.

PR: 141376
Submitted by: Paul <onemda at gmail.com>
MFC after: 1 week

14 years agoRemove the MTX_SPIN flag to the shared code MUTEX
Jack F Vogel [Mon, 14 Dec 2009 18:43:18 +0000 (18:43 +0000)]
Remove the MTX_SPIN flag to the shared code MUTEX
as it was causing a panic, also took the opportunity
to rename the lock for clarity.

14 years agoPrefer bus_alloc_resource_any(9) to bus_alloc_resource(9).
Pyun YongHyeon [Mon, 14 Dec 2009 18:27:34 +0000 (18:27 +0000)]
Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9).

14 years agoFix spelling in comment.
Pyun YongHyeon [Mon, 14 Dec 2009 18:19:56 +0000 (18:19 +0000)]
Fix spelling in comment.

14 years agoPrefer device_printf(9) to printf(9).
Pyun YongHyeon [Mon, 14 Dec 2009 18:00:08 +0000 (18:00 +0000)]
Prefer device_printf(9) to printf(9).

14 years agoRemove register keyword.
Pyun YongHyeon [Mon, 14 Dec 2009 17:53:10 +0000 (17:53 +0000)]
Remove register keyword.

14 years agoAdd an option to specify that the received ZFS should not be automatically
Xin LI [Mon, 14 Dec 2009 17:04:44 +0000 (17:04 +0000)]
Add an option to specify that the received ZFS should not be automatically
mounted (receive -u).

Obtained from: OpenSolaris (onnv revision 8584:327a1b6dd944)
Approved by: pjd

14 years agoStyle improvements:
Xin LI [Mon, 14 Dec 2009 16:54:39 +0000 (16:54 +0000)]
Style improvements:

 - Sort function prototypes;
 - Apply static on all function bodies.  To quote bde@:

> It is a good obfuscation to declare functions as static only in the
> prototype, so that you can't see the static for the actual function.
> The reverse obfuscation (with static only in the function definition)
> would make more sense, but is a constraint error.

Reviewed by: bde

14 years agoRemove comment claiming that building acpi into the kernel is deprecated.
John Baldwin [Mon, 14 Dec 2009 15:32:32 +0000 (15:32 +0000)]
Remove comment claiming that building acpi into the kernel is deprecated.

PR: docs/141353
Submitted by: Bruce Cran
MFC after: 1 week

14 years agoProperly fix callout handling by putting all the per-cpu info in
Luigi Rizzo [Mon, 14 Dec 2009 12:23:46 +0000 (12:23 +0000)]
Properly fix callout handling by putting all the per-cpu info in
struct callout_cpu. From the comment in the file:

+ * There is one struct callout_cpu per cpu, holding all relevant
+ * state for the callout processing thread on the individual CPU.
+ * In particular:
+ *     cc_ticks is incremented once per tick in callout_cpu().
+ *     It tracks the global 'ticks' but in a way that the individual
+ *     threads should not worry about races in the order in which
+ *     hardclock() and hardclock_cpu() run on the various CPUs.
+ *     cc_softclock is advanced in callout_cpu() to point to the
+ *     first entry in cc_callwheel that may need handling. In turn,
+ *     a softclock() is scheduled so it can serve the various entries i
+ *     such that cc_softclock <= i <= cc_ticks .

Together with a smaller patch committed in september, this fixes a
bug that affects 8.0 with apps that rely on callouts to fire exactly
in the number of ticks specified (qemu among them).
Right now, callouts in 8.0 fire one tick late.

This was discussed in september with JeffR and jhb

MFC after: 3 days

14 years agoRevert the xterm terminal behavior to NOT clear the screen after
Doug Barton [Mon, 14 Dec 2009 07:18:31 +0000 (07:18 +0000)]
Revert the xterm terminal behavior to NOT clear the screen after
exiting a pager, vi, etc.

Add some example xterm*-clear entries to the termcap files to make
it easier for people to enable that behavior.

Document the examples in the man page to make them easier to find.

14 years agoFix one spelling and one copy&paste error in comments.
Alexander Kabaev [Mon, 14 Dec 2009 01:51:23 +0000 (01:51 +0000)]
Fix one spelling and one copy&paste error in comments.

14 years agoWork-around a race condition on ia64 while unlocking a contested lock.
Marcel Moolenaar [Mon, 14 Dec 2009 01:26:01 +0000 (01:26 +0000)]
Work-around a race condition on ia64 while unlocking a contested lock.
The race condition is believed to be in UMTX_OP_MUTEX_WAKE. On ia64,
we simply go to the kernel to unlock.
The big question is why this is only a race condition on ia64...

MFC after: 3 days

14 years agoOnly set ATA_CHECKS_CABLE for chip versions that actually support
Marius Strobl [Sun, 13 Dec 2009 20:36:42 +0000 (20:36 +0000)]
Only set ATA_CHECKS_CABLE for chip versions that actually support
cable detection, i.e. neither for ALI_OLD nor for ALI_NEW revisions
>= 0xc7.

MFC after: 1 week

14 years agoMake admsw(4) compile again fixing typos and adding the missing variable
Bjoern A. Zeeb [Sun, 13 Dec 2009 20:27:59 +0000 (20:27 +0000)]
Make admsw(4) compile again fixing typos and adding the missing variable
after r199762.

14 years agoAdd Mark Heily's libkqueue test suite as a general kqueue test suite to
Robert Watson [Sun, 13 Dec 2009 20:27:46 +0000 (20:27 +0000)]
Add Mark Heily's libkqueue test suite as a general kqueue test suite to
tools/regression.  It tests a number of aspects of kqueue behavior,
although not all currently pass (possibly bugs in the test suite?).

Submitted by: Mark Heily <mark at heily.com>
Obtained from: svn://mark.heily.com/libkqueue/trunk/test (r114)

14 years agoProperly support M5229 revision 0xc7 and 0xc8:
Marius Strobl [Sun, 13 Dec 2009 18:42:06 +0000 (18:42 +0000)]
Properly support M5229 revision 0xc7 and 0xc8:
- These revisions no longer have cable detection capability.
- The UDMA support bit of register 0x4b has been dropped without an
  replacement.
- According to Linux it's crucial for working ATAPI DMA support to
  also set the reserved bit 1 of regsiter 0x53 with these revisions.

MFC after: 1 week

14 years agoSpecify the capability and media bits of the capabilities page in
Marius Strobl [Sun, 13 Dec 2009 18:26:19 +0000 (18:26 +0000)]
Specify the capability and media bits of the capabilities page in
native, i.e. big-endian, format and convert as appropriate like we
also do with the multibyte fields of the other pages. This fixes
the output of acd_describe() to match reality on big-endian machines
without breaking it on little-endian ones. While at it, also convert
the remaining multibyte fields of the pages read although they are
currently unused for consistency and in order to prevent possible
similar bugs in the future.

MFC after: 1 week

14 years ago- Fix main() to use two separated sockets for the two transports
Hiroki Sato [Sun, 13 Dec 2009 15:19:01 +0000 (15:19 +0000)]
- Fix main() to use two separated sockets for the two transports
  when "-P port" is specified.  It invoked svc{tcp,udp}_create()
  for only one of the two allocated sockets, and prevented the
  TCP socket from binding to as the result.

- Use TI-RPC functions and handle sockets in a
  transport-independent way.  At this moment only AF_INET ("udp"
  and "tcp") is supported because others need rewrites of ACL
  handling and yp clients.

- Add '-h addr' to specify addresses to bind to.

- Convert _msgout() to use variable argument lists and remove
  asprintf() for error strings.

- Remove register storage class specifier.

Discussed with: kuriyama
MFC after: 1 week

14 years agoThroughout the network stack we have a few places of
Bjoern A. Zeeb [Sun, 13 Dec 2009 13:57:32 +0000 (13:57 +0000)]
Throughout the network stack we have a few places of
if (jailed(cred))
left.  If you are running with a vnet (virtual network stack) those will
return true and defer you to classic IP-jails handling and thus things
will be "denied" or returned with an error.

Work around this problem by introducing another "jailed()" function,
jailed_without_vnet(), that also takes vnets into account, and permits
the calls, should the jail from the given cred have its own virtual
network stack.

We cannot change the classic jailed() call to do that,  as it is used
outside the network stack as well.

Discussed with: julian, zec, jamie, rwatson (back in Sept)
MFC after: 5 days

14 years agoAdd a few more V_hacks to nfsclient to allow machines with a VIMAGE
Bjoern A. Zeeb [Sun, 13 Dec 2009 11:06:39 +0000 (11:06 +0000)]
Add a few more V_hacks to nfsclient to allow machines with a VIMAGE
kernel to boot from NFS. [1]

Note: this is not a full virtualization of nfsclient. It is only does
what advertised above and nothing more.

Requested by: public demand [1]
Tested by: kris, ..
MFC after: 5 days

14 years ago - Remove times.h from C programs that does not manipulate with time at
Xin LI [Sun, 13 Dec 2009 04:50:11 +0000 (04:50 +0000)]
 - Remove times.h from C programs that does not manipulate with time at
   all.
 - Remove pathnames.h from all but io.c since it's the only module that
   used these definations.

14 years agoegetopt.c does not use any stdlib.h definations, nor it referenced any
Xin LI [Sun, 13 Dec 2009 04:34:51 +0000 (04:34 +0000)]
egetopt.c does not use any stdlib.h definations, nor it referenced any
symbol from other module, so remove reference of stdlib.h and extern.h.

Verified with: md5(1)

14 years agoUse ANSI prototype for foldit().
Xin LI [Sun, 13 Dec 2009 04:14:55 +0000 (04:14 +0000)]
Use ANSI prototype for foldit().

14 years agoWe use gmt2local code from tcpdump and gnuc.h is no longer being used
Xin LI [Sun, 13 Dec 2009 04:08:04 +0000 (04:08 +0000)]
We use gmt2local code from tcpdump and gnuc.h is no longer being used
there, so remove this dummy header.

14 years agoxinstall.c does not require ctype functions, so ctype.h is not
Xin LI [Sun, 13 Dec 2009 03:53:15 +0000 (03:53 +0000)]
xinstall.c does not require ctype functions, so ctype.h is not
necessary here.

Note: this would change the md5 checksum due to change caused
by different register layout.

14 years agoStaticify internal functions and make usage() a prototype.
Xin LI [Sun, 13 Dec 2009 03:34:19 +0000 (03:34 +0000)]
Staticify internal functions and make usage() a prototype.

14 years agoExplicitly say that this is an internal library which is intended to be
Xin LI [Sun, 13 Dec 2009 03:29:05 +0000 (03:29 +0000)]
Explicitly say that this is an internal library which is intended to be
used within FreeBSD base system only, and discourage user applications
from using it.  User applications should use the expat version from the
ports/package collection.

Reviewed by: simon (earlier version)
MFC after: 2 weeks

14 years agoUse prototype for usage().
Xin LI [Sun, 13 Dec 2009 03:18:37 +0000 (03:18 +0000)]
Use prototype for usage().

14 years agoRevert most part of 200420 as requested, as more review and polish is
Xin LI [Sun, 13 Dec 2009 03:14:06 +0000 (03:14 +0000)]
Revert most part of 200420 as requested, as more review and polish is
needed.

14 years agoAdd support for memory disk (md). The size of the memory disk
Marcel Moolenaar [Sun, 13 Dec 2009 01:20:32 +0000 (01:20 +0000)]
Add support for memory disk (md). The size of the memory disk
is determined by MD_IMAGE_SIZE. A file system can be embedded
into the loader with /sys/tools/embed_mfs.sh.
Note that md.c is not included when MD_IMAGE_SIZE is not set.

14 years agoUnbreak the ata_atapi() usage. Since r200171 the mode setting functions
Marius Strobl [Sun, 13 Dec 2009 00:13:21 +0000 (00:13 +0000)]
Unbreak the ata_atapi() usage. Since r200171 the mode setting functions
get a ata_device type device passed instead of a ata_channel one, thus
ata_atapi() has to be adjusted accordingly.

Reviewed by: mav
MFC after: 3 days

14 years agoUpdate ntp vendor code to 4.2.4p8.
Ollivier Robert [Sat, 12 Dec 2009 22:29:30 +0000 (22:29 +0000)]
Update ntp vendor code to 4.2.4p8.

This is mainly to fix CVE-2009-3563, a remote DOS.

MFC after: 3 days
Security: CVE-2009-3563

14 years agoDocument PBDRY and SLEEPQ_STOP_ON_BDRY.
Konstantin Belousov [Sat, 12 Dec 2009 22:08:37 +0000 (22:08 +0000)]
Document PBDRY and SLEEPQ_STOP_ON_BDRY.

Requested and reviewed by: attilio
MFC after: 3 days

14 years agoDon't free jail parameter values after printing them - jail_param_get
Jamie Gritton [Sat, 12 Dec 2009 21:59:30 +0000 (21:59 +0000)]
Don't free jail parameter values after printing them - jail_param_get
expects them to be there for the next jail in the list.

PR: bin/141359
MFC after: 1 week

14 years agoSince the change to rc.subr in r198162 it's not necessary to specify
Doug Barton [Sat, 12 Dec 2009 21:51:50 +0000 (21:51 +0000)]
Since the change to rc.subr in r198162 it's not necessary to specify
command in the rc.d script if we have a corresponding ${name}_program
entry, which we do for named.

Rename named_precmd to named_prestart to make it more clear and match
convention.

Move the command_args definition related to -u up into _prestart().
It (and the associated $named_uid value) are only used there, and
unlike required_* and pidfile don't need to be used until this stage.

Fix a silly bug that would only have affected people who were using
the new named_wait or named_auto_forward features, AND had set up an
rndc.conf file instead of using the automatically generated rndc.key.

For named_conf:
Add "-c $named_conf" to command_args if it's not set to the
default. If it is set to the default and we're using the base
BIND it's not necessary. If we're using BIND from the ports
the user is likely to have included it in _flags (due to long
necessity for doing so) so don't duplicate that if it's set.

Add $named_conf to required_files

14 years agoIn current code, threads performing an interruptible sleep (on both
Attilio Rao [Sat, 12 Dec 2009 21:31:07 +0000 (21:31 +0000)]
In current code, threads performing an interruptible sleep (on both
sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will
leave the waiters flag on forcing the owner to do a wakeup even when if
the waiter queue is empty.
That operation may lead to a deadlock in the case of doing a fake wakeup
on the "preferred" (based on the wakeup algorithm) queue while the other
queue has real waiters on it, because nobody is going to wakeup the 2nd
queue waiters and they will sleep indefinitively.

A similar bug, is present, for lockmgr in the case the waiters are
sleeping with LK_SLEEPFAIL on.  In this case, even if the waiters queue
is not empty, the waiters won't progress after being awake but they will
just fail, still not taking care of the 2nd queue waiters (as instead the
lock owned doing the wakeup would expect).

In order to fix this bug in a cheap way (without adding too much locking
and complicating too much the semantic) add a sleepqueue interface which
does report the actual number of waiters on a specified queue of a
waitchannel (sleepq_sleepcnt()) and use it in order to determine if the
exclusive waiters (or shared waiters) are actually present on the lockmgr
(or sx) before to give them precedence in the wakeup algorithm.
This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to
cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters
a lockmgr has and if all the waiters on the exclusive waiters queue are
LK_SLEEPFAIL just wake both queues.

The sleepq_sleepcnt() introduction and ABI breakage require
__FreeBSD_version bumping.

Reported by: avg, kib, pho
Reviewed by: kib
Tested by: pho

14 years agoFor ia32 syscall(), call cpu_set_syscall_retval(). Update comment inside
Konstantin Belousov [Sat, 12 Dec 2009 20:11:31 +0000 (20:11 +0000)]
For ia32 syscall(), call cpu_set_syscall_retval(). Update comment inside
cpu_set_syscall_retval() accordingly.

MFC after: 1 week

14 years agoDon't read the newline character to line buffer because lines are passed
Jaakko Heinonen [Sat, 12 Dec 2009 18:18:46 +0000 (18:18 +0000)]
Don't read the newline character to line buffer because lines are passed
to wcscoll(3). Newline characters could cause incorrect results when
comparing lines.

Also, if an input line didn't contain a newline character, it was
omitted from the output. According to my interpretation, SUSv3 requires
that the newline is always printed.

Add regression tests for the cases. [1]

PR: bin/140976
Submitted by: D'Arcy Cain (original version) [1]
Approved by: trasz (mentor)

14 years agoThe input line length limit mentioned on the manual page was removed by
Jaakko Heinonen [Sat, 12 Dec 2009 18:04:50 +0000 (18:04 +0000)]
The input line length limit mentioned on the manual page was removed by
r179374.

Approved by: trasz (mentor)

14 years agoInstall firmware(9) examples.
Antoine Brodin [Sat, 12 Dec 2009 17:04:36 +0000 (17:04 +0000)]
Install firmware(9) examples.

MFC after: 1 month

14 years agoMake the code buildable in userland so it is easier to test it:
Luigi Rizzo [Sat, 12 Dec 2009 15:49:28 +0000 (15:49 +0000)]
Make the code buildable in userland so it is easier to test it:
this requires a small reordering of headers and a few #defines to
map functions not available in userland.

Remove a useless #ifndef block at the beginning of the file.

Introduce (temporarily) rn_init2(), see the comment in the code
for the proper long term change.

No ABI or functional change.

MFC after: 7 days

14 years agoOver time things that used to be files/directories/links can change
Doug Barton [Sat, 12 Dec 2009 02:19:41 +0000 (02:19 +0000)]
Over time things that used to be files/directories/links can change
to something else. So add code to detect when things don't match and
give the user choices about how to fix it.

If we're using -P and something in the above check needs to be moved
we need to have the directory there for it, so create it at the
beginning and delete empty versions of it at the end.

The case where something used to be a file or link and now is supposed
to be a directory (e.g., /etc/security) is especially dangerous, so
make failure to install a necessary directory in $DESTDIR a fatal error.

14 years agoFix libusb_open_device_with_vid_pid() to return a NULL if no device is
Sean Farley [Sat, 12 Dec 2009 00:24:30 +0000 (00:24 +0000)]
Fix libusb_open_device_with_vid_pid() to return a NULL if no device is
found instead of the last device in its search list.

Reviewed by: thompsa
MFC after: 5 days

14 years agoRemove a dead store.
Sean Farley [Sat, 12 Dec 2009 00:11:40 +0000 (00:11 +0000)]
Remove a dead store.

MFC after: 5 days

14 years agoRemove driver lock assertion in MII register access. This change
Pyun YongHyeon [Sat, 12 Dec 2009 00:06:43 +0000 (00:06 +0000)]
Remove driver lock assertion in MII register access. This change
was made in r199543 to remove MTX_RECURSE. These routines can be
called in device attach phase(e.g. mii_phy_probe()) so checking
assertion here is not right as caller does not hold a driver lock.

14 years agoThe hostname passed to ulog_login(3) may be optional.
Ed Schouten [Fri, 11 Dec 2009 23:52:42 +0000 (23:52 +0000)]
The hostname passed to ulog_login(3) may be optional.

Don't trip on a null pointer being passed to this function when
performing a local login.

Noticed by: dougb

14 years agoRemove unneeded header includes from usr.bin/ except contributed code.
Xin LI [Fri, 11 Dec 2009 23:35:38 +0000 (23:35 +0000)]
Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe

14 years agoRemove unnecessary termcap.h includes inherited from extern.h and other
Xin LI [Fri, 11 Dec 2009 23:30:22 +0000 (23:30 +0000)]
Remove unnecessary termcap.h includes inherited from extern.h and other
unneeded headers.  While I'm there, make function definations ANSI
prototypes.

14 years agoMove unistd.h includes to individual .c files and remove unnecessary
Xin LI [Fri, 11 Dec 2009 23:23:57 +0000 (23:23 +0000)]
Move unistd.h includes to individual .c files and remove unnecessary
includes.

14 years agoRemove unnecessary includes.
Xin LI [Fri, 11 Dec 2009 23:20:02 +0000 (23:20 +0000)]
Remove unnecessary includes.

Reviewed by: rodrigc

14 years agoSimplify handling of MTREEFILE relative to DESTDIR
Doug Barton [Fri, 11 Dec 2009 23:03:35 +0000 (23:03 +0000)]
Simplify handling of MTREEFILE relative to DESTDIR

Make the message about a missing MTREEFILE combined with -U
more informative