]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agosh: Do not use locale for determining if something is a name.
jilles [Fri, 3 Sep 2010 22:13:54 +0000 (22:13 +0000)]
sh: Do not use locale for determining if something is a name.

This makes it impossible to use locale-specific characters in variable
names.

Names containing locale-specific characters make scripts only work with the
correct locale setting. Also, they did not even work in many practical cases
because multibyte character sets such as utf-8 are not supported.

This also avoids weirdness if LC_CTYPE is changed in the middle of a script.

14 years agosh: Add a test that 'read' leaves the file pointer at the correct place.
jilles [Fri, 3 Sep 2010 21:17:33 +0000 (21:17 +0000)]
sh: Add a test that 'read' leaves the file pointer at the correct place.

Naive buffering would break the common while read x... construct, which did
not appear to be tested yet.

14 years agoFix another bug introduced in r212109. We should unload DMA maps
yongari [Fri, 3 Sep 2010 18:00:17 +0000 (18:00 +0000)]
Fix another bug introduced in r212109. We should unload DMA maps
only after sending the last fragment of a frame so the mbuf pointer
also should be stored in the last descriptor index.

14 years agoUse a better #if guard.
mdf [Fri, 3 Sep 2010 17:42:17 +0000 (17:42 +0000)]
Use a better #if guard.

Suggested by pluknet <pluknet at gmail dot com>.

14 years agoStyle(9) fixes and eliminate the use of min().
mdf [Fri, 3 Sep 2010 17:42:12 +0000 (17:42 +0000)]
Style(9) fixes and eliminate the use of min().

14 years agoFix user-space libsbuf build. Why isn't CTASSERT available to
mdf [Fri, 3 Sep 2010 17:23:26 +0000 (17:23 +0000)]
Fix user-space libsbuf build.  Why isn't CTASSERT available to
user-space?

14 years agoFix brain fart when converting an if statement into a KASSERT.
mdf [Fri, 3 Sep 2010 16:12:39 +0000 (16:12 +0000)]
Fix brain fart when converting an if statement into a KASSERT.

14 years agoUse math rather than iteration when the desired sbuf size is larger than
mdf [Fri, 3 Sep 2010 16:09:17 +0000 (16:09 +0000)]
Use math rather than iteration when the desired sbuf size is larger than
SBUF_MAXEXTENDSIZE.

14 years agoChange the parameter passed to the inline assembly to u_short
rdivacky [Fri, 3 Sep 2010 14:25:17 +0000 (14:25 +0000)]
Change the parameter passed to the inline assembly to u_short
as we are dealing with 16bit segment registers. Change mov
to movw.

Approved by:    rpaulo (mentor)
Reviewed by:    kib, rink

14 years agoWhen an asm location cannot be resolved to a function the cost
fabient [Fri, 3 Sep 2010 13:54:02 +0000 (13:54 +0000)]
When an asm location cannot be resolved to a function the cost
will be spread as small value and then filtered by the threshold.
As a first step solution display the number of event that cannot
be resolved as a valid function location.

MFC after: 1week

14 years agovm_page.c: include opt_msgbuf.h for MSGBUF_SIZE use in vm_page_startup
avg [Fri, 3 Sep 2010 10:40:53 +0000 (10:40 +0000)]
vm_page.c: include opt_msgbuf.h for MSGBUF_SIZE use in vm_page_startup

vm_page_startup uses MSGBUF_SIZE value for adding msgbuf pages to minidump.
If opt_msgbuf.h is not included and MSGBUF_SIZE is overriden in kernel
config, then not all msgbuf pages will be dumped.  And most importantly,
struct msgbuf itself will not be included.  Thus the dump would look
corrupted/incomplete to tools like kgdb, dmesg, etc that try to access
struct msgbuf as one of the first things they do when working on a crash
dump.

MFC after: 5 days

14 years agoWe need to copy the ports config files before we launch the prefetch
phk [Fri, 3 Sep 2010 09:34:15 +0000 (09:34 +0000)]
We need to copy the ports config files before we launch the prefetch

14 years agoacpi: update stale comments about order of cpu devices probing
avg [Fri, 3 Sep 2010 08:07:04 +0000 (08:07 +0000)]
acpi: update stale comments about order of cpu devices probing

These comments should have been updated in r203776 when the order was
changed.

Pointyhat to: avg
MFC after: 3 days

14 years ago- Bump MAXCPU to 4. Tested on a quad G5 with both 32 and 64-bit kernels.
grehan [Fri, 3 Sep 2010 03:56:09 +0000 (03:56 +0000)]
- Bump MAXCPU to 4. Tested on a quad G5 with both 32 and 64-bit kernels.
A make buildkernel -j4 uses ~360% CPU.
- Bracket the AP spinup printf with a mutex to avoid garbled output.
- Enable SMP by default on powerpc64.

Reviewed by: nwhitehorn

14 years agoAllow / in the NANO_DEVICE
imp [Fri, 3 Sep 2010 03:48:06 +0000 (03:48 +0000)]
Allow / in the NANO_DEVICE

PR: 149729
Submitted by: Thomas Quinot <thomas@cuivre.fr.eu.org>

14 years agofix the move so that it matches what the rest of the internet
jmg [Fri, 3 Sep 2010 03:20:34 +0000 (03:20 +0000)]
fix the move so that it matches what the rest of the internet
says about this game...  This move also makes more sense...

MFC after: 1 week

14 years agoInitial WOL support. NS DP8315 was tested but SiS900/SiS7016 was
yongari [Fri, 3 Sep 2010 00:34:45 +0000 (00:34 +0000)]
Initial WOL support. NS DP8315 was tested but SiS900/SiS7016 was
not tested.
While I'm here, clean up SIOCSIFCAP handler.

14 years agoImplement initial device suspend/resume method.
yongari [Thu, 2 Sep 2010 22:37:13 +0000 (22:37 +0000)]
Implement initial device suspend/resume method.

14 years agoIn the case of non-sequential mappings, ofw_mapmem() could ask Open
nwhitehorn [Thu, 2 Sep 2010 22:26:49 +0000 (22:26 +0000)]
In the case of non-sequential mappings, ofw_mapmem() could ask Open
Firmware to map a memory region with negative length, causing crashes
and Undefined Behavior. Add the appropriate check to make the behavior
defined.

14 years agoAdding a missing firstname (Monique)
edwin [Thu, 2 Sep 2010 21:48:35 +0000 (21:48 +0000)]
Adding a missing firstname (Monique)

PR: conf/150049
Submitted by: Thierry Thomas <thierry@pompo.net>

14 years agoCorrect spelling mistake, int -> into
gavin [Thu, 2 Sep 2010 21:29:50 +0000 (21:29 +0000)]
Correct spelling mistake, int -> into

MFC after: 3 days

14 years agoBetter wording.
yongari [Thu, 2 Sep 2010 20:43:01 +0000 (20:43 +0000)]
Better wording.

Submitted by: jkim

14 years agoCorrect bioq_disksort so that bioq_insert_tail() offers barrier semantic.
gibbs [Thu, 2 Sep 2010 19:40:28 +0000 (19:40 +0000)]
Correct bioq_disksort so that bioq_insert_tail() offers barrier semantic.
Add the BIO_ORDERED flag for struct bio and update bio clients to use it.

The barrier semantics of bioq_insert_tail() were broken in two ways:

 o In bioq_disksort(), an added bio could be inserted at the head of
   the queue, even when a barrier was present, if the sort key for
   the new entry was less than that of the last queued barrier bio.

 o The last_offset used to generate the sort key for newly queued bios
   did not stay at the position of the barrier until either the
   barrier was de-queued, or a new barrier (which updates last_offset)
   was queued.  When a barrier is in effect, we know that the disk
   will pass through the barrier position just before the
   "blocked bios" are released, so using the barrier's offset for
   last_offset is the optimal choice.

sys/geom/sched/subr_disk.c:
sys/kern/subr_disk.c:
o Update last_offset in bioq_insert_tail().

o Only update last_offset in bioq_remove() if the removed bio is
  at the head of the queue (typically due to a call via
  bioq_takefirst()) and no barrier is active.

o In bioq_disksort(), if we have a barrier (insert_point is non-NULL),
  set prev to the barrier and cur to it's next element.  Now that
  last_offset is kept at the barrier position, this change isn't
  strictly necessary, but since we have to take a decision branch
  anyway, it does avoid one, no-op, loop iteration in the while
  loop that immediately follows.

o In bioq_disksort(), bypass the normal sort for bios with the
  BIO_ORDERED attribute and instead insert them into the queue
  with bioq_insert_tail().  bioq_insert_tail() not only gives
  the desired command order during insertion, but also provides
  barrier semantics so that commands disksorted in the future
  cannot pass the just enqueued transaction.

sys/sys/bio.h:
Add BIO_ORDERED as bit 4 of the bio_flags field in struct bio.

sys/cam/ata/ata_da.c:
sys/cam/scsi/scsi_da.c
Use an ordered command for SCSI/ATA-NCQ commands issued in
response to bios with the BIO_ORDERED flag set.

sys/cam/scsi/scsi_da.c
Use an ordered tag when issuing a synchronize cache command.

Wrap some lines to 80 columns.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
sys/geom/geom_io.c
Mark bios with the BIO_FLUSH command as BIO_ORDERED.

Sponsored by: Spectra Logic Corporation
MFC after: 1 month

14 years agoDocument tunable dev.sis.%unit.manual_pad
yongari [Thu, 2 Sep 2010 18:22:06 +0000 (18:22 +0000)]
Document tunable dev.sis.%unit.manual_pad
While I'm here Xref vlan(4) as sis(4) supports VLAN oversized
frames.

14 years agoEnable sis(4). sis(4) should work on all architectures.
yongari [Thu, 2 Sep 2010 18:12:54 +0000 (18:12 +0000)]
Enable sis(4). sis(4) should work on all architectures.

14 years agoUnlike most other controllers, NS DP83815/DP83816 controllers seem
yongari [Thu, 2 Sep 2010 18:10:11 +0000 (18:10 +0000)]
Unlike most other controllers, NS DP83815/DP83816 controllers seem
to pad with 0xFF when it encounter short frames.  According to RFC
1042 the pad bytes should be 0x00.
Because manual padding consumes extra CPU cycles, introduce a new
tunable which controls the padding behavior. Turning this tunable
on will have driver pad manually but it's disabled by default. Users
can enable software padding by setting the following tunable to
non-zero value.

dev.sis.%d.manual_pad="1"

PR: kern/35422 (patch not used)

14 years agoFix the last endianness issue on handling station address which
yongari [Thu, 2 Sep 2010 17:51:41 +0000 (17:51 +0000)]
Fix the last endianness issue on handling station address which
prevented driver from working on big-endian machines. Also rewrite
station address programming to make it work on strict-alignment
architectures. With this change, sis(4) now works on sparc64 and
performance number looks good even though sis(4) have to apply
fixup code to align received frames on 2 bytes boundary on sparc64.

14 years agoMFp4 CH=183052 183053 183258:
bz [Thu, 2 Sep 2010 17:43:44 +0000 (17:43 +0000)]
MFp4 CH=183052 183053 183258:

  In protosw we define pr_protocol as short, while on the wire
  it is an uint8_t.  That way we can have "internal" protocols
  like DIVERT, SEND or gaps for modules (PROTO_SPACER).
  Switch ipproto_{un,}register to accept a short protocol number(*)
  and do an upfront check for valid boundries. With this we
  also consistently report EPROTONOSUPPORT for out of bounds
  protocols, as we did for proto == 0.  This allows a caller
  to not error for this case, which is especially important
  if we want to automatically call these from domain handling.

  (*) the functions have been without any in-tree consumer
  since the initial introducation, so this is considered save.

  Implement ip6proto_{un,}register() similarly to their legacy IP
  counter parts to allow modules to hook up dynamically.

Reviewed by: philip, will
MFC after: 1 week

14 years agoDisable video ROM shadowing by default as I originally intended. I found
jkim [Thu, 2 Sep 2010 17:22:12 +0000 (17:22 +0000)]
Disable video ROM shadowing by default as I originally intended.  I found
a case where video ROM for an IGP is too tightly coupled with system BIOS
to get relocated.

14 years agoFix UP build.
mdf [Thu, 2 Sep 2010 16:23:05 +0000 (16:23 +0000)]
Fix UP build.

MFC after: 2 weeks

14 years agoMFp4 CH=183259:
bz [Thu, 2 Sep 2010 16:11:12 +0000 (16:11 +0000)]
MFp4 CH=183259:

  No reason to use if_free_type() as we don't change our type.
  Just if_free() is fine.

MFC after: 3 days

14 years agoRemove the freelist, which simply duplicates some of the zone allocator's
des [Thu, 2 Sep 2010 14:13:43 +0000 (14:13 +0000)]
Remove the freelist, which simply duplicates some of the zone allocator's
functionality.

Submitted by: Daniel Braniss <danny@cs.huji.ac.il>
MFC after: 3 weeks

14 years agoRemove trailing whitespace.
emaste [Thu, 2 Sep 2010 14:05:32 +0000 (14:05 +0000)]
Remove trailing whitespace.

14 years agoAdd fix for SiI3114 and SiI3512 chips bug, which caused sending R_ERR in
mav [Thu, 2 Sep 2010 12:32:29 +0000 (12:32 +0000)]
Add fix for SiI3114 and SiI3512 chips bug, which caused sending R_ERR in
response to DMA activate FIS under certain circumstances. This is
recommended fix from chip datasheet. If triggered, this bug most likely
cause write command timeout.

MFC after: 2 weeks

14 years agoSATA1.x SiliconImage controllers on power-on reset TFD Status register into
mav [Thu, 2 Sep 2010 11:18:43 +0000 (11:18 +0000)]
SATA1.x SiliconImage controllers on power-on reset TFD Status register into
value 0xff. On hot-plug this value confuses ata_generic_reset() device
presence detection logic. As soon as we already know drive presence from
SATA hard reset, hint ata_generic_reset() to wait for device signature
until success or full timeout.

14 years agoo csup(1) does not have -g flag. Remove it from the example.
maxim [Thu, 2 Sep 2010 05:07:34 +0000 (05:07 +0000)]
o csup(1) does not have -g flag.  Remove it from the example.

PR: conf/150214
Submitted by: Li
MFC after: 1 week

14 years agoReduce the need to accesss struct usb_device by providing functions to access
thompsa [Thu, 2 Sep 2010 04:39:45 +0000 (04:39 +0000)]
Reduce the need to accesss struct usb_device by providing functions to access
the product, manufacturer and serial strings.

Submitted by: Hans Petter Selasky

14 years agoAdd support for power mode filtering as some USB hardware does not support
thompsa [Thu, 2 Sep 2010 04:05:00 +0000 (04:05 +0000)]
Add support for power mode filtering as some USB hardware does not support
power saving.

Submitted by: Hans Petter Selasky

14 years agoChange argument for usbd_get_dma_delay() from USB bus to USB device, some
thompsa [Thu, 2 Sep 2010 04:01:18 +0000 (04:01 +0000)]
Change argument for usbd_get_dma_delay() from USB bus to USB device, some
embedded hardware needs to know exactly which device is in question before it
exactly can decide the required delay.

Submitted by: Hans Petter Selasky

14 years agoFix setting of the rx_max and tx_max variables. If the expected buffer size is
thompsa [Thu, 2 Sep 2010 03:55:08 +0000 (03:55 +0000)]
Fix setting of the rx_max and tx_max variables. If the expected buffer size is
greater than 65535 bytes then the CDC driver might not work as expected, which
is not likely with the existing USB speeds.

Submitted by: Hans Petter Selasky

14 years agoFix UMS_BUTTON_MAX define name
thompsa [Thu, 2 Sep 2010 03:52:04 +0000 (03:52 +0000)]
Fix UMS_BUTTON_MAX define name

14 years agoFix build breakage from r212127
thompsa [Thu, 2 Sep 2010 03:50:11 +0000 (03:50 +0000)]
Fix build breakage from r212127

14 years agoAdd GPIO programming for more PHY hardware.
thompsa [Thu, 2 Sep 2010 03:47:07 +0000 (03:47 +0000)]
Add GPIO programming for more PHY hardware.

Submitted by: yongari

14 years agoAdd support for extra buttons on the Kensington Slimblade Trackball.
thompsa [Thu, 2 Sep 2010 03:44:56 +0000 (03:44 +0000)]
Add support for extra buttons on the Kensington Slimblade Trackball.

Submitted by: Lee, Chung-Yeol

14 years agoSilence debug error by default.
thompsa [Thu, 2 Sep 2010 03:42:26 +0000 (03:42 +0000)]
Silence debug error by default.

PR: usb/141212
Submitted by: Hans Petter Selasky

14 years agoWe need to grab a node reference count to vap->iv_bss before using it as it is
thompsa [Thu, 2 Sep 2010 03:28:03 +0000 (03:28 +0000)]
We need to grab a node reference count to vap->iv_bss before using it as it is
possible for the node to be replaced and freed at any time by
ieee80211_sta_join1().

14 years agoModify pxe.c to use the version of nfs_getrootfh() that returns
rmacklem [Thu, 2 Sep 2010 01:05:10 +0000 (01:05 +0000)]
Modify pxe.c to use the version of nfs_getrootfh() that returns
the file handle's size and was recently committed to
lib/libstand/nfs.c. This allows pxeboot to use NFSv3 and work
correcty for non-FreeBSD as well as FreeBSD NFS servers.
If built with OLD_NFSV2 defined, the old
code that predated this patch will be used.

Tested by: danny at cs.huji.ac.il

14 years agoModify lib/libstand/nfs.c to use NFSv3 instead of NFSv2.
rmacklem [Thu, 2 Sep 2010 01:00:13 +0000 (01:00 +0000)]
Modify lib/libstand/nfs.c to use NFSv3 instead of NFSv2.
This allows the nfs_getrootfh() function to return the
correct file handle size to pxe.c for pxeboot. It also
results in NFSv2 no longer being used by default anywhere
in FreeBSD. If built with OLD_NFSV2 defined, the old
code that predated this patch will be built and NFSv2
will be used.

Tested by: danny at cs.huji.ac.il
MFC after: 2 weeks

14 years agoFix stupid error in r212109 which didn't swap DMA maps. This caused
yongari [Thu, 2 Sep 2010 00:44:05 +0000 (00:44 +0000)]
Fix stupid error in r212109 which didn't swap DMA maps. This caused
IOMMU panic on sparc64 under high TX load.

14 years agoModify nfs_diskless.c to recognize the environment variable
rmacklem [Wed, 1 Sep 2010 23:51:07 +0000 (23:51 +0000)]
Modify nfs_diskless.c to recognize the environment variable
boot.nfsroot.nfshandlelen and set the diskless root fs to
use NFSv3 and this file handle length when it is set. If
this environment variable is not set, the diskless root fs
will use NFSv2 and the same defaults as before. This fixes
the problem where the diskless nfs root fs had to be on a
FreeBSD server for NFSv3 to work, because it did not know
the correct file handle length and assumed the size used
by FreeBSD. Until pxeboot and loader are replaced by ones
built from commits coming soon, boot.nfsroot.nfshandlelen
will not be set by them and the diskless root fs will use
NFSv2 unless the /etc/fstab entry has the "nfsv3" option
specified.

Tested by: danny at cs.huji.ac.il
MFC after: 2 weeks

14 years agoAdd missing MODULE_VERSION() definitions, this resolves problems around
thompsa [Wed, 1 Sep 2010 23:47:53 +0000 (23:47 +0000)]
Add missing MODULE_VERSION() definitions, this resolves problems around
duplicate module loads.

PR: usb/125736
Submitted by: danger, mm
Reviewed by: hselasky

14 years agoMove sis_reset() to sis_initl(). This ensures driver starts with
yongari [Wed, 1 Sep 2010 22:50:11 +0000 (22:50 +0000)]
Move sis_reset() to sis_initl(). This ensures driver starts with
known good state of controller.

14 years agoAvoid controller reinitialization which could be triggered by
yongari [Wed, 1 Sep 2010 22:16:25 +0000 (22:16 +0000)]
Avoid controller reinitialization which could be triggered by
dhclient(8) or alias addresses are added.

PR: kern/87506

14 years agoDo not reinitialize controller whenever promiscuous mode or
yongari [Wed, 1 Sep 2010 22:08:23 +0000 (22:08 +0000)]
Do not reinitialize controller whenever promiscuous mode or
allmulti is toggled. Controller does not require reinitialization.
This removes unnecessary controller reinitialization whenever
tcpdump is used.
While I'm here remove unnecessary variable reinitialization.

14 years agoReport result of link state change to caller. Previously it always
yongari [Wed, 1 Sep 2010 21:44:36 +0000 (21:44 +0000)]
Report result of link state change to caller. Previously it always
returned success.

14 years agoOverhaul link state change handling. Previously sis(4) blindly
yongari [Wed, 1 Sep 2010 21:42:19 +0000 (21:42 +0000)]
Overhaul link state change handling. Previously sis(4) blindly
configured TX/RX MACs before getting a valid link. After that, when
link state change callback is called, it called device
initialization again to reconfigure TX/RX MACs depending on
resolved link state. This hack created several bad side effects and
it required more hacks to not collide with sis_tick callback as
well as disabling switching to currently selected media in device
initialization. Also it seems sis(4) was used to be a template
driver for long time so other drivers which was modeled after
sis(4) also should be changed.

TX/RX MACs are now reconfigured after getting a valid link. Fix for
short cable error is also applied after getting a link because it's
only valid when the resolved speed is 100Mbps.

While I'm here slightly reorganize interrupt handler such that
sis(4) always read SIS_ISR register to see whether the interrupt is
ours or not. This change removes another hack and make it possible
to nuke sis_stopped variable in softc.

14 years agoFix a bug with sched_affinity() where it checks td_pinned of another
mdf [Wed, 1 Sep 2010 20:32:47 +0000 (20:32 +0000)]
Fix a bug with sched_affinity() where it checks td_pinned of another
thread in a racy manner, which can lead to attempting to migrate a
thread that is pinned to a CPU.  Instead, have sched_switch() determine
which CPU a thread should run on if the current one is not allowed.

KASSERT in sched_bind() that the thread is not yet pinned to a CPU.

KASSERT in sched_switch() that only migratable threads or those moving
due to a sched_bind() are changing CPUs.

sched_affinity code came from jhb@.

MFC after: 2 weeks

14 years agos/u_intXX_t/uintXX_t/g
yongari [Wed, 1 Sep 2010 19:53:15 +0000 (19:53 +0000)]
s/u_intXX_t/uintXX_t/g

14 years agormlock(9) two additions and one change/fix:
mlaier [Wed, 1 Sep 2010 19:50:03 +0000 (19:50 +0000)]
rmlock(9) two additions and one change/fix:
 - add rm_try_rlock().
 - add RM_SLEEPABLE to use sx(9) as the back-end lock in order to sleep while
   holding the write lock.
 - change rm_noreadtoken to a cpu bitmask to indicate which CPUs need to go
   through the lock/unlock in order to synchronize.  As a side effect, this
   also avoids IPI to CPUs without any readers during rm_wlock.

Discussed with: ups@, rwatson@ on arch@
Sponsored by: Isilon Systems, Inc.

14 years agobus_dma(9) cleanup.
yongari [Wed, 1 Sep 2010 19:33:40 +0000 (19:33 +0000)]
bus_dma(9) cleanup.
 o Enforce TX/RX descriptor ring alignment. NS data sheet says the
   controller needs 4 bytes alignment but use 16 to cover both SiS
   and NS controllers. I don't have SiS data sheet so I'm not sure
   what is alignment restriction of SiS controller but 16 would be
   enough because it's larger than the size of a TX/RX descriptor.
   Previously sis(4) ignored the alignment restriction.
 o Enforce RX buffer alignment, 4.
   Previously sis(4) ignored RX buffer alignment restriction.
 o Limit number of TX DMA segment to be used to 16. It seems
   controller has no restriction on number of DMA segments but
   using more than 16 looks resource waste.
 o Collapse long mbuf chains with m_collapse(9) instead of calling
   expensive m_defrag(9).
 o TX/RX side bus_dmamap_load_mbuf_sg(9) support and remove
   unnecessary callbacks.
 o Initial endianness support.
 o Prefer local alignment fixup code to m_devget(9).
 o Pre-allocate TX/RX mbuf DMA maps instead of creating/destroying
   these maps in fast TX/RX path. On non-x86 architectures, this is
   very expensive operation and there is no need to do that.
 o Add missing bus_dmamap_sync(9) in TX/RX path.
 o watchdog is now unarmed only when there are no pending frames
   on controller. Previously sis(4) blindly unarmed watchdog
   without checking the number of queued frames.
 o For efficiency, loaded DMA map is reused for error frames.
 o DMA map loading failure is now gracefully handled. Previously
   sis(4) ignored any DMA map loading errors.
 o Nuke unused macros which are not appropriate for endianness
   operation.
 o Stop embedding driver maintained structures into descriptor
   rings. Because TX/RX descriptor structures are shared between
   host and controller, frequent bus_dmamap_sync(9) operations are
   required in fast path. Embedding driver structures will increase
   the size of DMA map which in turn will slow down performance.

14 years agoNuke unnecessary return at the end of function.
yongari [Wed, 1 Sep 2010 18:41:59 +0000 (18:41 +0000)]
Nuke unnecessary return at the end of function.

14 years agostyle(9) - space after keywords.
yongari [Wed, 1 Sep 2010 18:39:35 +0000 (18:39 +0000)]
style(9) - space after keywords.

14 years agoRemove leading and trailing white spaces.
yongari [Wed, 1 Sep 2010 18:28:08 +0000 (18:28 +0000)]
Remove leading and trailing white spaces.
No functional changes.

14 years agoUpdates for the RMI MIPS platform code
jchandra [Wed, 1 Sep 2010 17:35:31 +0000 (17:35 +0000)]
Updates for the RMI MIPS platform code
- set cache_coherent_dma flag in cpuinfo for XLR, this will make sure that
  BUS_DMA_COHERENT flag is handled correctly in busdma_machdep.c
- iodi.c, call device_get_name() just once
- clear RMI specific EIRR while intializing CPUs
- remove debug print in intr_machdep.c

14 years agoAdd a sysctl knob to accept input packets on any link in a failover lagg.
emaste [Wed, 1 Sep 2010 16:53:38 +0000 (16:53 +0000)]
Add a sysctl knob to accept input packets on any link in a failover lagg.

14 years agoFix a bug which results in peer IPv4 addresses a.b.c.d with 224<=d<=239
tuexen [Wed, 1 Sep 2010 16:11:26 +0000 (16:11 +0000)]
Fix a bug which results in peer IPv4 addresses a.b.c.d with 224<=d<=239
incorrectly being detected as multicast addresses on little endian systems.

MFC after: 2 weeks

14 years agoUse a cleaner expression to retrieve the memory size in pc98's boot2.c,
dim [Wed, 1 Sep 2010 15:24:47 +0000 (15:24 +0000)]
Use a cleaner expression to retrieve the memory size in pc98's boot2.c,
which also avoids NULL pointer arithmetic, as suggested by jhb.  The
available space goes from 11 bytes to 7.

Reviewed by: nyan
Approved by: rpaulo (mentor)

14 years agoAs long as we are going to panic anyway, there's no need to hide additional
emaste [Wed, 1 Sep 2010 13:47:11 +0000 (13:47 +0000)]
As long as we are going to panic anyway, there's no need to hide additional
information behind DIAGNOSTIC.

14 years agoRemove incorrect comments, also make sure signal is
davidxu [Wed, 1 Sep 2010 13:22:55 +0000 (13:22 +0000)]
Remove incorrect comments, also make sure signal is
disabled when unregistering sigaction.

14 years agoo Sync the man page with the reality: nfs/ includes
maxim [Wed, 1 Sep 2010 12:08:54 +0000 (12:08 +0000)]
o Sync the man page with the reality: nfs/ includes
are under include/ and include/fs/.

PR: docs/139153
Submitted by: gjb
MFC after: 1 week

14 years agoMake the /dev/dtrace/helper node have the mode 0660. This allows
rpaulo [Wed, 1 Sep 2010 12:08:32 +0000 (12:08 +0000)]
Make the /dev/dtrace/helper node have the mode 0660. This allows
programs that refuse to run as root (pgsql) to install probes when their
user is part of the wheel group.

Sponsored by: The FreeBSD Foundation
> Description of fields to fill in above:                     76 columns --|
> PR:            If a GNATS PR is affected by the change.
> Submitted by:  If someone else sent in the change.
> Reviewed by:   If someone else reviewed your modification.
> Approved by:   If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
> Security:      Vulnerability reference (one per line) or description.
> Empty fields above will be automatically removed.

M    dev/dtrace/dtrace_load.c

14 years agoInclude <sys/sdt.h> on a generated header.
rpaulo [Wed, 1 Sep 2010 11:27:09 +0000 (11:27 +0000)]
Include <sys/sdt.h> on a generated header.

Sponsored by: The FreeBSD Foundation

14 years agoRemove reference to device minor numbers in psm(4) man page.
ed [Wed, 1 Sep 2010 09:53:24 +0000 (09:53 +0000)]
Remove reference to device minor numbers in psm(4) man page.

The number returned by stat(2) is generated automatically, so it is not
possible to deduce whether the device is blocking or not.

MFC after: 1 week

14 years agoo List MOUNTVER and SCHED classes. X-ref gsched(8). Bump Dd.
maxim [Wed, 1 Sep 2010 08:32:40 +0000 (08:32 +0000)]
o List MOUNTVER and SCHED classes.  X-ref gsched(8).  Bump Dd.

PR: docs/149925
Submitted by: arundel

14 years agoIn function __pthread_cxa_finalize(), also make code for removing
davidxu [Wed, 1 Sep 2010 07:09:46 +0000 (07:09 +0000)]
In function __pthread_cxa_finalize(), also make code for removing
atfork handler be async-signal safe.

14 years agoIncrease device reset timeout from 10 to 15 seconds, same as in ahci(4).
mav [Wed, 1 Sep 2010 06:43:41 +0000 (06:43 +0000)]
Increase device reset timeout from 10 to 15 seconds, same as in ahci(4).
Some devices found need about 10-12 seconds to spinup.

14 years ago- Remove duplicate comment.
lulf [Wed, 1 Sep 2010 05:34:17 +0000 (05:34 +0000)]
- Remove duplicate comment.

PR: kern/148820
Submitted by: pluknet <pluknet - at - gmail.com>

14 years agopthread_atfork should acquire writer lock and protect the code
davidxu [Wed, 1 Sep 2010 03:55:10 +0000 (03:55 +0000)]
pthread_atfork should acquire writer lock and protect the code
with critical region.

14 years agoChange atfork lock from mutex to rwlock, also make mutexes used by malloc()
davidxu [Wed, 1 Sep 2010 03:11:21 +0000 (03:11 +0000)]
Change atfork lock from mutex to rwlock, also make mutexes used by malloc()
module private type, when private type mutex is locked/unlocked, thread
critical region is entered or leaved. These changes makes fork()
async-signal safe which required by POSIX. Note that user's atfork handler
still needs to be async-signal safe, but it is not problem of libthr, it
is user's responsiblity.

14 years agoAdd signal handler wrapper, the reason to add it becauses there are
davidxu [Wed, 1 Sep 2010 02:18:33 +0000 (02:18 +0000)]
Add signal handler wrapper, the reason to add it becauses there are
some cases we want to improve:
  1) if a thread signal got a signal while in cancellation point,
     it is possible the TDP_WAKEUP may be eaten by signal handler
     if the handler called some interruptibly system calls.
  2) In signal handler, we want to disable cancellation.
  3) When thread holding some low level locks, it is better to
     disable signal, those code need not to worry reentrancy,
     sigprocmask system call is avoided because it is a bit expensive.
The signal handler wrapper works in this way:
  1) libthr installs its signal handler if user code invokes sigaction
     to install its handler, the user handler is recorded in internal
     array.
  2) when a signal is delivered, libthr's signal handler is invoke,
     libthr checks if thread holds some low level lock or is in critical
     region, if it is true, the signal is buffered, and all signals are
     masked, once the thread leaves critical region, correct signal
     mask is restored and buffered signal is processed.
  3) before user signal handler is invoked, cancellation is temporarily
     disabled, after user signal handler is returned, cancellation state
     is restored, and pending cancellation is rescheduled.

14 years agorescure comments from RELENG_4.
davidxu [Wed, 1 Sep 2010 01:26:07 +0000 (01:26 +0000)]
rescure comments from RELENG_4.

14 years agoWhitespace and comment fixes.
jamie [Tue, 31 Aug 2010 23:14:03 +0000 (23:14 +0000)]
Whitespace and comment fixes.

MFC after: 3 days

14 years agoDon't over-allocate array values in jailparam_export.
jamie [Tue, 31 Aug 2010 21:50:09 +0000 (21:50 +0000)]
Don't over-allocate array values in jailparam_export.
Fix a little comment typo.

MFC after: 3 days

14 years agoMake it clear in the example that jailparam_export's return value
jamie [Tue, 31 Aug 2010 21:48:45 +0000 (21:48 +0000)]
Make it clear in the example that jailparam_export's return value
should be freed.

MFC after: 3 days

14 years agoRemove unnecessary atomic operation in bge_poll. bge(4) always
yongari [Tue, 31 Aug 2010 20:56:18 +0000 (20:56 +0000)]
Remove unnecessary atomic operation in bge_poll. bge(4) always
holds a driver lock in the function entry and
memory synchronization is handled by bus_dmamap_sync(9).

14 years agoMake sure the interrupt entry point is within the video ROM range. We must
jkim [Tue, 31 Aug 2010 20:21:52 +0000 (20:21 +0000)]
Make sure the interrupt entry point is within the video ROM range.  We must
not change interrupt vector if it is not pointing the ROM itself.  Actually,
we just fail shadowing altogether if that is the case because the shadowed
copy will be useless for sure and POST may not be relocatable or useful.
While I'm here, fix a debugging message under bootverbose, really.  r211829
fixed one case but broke another.  Mea Culpa.

14 years agobge_txeof() already checks whether it has to free transmitted mbufs
yongari [Tue, 31 Aug 2010 19:59:18 +0000 (19:59 +0000)]
bge_txeof() already checks whether it has to free transmitted mbufs
or not by comparing reported TX consumer index with saved index. So
remove unnecessary check done after freeing transmitted mbufs.
While I'm here nuke unnecessary variable initializations.

14 years agoEliminate confusing while () loop. In the first version of the code it was
pjd [Tue, 31 Aug 2010 19:01:46 +0000 (19:01 +0000)]
Eliminate confusing while () loop. In the first version of the code it was
there to avoid gotos, but in the current version it serves no purpose.

MFC after: 2 weeks

14 years agoFor consistency, change all 'i386' and MACHINE_ARCH to x86.
delphij [Tue, 31 Aug 2010 19:01:12 +0000 (19:01 +0000)]
For consistency, change all 'i386' and MACHINE_ARCH to x86.

Reviewed by: jhb
MFC after: 1 week

14 years agoHandle PAE case correctly. You cannot effectively specify a 4GB
yongari [Tue, 31 Aug 2010 18:48:09 +0000 (18:48 +0000)]
Handle PAE case correctly. You cannot effectively specify a 4GB
boundary in PAE case so use a 2GB boundary for PAE as suggested by
jhb.

Pointed out by: jhb
Reviewed by: jhb

14 years agoAvoid directly manipulating a NULL pointer (which could result in
dim [Tue, 31 Aug 2010 18:11:50 +0000 (18:11 +0000)]
Avoid directly manipulating a NULL pointer (which could result in
undefined behaviour) in sys/boot/pc98/boot2/boot2.c.

Reviewed by: nyan
Approved by: rpaulo (mentor)

14 years agoHave memguard(9) crash with an easier-to-debug message on double-free.
mdf [Tue, 31 Aug 2010 17:43:47 +0000 (17:43 +0000)]
Have memguard(9) crash with an easier-to-debug message on double-free.

Reviewed by:    zml
MFC after:      3 weeks

14 years agoAlways compile pc98 boot2 with gcc instead of clang, just as with i386
dim [Tue, 31 Aug 2010 17:38:20 +0000 (17:38 +0000)]
Always compile pc98 boot2 with gcc instead of clang, just as with i386
boot2.  Unfortunately both still are too big when compiled with clang.

Reviewed by: nyan
Approved by: rpaulo (mentor)

14 years agoSplit common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
yongari [Tue, 31 Aug 2010 17:33:48 +0000 (17:33 +0000)]
Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
tag. All controllers that are not BCM5755 or higher have 4GB
boundary DMA bug. Previously bge(4) used 32bit DMA address to
workaround the bug(r199670). However this caused the use of bounce
buffers such that it resulted in poor performance for systems which
have more than 4GB memory. Because bus_dma(9) honors boundary
restriction requirement of DMA tag for dynamic buffers, having a
separate TX/RX mbuf DMA tag will greatly reduce the possibility of
using bounce buffers. For DMA buffers allocated with
bus_dmamem_alloc(9), now bge(4) explicitly checks whether the
requested memory region crossed the boundary or not.
With this change, only the DMA buffer that crossed the boundary
will use 32bit DMA address. Other DMA buffers are not affected as
separate DMA tag is created for each DMA buffer.
Even if 32bit DMA address space is used for a buffer, the chance to
use bounce buffer is still very low as the size of buffer is small.
This change should eliminate most usage of bounce buffers on
systems that have more than 4GB memory.

More correct fix would be teaching bus_dma(9) to honor boundary
restriction for buffers created with bus_dmamem_alloc(9) but it
seems that is not easy.

While I'm here cleanup bge_dma_map_addr() and remove unnecessary
member variables in bge_dmamap_arg structure.

Tested by: marcel

14 years agoUse a more robust way to substitute gcc for clang, when compiling
dim [Tue, 31 Aug 2010 17:33:29 +0000 (17:33 +0000)]
Use a more robust way to substitute gcc for clang, when compiling
gnu/lib/libobjc and sys/boot/i386/boot2, so it also works when using
absolute paths and/or options, as in CC="/absolute/path/clang -foo".

Approved by: rpaulo (mentor)

14 years agoThe realloc case for memguard(9) will copy too many bytes when
mdf [Tue, 31 Aug 2010 16:57:58 +0000 (16:57 +0000)]
The realloc case for memguard(9) will copy too many bytes when
reallocating to a smaller-sized allocation.  Fix this issue.

Noticed by:     alc
Reviewed by:    alc
Approved by:    zml (mentor)
MFC after:      3 weeks

14 years agoRestructure how reset and poweroff are handled on PowerPC systems, since
nwhitehorn [Tue, 31 Aug 2010 15:27:46 +0000 (15:27 +0000)]
Restructure how reset and poweroff are handled on PowerPC systems, since
the existing code was very platform specific, and broken for SMP systems
trying to reboot from KDB.

- Add a new PLATFORM_RESET() method to the platform KOBJ interface, and
  migrate existing reset functions into platform modules.
- Modify the OF_reboot() routine to submit the request by hand to avoid
  the IPIs involved in the regular openfirmware() routine. This fixes
  reboot from KDB on SMP machines.
- Move non-KDB reset and poweroff functions on the Powermac platform
  into the relevant power control drivers (cuda, pmu, smu), instead of
  using them through the Open Firmware backdoor.
- Rename platform_chrp to platform_powermac since it has become
  increasingly Powermac specific. When we gain support for IBM systems,
  we will grow a new platform_chrp.

14 years agoRemove some code made obsolete by the powerpc64 import.
nwhitehorn [Tue, 31 Aug 2010 15:22:09 +0000 (15:22 +0000)]
Remove some code made obsolete by the powerpc64 import.

14 years agoInclude process PID in log messages.
pjd [Tue, 31 Aug 2010 12:05:13 +0000 (12:05 +0000)]
Include process PID in log messages.

Submitted by: Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 2 weeks

14 years agoCorrect error message.
pjd [Tue, 31 Aug 2010 12:03:29 +0000 (12:03 +0000)]
Correct error message.

Submitted by: Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 2 weeks