]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoRevert changes in r228790. It prevented the ypserv daemon from working with
Hiroki Sato [Tue, 17 Jan 2012 20:39:33 +0000 (20:39 +0000)]
Revert changes in r228790.  It prevented the ypserv daemon from working with
with multiple socktypes.

12 years agoOnly use the static assertion when __generic is available.
Ed Schouten [Tue, 17 Jan 2012 20:22:10 +0000 (20:22 +0000)]
Only use the static assertion when __generic is available.

Reported by: tijl

12 years agoDon't expose __generic() when not using C++.
Ed Schouten [Tue, 17 Jan 2012 20:21:31 +0000 (20:21 +0000)]
Don't expose __generic() when not using C++.

According to the GCC documentation, the constructs used to implement
<tgmath.h> are only available in C mode. They only cause breakage when
used used with g++.

Reported by: tijl

12 years agoFree allocated jumbo buffers when controller is stopped.
Pyun YongHyeon [Tue, 17 Jan 2012 19:36:53 +0000 (19:36 +0000)]
Free allocated jumbo buffers when controller is stopped.

12 years agoUse a RX DMA tag to free loaded RX DMA maps.
Pyun YongHyeon [Tue, 17 Jan 2012 19:31:03 +0000 (19:31 +0000)]
Use a RX DMA tag to free loaded RX DMA maps.
Previously it used a TX DMA tag.

12 years agoTidy-up.
Adrian Chadd [Tue, 17 Jan 2012 18:20:34 +0000 (18:20 +0000)]
Tidy-up.

12 years agoThe newhook method can be called in ISR context at
Gleb Smirnoff [Tue, 17 Jan 2012 18:10:25 +0000 (18:10 +0000)]
The newhook method can be called in ISR context at
certain circumstances, so better use M_NOWAIT in it.

12 years agoAdd definitions for the FPU extended state header, legacy extended
Konstantin Belousov [Tue, 17 Jan 2012 17:07:13 +0000 (17:07 +0000)]
Add definitions for the FPU extended state header, legacy extended
state and AVX state.

MFC after: 1 week

12 years agoModernize the fpusave structures definitions by using uint*_t types.
Konstantin Belousov [Tue, 17 Jan 2012 16:53:41 +0000 (16:53 +0000)]
Modernize the fpusave structures definitions by using uint*_t types.

MFC after: 1 week

12 years agoExplain why it is safe to unlock the vnode.
Alan Cox [Tue, 17 Jan 2012 16:20:50 +0000 (16:20 +0000)]
Explain why it is safe to unlock the vnode.

Requested by: kib

12 years agoFix clang atomic to use for atomic_is_lock_free().
David Chisnall [Tue, 17 Jan 2012 15:20:41 +0000 (15:20 +0000)]
Fix clang atomic to use for atomic_is_lock_free().

Reviewed by: ed
Approved by: dim (mentor)

12 years agoAllocate our mbuf with m_get2().
Gleb Smirnoff [Tue, 17 Jan 2012 12:14:26 +0000 (12:14 +0000)]
Allocate our mbuf with m_get2().

12 years agoProvide a function m_get2() that allocates a minimal mbuf that
Gleb Smirnoff [Tue, 17 Jan 2012 12:13:36 +0000 (12:13 +0000)]
Provide a function m_get2() that allocates a minimal mbuf that
would fit specified size. Returned mbuf may be a single mbuf,
an mbuf with a cluster from packet zone, or an mbuf with jumbo
cluster of sufficient size.

12 years agoImplement xsetbv(), xsave() and xrstor() providing C access to the
Konstantin Belousov [Tue, 17 Jan 2012 07:30:36 +0000 (07:30 +0000)]
Implement xsetbv(), xsave() and xrstor() providing C access to the
similarly named CPU instructions.

Since our in-tree binutils gas is not aware of the instructions, and
I have to use the byte-sequence to encode them, hardcode the r/m operand
as (%rdi). This way, first argument of the pseudo-function is already
placed into proper register.

MFC after: 1 week

12 years agoAdd definitions related to XCR0.
Konstantin Belousov [Tue, 17 Jan 2012 07:23:43 +0000 (07:23 +0000)]
Add definitions related to XCR0.

MFC after: 1 week

12 years agoAdd macro IS_BSP() to check whether the current CPU is BSP.
Konstantin Belousov [Tue, 17 Jan 2012 07:21:23 +0000 (07:21 +0000)]
Add macro IS_BSP() to check whether the current CPU is BSP.

MFC after: 1 week

12 years agoFix the "lock &zrl->zr_mtx already initialized" assertion by initializing
Sergey Kandaurov [Tue, 17 Jan 2012 06:23:25 +0000 (06:23 +0000)]
Fix the "lock &zrl->zr_mtx already initialized" assertion by initializing
the allocated memory before calling mtx_init(9) on mtx pointing to it.
Otherwize, random contents of uninitialized memory might occasionally
trigger the assertion.

Reported by: Pavel Polyakov <bsd kobyla org>
Reviewed by: pjd
MFC after: 1 week

12 years agoReturn EOPNOTSUPP since we only support update mounts for NFS export.
Kevin Lo [Tue, 17 Jan 2012 01:25:53 +0000 (01:25 +0000)]
Return EOPNOTSUPP since we only support update mounts for NFS export.

Spotted by: trociny

12 years agoThere are several bugs/hangs when trying to take a snapshot on a UFS/FFS
Kirk McKusick [Tue, 17 Jan 2012 01:14:56 +0000 (01:14 +0000)]
There are several bugs/hangs when trying to take a snapshot on a UFS/FFS
filesystem running with journaled soft updates. Until these problems
have been tracked down, return ENOTSUPP when an attempt is made to
take a snapshot on a filesystem running with journaled soft updates.

MFC after: 2 weeks

12 years agoMake sure all intermediate variables holding mount flags (mnt_flag)
Kirk McKusick [Tue, 17 Jan 2012 01:08:01 +0000 (01:08 +0000)]
Make sure all intermediate variables holding mount flags (mnt_flag)
and that all internal kernel calls passing mount flags are declared
as uint64_t so that flags in the top 32-bits are not lost.

MFC after: 2 weeks

12 years agoRevert r212360 now that PowerPC can handle large sparse arguments to
Nathan Whitehorn [Tue, 17 Jan 2012 00:31:09 +0000 (00:31 +0000)]
Revert r212360 now that PowerPC can handle large sparse arguments to
pmap_remove() (changed in r228412).

MFC after: 2 weeks

12 years agoImprove abstraction. Eliminate direct access by elf*_load_section()
Alan Cox [Tue, 17 Jan 2012 00:27:32 +0000 (00:27 +0000)]
Improve abstraction.  Eliminate direct access by elf*_load_section()
to an OBJT_VNODE-specific field of the vm object.  The same
information can be just as easily obtained from the struct vattr that
is in struct image_params if the latter is passed to
elf*_load_section().  Moreover, by replacing the vmspace and vm
object parameters to elf*_load_section() with a struct image_params
parameter, we actually reduce the size of the object code.

In collaboration with: kib

12 years ago- Add ID for the BeagleBone FTDI serial over usb port.
Stanislav Sedov [Mon, 16 Jan 2012 23:14:23 +0000 (23:14 +0000)]
- Add ID for the BeagleBone FTDI serial over usb port.

MFC after: 3 days

12 years agoAdd support for more USB devices.
Hans Petter Selasky [Mon, 16 Jan 2012 22:26:25 +0000 (22:26 +0000)]
Add support for more USB devices.

Submitted by: pav @
MFC after: 1 week

12 years agoRemove unnecessary includes from these libutil man pages.
Guy Helmer [Mon, 16 Jan 2012 21:25:41 +0000 (21:25 +0000)]
Remove unnecessary includes from these libutil man pages.

Requested by bde (as was the previous commit).

12 years agoFix more disorder in prototypes and constants.
Guy Helmer [Mon, 16 Jan 2012 21:19:23 +0000 (21:19 +0000)]
Fix more disorder in prototypes and constants.
Fix header comments for each section of constants.
Fix whitespace in #define lines.
Fix unnecessary parenthesis in constants.

12 years agoBe pedantic and change // comment to C-style one.
Sergey Kandaurov [Mon, 16 Jan 2012 20:42:56 +0000 (20:42 +0000)]
Be pedantic and change // comment to C-style one.

Noticed by: Bruce Evans

12 years agoGenerate a warning if the kernel's arc4random() is seeded with bogus entropy.
David Schultz [Mon, 16 Jan 2012 20:18:10 +0000 (20:18 +0000)]
Generate a warning if the kernel's arc4random() is seeded with bogus entropy.

12 years agoFix the value of float_t to match what is implied by FLT_EVAL_METHOD.
David Schultz [Mon, 16 Jan 2012 20:17:51 +0000 (20:17 +0000)]
Fix the value of float_t to match what is implied by FLT_EVAL_METHOD.

12 years agoChange the definition of FLT_EVAL_METHOD from 1 to 0. A value of 1 implies
David Schultz [Mon, 16 Jan 2012 20:17:29 +0000 (20:17 +0000)]
Change the definition of FLT_EVAL_METHOD from 1 to 0.  A value of 1 implies
that the compiler promotes floats to double precision in computations, but
inspection of the output of a cross-compiler indicates that this isn't the
case on powerpc.

12 years agoChange checkpath() to not exit on error. This is a prerequisite for
Jaakko Heinonen [Mon, 16 Jan 2012 19:34:21 +0000 (19:34 +0000)]
Change checkpath() to not exit on error. This is a prerequisite for
fixing the mount(8) "failok" option.

PR: 163668
Reviewed by: Garrett Cooper, delphij (previous version)

12 years agoUse the signal fence builtin in stdatomic.h when using the clang atomic
David Chisnall [Mon, 16 Jan 2012 18:19:53 +0000 (18:19 +0000)]
Use the signal fence builtin in stdatomic.h when using the clang atomic
builtins, rather than the __asm hack.  Somehow I missed the existence of this
builtin originally and only noticed that it was there when I went to implement
it...

Note: Trunk clang now has support for (most of) the C[++]11 atomics stuff.
Please test!

Approved by: brooks (mentor)

12 years agoAdd a bit of verbosity to the comment.
Ivan Voras [Mon, 16 Jan 2012 15:47:42 +0000 (15:47 +0000)]
Add a bit of verbosity to the comment.

12 years agoFix a style bug
Kevin Lo [Mon, 16 Jan 2012 14:54:48 +0000 (14:54 +0000)]
Fix a style bug

Spotted by: avg

12 years agoMake panic strings in m_gettype(), m_getzone(), m_cljset()
Gleb Smirnoff [Mon, 16 Jan 2012 13:23:19 +0000 (13:23 +0000)]
Make panic strings in m_gettype(), m_getzone(), m_cljset()
consistent.

12 years agoAdd missing static.
Gleb Smirnoff [Mon, 16 Jan 2012 12:33:55 +0000 (12:33 +0000)]
Add missing static.

12 years agoRemove some disabled NOTYET code. Probability of enabling it is low,
Gleb Smirnoff [Mon, 16 Jan 2012 12:31:33 +0000 (12:31 +0000)]
Remove some disabled NOTYET code. Probability of enabling it is low,
if anyone wants, he/she can take it from svn.

12 years agosh: Fix execution of multiple statements in a trap when evalskip is set
Jean-Sébastien Pédron [Mon, 16 Jan 2012 11:07:46 +0000 (11:07 +0000)]
sh: Fix execution of multiple statements in a trap when evalskip is set

Before this fix, only the first statement of the trap was executed if
evalskip was set. This is for example the case when:
    o  "-e" is set for this shell
    o  a trap is set on EXIT
    o  a function returns 1 and causes the script to abort

Reviewed by: jilles
MFC after: 2 weeks

12 years agosh: Test EXIT trap with multiple statements in it
Jean-Sébastien Pédron [Mon, 16 Jan 2012 10:59:44 +0000 (10:59 +0000)]
sh: Test EXIT trap with multiple statements in it

Reviewed by: jilles
MFC after: 2 weeks

12 years agom_getzone() should return only cluster zones.
Gleb Smirnoff [Mon, 16 Jan 2012 10:58:14 +0000 (10:58 +0000)]
m_getzone() should return only cluster zones.

12 years agoExport ttyname instead of ttyunit via the sysctl interface.
Hans Petter Selasky [Mon, 16 Jan 2012 10:42:43 +0000 (10:42 +0000)]
Export ttyname instead of ttyunit via the sysctl interface.

Submitted by: Mykhaylo Yehorov
PR: usb/164090
MFC after: 1 week

12 years agoAdd nfs export support to tmpfs(5)
Kevin Lo [Mon, 16 Jan 2012 10:25:22 +0000 (10:25 +0000)]
Add nfs export support to tmpfs(5)

Reviewed by: kib

12 years agoDrop support for SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFDSTADDR
Gleb Smirnoff [Mon, 16 Jan 2012 09:53:24 +0000 (09:53 +0000)]
Drop support for SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFBRDADDR, SIOCSIFDSTADDR
ioctl commands.

PR: 163524
Reviewed by: net

12 years agoExport information about USB serial port unit and port numbers
Hans Petter Selasky [Mon, 16 Jan 2012 08:13:25 +0000 (08:13 +0000)]
Export information about USB serial port unit and port numbers
directly via the sysctl interface.

Submitted by: Mykhaylo Yehorov
PR: usb/164090
MFC after: 1 week

12 years agoInsert read memory barriers.
David Xu [Mon, 16 Jan 2012 06:15:14 +0000 (06:15 +0000)]
Insert read memory barriers.

12 years agoMatch surrounding style.
Xin LI [Mon, 16 Jan 2012 06:00:44 +0000 (06:00 +0000)]
Match surrounding style.

Noticed by: avg

12 years agoRemove a confused comment and fix some minor bugs.
David Schultz [Mon, 16 Jan 2012 05:23:27 +0000 (05:23 +0000)]
Remove a confused comment and fix some minor bugs.

12 years agoFix the definition of FLT_EVAL_METHOD and some minor bugs.
David Schultz [Mon, 16 Jan 2012 05:23:13 +0000 (05:23 +0000)]
Fix the definition of FLT_EVAL_METHOD and some minor bugs.

12 years agoStop overloading opt_global.h.
Adrian Chadd [Mon, 16 Jan 2012 05:07:32 +0000 (05:07 +0000)]
Stop overloading opt_global.h.

12 years agoEliminate branch and insert an explicit reader memory barrier to ensure
David Xu [Mon, 16 Jan 2012 04:39:10 +0000 (04:39 +0000)]
Eliminate branch and insert an explicit reader memory barrier to ensure
that waiter bit is set before reading semaphore count.

12 years agoComputations on NaNs are supposed to return one of the input NaNs unchanged.
David Schultz [Mon, 16 Jan 2012 04:09:45 +0000 (04:09 +0000)]
Computations on NaNs are supposed to return one of the input NaNs unchanged.
Fix a few places in the sparc64 floating-point emulator where this wasn't
being handled properly.

Submitted by: bde

12 years agoAdd an implementation of fenv.h intended for platforms that lack an FPU and
David Schultz [Mon, 16 Jan 2012 04:09:17 +0000 (04:09 +0000)]
Add an implementation of fenv.h intended for platforms that lack an FPU and
use softfloat.

Thanks to Ian Lepore for testing and debugging this patch.  The fenv
regression tests pass (at least for Ian's arm chip) with this change.

12 years agoImplement FLT_ROUNDS for arm. Some (all?) arm FPUs lack support for
David Schultz [Mon, 16 Jan 2012 04:08:29 +0000 (04:08 +0000)]
Implement FLT_ROUNDS for arm.  Some (all?) arm FPUs lack support  for
dynamic rounding modes, but FPUless chips that use softfloat can support it
because everything is emulated anyway.  (We presently have incomplete
support for hardware FPUs.)

Submitted by: Ian Lepore

12 years agoRemove functions from softfloat's Symbol.map that don't need to be exported.
David Schultz [Mon, 16 Jan 2012 04:06:56 +0000 (04:06 +0000)]
Remove functions from softfloat's Symbol.map that don't need to be exported.
Also use the proper number of underscores for internal names.  (Changing
the names should be fine, since apparently the symbols are currently
unused.)

12 years agoConvert softfloat to use the standard exception flag and rounding macros
David Schultz [Mon, 16 Jan 2012 04:05:53 +0000 (04:05 +0000)]
Convert softfloat to use the standard exception flag and rounding macros
in fenv.h instead of the non-standard and incomplete ones in ieeefp.h.

Thanks to Ian Lepore for testing this patch.

12 years agoCorrect some bugs that resulted from arm/_fpmath.h being blindly copied
David Schultz [Mon, 16 Jan 2012 04:04:35 +0000 (04:04 +0000)]
Correct some bugs that resulted from arm/_fpmath.h being blindly copied
from the x86 version, which has a completely different long double
format.

Submitted by: Maks Verver

12 years agos/amd64/i386/ in comment.
Colin Percival [Mon, 16 Jan 2012 02:42:41 +0000 (02:42 +0000)]
s/amd64/i386/ in comment.

12 years agoCopy XENHVM config file from amd64, now that i386+XENHVM works.
Colin Percival [Mon, 16 Jan 2012 02:42:16 +0000 (02:42 +0000)]
Copy XENHVM config file from amd64, now that i386+XENHVM works.

12 years agoMake XENHVM work on i386. The __ffs() function counts bits starting from
Colin Percival [Mon, 16 Jan 2012 02:38:45 +0000 (02:38 +0000)]
Make XENHVM work on i386.  The __ffs() function counts bits starting from
zero, unlike ffs(3), which starts counting from 1.

12 years agoAdd check to avoid assertion panic on duplicate stop.
Alexander Motin [Mon, 16 Jan 2012 00:26:52 +0000 (00:26 +0000)]
Add check to avoid assertion panic on duplicate stop.

Reported by: Yuri Pankov <yuri.pankov@gmail.com>
MFC after: 2 months

12 years agoWhen tmpfs_write() resets an extended file to its original size after an
Alan Cox [Mon, 16 Jan 2012 00:26:49 +0000 (00:26 +0000)]
When tmpfs_write() resets an extended file to its original size after an
error, we want tmpfs_reg_resize() to ignore I/O errors and unconditionally
update the file's size.

Reviewed by: kib
MFC after: 3 weeks

12 years agoBeagleBone uses an FTDI chip with
Tim Kientzle [Sun, 15 Jan 2012 23:00:33 +0000 (23:00 +0000)]
BeagleBone uses an FTDI chip with
an altered Product ID.

12 years agosh: Fix some bugs with exit status from case containing ;&.
Jilles Tjoelker [Sun, 15 Jan 2012 21:39:38 +0000 (21:39 +0000)]
sh: Fix some bugs with exit status from case containing ;&.

Also, rework evalcase() to not evaluate any tree. Instead, return the
NCLISTFALLTHRU node and handle it in evaltree().

Fixed bugs:

* If a ;& list with non-zero exit status is followed by an empty ;; or final
  list, the exit status of the case command should be equal to the exit
  status of the ;& list, not 0.

* An empty ;& case should not reset $?.

12 years agodadump: don't leak the periph lock on i/o error
Andriy Gapon [Sun, 15 Jan 2012 20:43:39 +0000 (20:43 +0000)]
dadump: don't leak the periph lock on i/o error

Reported by: az
MFC after: 1 week

12 years agoxlocale.h: consistently use __va_list
Andriy Gapon [Sun, 15 Jan 2012 20:37:39 +0000 (20:37 +0000)]
xlocale.h: consistently use __va_list

Plain 'va_list' in this header seems to cause troubles with non-base GCC
which creates and uses "tortured" versions of some sysem header files
including stdio.h (installed in a private 'include-fixed' directory).

Reviewed by: theraven
X-MFC with: r227753

12 years agoMake man page wording more clear:
Eitan Adler [Sun, 15 Jan 2012 20:14:52 +0000 (20:14 +0000)]
Make man page wording more clear:

PR: docs/164078
Submitted by: Taras <ds@ukrhub.net>
Approved by: bcr
MFC after: 3 days

12 years agosh: Fix two bugs with case and exit status:
Jilles Tjoelker [Sun, 15 Jan 2012 20:04:05 +0000 (20:04 +0000)]
sh: Fix two bugs with case and exit status:

* If no pattern is matched, POSIX says the exit status shall be 0 (even if
  there are command substitutions).
* If a pattern is matched and there are no command substitutions, the first
  command should see the $? from before the case command, not always 0.

12 years agoFix the situation where net80211 is built with IEEE80211_SUPPORT_TDMA but a module
Adrian Chadd [Sun, 15 Jan 2012 19:45:23 +0000 (19:45 +0000)]
Fix the situation where net80211 is built with IEEE80211_SUPPORT_TDMA but a module
is used.

Although the module _builds_, it fails to load because of a missing symbol from
ieee80211_tdma.c.

Specifics:

* Always build ieee80211_tdma.c in the module;
* only compile in the code if IEEE80211_SUPPORT_TDMA is defined.

12 years agoBuild some more things (random, bridge/gif/gre, gpio, USB) as modules as well
Adrian Chadd [Sun, 15 Jan 2012 19:43:56 +0000 (19:43 +0000)]
Build some more things (random, bridge/gif/gre, gpio, USB) as modules as well
so some embedded platform builds can use these instead of a fully monolithic
kernel.

12 years agoBegin breaking out the AR71xx specific functional drivers into modules.
Adrian Chadd [Sun, 15 Jan 2012 19:42:55 +0000 (19:42 +0000)]
Begin breaking out the AR71xx specific functional drivers into modules.

The USB code as it stands includes the bus glue along _with_ the controller
code. So the ohci/ehci modules actually build the USB controller code and
the PCI bus glue.

It'd be nice to ship separate modules for the PCI glue and the USB
controller (so for example if there were a USB controller hanging off
the internal SoC bus as well as an external PCI device) it could be done.

This is primarily done to save a few bytes here and there on embedded
systems with limited flash space for kernels - a very limited (sub-1MB)
space may be available for the kernel and may only support gzip encoding.
The rootfs can be LZMA compressed.

12 years agoAllow building the GPIO bus and associated bits as modules.
Adrian Chadd [Sun, 15 Jan 2012 19:40:59 +0000 (19:40 +0000)]
Allow building the GPIO bus and associated bits as modules.

This is primarily done to save a few bytes here and there on embedded
systems with limited flash space for kernels - a very limited (sub-1MB)
space may be available for the kernel and may only support gzip encoding.
The rootfs can be LZMA compressed.

12 years agoAdd the new option introduced in the previous commit.
Adrian Chadd [Sun, 15 Jan 2012 19:30:32 +0000 (19:30 +0000)]
Add the new option introduced in the previous commit.

12 years agoSome of the atheros based embedded devices use one or more PCI NICs
Adrian Chadd [Sun, 15 Jan 2012 19:29:33 +0000 (19:29 +0000)]
Some of the atheros based embedded devices use one or more PCI NICs
on-board, glued to the AR71xx CPU.  These may forgo separate WMAC EEPROMs
(which store configuration and calibration data) and instead store
it in the main board SPI flash.

Normally the NIC reads the EEPROM attached to it to setup various PCI
configuration registers.  If this isn't done, the device will probe as
something different (eg 0x168c:abcd, or 0x168c:ff??.)  Other setup registers
are also written to which may control important functions.

This introduces a new compile option, AR71XX_ATH_EEPROM, which enables the
use of this particular code.  The ART offset in the SPI flash can be
specified as a hint against the relevant slot/device number, for example:

hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000
hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1fff5000

TODO:

* Think of a better name;
* Make the PCIe version of this fixup code also use this option;
* Maybe also check slot 19;
* This has to happen _before_ the SPI flash is set from memory-mapped
  to SPI-IO - so document that somewhere.

12 years agoBreak out the "memory" EEPROM data read method from being AR9130 specific
Adrian Chadd [Sun, 15 Jan 2012 19:22:34 +0000 (19:22 +0000)]
Break out the "memory" EEPROM data read method from being AR9130 specific
to being more generic.

Other embedded SoCs also throw the configuration/PCI register
info into flash.

For now I'm just hard-coding the AR9280 option (for on-board AR9220's on
AP94 and commercial designs (eg D-Link DIR-825.))

TODO:

* Figure out how to support it for all 11n SoC NICs by doing it in
  ar5416InitState();
* Don't hard-code the EEPROM size - add another field which is set
  by the relevant chip initialisation code.
* 'owl_eep_start_loc' may need to be overridden in some cases to 0x0.
  I need to do some further digging.

12 years agoIn kvm_argv(), the case when the supplied buffer was too short to hold the
Mikolaj Golub [Sun, 15 Jan 2012 18:51:07 +0000 (18:51 +0000)]
In kvm_argv(), the case when the supplied buffer was too short to hold the
requested value was handled incorrectly, and the function retuned NULL
instead of the truncated result.

Fix this and also remove unnecessary check for buf != NULL, which alway
retuns true.

MFC after: 3 days

12 years agoAbrogate nchr argument in proc_getargv() and proc_getenvv(): we always want
Mikolaj Golub [Sun, 15 Jan 2012 18:47:24 +0000 (18:47 +0000)]
Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always want
to read strings completely to know the actual size.

As a side effect it fixes the issue with kern.proc.args and kern.proc.env
sysctls, which didn't return the size of available data when calling
sysctl(3) with the NULL argument for oldp.

Note, in get_ps_strings(), which does actual work for proc_getargv() and
proc_getenvv(), we still have a safety limit on the size of data read in
case of a corrupted procces stack.

Suggested by: kib
MFC after: 3 days

12 years agoPick a constant high IRQ value for the PS3 IPI, which lets PS3 devices be
Nathan Whitehorn [Sun, 15 Jan 2012 18:26:43 +0000 (18:26 +0000)]
Pick a constant high IRQ value for the PS3 IPI, which lets PS3 devices be
usefully loaded and unloaded as modules.

Submitted by: geoffrey dot levand at mail dot ru
MFC after: 2 weeks

12 years agoFix missing in r230129:
Martin Matuska [Sun, 15 Jan 2012 18:08:15 +0000 (18:08 +0000)]
Fix missing in r230129:

kern_jail.c: initialize fullpath_disabled to zero
vfs_cache.c: add missing dot in comment

Reported by: kib
MFC after: 1 month

12 years agoRemove duplicate line from usage
Eitan Adler [Sun, 15 Jan 2012 17:01:28 +0000 (17:01 +0000)]
Remove duplicate line from usage

PR: bin/164139
Submitted by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: nwhitehorn
MFC after: 3 days

12 years agoFix some unreliability problems related to MSR bits inherited from kboot by
Nathan Whitehorn [Sun, 15 Jan 2012 16:58:44 +0000 (16:58 +0000)]
Fix some unreliability problems related to MSR bits inherited from kboot by
setting an absolute MSR when during on the MMU. This prevents delay(), in
particular, from intermittently malfunctioning.

12 years agoNow that we can tolerate LPAR context switches on the PS3 hypervisor, going
Nathan Whitehorn [Sun, 15 Jan 2012 16:57:18 +0000 (16:57 +0000)]
Now that we can tolerate LPAR context switches on the PS3 hypervisor, going
to hypervisor-idle on both threads will not hang the kernel.

12 years agoSmall cleanup, no functional change.
Michael Tuexen [Sun, 15 Jan 2012 14:03:05 +0000 (14:03 +0000)]
Small cleanup, no functional change.

12 years agoFix a few comment typos.
Joel Dahl [Sun, 15 Jan 2012 13:36:47 +0000 (13:36 +0000)]
Fix a few comment typos.

12 years agoTwo cleanups. No functional change.
Michael Tuexen [Sun, 15 Jan 2012 13:35:55 +0000 (13:35 +0000)]
Two cleanups. No functional change.

12 years agoRemove spurious 8bit chars, turning files into plain ASCII.
Ulrich Spörlein [Sun, 15 Jan 2012 13:23:54 +0000 (13:23 +0000)]
Remove spurious 8bit chars, turning files into plain ASCII.

12 years agoConvert files to UTF-8
Ulrich Spörlein [Sun, 15 Jan 2012 13:23:43 +0000 (13:23 +0000)]
Convert files to UTF-8

12 years agoRemove spurious 8bit chars, turning files into plain ASCII.
Ulrich Spörlein [Sun, 15 Jan 2012 13:23:33 +0000 (13:23 +0000)]
Remove spurious 8bit chars, turning files into plain ASCII.

12 years agoConvert files to UTF-8
Ulrich Spörlein [Sun, 15 Jan 2012 13:23:18 +0000 (13:23 +0000)]
Convert files to UTF-8

12 years agoReencode morse.c to UTF-8. This does not make it Unicode aware.
Ulrich Spörlein [Sun, 15 Jan 2012 13:23:01 +0000 (13:23 +0000)]
Reencode morse.c to UTF-8. This does not make it Unicode aware.

No changes in resulting object file. Moved user-visible symbols into
comment table, so you can see all chars, not just the ones matching your
(fallback) locale.

12 years agoMajor snd_hda driver rewrite:
Alexander Motin [Sun, 15 Jan 2012 13:21:36 +0000 (13:21 +0000)]
Major snd_hda driver rewrite:
 - Huge old hdac driver was split into three independent pieces: HDA
controller driver (hdac), HDA CODEC driver (hdacc) and HDA sudio function
driver (hdaa).
 - Support for multichannel recording was added. Now, as specification
defines, driver checks input associations for pins with sequence numbers
14 and 15, and if found (usually) -- works as before, mixing signals
together. If it doesn't, it configures input association as multichannel.
 - Signal tracer was improved to look for cases where several DACs/ADCs in
CODEC can work with the same audio signal. If such case found, driver
registers additional playback/record stream (channel) for the pcm device.
 - New controller streams reservation mechanism was implemented. That
allows to have more pcm devices then streams supported by the controller
(usually 4 in each direction). Now it limits only number of simultaneously
transferred audio streams, that is rarely reachable and properly reported
if happens.
 - Codec pins and GPIO signals configuration was exported via set of
writable sysctls. Another sysctl dev.hdaa.X.reconfig allows to trigger
driver reconfiguration in run-time.
 - Driver now decodes pins location and connector type names. In some cases
it allows to hint user where on the system case connectors, related to the
pcm device, are located. Number of channels supported by pcm device,
reported now (if it is not 2), should also make search easier.
 - Added workaround for digital mic on some Asus laptops/netbooks.

MFC after: 2 months
Sponsored by: iXsystems, Inc.

12 years agoIntroduce vn_path_to_global_path()
Martin Matuska [Sun, 15 Jan 2012 12:08:20 +0000 (12:08 +0000)]
Introduce vn_path_to_global_path()

This function updates path string to vnode's full global path and checks
the size of the new path string against the pathlen argument.

In vfs_domount(), sys_unmount() and kern_jail_set() this new function
is used to update the supplied path argument to the respective global path.

Unbreaks jailed zfs(8) with enforce_statfs set to 1.

Reviewed by: kib
MFC after: 1 month

12 years agoUse getopts instead of getopt(1).
Gleb Smirnoff [Sun, 15 Jan 2012 09:27:00 +0000 (09:27 +0000)]
Use getopts instead of getopt(1).

Suggested by: jilles

12 years agoRestore functionality to pack several kernels into release. All
Gleb Smirnoff [Sun, 15 Jan 2012 08:36:25 +0000 (08:36 +0000)]
Restore functionality to pack several kernels into release. All
kernels specified by KERNCONF are built and packed into release.
The first one is packed into kernel.txz, all others to
kernel.CONFIG.txz.

The first one is installed on bootables in /boot.

12 years ago- Fix undefined behavior when device_get_name is null
Eitan Adler [Sun, 15 Jan 2012 07:09:18 +0000 (07:09 +0000)]
- Fix undefined behavior when device_get_name is null
- Make error message more informative

PR: kern/149800
Submitted by: olgeni
Approved by: cperciva
MFC after: 1 week

12 years agoRework SLB trap handling so that double-faults into an SLB trap handler are
Nathan Whitehorn [Sun, 15 Jan 2012 00:08:14 +0000 (00:08 +0000)]
Rework SLB trap handling so that double-faults into an SLB trap handler are
possible, and double faults within an SLB trap handler are not. The result
is that it possible to take an SLB fault at any time, on any address, for
any reason, at any point in the kernel.

This lets us do two important things. First, it removes the (soft) 16 GB RAM
ceiling on PPC64 as well as any architectural limitations on KVA space.
Second, it lets the kernel tolerate poorly designed hypervisors that
have a tendency to fail to restore the SLB properly after a hypervisor
context switch.

MFC after: 6 weeks

12 years agoFor the mass rc.d changes, add a command line to make the update easier
Doug Barton [Sat, 14 Jan 2012 23:19:10 +0000 (23:19 +0000)]
For the mass rc.d changes, add a command line to make the update easier

12 years agosh: Add testcases that should not be broken by future optimizations.
Jilles Tjoelker [Sat, 14 Jan 2012 23:10:18 +0000 (23:10 +0000)]
sh: Add testcases that should not be broken by future optimizations.

12 years agoNeither tmpfs_nocacheread() nor tmpfs_mappedwrite() needs to call
Alan Cox [Sat, 14 Jan 2012 23:04:27 +0000 (23:04 +0000)]
Neither tmpfs_nocacheread() nor tmpfs_mappedwrite() needs to call
vm_object_pip_{add,subtract}() on the swap object because the swap
object can't be destroyed while the vnode is exclusively locked.
Moreover, even if the swap object could have been destroyed during
tmpfs_nocacheread() and tmpfs_mappedwrite() this code is broken
because vm_object_pip_subtract() does not wake up the sleeping thread
that is trying to destroy the swap object.

Free invalid pages after an I/O error.  There is no virtue in keeping
them around in the swap object creating more work for the page daemon.
(I believe that any non-busy page in the swap object will now always
be valid.)

vm_pager_get_pages() does not return a standard errno, so its return
value should not be returned by tmpfs without translation to an errno
value.

There is no reason for the wakeup on vpg in tmpfs_mappedwrite() to
occur with the swap object locked.

Eliminate printf()s from tmpfs_nocacheread() and tmpfs_mappedwrite().
(The swap pager already spam your console if data corruption is
imminent.)

Reviewed by: kib
MFC after: 3 weeks

12 years agoRevert to the old behavior of allocating table/table entries using
Christian S.J. Peron [Sat, 14 Jan 2012 22:51:34 +0000 (22:51 +0000)]
Revert to the old behavior of allocating table/table entries using
M_NOWAIT.  Currently, the code allows for sleeping in the ioctl path
to guarantee allocation.  However code also handles ENOMEM gracefully, so
propagate this error back to user-space, rather than sleeping while
holding the global pf mutex.

Reviewed by: glebius
Discussed with: bz

12 years agosh: Change input buffer size from 1023 to 1024.
Jilles Tjoelker [Sat, 14 Jan 2012 22:46:18 +0000 (22:46 +0000)]
sh: Change input buffer size from 1023 to 1024.

PR: bin/161756