]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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.

12 years agoReapply r228785 now it has been tested by Adrian. Also add comments
dim [Fri, 30 Dec 2011 02:58:37 +0000 (02:58 +0000)]
Reapply r228785 now it has been tested by Adrian.  Also add comments
with the old AR_SCR_SLE_XXX values, with a short explanation why they
were changed.

Reviewed by: adrian
MFC after: 1 week

12 years agoIn sys/dev/drm/radeon_state.c, use the correct printf length modifiers
dim [Fri, 30 Dec 2011 02:07:50 +0000 (02:07 +0000)]
In sys/dev/drm/radeon_state.c, use the correct printf length modifiers
for ints.

MFC after: 1 week

12 years agoFor several files in sys/dev/drm, disable -Wunused-value when building
dim [Fri, 30 Dec 2011 01:54:45 +0000 (01:54 +0000)]
For several files in sys/dev/drm, disable -Wunused-value when building
with clang.  There are several macros in these files that return values,
and in some cases nothing is done with them, but it is completely
harmless.  For some other files, also disable -Wconstant-conversion,
since that triggers a false positive with the DMA_BIT_MASK() macro.

MFC after: 1 week

12 years agoExtend <stdatomic.h> to support GCC 4.7's __atomic.
ed [Fri, 30 Dec 2011 01:37:25 +0000 (01:37 +0000)]
Extend <stdatomic.h> to support GCC 4.7's __atomic.

The development version of GCC also supports an atomics interface
similar to Clang's. Change the header file to work as follows:

- __CLANG_ATOMICS: Use Clang's new atomics interface,
- __GNUC_ATOMICS: Use GCC's new atomics interface,
- else: fall back to GCC's __sync interface.

12 years agoReencode files to UTF-8. Drop CP1252 em-dash.
uqs [Fri, 30 Dec 2011 00:59:08 +0000 (00:59 +0000)]
Reencode files to UTF-8. Drop CP1252 em-dash.

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

Add some $FreeBSD$ tags so svn will allow the commit.

12 years agoSet fbsd:nokeywords for contributed sources.
uqs [Fri, 30 Dec 2011 00:02:56 +0000 (00:02 +0000)]
Set fbsd:nokeywords for contributed sources.

12 years agoAdd "options CAPABILITY_MODE" and "options CAPABILITIES" to GENERIC kernel
rwatson [Thu, 29 Dec 2011 22:48:36 +0000 (22:48 +0000)]
Add "options CAPABILITY_MODE" and "options CAPABILITIES" to GENERIC kernel
configurations for various architectures in FreeBSD 10.x.  This allows
basic Capsicum functionality to be used in the default FreeBSD
configuration on non-embedded architectures; process descriptors are not
yet enabled by default.

MFC after: 3 months
Sponsored by: Google, Inc

12 years agolibc: Eliminate some relative relocations in file flags table.
jilles [Thu, 29 Dec 2011 22:15:18 +0000 (22:15 +0000)]
libc: Eliminate some relative relocations in file flags table.

12 years agoFor sys/dev/ce/tau32-ddk.c, disable the following warning when building
dim [Thu, 29 Dec 2011 21:17:35 +0000 (21:17 +0000)]
For sys/dev/ce/tau32-ddk.c, disable the following warning when building
with clang:

sys/dev/ce/tau32-ddk.c:1228:37: warning: implicit truncation from 'int' to bitfield changes value from 65532 to 8188 [-Wconstant-conversion]

Since this file is obfuscated C, we can never determine (in a sane way,
at least :) if this points to a real problem or not.  The driver has
been in the tree for more than five years, so it most likely isn't.

MFC after: 1 week

12 years agoFix manual section for acl_get(3) and mac_get(3) family functions.
pluknet [Thu, 29 Dec 2011 21:12:22 +0000 (21:12 +0000)]
Fix manual section for acl_get(3) and mac_get(3) family functions.

Reviewed by: rwatson
MFC after: 1 week

12 years agoDefer the work of freeing IPv4 multicast options from a socket to an
jhb [Thu, 29 Dec 2011 20:41:16 +0000 (20:41 +0000)]
Defer the work of freeing IPv4 multicast options from a socket to an
asychronous task.  This avoids tearing down multicast state including
sending IGMP leave messages and reprogramming MAC filters while holding
the per-protocol global pcbinfo lock that is used in the receive path of
packet processing.

Reviewed by: rwatson
MFC after: 1 month

12 years agoUpdate if_obytes and if_omcast after successful transmit.
yongari [Thu, 29 Dec 2011 18:40:58 +0000 (18:40 +0000)]
Update if_obytes and if_omcast after successful transmit.
While I'm here update if_oerrors if parent interface of vlan is not
up and running.  Previously it updated collision counter and it was
confusing to interprete it.

PR: kern/163478
Reviewed by: glebius, jhb
Tested by: Joe Holden < lists <> rewt dot org dot uk >

12 years agoUse queue(3) macros instead of home-rolled versions in several places in
jhb [Thu, 29 Dec 2011 18:25:18 +0000 (18:25 +0000)]
Use queue(3) macros instead of home-rolled versions in several places in
the INET6 code.  This includes retiring the 'ndpr_next' and 'pfr_next'
macros.

Submitted by: pluknet (earlier version)
Reviewed by: pluknet

12 years agoFix clang warnings in sys/dev/ce/if_ce.c and sys/dev/cp/if_cp.c,
dim [Thu, 29 Dec 2011 17:46:24 +0000 (17:46 +0000)]
Fix clang warnings in sys/dev/ce/if_ce.c and sys/dev/cp/if_cp.c,
using jkim's last patch (reviewed by bde) from here:

http://docs.freebsd.org/cgi/mid.cgi?201010141558.03154.jkim

MFC after: 1 week

12 years agoUse curthread rather than PCPU_GET(curthread). 'curthread' uses
jhb [Thu, 29 Dec 2011 16:40:54 +0000 (16:40 +0000)]
Use curthread rather than PCPU_GET(curthread).  'curthread' uses
special-case optimizations on several platforms and is preferred.

Reported by: dim (indirectly)
MFC after: 2 weeks

12 years agoFurther relax the strictness of enforcing allocations to only come from
jhb [Thu, 29 Dec 2011 16:23:14 +0000 (16:23 +0000)]
Further relax the strictness of enforcing allocations to only come from
decoded ranges.  Pass any request for a specific range that fails because
it is not in a decoded range for an ACPI Host-PCI bridge up to the parent
to see if it can still be allocated.  This is based on the assumption that
many BIOSes are inconsistent/broken and that settings programmed into BARs
or resources assigned to other built-in components are more trustworthy than
the list of decoded resource ranges in _CRS.  This effectively limits the
decoded ranges to only being used for "wildcard" ranges when allocating
fresh resources for a BAR, etc.  At some point I would like to only be
this permissive during an early scan of firmware-assigned resources during
boot and to be strict about all later allocations, but that isn't viable
currently.

MFC after: 2 weeks

12 years agoCap the priority calculated from the current thread's running tick count
jhb [Thu, 29 Dec 2011 16:17:16 +0000 (16:17 +0000)]
Cap the priority calculated from the current thread's running tick count
at SCHED_PRI_RANGE to prevent overflows in the priority value.  This can
happen due to irregularities with clock interrupts under certain
virtualization environments.

Tested by: Larry Rosenman  ler lerctr org
MFC after: 2 weeks

12 years agoDon't fallback to a CARP address in BACKUP state.
glebius [Thu, 29 Dec 2011 15:59:14 +0000 (15:59 +0000)]
Don't fallback to a CARP address in BACKUP state.

12 years agoRegen.
jhb [Thu, 29 Dec 2011 15:35:47 +0000 (15:35 +0000)]
Regen.

12 years agoImplement linux_fadvise64() and linux_fadvise64_64() using
jhb [Thu, 29 Dec 2011 15:34:59 +0000 (15:34 +0000)]
Implement linux_fadvise64() and linux_fadvise64_64() using
kern_posix_fadvise().

Reviewed by: silence on emulation@
MFC after: 2 weeks

12 years agoFix typo in comment.
rwatson [Thu, 29 Dec 2011 15:34:59 +0000 (15:34 +0000)]
Fix typo in comment.

MFC after: 3 days

12 years agoDon't define static_assert for C++.
ed [Thu, 29 Dec 2011 14:41:17 +0000 (14:41 +0000)]
Don't define static_assert for C++.

Even though _Static_assert() is pretty robust for C code, it cannot work
correctly with C++ code.  This is due to the fact that C++ template
parameters may contain commas that are not enclosed in parentheses. For
example:

static_assert(foo<int, int>::bar == baz, "...");

This causes _Static_assert to be called with an excessive number of
parameters.  If you want to use static_assert in C++, just use a C++11
compiler.

Reported on: current@, ports@

12 years agoReencode files from latin1 to UTF-8.
uqs [Thu, 29 Dec 2011 12:33:27 +0000 (12:33 +0000)]
Reencode files from latin1 to UTF-8.

12 years agoUpdate LOCKLEAF comment: it should say "vnode".
pluknet [Thu, 29 Dec 2011 12:28:05 +0000 (12:28 +0000)]
Update LOCKLEAF comment: it should say "vnode".
Inspired by PR docs/11596.

12 years agoAdd PCI Id for the Intel AMT serial interface as found on my DQ67OW.
kib [Thu, 29 Dec 2011 08:27:37 +0000 (08:27 +0000)]
Add PCI Id for the Intel AMT serial interface as found on my DQ67OW.

MFC after: 1 week

12 years agoI'm not yet an alumni, add myself in the right section
bapt [Thu, 29 Dec 2011 08:13:11 +0000 (08:13 +0000)]
I'm not yet an alumni, add myself in the right section

Approved by: des (mentor)

12 years agoFlesh out the RSPRO GPIO config, including the RF LED.
adrian [Thu, 29 Dec 2011 06:07:24 +0000 (06:07 +0000)]
Flesh out the RSPRO GPIO config, including the RF LED.

12 years agoBreak out the AR71XX config file into _BASE and board specific
adrian [Thu, 29 Dec 2011 05:51:48 +0000 (05:51 +0000)]
Break out the AR71XX config file into _BASE and board specific
bits.

The ROUERSTATION and RSPRO variants contain:

* the board specific bits (eg the RTC for RSPRO, later on it'll
  include the GPIO/LED definitions);
* the boot specific bits (eg, on-board flash, usb flash, etc).

For now the AR71XX_BASE file contains the common board config,
drivers and net80211/ath wireless drivers.

I'll follow this up with config files for the other boards I
have (eg the Ubiquiti LSSR71, as well as some Mikrotik boards
that use the AR71XX and atheros reference boards) which will
be quite easy to do now.