]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoIFC to head to catch up the bhyve branch
sbruno [Wed, 4 Jan 2012 02:01:27 +0000 (02:01 +0000)]
IFC to head to catch up the bhyve branch

Approved by: grehan@

12 years agoSimply disallow <stdnoreturn.h> to be used in combination with C++.
ed [Tue, 3 Jan 2012 23:05:23 +0000 (23:05 +0000)]
Simply disallow <stdnoreturn.h> to be used in combination with C++.

There is no way one could possibly use this header file in combination
with C++ code. The problem is that in C11 the `noreturn' macro expands
to the `_Noreturn' function specifier, while in C++11 the `noreturn'
keyword is an attribute.

So in C11 you have to write:

noreturn void exit(int status);

While in C++11 you have to write:

[[noreturn]] void exit(int status);

It is impossible to #define noreturn for C++ in such a way that it
allows both conventions.

By intentionally breaking this header this way, we prevent people from
using this header in their C++<11 sources.

12 years agoFix an obvious typo. We do want to specify file permission when we pass O_CREAT.
pjd [Tue, 3 Jan 2012 22:52:29 +0000 (22:52 +0000)]
Fix an obvious typo. We do want to specify file permission when we pass O_CREAT.

12 years agoAdd special loader environment variables 'comconsole_port' and
kib [Tue, 3 Jan 2012 22:36:12 +0000 (22:36 +0000)]
Add special loader environment variables 'comconsole_port' and
'comconsole_pcidev'. The former allows to set the base address of the
serial console i/o port. The later takes the string of the format
'bus:device:function:[bar]' as a value and uses the serial port attached
as PCI device at the specified location for console.

Both variants pass 'hw.uart.console' variable to the uart driver to
properly hand-over the kernel console.

Change allows to use ISA serial ports other than COM1 for the
loader/kernel console without loader recompilation. Also, you can use
PCI-attached port as the console, e.g. Intel AMT serial pseudo-port on
some motherboards based on Q67 chipset.

Reviewed by: jhb
MFC after: 2 weeks

12 years agoDo the vput() for the lowervp in the null_nodeget() for error case too.
kib [Tue, 3 Jan 2012 21:09:07 +0000 (21:09 +0000)]
Do the vput() for the lowervp in the null_nodeget() for error case too.
Several callers of null_nodeget() did the cleanup itself, but several
missed it, most prominent being null_bypass(). Remove the cleanup from
the callers, now null_nodeget() handles lowervp free itself.

Reported and tested by: pho
MFC after: 1 week

12 years agoReplace a GPL'd header in the emu10k1 snd driver code.
pfg [Tue, 3 Jan 2012 21:04:54 +0000 (21:04 +0000)]
Replace a GPL'd header in the emu10k1 snd driver code.

This brings in the emuxkireg.h from NetBSD (dev/pci) which
is used for the same purpose but is smaller. The emu10k1
is now free from the GPL.

PR: 153901
Obtained from: NetBSD
Approved by: core (mentor implicit)
MFC after: 2 weeks

12 years agoSome small fixes to CPU accounting for threads:
jhb [Tue, 3 Jan 2012 21:03:28 +0000 (21:03 +0000)]
Some small fixes to CPU accounting for threads:
- Only initialize the per-cpu switchticks and switchtime in sched_throw()
  for the very first context switch on APs during boot.  This avoids a
  small gap between the middle of thread_exit() and sched_throw() where
  time is not accounted to any thread.
- In thread_exit(), update the timestamp bookkeeping to track the changes
  to mi_switch() introduced by td_rux so that the code once again matches
  the comment claiming it is mimicing mi_switch().  Specifically, only
  update the per-thread stats directly and depend on ruxagg() to update
  p_rux rather than adjusting p_rux directly.  While here, move the
  timestamp bookkeeping as late in the function as possible.

Reviewed by: bde, kib
MFC after: 1 week

12 years agoDocument the state of the lowervp vnode for null_nodeget().
kib [Tue, 3 Jan 2012 21:03:20 +0000 (21:03 +0000)]
Document the state of the lowervp vnode for null_nodeget().

Tested by: pho
MFC after: 1 week

12 years agoFix a few bugs in the SRAT parsing code:
jhb [Tue, 3 Jan 2012 20:53:58 +0000 (20:53 +0000)]
Fix a few bugs in the SRAT parsing code:
- Actually increment ndomain when building our list of known domains
  so that we can properly renumber them to be 0-based and dense.
- If the number of domains exceeds the configured maximum (VM_NDOMAIN),
  bail out of processing the SRAT and disable NUMA rather than hitting an
  obscure panic later.
- Don't bother parsing the SRAT at all if VM_NDOMAIN is set to 1 to
  disable NUMA (the default).

Reported by: phk (2)
MFC after: 1 week

12 years agoIn sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, check the
dim [Tue, 3 Jan 2012 20:53:07 +0000 (20:53 +0000)]
In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, check the
the number of links against LINK_MAX (which is INT16_MAX), not against
UINT32_MAX.  Otherwise, the constant would implicitly be converted to
-1.

Reviewed by: pjd
MFC after: 1 week

12 years agoIn sys/dev/qlxgb/qla_misc.c, fix a copy/paste issue. Clang complained
dim [Tue, 3 Jan 2012 20:51:26 +0000 (20:51 +0000)]
In sys/dev/qlxgb/qla_misc.c, fix a copy/paste issue.  Clang complained
the variable 'val' was uninitialized when used.  Instead, 'sig' should
have been printed.

Reviewed by: davidcs
MFC after: 1 week

12 years agoWhen cancelling multicast timers on an interface, don't release the
jhb [Tue, 3 Jan 2012 20:34:52 +0000 (20:34 +0000)]
When cancelling multicast timers on an interface, don't release the
reference on a group in the leaving state while iterating over the loop.
Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach()
of placing the groups to free on pending release list and then releasing
the references after dropping the IF_ADDR_LOCK.  This closes an ugly race
where the code was dropping the lock in the middle of iterating over the
list.  It also fixes some additional potential use-after-free bugs since
the cancellation routine also applied other changes to the group after
dropping the reference.  Now those changes are performed before the
reference is dropped and the group is potentially freed.

Prodded to fix by: glebius
Reviewed by: bz
MFC after: 1 week

12 years agoDon't forget to release queue lock when allocation of memory failed.
delphij [Tue, 3 Jan 2012 20:17:35 +0000 (20:17 +0000)]
Don't forget to release queue lock when allocation of memory failed.

Submitted by: Sascha Wildner <saw online de>
Obtained from: DragonFly
MFC after: 2 weeks

12 years agoIntegrate the line drawing algorithm from the book "Graphic Gems 1".
pfg [Tue, 3 Jan 2012 19:47:32 +0000 (19:47 +0000)]
Integrate the line drawing algorithm from the book "Graphic Gems 1".

http://www.graphicsgems.org/

At the time it claimed to be 3-4 times faster than the traditional
algorithm.

PR: 18769
Approved by: jhb (mentor)
MFC after: 2 weeks

12 years agoGrab a reference on the matching interface address (ifa) in the handling
jhb [Tue, 3 Jan 2012 19:44:36 +0000 (19:44 +0000)]
Grab a reference on the matching interface address (ifa) in the handling
of the SIOC[DG]LIFADDR icotls before dropping the IF_ADDR_LOCK() and
release the reference after using it.  This prevents the address from
being potentially freed out from under the ioctl handler.

Reviewed by: bz
MFC after: 1 week

12 years agoImport compiler-rt r147467.
ed [Tue, 3 Jan 2012 19:41:36 +0000 (19:41 +0000)]
Import compiler-rt r147467.

The compiler-rt shipped with FreeBSD is now based on unmodified upstream
sources.

12 years ago- Octeon-SDK strictly requires multi_count to be zero for
gonzo [Tue, 3 Jan 2012 19:10:37 +0000 (19:10 +0000)]
- Octeon-SDK strictly requires multi_count to be zero for
    full and low speed devices.

12 years agoMinor cleanups to ntfs code
pfg [Tue, 3 Jan 2012 19:09:01 +0000 (19:09 +0000)]
Minor cleanups to ntfs code

bzero -> memset
rename variables to avoid shadowing.

PR: 142401
Obtained from: NetBSD
Approved by jhb (mentor)

12 years agoReplace index() and rindex() calls with strchr() and strrchr().
ed [Tue, 3 Jan 2012 18:51:58 +0000 (18:51 +0000)]
Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.

12 years agoIn sys/compat/linux/linux_ioctl.c, work around a warning when a pointer
dim [Tue, 3 Jan 2012 18:49:39 +0000 (18:49 +0000)]
In sys/compat/linux/linux_ioctl.c, work around a warning when a pointer
is compared to an integer, by casting the pointer to l_uintptr_t.  No
functional difference on both i386 and amd64.

Reviewed by: ed, jhb
MFC after: 1 week

12 years agoIn sys/dev/if_ndis/if_ndis_pccard.c, fix a bug where a garbage rid was
dim [Tue, 3 Jan 2012 18:40:41 +0000 (18:40 +0000)]
In sys/dev/if_ndis/if_ndis_pccard.c, fix a bug where a garbage rid was
passed to resource_list_add().  The rid that was just returned by
bus_alloc_resource_any() should have been used instead.

Reviewed by: jhb
MFC after: 1 week

12 years agoImprove the cscope target's handling of MD directories. Automatically
jhb [Tue, 3 Jan 2012 17:31:27 +0000 (17:31 +0000)]
Improve the cscope target's handling of MD directories.  Automatically
include the MACHINE_CPUARCH directory if it differents from MACHINE when
building an index for a single machine.  Also, include the 'x86' directory
when building an index for i386, pc98, or amd64.

MFC after: 1 week

12 years agoAdd support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control
mav [Tue, 3 Jan 2012 17:04:09 +0000 (17:04 +0000)]
Add support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control
sector size same as acd driver does. Together with r228808 and r228847 this
allows existing multimedia/vlc to play Audio CDs via CAM cd driver.

PR: ports/162190
MFC after: 1 week

12 years agoUse TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that
jhb [Tue, 3 Jan 2012 16:22:29 +0000 (16:22 +0000)]
Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that
do not modify the queues they iterate over.

Submitted by: glebius

12 years agoRemove hand-written version of strcspn().
ed [Tue, 3 Jan 2012 11:13:07 +0000 (11:13 +0000)]
Remove hand-written version of strcspn().

The code searches for the first occurence of @, : or !. Upon failure, it
returns the index of \0. This is exactly what strcspn() does.

12 years agoFix subtle typo: compare against idx -- not index.
ed [Tue, 3 Jan 2012 11:10:15 +0000 (11:10 +0000)]
Fix subtle typo: compare against idx -- not index.

In this contest, index refers to the index(3) function. In this case it
doesn't really harm, as this function is never called with idx == NULL.

MFC after: 2 weeks

12 years agoSimply use getprogname() to obtain the name of the process.
ed [Tue, 3 Jan 2012 11:08:58 +0000 (11:08 +0000)]
Simply use getprogname() to obtain the name of the process.

12 years agoAdd support for Intel EG20T serial ports
kevlo [Tue, 3 Jan 2012 10:01:12 +0000 (10:01 +0000)]
Add support for Intel EG20T serial ports

12 years agoDon't rely on MCS7 being at index 7 while determining the amount
bschmidt [Tue, 3 Jan 2012 09:42:31 +0000 (09:42 +0000)]
Don't rely on MCS7 being at index 7 while determining the amount
of antennas to use. Not all APs enable all MCS rates.

Poked by: Lucius Windschuh <lwindschuh at googlemail dot com>
MFC after: 1 week

12 years agoMerge index() and strchr() together.
ed [Tue, 3 Jan 2012 07:14:01 +0000 (07:14 +0000)]
Merge index() and strchr() together.

As I looked through the C library, I noticed the FreeBSD MIPS port has a
hand-written version of index(). This is nice, if it weren't for the
fact that most applications call strchr() instead.

Also, on the other architectures index() and strchr() are identical,
meaning we have two identical pieces of code in the C library and
statically linked applications.

Solve this by naming the actual file strchr.[cS] and let it use
__strong_reference()/STRONG_ALIAS() to provide the index() routine. Do
the same for rindex()/strrchr().

This seems to make the C libraries and static binaries slightly smaller,
but this reduction in size seems negligible.

12 years agoAdd support for strong aliasing of symbols in i386 assembly.
ed [Tue, 3 Jan 2012 07:06:35 +0000 (07:06 +0000)]
Add support for strong aliasing of symbols in i386 assembly.

This macro is a literal copy from the MIPS version of <machine/asm.h>.

12 years agoImplement extensions on top of standards instead of the other way around.
ed [Tue, 3 Jan 2012 07:05:30 +0000 (07:05 +0000)]
Implement extensions on top of standards instead of the other way around.

Now that index() and rindex() have become unused, simply turn them into
wrappers around strchr() and strrchr(), respectively.

12 years agoDon't pass VM_ALLOC_ZERO to vm_page_grab() in tmpfs_mappedwrite() and
alc [Tue, 3 Jan 2012 03:29:01 +0000 (03:29 +0000)]
Don't pass VM_ALLOC_ZERO to vm_page_grab() in tmpfs_mappedwrite() and
tmpfs_nocacheread().  It is both unnecessary and a pessimization.  It
results in either the page being zeroed twice or zeroed first and then
overwritten by an I/O operation.

MFC after: 3 weeks

12 years agoTrivial standardization to a few comments in kern.pre.mk.
gjb [Tue, 3 Jan 2012 00:22:08 +0000 (00:22 +0000)]
Trivial standardization to a few comments in kern.pre.mk.

Submitted by: arundel
MFC after: 3 days

12 years agoRemove extraneous semicolons.
ed [Mon, 2 Jan 2012 22:58:32 +0000 (22:58 +0000)]
Remove extraneous semicolons.

These macros are supposed to be invoked as regular functions, so remove
them.

12 years agoAdd WITHOUT_CAPSICUM src.conf(5) define, which can be used to compile out
rwatson [Mon, 2 Jan 2012 21:57:58 +0000 (21:57 +0000)]
Add WITHOUT_CAPSICUM src.conf(5) define, which can be used to compile out
use of Capsicum by userspace applications.

MFC after: 3 weeks
Sponsored by: Google, Inc.

12 years agoMake sure we probe and attach the root HUB after
hselasky [Mon, 2 Jan 2012 20:28:33 +0000 (20:28 +0000)]
Make sure we probe and attach the root HUB after
resume else no devices will appear again.

MFC after: 1 day

12 years agoRemove unneeded checks for CAM_DEV_QFRZN after cam_periph_runccb() call.
mav [Mon, 2 Jan 2012 17:02:45 +0000 (17:02 +0000)]
Remove unneeded checks for CAM_DEV_QFRZN after cam_periph_runccb() call.
cam_periph_runccb() since the beginning checks it and releases device queue.
After r203108 it even clears CAM_DEV_QFRZN flag after that to avoid double
release, so removed code is unreachable now.

MFC after: 1 month

12 years agoMCS32 equals 32, not 8*ic_txstream.
bschmidt [Mon, 2 Jan 2012 16:02:30 +0000 (16:02 +0000)]
MCS32 equals 32, not 8*ic_txstream.

12 years agoRemove an uneeded inpcb forward declaration and align the function
bz [Mon, 2 Jan 2012 13:03:13 +0000 (13:03 +0000)]
Remove an uneeded inpcb forward declaration and align the function
declaration following to match the style in the rest of the file.

MFC after: 3 days

12 years agoUse strchr() and strrchr().
ed [Mon, 2 Jan 2012 12:12:10 +0000 (12:12 +0000)]
Use strchr() and strrchr().

It seems strchr() and strrchr() are used more often than index() and
rindex(). Therefore, simply migrate all kernel code to use it.

For the XFS code, remove an empty line to make the code identical to
the code in the Linux kernel.

12 years agoAs I came by and noticed add a comment that inp locking is a bit optistic
bz [Mon, 2 Jan 2012 09:18:58 +0000 (09:18 +0000)]
As I came by and noticed add a comment that inp locking is a bit optistic
(read: non-existent) here and should be fixed.

12 years agosh: Make various functions static.
jilles [Sun, 1 Jan 2012 22:17:12 +0000 (22:17 +0000)]
sh: Make various functions static.

12 years agosh: Remove unused function scopyn().
jilles [Sun, 1 Jan 2012 22:15:38 +0000 (22:15 +0000)]
sh: Remove unused function scopyn().

12 years agoInitial copy of xz-embedded to sys/contrib/.
adrian [Sun, 1 Jan 2012 21:32:25 +0000 (21:32 +0000)]
Initial copy of xz-embedded to sys/contrib/.

The upcoming geom_compress module (a read-only gzip/ulzma translation layer,
similar to what geom_uzip does) will leverage parts of this.

12 years agoFix sloppyness in memcchr() man page.
ed [Sun, 1 Jan 2012 20:59:42 +0000 (20:59 +0000)]
Fix sloppyness in memcchr() man page.

I was considering adding it to libc as well, but last minute I thought
it would be good enough to add it to libkern exclusively. I forgot to
rename the man page and hook it up.

12 years agoRemove the now unused skpc() function.
ed [Sun, 1 Jan 2012 20:54:44 +0000 (20:54 +0000)]
Remove the now unused skpc() function.

It was only used by ufs and ext2 and I have really strong doubts that
there are other pieces of code that also use this function. If it turns
out that external drivers use this code as well, I'd be happy to migrate
or revert.

Bump __FreeBSD_version while there.

12 years agosh: Make patmatch() non-recursive.
jilles [Sun, 1 Jan 2012 20:50:19 +0000 (20:50 +0000)]
sh: Make patmatch() non-recursive.

12 years agoMigrate ufs and ext2fs from skpc() to memcchr().
ed [Sun, 1 Jan 2012 20:47:33 +0000 (20:47 +0000)]
Migrate ufs and ext2fs from skpc() to memcchr().

While there, remove a useless check from the code. memcchr() always
returns characters unequal to 0xff in this case, so inosused[i] ^ 0xff
can never be equal to zero. Also, the fact that memcchr() returns a
pointer instead of the number of bytes until the end, makes conversion
to an offset far more easy.

12 years agoFix typo; return -> returns.
ed [Sun, 1 Jan 2012 20:30:48 +0000 (20:30 +0000)]
Fix typo; return -> returns.

12 years agoIntroducing memcchr(3).
ed [Sun, 1 Jan 2012 20:26:11 +0000 (20:26 +0000)]
Introducing memcchr(3).

It seems two of the file system drivers we have in the tree, namely ufs
and ext3, use a function called `skpc()'. The meaning of this function
does not seem to be documented in FreeBSD, but it turns out one needs to
be a VAX programmer to understand what it does.

SPKC is an instruction on the VAX that does the opposite of memchr(). It
searches for the non-equal character. Add a new function called
memcchr() to the tree that has the following advantages over skpc():

- It has a name that makes more sense than skpc(). Just like strcspn()
  matches the complement of strspn(), memcchr() is the complement of
  memchr().

- It is faster than skpc(). Similar to our strlen() in libc, it compares
  entire words, instead of single bytes. It seems that for this routine
  this yields a sixfold performance increase on amd64.

- It has a man page.

12 years agoRedo r228645, but instead of casting away const conversion warnings in
dim [Sun, 1 Jan 2012 20:13:02 +0000 (20:13 +0000)]
Redo r228645, but instead of casting away const conversion warnings in
contrib/less, add a few const qualifiers in the right places.

Suggested by: das
MFC after: 1 week

12 years agoRevert r228645, which casts away a number of const conversion warnings
dim [Sun, 1 Jan 2012 20:09:05 +0000 (20:09 +0000)]
Revert r228645, which casts away a number of const conversion warnings
in contrib/less.  I will fix those more properly in the next commit.

12 years agoAvoid double-unlock or double unreference for ndp->ni_dvp when the vnode dp
kib [Sun, 1 Jan 2012 18:45:59 +0000 (18:45 +0000)]
Avoid double-unlock or double unreference for ndp->ni_dvp when the vnode dp
lock upgrade right after the 'success' label fails.

In collaboration with: pho
MFC after: 1 week

12 years agoIn several llvm library Makefiles, remove extraneous slashes at the end
dim [Sun, 1 Jan 2012 18:36:42 +0000 (18:36 +0000)]
In several llvm library Makefiles, remove extraneous slashes at the end
of SRCDIR definitions.

MFC after: 3 days

12 years agoInstead of forcing -O1 on PowerPC for LLVM and clang, fix the actual
nwhitehorn [Sun, 1 Jan 2012 15:56:15 +0000 (15:56 +0000)]
Instead of forcing -O1 on PowerPC for LLVM and clang, fix the actual
problem by adding -fno-strict-aliasing to CFLAGS. Since this is a global
issue that just happened to manifest on PowerPC, add this to CFLAGS
unconditionally.

MFC after: 1 week

12 years ago- Properly set IRQ handlers for all USB ports
gonzo [Sun, 1 Jan 2012 09:12:21 +0000 (09:12 +0000)]
- Properly set IRQ handlers for all USB ports

12 years agoIf frames are dumped out of the queue, let's at least see what they are.
adrian [Sun, 1 Jan 2012 01:08:51 +0000 (01:08 +0000)]
If frames are dumped out of the queue, let's at least see what they are.

This shows that the majority of the weird traffic I see here are probe
frames that haven't been sent out, but I can also trigger this condition
by doing ICMP w/ -i 0.3 - enough to trigger the TX during actual scanning,
but not fast enough to stop scanning from occuring.

PR: kern/163689

12 years ago- add myself to the calendar (jgh)
jgh [Sun, 1 Jan 2012 00:23:32 +0000 (00:23 +0000)]
- add myself to the calendar (jgh)

Approved by: crees (mentor)

12 years agoThis particular work around isn't required any longer, now that the
adrian [Sat, 31 Dec 2011 23:41:19 +0000 (23:41 +0000)]
This particular work around isn't required any longer, now that the
11n radio backends are also added into the RF linker set.

This saves around 7k from the kernel binary.

12 years ago- struct clocktime sets different ranges for DOW and month
gonzo [Sat, 31 Dec 2011 23:21:36 +0000 (23:21 +0000)]
- struct clocktime sets different ranges for DOW and month
    comparing to struct timeval. for clocktime they should be
    1..7 and 1..12 respectively

- CAPK-0100ND uses RTC without centruy bit (DS1307) so set it 21st

12 years agoImport xz-embedded from git.
adrian [Sat, 31 Dec 2011 22:35:46 +0000 (22:35 +0000)]
Import xz-embedded from git.

This is from commit hash '48f4588342f4a4e0182a6740e25675fd8e6c6295'.

12 years agoUpgrade libcompiler_rt to upstream revision 147390.
ed [Sat, 31 Dec 2011 19:01:48 +0000 (19:01 +0000)]
Upgrade libcompiler_rt to upstream revision 147390.

This version of libcompiler_rt adds support for __mulo[sdt]i4(), which
computes a multiply and its overflow flag. There are also a lot of
cleanup fixes to headers that don't really affect us.

Updating to this revision should make it a bit easier to contribute
changes back to the LLVM developers.

12 years agoRemove a declaration to a non-existent function.
bz [Sat, 31 Dec 2011 16:19:22 +0000 (16:19 +0000)]
Remove a declaration to a non-existent function.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

12 years agoOops - this was referencing a local file, which I've done away with.
adrian [Sat, 31 Dec 2011 15:56:00 +0000 (15:56 +0000)]
Oops - this was referencing a local file, which I've done away with.

12 years agoFix header pollution, possibly unbreaking the build of cfi_bus_ixp4xx.c
marius [Sat, 31 Dec 2011 15:53:34 +0000 (15:53 +0000)]
Fix header pollution, possibly unbreaking the build of cfi_bus_ixp4xx.c
as part of cfi.ko.

12 years agoImport compiler-rt r147390.
ed [Sat, 31 Dec 2011 14:55:23 +0000 (14:55 +0000)]
Import compiler-rt r147390.

12 years agoMake the comment in i386/include/ucontext.h identical to the one in
kib [Sat, 31 Dec 2011 14:44:42 +0000 (14:44 +0000)]
Make the comment in i386/include/ucontext.h identical to the one in
amd64/include/ucontext.h. The later is better worded.

Requested by: deischen
MFC after: 3 days

12 years agoAdd missing change to XHCI driver similar to changes in r228483.
hselasky [Sat, 31 Dec 2011 13:34:42 +0000 (13:34 +0000)]
Add missing change to XHCI driver similar to changes in r228483.

MFC after: 0 days

12 years agoDefault to not performing the early-boot memory tests when we detect we
gavin [Sat, 31 Dec 2011 13:24:53 +0000 (13:24 +0000)]
Default to not performing the early-boot memory tests when we detect we
are booting inside a VM.  There are three reasons to disable this:

o  It causes the VM host to believe that all the tested pages or RAM are
   in use.  This in turn may force the host to page out pages of RAM
   belonging to other VMs, or otherwise cause problems with fair resource
   sharing on the VM cluster.
o  It adds significant time to the boot process (around 1 second/Gig in
   testing)
o  It is unnecessary - the host should have already verified that the
   memory is functional etc.

Note that this simply changes the default when in a VM - it can still be
overridden using the hw.memtest.tests tunable.

MFC after: 4 weeks

12 years agoIn sys/dev/hwpmc/hwpmc_amd.c, fix a clang warning about invalid enum
dim [Sat, 31 Dec 2011 12:37:07 +0000 (12:37 +0000)]
In sys/dev/hwpmc/hwpmc_amd.c, fix a clang warning about invalid enum
conversions.

Reviewed by: jkoshy
MFC after: 1 week

12 years agoFix typos in command descriptions.
stefanf [Sat, 31 Dec 2011 12:12:41 +0000 (12:12 +0000)]
Fix typos in command descriptions.

12 years agoRevert r228986 until it can be reworked to avoid panicing the kernel when the
lstewart [Sat, 31 Dec 2011 07:21:28 +0000 (07:21 +0000)]
Revert r228986 until it can be reworked to avoid panicing the kernel when the
same interface is attached multiple times with different DLTs, as is done in
net80211 for example.

Reported by: adrian

12 years ago- Pass proper endpoint number (without direction flag) to
gonzo [Sat, 31 Dec 2011 05:45:10 +0000 (05:45 +0000)]
- Pass proper endpoint number (without direction flag) to
   cvmx_usb_open_pipe

12 years ago- Properly clean state structure in cvmx_usb_initialize
gonzo [Sat, 31 Dec 2011 05:25:42 +0000 (05:25 +0000)]
- Properly clean state structure in cvmx_usb_initialize

12 years ago- CAPK-0100 board's USB timer is 12MHz
gonzo [Sat, 31 Dec 2011 05:24:21 +0000 (05:24 +0000)]
- CAPK-0100 board's USB timer is 12MHz

12 years agoHappy 2012 to FreeBSD users in Samoa.
obrien [Sat, 31 Dec 2011 04:38:04 +0000 (04:38 +0000)]
Happy 2012 to FreeBSD users in Samoa.

12 years agoUse in-label sectorsize to determine position of the label when
sobomax [Sat, 31 Dec 2011 00:09:33 +0000 (00:09 +0000)]
Use in-label sectorsize to determine position of the label when
writing label into a file image. The most common use - putting disklabel
into ISO file. Before this change the label would always go to
the offset 512, while geom_part code expects it to be in the 1st
sector (i.e. 2048 incase of ISO). BSD disklabels provide good and
lightweight way to logically split livecds. It is non-intrusive as
far as ISO9660 goes (both boot-wise and metadata-wise) and
completely transparent to anything but BSD, so you can have
BSD-specific area appended after regular ISO.

And with a little bit of GEOM trickery you can do even more
interesting stuff with it.

For example we make "hybrid" bootable CDs using this method.
We create bootable ISO with kernel and such and append UFS
image compressed with UZIP and it works like a charm. We put
label based on the offsef of the BSD part into the ISO. The kernel
boots off normal ISO9660 part, tastes label attaches it,
tastes UZIP, attaches it and finally mounts UFS using GEOM_LABEL.
This provides much better way of eliminating waste than doing
"crunched" build.

MFC after: 1 month

12 years agoAdd header required by cfi_bus_fdt.c.
marius [Fri, 30 Dec 2011 21:22:10 +0000 (21:22 +0000)]
Add header required by cfi_bus_fdt.c.

12 years agoAdd some additional const poison after r228972. The 'mapping' array in
dim [Fri, 30 Dec 2011 20:41:24 +0000 (20:41 +0000)]
Add some additional const poison after r228972.  The 'mapping' array in
lib/libc/gen/strtofflags.c became const, but gcc did not warn about
assigning its members to non-const pointers.  Clang warned about this
with:

lib/libc/gen/strtofflags.c:98:12: error: assigning to 'char *' from 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types]
                        for (sp = mapping[i].invert ? mapping[i].name :
                                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reviewed by: jilles

12 years agoMerge r216333 and r216555 from the native pmap
alc [Fri, 30 Dec 2011 18:16:15 +0000 (18:16 +0000)]
Merge r216333 and r216555 from the native pmap
  When r207410 eliminated the acquisition and release of the page queues
  lock from pmap_extract_and_hold(), it didn't take into account that
  pmap_pte_quick() sometimes requires the page queues lock to be held.
  This change reimplements pmap_extract_and_hold() such that it no
  longer uses pmap_pte_quick(), and thus never requires the page queues
  lock.

Merge r177525 from the native pmap
  Prevent the overflow in the calculation of the next page directory.
  The overflow causes the wraparound with consequent corruption of the
  (almost) whole address space mapping.

Strictly speaking, r177525 is not required by the Xen pmap because the
hypervisor steals the uppermost region of the normal kernel address
space.  I am nonetheless merging it in order to reduce the number of
unnecessary differences between the native and Xen pmap implementations.

Tested by: sbruno

12 years agoIn sys/compat/ndis/subr_ntoskrnl.c, change the RtlFillMemory function
dim [Fri, 30 Dec 2011 17:18:09 +0000 (17:18 +0000)]
In sys/compat/ndis/subr_ntoskrnl.c, change the RtlFillMemory function
definition from K&R to ANSI, to avoid a clang warning about the uint8_t
parameter being promoted to int, which is not compatible with the type
declared in the earlier prototype.

MFC after: 1 week

12 years agostyle(9), whitespace and spelling nits.
glebius [Fri, 30 Dec 2011 15:41:28 +0000 (15:41 +0000)]
style(9), whitespace and spelling nits.

12 years agoSet svn:executable on dhclient-script
dumbbell [Fri, 30 Dec 2011 14:46:53 +0000 (14:46 +0000)]
Set svn:executable on dhclient-script

Sponsored by: Yakaz (http://www.yakaz.com)

12 years agoAdapt testsuite following change in Domain Search error handling
dumbbell [Fri, 30 Dec 2011 14:41:47 +0000 (14:41 +0000)]
Adapt testsuite following change in Domain Search error handling

In this testsuite, warning() and error() have the same behaviour.

PR: bin/163431
Sponsored by: Yakaz (http://www.yakaz.com)

12 years agoInvalid Domain Search option isn't considered as a fatal error
dumbbell [Fri, 30 Dec 2011 14:33:08 +0000 (14:33 +0000)]
Invalid Domain Search option isn't considered as a fatal error

In the original Domain Search option patch, an invalid option value
would cause the whole lease to be rejected. However, DHCP servers who
emit such an invalid value are more common than I thought. With this new
patch, just the option is rejected, not the entire lease.

PR: bin/163431
Submitted by: Fabian Keil <fk@fabiankeil.de> (earlier version)
Reviewed by: Fabian Keil <fk@fabiankeil.de>
Sponsored by: Yakaz (http://www.yakaz.com)

12 years agoDisable several instances instances of clang's -Wself-assign warning.
dim [Fri, 30 Dec 2011 13:16:59 +0000 (13:16 +0000)]
Disable several instances instances of clang's -Wself-assign warning.
All of these are harmless, and are in fact used to shut up warnings from
lint.

While here, remove -Wno-missing-prototypes from the xfs module
Makefile, as I could not reproduce those warnings either with gcc or
clang.

MFC after: 1 week

12 years agoSpelling fixes for share/
uqs [Fri, 30 Dec 2011 11:11:54 +0000 (11:11 +0000)]
Spelling fixes for share/

12 years agoSpelling fixes for usr.bin/
uqs [Fri, 30 Dec 2011 11:02:40 +0000 (11:02 +0000)]
Spelling fixes for usr.bin/

12 years agoReencode files from latin1 to UTF-8.
uqs [Fri, 30 Dec 2011 10:59:15 +0000 (10:59 +0000)]
Reencode files from latin1 to UTF-8.

This makes a tiny percentage of entries in calendars ugly for latin1
users, but fixes them for UTF-8 users.

This badly needs a solution involving locale-dependent re-encoding.

12 years agoSpelling fixes for usr.sbin/
uqs [Fri, 30 Dec 2011 10:58:14 +0000 (10:58 +0000)]
Spelling fixes for usr.sbin/

12 years agoFix typo in Makefile comment.
rwatson [Fri, 30 Dec 2011 10:45:00 +0000 (10:45 +0000)]
Fix typo in Makefile comment.

MFC after: 3 days

12 years agoAdd a configuration file for the Atheros PB47 reference board.
adrian [Fri, 30 Dec 2011 09:48:35 +0000 (09:48 +0000)]
Add a configuration file for the Atheros PB47 reference board.
This is an AR71xx based board with 8MB flash, 64MB RAM, a
Mini-PCI+ slot (see below) and a single 10/100/1000baseT
ethernet port.  It also has two USB ports.

This is an easier board than most to add as it doesn't have a
switch PHY on-board.  This made it (mostly) trivial to craft a
working configuration.

Things to note:

* This, like most other reference boards, use uboot rather then
  redboot.  It means that you typically have to manually flash
  both the kernel and rootfs partitions.

* Since there's currently no (nice) way to extract out the
  ethernet MAC and RAM from the uboot environment, the RAM
  will default to 32mb and the MAC will be something very
  incorrect.   I'll try to fix this up in a subsequent commit
  or two, even if it's just some hard-coded nonsense in
  ar71xx_machdep.c for now.

* The board is designed for a specific model of mini-PCI+
  NIC which never made it into production.  Normal mini-PCI
  NICs will work fine; if you happen to have the NIC in question
  then it will work fine with this board.

12 years agoAdd a couple of missing wlan modules.
adrian [Fri, 30 Dec 2011 09:39:24 +0000 (09:39 +0000)]
Add a couple of missing wlan modules.

12 years ago- Introduce the net.bpf.tscfg sysctl tree and associated code so as to make one
lstewart [Fri, 30 Dec 2011 08:57:58 +0000 (08:57 +0000)]
- Introduce the net.bpf.tscfg sysctl tree and associated code so as to make one
  aspect of time stamp configuration per interface rather than per BPF
  descriptor. Prior to this, the order in which BPF devices were opened and the
  per descriptor time stamp configuration settings could cause non-deterministic
  and unintended behaviour with respect to time stamping. With the new scheme, a
  BPF attached interface's tscfg sysctl entry can be set to "default", "none",
  "fast", "normal" or "external". Setting "default" means use the system default
  option (set with the net.bpf.tscfg.default sysctl), "none" means do not
  generate time stamps for tapped packets, "fast" means generate time stamps for
  tapped packets using a hz granularity system clock read, "normal" means
  generate time stamps for tapped packets using a full timecounter granularity
  system clock read and "external" (currently unimplemented) means use the time
  stamp provided with the packet from an underlying source.

- Utilise the recently introduced sysclock_getsnapshot() and
  sysclock_snap2bintime() KPIs to ensure the system clock is only read once per
  packet, regardless of the number of BPF descriptors and time stamp formats
  requested. Use the per BPF attached interface time stamp configuration to
  control if sysclock_getsnapshot() is called and whether the system clock read
  is fast or normal. The per BPF descriptor time stamp configuration is then
  used to control how the system clock snapshot is converted to a bintime by
  sysclock_snap2bintime().

- Remove all FAST related BPF descriptor flag variants. Performing a "fast"
  read of the system clock is now controlled per BPF attached interface using
  the net.bpf.tscfg sysctl tree.

- Update the bpf.4 man page.

Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward
Clock Synchronization Algorithms" project.

For more information, see http://www.synclab.org/radclock/

In collaboration with: Julien Ridoux (jridoux at unimelb edu au)

12 years agoUnset the environment variables associated with individual menu items
pluknet [Fri, 30 Dec 2011 06:24:59 +0000 (06:24 +0000)]
Unset the environment variables associated with individual menu items
before invoking the kernel.

Quoting submitter:

The issue is with the new boot loader menu. It adds many loader variables
including ones that contain ANSI color escapes.

Obviously, these ANSI codes don't play well with serial consoles when
kenv(1) is executed without arguments (reports vary as to what happens,
but it's never pretty).

The net-effect is that kenv(1) no longer reports menu-related variables.

In essence, kenv(1) output should now appear the same as on RELENG_8
(which lacks the new boot loader and didn't use any such variables).
Thus, restoring serial console glory.

Submitted by: Devin Teske <devin dott teske fisglobal.com>
MFC after: 2 weeks

12 years agoDEBUG is a kernel option. Don't define it here, as it breaks LINT.
marcel [Fri, 30 Dec 2011 04:00:31 +0000 (04:00 +0000)]
DEBUG is a kernel option. Don't define it here, as it breaks LINT.
Since DEBUG was subsequently undefined, this is just debugging left-
over.

12 years agoActually set the baudrate from the FDT.
marcel [Fri, 30 Dec 2011 03:57:17 +0000 (03:57 +0000)]
Actually set the baudrate from the FDT.

12 years agoRemove trailing white-space.
marcel [Fri, 30 Dec 2011 03:54:22 +0000 (03:54 +0000)]
Remove trailing white-space.

12 years agoAdd a module for cfi(4). Build only for arm and powerpc, as there are
marcel [Fri, 30 Dec 2011 03:48:39 +0000 (03:48 +0000)]
Add a module for cfi(4). Build only for arm and powerpc, as there are
only bus attachments only for these.