Commit Graph

185959 Commits

Author SHA1 Message Date
Ian Lepore
f32d80bf1f Add a nand flash controller driver for Atmel at91 family. Tested only
on at91rm9200 so far.

The files.at91 has listed a nand driver for ages, but it never existed.
2013-12-02 03:52:40 +00:00
Adrian Chadd
d27bb17b9c Log the rx ring offset as part of the debug message. 2013-12-02 03:49:33 +00:00
Pedro F. Giffuni
51e28103da libcpp: Merge fixes from upstream
GCC preprocessor/29966:
* macro.c (lex_expansion_token): Save and restore cpp_reader's
cur_token.
(_cpp_create_definition): Don't restore cur_token here.
* lex.c (_cpp_lex_token): Added assertion.

GCC preprocessor/28709:
* macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.

GCC c/31924
* expr.c (interpret_float_suffix): Check for invalid suffix.

GCC preprocessor/14331
* lex.c (_cpp_get_fresh_line):  Don't warn if no newline at EOF.

Fixup whitespacing

Obtained from:	gcc per-4.3 (rev. 121340, 124356, 124358, 124730,
				  125212, 125255 ; GPLv2)
MFC after:	3 weeks
2013-12-02 03:47:08 +00:00
Adrian Chadd
30ca148cf7 Oops - fix bad indent. Sorry! 2013-12-02 03:43:37 +00:00
Adrian Chadd
9d8e8cd665 Add some sanity checks to the TLV fetch.
Obtained from:	Linux iwlwifi
2013-12-02 03:42:39 +00:00
Adrian Chadd
c6f810c6a4 Add some code to double-check whether we're correctly populating the
TX ring according to what the firmware requires.

The firmware requires A-MPDU sub-frames to be at a very specific ring
offset - that is, the ring slot offset should be (seqno % 256.)

This holds for every NIC I've tested thus far except the 4965,
which starts erroring out here shortly before the firmware panics.
Which is good, it's doing what it's supposed to (read: capture that
we've screwed up somewhere.)

The specifics about getting this stuff right:

* the initial seqno allocation should match up with the ringid.
* .. yes, this means we can start at a ring offset that isn't zero.
* .. because we program the start seqno in the firmware message
  to setup the AC.
* The initial seqno allocation may be non-zero _and_ frames may be
  being transmitted during a-mpdu negotiation.  I faced similar
  issues on ath(4) and had to software queue frames to that node+TID
  during A-MPDU negotiation.
* seqno allocation should be in lockstep with ring increments.
* If we fail to transmit some segment, no, we shouldn't reuse that
  ring slot.  We should just transmit a BAR (which we aren't yet
  doing, sigh) and move onto the next seqno.
* In theory there shouldn't be any holes in the seqno space when
  we are transmitting frames.

Tested:

* 4965 (throws problems, so yes we have to fix this);
* 5100 (seems ok);
* 6200 (seems ok);
* 2200 (seems ok);
* 2230 (seems ok).
2013-12-02 03:40:51 +00:00
Eitan Adler
2526f9d725 Partial revert of r258779 and r258780:
The directory sys/dev/drm2/i915 is apperently contributed code.
	Revert to the broken version of this file to make future imports easier.

Requested by:	kib
2013-12-02 03:36:44 +00:00
Eitan Adler
5f30ec9b63 In a situation where:
- The remote host sends a FIN
	- in an ACK for a sequence number for which an ACK has already
	  been received
	- There is still unacked data on route to the remote host
	- The packet does not contain a window update

The packet may be dropped without processing the FIN flag.

PR:		kern/99188
Submitted by:	Staffan Ulfberg <staffan@ulfberg.se>
Discussed with:	andre
MFC after:	never
2013-12-02 03:11:25 +00:00
Ian Lepore
ca38150ce3 Add definitions for the additional PIO pins found on recent AT91 SoCs. 2013-12-02 02:33:03 +00:00
Nathan Whitehorn
3cb6654d23 Add new sysctl, kern.supported_abis, containing the list of FreeBSD
MACHINE_ARCH values whose binaries this kernel can run. This patch provides
a feature requested for implementing pkgng ABI identifiers in a robust
way.

The list is designed to indicate whether, say, an i386 package can be run on
the current system. If kern.supported_abis contains "i386", then the answer
is yes. Otherwise, the answer is no.

At the moment, this only supports MACHINE_ARCH and MACHINE_ARCH32. As we
gain support for more interesting combinations, this needs to become more
flexible, possibily through the sysent framework, along with the
hw.machine_arch emulation immediately preceding this code in kern_mib.c.

Reviewed by:	imp
MFC after:	3 days
2013-12-02 00:44:36 +00:00
Pedro F. Giffuni
6d94bd07cc libiberty: upstream updates.
There is a new ChangeLog.gcc43 file but most notable:

* floatformat.c (get_field): Fix segfault with little-endian word
  order on 64-bit hosts.
  (put_field): Likewise.
  (min): Move definition.

gcc/cp/ChangeLog
2007-05-04  Geoffrey Keating  <geoffk@apple.com>

  PR 31775
  * mangle.c (write_mangled_name): Mangle static variable names.
  (write_unqualified_name): Use local-source-name for
  namespace-scope static variables.
(Completes FreeBSD's r258017 )

Obtained from:	gcc 4.3 (rev. 118552, 120097, 20698, 120702,
			 121364, 122972, 126588; GPLv2)
MFC after:	2 weeks
2013-12-01 22:08:19 +00:00
Gleb Smirnoff
ad4804a001 Remove unused variable. 2013-12-01 20:03:00 +00:00
Nathan Whitehorn
4aa3cee65a Revert last few revisions; apologies for the noise. There are very rare,
broken systems that require SPRG state to be preserved.
2013-12-01 19:59:36 +00:00
Nathan Whitehorn
c7291bdcd0 Deleted one line too many. 2013-12-01 19:56:30 +00:00
Nathan Whitehorn
ff4ae2ead1 No actual hardware supported by FreeBSD requires this SPRG save/restore
paranoia, so kill it. In particular, changes to SPRG0 are dangerous, since
that is where the PCPU pointer is kept.
2013-12-01 19:45:04 +00:00
Nathan Whitehorn
c1cb22d755 Rearchitect platform memory map parsing to make it less
Open Firmware-centric:
- Keep the static list of regions in platform.c instead of ofw_machdep.c
- Move various merging and sorting operations to platform.c as well
- Move apple_hacks code out of ofw_machdep.c and into platform_powermac.c,
  where it belongs
- Move CHRP-specific dynamic-reconfiguration memory parsing into
  platform_chrp.c instead of pretending it is shared code
2013-12-01 19:43:15 +00:00
Nathan Whitehorn
02ef3f33de Real OF systems have an ihandle under /chosen/stdout, not a phandle. Use
the right type.
2013-12-01 19:05:32 +00:00
Nathan Whitehorn
fb5b9994b3 Open Firmware mandates that certain cross-references, in particular those
in /chosen, be ihandles. The ePAPR spec makes those cross-reference phandles,
since FDT has no concept of ihandles. Have the OF FDT CI module interpret
queries about ihandles as cross-reference phandles.
2013-12-01 19:03:20 +00:00
Nathan Whitehorn
9d2c48c0e3 Remove unnecessary double-setting of the thread's onfault state in
copyinstr().
2013-12-01 17:29:07 +00:00
Nathan Whitehorn
3df046183e The kernel stack guard pages are only below the stack pointer, not above.
Prevent erroneous detection of stack overflows on legitimate faults on the
page after this thread's stack.

MFC after:	3 days
2013-12-01 17:28:28 +00:00
Jilles Tjoelker
577ad9b2d3 test: Simplify the code by unifying op_num and op_type.
The global variable t_wp_op is no longer needed.
2013-12-01 17:00:57 +00:00
Nathan Whitehorn
49aba28afe Make uart_cpu_powerpc work on both FDT and OFW systems. This is the last
remaining modification required to build kernels that work with both on
PowerPC.
2013-12-01 16:02:22 +00:00
Hiroki Sato
46b13263cf Use standard CLEANFILES/CLEANDIRS and clean target in bsd.obj.mk. 2013-12-01 15:24:35 +00:00
Hiroki Sato
464485c8d0 - Prevent TARGET and TARGET_ARCH from being defined as empty when
TARGET="" and/or TARGET_ARCH="" is specified.
- Remove extra ().
2013-12-01 15:06:30 +00:00
Jilles Tjoelker
b865f8ef40 chmod(2): Document S_ISVTX following SUSv3/SUSv4.
S_ISTXT is non-standard.

While here, also update fchmodat() standards entry to POSIX.1-2008.
2013-12-01 12:24:57 +00:00
Jilles Tjoelker
09466daf8c waitid(2): Do not tell userland programmers to include <sys/signal.h>.
Userland should get these definitions by including <signal.h>.
2013-12-01 11:59:37 +00:00
Pawel Jakub Dawidek
fc4618e769 Remove trailing backslash. 2013-12-01 09:52:38 +00:00
Pawel Jakub Dawidek
2f02600abf Move my simple logging API to a separate library. It is now already used
by hastctl(8), hastd(8) and auditdistd(8) and will soon be also used
by casperd(8) and its services. There is no documentation and pjdlog.h
header file is not installed in /usr/include/ to keep it private.
Unfortunately we don't have /lib/private/ at this point, only
/usr/lib/private/, so the library is installed in /lib/.

Sponsored by:	The FreeBSD Foundation
2013-12-01 09:41:06 +00:00
Edward Tomasz Napierala
c4dfe4abe2 Fix hang on reboot with active iSCSI connections.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2013-12-01 08:13:10 +00:00
Kirk McKusick
2e436d88a3 We needlessly panic when trying to flush MKDIR_PARENT dependencies.
We had previously tried to flush all MKDIR_PARENT dependencies (and
all the NEWBLOCK pagedeps) by calling ffs_update(). However this will
only resolve these dependencies in direct blocks. So very large
directories with MKDIR_PARENT dependencies in indirect blocks had
not yet gotten flushed. As the directory is in the midst of doing a
complete sync, we simply defer the checking of the MKDIR_PARENT
dependencies until the indirect blocks have been sync'ed.

Reported by: Shawn Wallbridge of imaginaryforces.com
Tested by:   John-Mark Gurney <jmg@funkthat.com>
PR:          183424
MFC after:   2 weeks
2013-12-01 07:34:21 +00:00
Adrian Chadd
79750e3b36 Migrate the sendfile_sync structure into a public(ish) API in preparation
for extending and reusing it.

The sendfile_sync wrapper is mostly just a "mbuf transaction" wrapper,
used to indicate that the backing store for a group of mbufs has completed.
It's only being used by sendfile for now and it's only implementing a
sleep/wakeup rendezvous.  However, there are other potential signaling
paths (kqueue) and other potential uses (socket zero-copy write) where the
same mechanism would also be useful.

So, with that in mind:

* extract the sendfile_sync code out into sf_sync_*() methods
* teach the sf_sync_alloc method about the current config flag -
  it will eventually know about kqueue.
* move the sendfile_sync code out of do_sendfile() - the only thing
  it now knows about is the sfs pointer.  The guts of the sync
  rendezvous (setup, rendezvous/wait, free) is now done in the
  syscall wrapper.
* .. and teach the 32-bit compat sendfile call the same.

This should be a no-op.  It's primarily preparation work for teaching
the sendfile_sync about kqueue notification.

Tested:

* Peter Holm's sendfile stress / regression scripts

Sponsored by:	Netflix, Inc.
2013-12-01 03:53:21 +00:00
Eitan Adler
4be4358fd1 r258780 should not have applied to .S files.
Reported by:	jmallett
2013-12-01 02:58:48 +00:00
Glen Barber
8bf3303aa0 Move OPTIONS_UNSET outside of the PBUILD_FLAGS variable, otherwise the
textproc/docproj port build fails.

Pointyhat:	gjb
MFC after:	3 days
X-Before-RC1:	yes
Sponsored by:	The FreeBSD Foundation
2013-11-30 23:56:26 +00:00
Devin Teske
4e918fd37b Sort function output on name of the function. 2013-11-30 23:47:18 +00:00
Eitan Adler
7a22215c53 Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit.  Instead use (1U << 31) which gets the
expected result.

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.

Discussed with:	-arch, rdivacky
Reviewed by:	cperciva
2013-11-30 22:17:27 +00:00
Eitan Adler
c8aef31d30 Similar to the (1 << 31) case it is not defined to do (2 << 30). 2013-11-30 22:16:37 +00:00
Andreas Tobler
86b2b302f9 Add a printf to inform about the logical memory block size which is in use
by the system. This might give a hint why a pSeries system is not booting.
2013-11-30 21:54:55 +00:00
Jilles Tjoelker
670dd3f08f sh: Prefer memcpy() to strcpy() in most cases. Remove the scopy macro. 2013-11-30 21:27:11 +00:00
Hiroki Sato
9d22cb2e69 Add NOPKG to disable pkg-stage. 2013-11-30 17:07:53 +00:00
Pawel Jakub Dawidek
f2b525e6b9 Make process descriptors standard part of the kernel. rwhod(8) already
requires process descriptors to work and having PROCDESC in GENERIC
seems not enough, especially that we hope to have more and more consumers
in the base.

MFC after:	3 days
2013-11-30 15:08:35 +00:00
Michael Tuexen
c302aeb123 In
http://svnweb.freebsd.org/changeset/base/258221
I introduced a bug which initialized global locks
whenever the SCTP stack initialized. This was fixed in
http://svnweb.freebsd.org/changeset/base/258574
by rodrigc@. He just initialized the locks for
the default vnet. This fix reverts to the old
behaviour before r258221, which explicitly makes
sure it is only called once, because this works also on
other platforms.
MFC after: 3 days
X-MFC with: r258574.
2013-11-30 12:51:19 +00:00
Adrian Chadd
011a151b50 Disable this debugging - it's far too verbose when doing TX rate debugging. 2013-11-29 22:36:00 +00:00
Adrian Chadd
2f1b79906d Use the correct endian-ness accessor for this TLV field.
(It's coming from firmware and thus it's defined as little-endian.)
2013-11-29 22:35:24 +00:00
Adrian Chadd
1db2772f43 Make sure any waiters on the scan results get notified if the scan task
decides to do nothing.

If this isn't done, then a scan request whilst a scan occurs in an active
channel set or a completed channel set will hang.

Tested:

* Intel 5100, STA mode
2013-11-29 22:24:57 +00:00
Nathan Whitehorn
e30a29aa7c Use the Open Firmware-based CPU frequency determination as a generic
fallback if we can't measure CPU frequency. This is also useful on a
variety of embedded systems using FDT.
2013-11-29 21:59:03 +00:00
Andreas Tobler
ac181a2130 Fix typo. 2013-11-29 20:19:00 +00:00
Eitan Adler
04660ed15f Fix typo
Reported by:	emaste
2013-11-29 20:14:26 +00:00
Eitan Adler
5c41c9d246 Fix typo
Reported by:	swildner@DragonFlyBSD.org
2013-11-29 20:12:02 +00:00
Pedro F. Giffuni
5b1674597f gcc: upstream alignment cleanups.
This solves GCC/32617 and contributes to reduce differences with
Apple's gcc42.

Complete some references in the ChangeLog while here.

Obtained from:	gcc 4.3 (rev. 126529, 126588; GPLv2)
MFC after:	3 weeks
2013-11-29 18:46:02 +00:00
Andriy Gapon
f77ffe1b22 zfs: add zfs_freebsd_putpages
this should be more optimal than writing pages one-by-one via zfs_write ->
update_pages in the case of multi-page putpages call

MFC after:	16 days
2013-11-29 15:39:39 +00:00