Commit Graph

167342 Commits

Author SHA1 Message Date
Ed Schouten
dc15eac046 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.
2012-01-02 12:12:10 +00:00
Bjoern A. Zeeb
762ad1d614 As I came by and noticed add a comment that inp locking is a bit optistic
(read: non-existent) here and should be fixed.
2012-01-02 09:18:58 +00:00
Jilles Tjoelker
260fc3f4d2 sh: Make various functions static. 2012-01-01 22:17:12 +00:00
Jilles Tjoelker
f6d3a9b03f sh: Remove unused function scopyn(). 2012-01-01 22:15:38 +00:00
Adrian Chadd
63dab8eed9 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.
2012-01-01 21:32:25 +00:00
Ed Schouten
194cef3114 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.
2012-01-01 20:59:42 +00:00
Ed Schouten
41adcfa1d0 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.
2012-01-01 20:54:44 +00:00
Jilles Tjoelker
820491f824 sh: Make patmatch() non-recursive. 2012-01-01 20:50:19 +00:00
Ed Schouten
8f8d30274a 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.
2012-01-01 20:47:33 +00:00
Ed Schouten
a4ec012311 Fix typo; return -> returns. 2012-01-01 20:30:48 +00:00
Ed Schouten
de85bfc508 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.
2012-01-01 20:26:11 +00:00
Dimitry Andric
80acde97f1 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
2012-01-01 20:13:02 +00:00
Dimitry Andric
dd3bd0ed42 Revert r228645, which casts away a number of const conversion warnings
in contrib/less.  I will fix those more properly in the next commit.
2012-01-01 20:09:05 +00:00
Konstantin Belousov
cdb7a43117 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
2012-01-01 18:45:59 +00:00
Dimitry Andric
f8f33f6ab6 In several llvm library Makefiles, remove extraneous slashes at the end
of SRCDIR definitions.

MFC after:	3 days
2012-01-01 18:36:42 +00:00
Nathan Whitehorn
3f922e14a3 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
2012-01-01 15:56:15 +00:00
Oleksandr Tymoshenko
af8b177113 - Properly set IRQ handlers for all USB ports 2012-01-01 09:12:21 +00:00
Adrian Chadd
c0711b9756 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
2012-01-01 01:08:51 +00:00
Jason Helfman
718e97bf96 - add myself to the calendar (jgh)
Approved by:	crees (mentor)
2012-01-01 00:23:32 +00:00
Adrian Chadd
a92de4a5f6 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.
2011-12-31 23:41:19 +00:00
Oleksandr Tymoshenko
868fb4d19b - 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
2011-12-31 23:21:36 +00:00
Adrian Chadd
38f44a8c7c Import xz-embedded from git.
This is from commit hash '48f4588342f4a4e0182a6740e25675fd8e6c6295'.
2011-12-31 22:35:46 +00:00
Ed Schouten
7686ff743c 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.
2011-12-31 19:01:48 +00:00
Bjoern A. Zeeb
1a69707f40 Remove a declaration to a non-existent function.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2011-12-31 16:19:22 +00:00
Adrian Chadd
b2e6077c31 Oops - this was referencing a local file, which I've done away with. 2011-12-31 15:56:00 +00:00
Marius Strobl
7ccccd843a Fix header pollution, possibly unbreaking the build of cfi_bus_ixp4xx.c
as part of cfi.ko.
2011-12-31 15:53:34 +00:00
Ed Schouten
219fb04889 Import compiler-rt r147390. 2011-12-31 14:55:23 +00:00
Konstantin Belousov
36fd83b613 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
2011-12-31 14:44:42 +00:00
Hans Petter Selasky
c2d0465a9b Add missing change to XHCI driver similar to changes in r228483.
MFC after:	0 days
2011-12-31 13:34:42 +00:00
Gavin Atkinson
c1cbd9ab53 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
2011-12-31 13:24:53 +00:00
Dimitry Andric
b38c0519c5 In sys/dev/hwpmc/hwpmc_amd.c, fix a clang warning about invalid enum
conversions.

Reviewed by:	jkoshy
MFC after:	1 week
2011-12-31 12:37:07 +00:00
Stefan Farfeleder
45360108f8 Fix typos in command descriptions. 2011-12-31 12:12:41 +00:00
Lawrence Stewart
253a3814d4 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
2011-12-31 07:21:28 +00:00
Oleksandr Tymoshenko
9db595847a - Pass proper endpoint number (without direction flag) to
cvmx_usb_open_pipe
2011-12-31 05:45:10 +00:00
Oleksandr Tymoshenko
d77d1b1a17 - Properly clean state structure in cvmx_usb_initialize 2011-12-31 05:25:42 +00:00
Oleksandr Tymoshenko
67c1180199 - CAPK-0100 board's USB timer is 12MHz 2011-12-31 05:24:21 +00:00
David E. O'Brien
879dda1fd5 Happy 2012 to FreeBSD users in Samoa. 2011-12-31 04:38:04 +00:00
Maxim Sobolev
3fd209e4f2 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
2011-12-31 00:09:33 +00:00
Marius Strobl
0f1999cddf Add header required by cfi_bus_fdt.c. 2011-12-30 21:22:10 +00:00
Dimitry Andric
b9b670e347 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
2011-12-30 20:41:24 +00:00
Alan Cox
c65205a6e2 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
2011-12-30 18:16:15 +00:00
Dimitry Andric
84143cee4f 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
2011-12-30 17:18:09 +00:00
Gleb Smirnoff
4bd1b55756 style(9), whitespace and spelling nits. 2011-12-30 15:41:28 +00:00
Jean-Sébastien Pédron
999f397284 Set svn:executable on dhclient-script
Sponsored by:	Yakaz (http://www.yakaz.com)
2011-12-30 14:46:53 +00:00
Jean-Sébastien Pédron
840fac731b 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)
2011-12-30 14:41:47 +00:00
Jean-Sébastien Pédron
33d5b03267 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)
2011-12-30 14:33:08 +00:00
Dimitry Andric
97a15669a0 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
2011-12-30 13:16:59 +00:00
Ulrich Spörlein
93b03d5dc7 Spelling fixes for share/ 2011-12-30 11:11:54 +00:00
Ulrich Spörlein
487ac9ac21 Spelling fixes for usr.bin/ 2011-12-30 11:02:40 +00:00
Ulrich Spörlein
fb2ad9d3a4 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.
2011-12-30 10:59:15 +00:00