]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMFV: tcpdump 4.4.0.
Xin LI [Thu, 30 May 2013 20:51:22 +0000 (20:51 +0000)]
MFV: tcpdump 4.4.0.

MFC after: 4 weeks

11 years agoAfter the object lock was dropped, the object' reference count could
Konstantin Belousov [Thu, 30 May 2013 20:00:19 +0000 (20:00 +0000)]
After the object lock was dropped, the object' reference count could
change.  Retest the ref_count and return from the function to not
execute the further code which assumes that ref_count == 1 if it is
not.  Also, do not leak vnode lock if other thread cleared OBJ_TMPFS
flag meantime.

Reported by: bdrewery
Tested by: bdrewery, pho
Sponsored by: The FreeBSD Foundation

11 years agoRemove the capitalization in the assertion message. Print the address
Konstantin Belousov [Thu, 30 May 2013 19:53:31 +0000 (19:53 +0000)]
Remove the capitalization in the assertion message.  Print the address
of the object to get useful information from optimizated kernels dump.

11 years agoAssert that OBJ_TMPFS flag on the vm object for the tmpfs node is
Konstantin Belousov [Thu, 30 May 2013 19:51:33 +0000 (19:51 +0000)]
Assert that OBJ_TMPFS flag on the vm object for the tmpfs node is
cleared when the tmpfs node is going away.

Tested by: bdrewery, pho

11 years ago- Do supply arguments as pointers to bce_get_{pg,rx}_buf() that are not
Marius Strobl [Thu, 30 May 2013 17:24:36 +0000 (17:24 +0000)]
- Do supply arguments as pointers to bce_get_{pg,rx}_buf() that are not
  altered or actually needed there any longer.
- Honor errors passed to the DMA mapping callbacks.
- In bce_get_rx_buf(), do not reserve stack space for more DMA segments
  than actually necessary.
- In bce_get_pg_buf(), take advantage of bus_dmamap_load_mbuf_sg(9).
- In bce_rx_intr(), remove a pointless check for an empty mbuf pointer
  which can only happen in case of a severe programming error. Moreover,
  recovering from that situation would require way more actions with header
  splitting enabled (which it is by default).
- Fix VLAN tagging in the RX path; do not attach the VLAN tag twice if the
  firmware has been told to keep it. [1]

Obtained from: OpenBSD [1]
MFC after: 1 week

11 years agoUpdate byacc to 20130304
Baptiste Daroussin [Thu, 30 May 2013 16:16:28 +0000 (16:16 +0000)]
Update byacc to 20130304

11 years ago- As a follow-up to r247565, make firmware images that do not require
Marius Strobl [Thu, 30 May 2013 16:09:56 +0000 (16:09 +0000)]
- As a follow-up to r247565, make firmware images that do not require
  patching at runtime actually const.
- Remove pointless softc members by employing the corresponding constants
  directly.
- Remove pointless returns.
- Remove unnecessary inclusion of opt_device_polling.h.
- Replace an outdated and now bogus comment in bce_tick() with the
  appropriate one.

MFC after: 1 week

11 years agoRestore (at least temporarily) SHARED=symlinks in the build includes
Brooks Davis [Thu, 30 May 2013 15:25:54 +0000 (15:25 +0000)]
Restore (at least temporarily) SHARED=symlinks in the build includes
stage of buildworld.  This was accidentally included in r251140.

Reported by: jhb

11 years agoAlways define INSTALL_DDIR and define it such that it contains no extra
Brooks Davis [Thu, 30 May 2013 14:09:58 +0000 (14:09 +0000)]
Always define INSTALL_DDIR and define it such that it contains no extra
/ characters rather than removing them later on.  This should fix
release builds.

PR: conf/178963
Reviewed by: gjb, hrs

11 years agoBring in a number of new features, mostly implemented by Michio Honda:
Luigi Rizzo [Thu, 30 May 2013 14:07:14 +0000 (14:07 +0000)]
Bring in a number of new features, mostly implemented by Michio Honda:

- the VALE switch now support up to 254 destinations per switch,
  unicast or broadcast (multicast goes to all ports).

- we can attach hw interfaces and the host stack to a VALE switch,
  which means we will be able to use it more or less as a native bridge
  (minor tweaks still necessary).
  A 'vale-ctl' program is supplied in tools/tools/netmap
  to attach/detach ports the switch, and list current configuration.

- the lookup function in the VALE switch can be reassigned to
  something else, similar to the pf hooks. This will enable
  attaching the firewall, or other processing functions (e.g. in-kernel
  openvswitch) directly on the netmap port.

The internal API used by device drivers does not change.

Userspace applications should be recompiled because we
bump NETMAP_API as we now use some fields in the struct nmreq
that were previously ignored -- otherwise, data structures
are the same.

Manpages will be committed separately.

11 years agoclarify usage of NETMAP_BUF
Luigi Rizzo [Thu, 30 May 2013 13:41:19 +0000 (13:41 +0000)]
clarify usage of NETMAP_BUF

11 years agoImport byacc 20130304
Baptiste Daroussin [Thu, 30 May 2013 13:10:38 +0000 (13:10 +0000)]
Import byacc 20130304

11 years ago- Merge from r249476: Ensure that PCI bus BUS_GET_DMA_TAG() method sees
Marius Strobl [Thu, 30 May 2013 12:16:55 +0000 (12:16 +0000)]
- Merge from r249476: Ensure that PCI bus BUS_GET_DMA_TAG() method sees
  the actual PCI device which makes the request for DMA tag, instead of
  some descendant of the PCI device, by creating a pass-through trampoline.
- Sprinkle const on tables.
- Use NULL instead of 0 for pointers.
- Take advantage of nitems().

MFC after: 1 week

11 years agoadd support for rate-limiting in the sender (-R ...)
Luigi Rizzo [Thu, 30 May 2013 11:10:42 +0000 (11:10 +0000)]
add support for rate-limiting in the sender (-R ...)

Obtained from: Giuseppe Lettieri

11 years agoadd a compile-time option to copy packets instead of doing
Luigi Rizzo [Thu, 30 May 2013 11:09:41 +0000 (11:09 +0000)]
add a compile-time option to copy packets instead of doing
the buffer swapping.

11 years agoremove use of deprecated ioctl()
Luigi Rizzo [Thu, 30 May 2013 11:08:16 +0000 (11:08 +0000)]
remove use of deprecated ioctl()

11 years agoMFV: libpcap 1.4.0.
Xin LI [Thu, 30 May 2013 08:02:00 +0000 (08:02 +0000)]
MFV: libpcap 1.4.0.

MFC after: 4 weeks

11 years agoVendor import of tcpdump 4.4.0.
Xin LI [Thu, 30 May 2013 06:46:26 +0000 (06:46 +0000)]
Vendor import of tcpdump 4.4.0.

11 years agoVendor import of libpcap 1.4.0.
Xin LI [Thu, 30 May 2013 06:41:26 +0000 (06:41 +0000)]
Vendor import of libpcap 1.4.0.

11 years agoAdd __sync_synchronize().
Ed Schouten [Thu, 30 May 2013 06:20:50 +0000 (06:20 +0000)]
Add __sync_synchronize().

This function can easily be implemented on top of the mb() macro
provided by <machine/atomic.h>.

11 years agoUse #ifdef instead of #if defined.
Ed Schouten [Thu, 30 May 2013 06:20:23 +0000 (06:20 +0000)]
Use #ifdef instead of #if defined.

This makes these tests a bit more consistent with the tests done at the
bottom of the file.

11 years agoI'm happy to finally commit stephen@'s implementations of cacos,
David Schultz [Thu, 30 May 2013 04:49:26 +0000 (04:49 +0000)]
I'm happy to finally commit stephen@'s implementations of cacos,
cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@
for working on these.

Submitted by: stephen@
Reviewed by: bde

11 years agoFix some harmless bugs in a test.
David Schultz [Thu, 30 May 2013 04:47:03 +0000 (04:47 +0000)]
Fix some harmless bugs in a test.

11 years agoBasic tests for complex inverse trig and hyperbolic functions.
David Schultz [Thu, 30 May 2013 04:46:36 +0000 (04:46 +0000)]
Basic tests for complex inverse trig and hyperbolic functions.

11 years agoMFP4 @217311
Brooks Davis [Thu, 30 May 2013 01:22:50 +0000 (01:22 +0000)]
MFP4 @217311

Intel and Sharp flash power on with their blocks in a "locked" state.
Unlocked them before attempting to perform an erase or write action and
relock when the action is complete.

11 years agoMFP4 @222836
Brooks Davis [Thu, 30 May 2013 01:19:02 +0000 (01:19 +0000)]
MFP4 @222836

Add support for partitioning CFI disks from FDT using geom_flashmap.

Sponsored by: DARPA, AFRL

11 years agoAllow unmapped I/O via aacd(4). It shouldn't be too hard to add the
Marius Strobl [Thu, 30 May 2013 00:22:07 +0000 (00:22 +0000)]
Allow unmapped I/O via aacd(4). It shouldn't be too hard to add the
same support for aacp(4), I'm lacking the necessary hardware for
testing, though.

11 years ago- Remove pointless returns.
Marius Strobl [Thu, 30 May 2013 00:11:22 +0000 (00:11 +0000)]
- Remove pointless returns.
- Make cm_data a void pointer and cm_flags unsigned as appropriate.

MFC after: 3 days

11 years agoFix a typo in r249213; the second bus_if.h should have been isa_if.h.
Marius Strobl [Wed, 29 May 2013 23:56:49 +0000 (23:56 +0000)]
Fix a typo in r249213; the second bus_if.h should have been isa_if.h.

11 years agoAdd support for tethering on the iPhone 4S
Eitan Adler [Wed, 29 May 2013 20:36:51 +0000 (20:36 +0000)]
Add support for tethering on the iPhone 4S

PR: usb/179078
Submitted by: Christopher Sean Hilton <chris@vindaloo.com>
MFC After: 1 week

11 years agoModify atf::fs::path::get_process_helpers_path API to properly
Marcel Moolenaar [Wed, 29 May 2013 19:41:36 +0000 (19:41 +0000)]
Modify atf::fs::path::get_process_helpers_path API to properly
handle pathing with detail/ tests. Based on patch pushed upstream to
ATF project.

Obtained from: Garrett Cooper <yaneurabeya@gmail.com>

11 years agoMake the instruction order for buildworld agree with UPDATING and the
Chris Rees [Wed, 29 May 2013 19:16:59 +0000 (19:16 +0000)]
Make the instruction order for buildworld agree with UPDATING and the
Handbook.

Reviewed by: imp, bdrewery, netchild
Approved by: gjb (mentor)

11 years agoDon't assign the copyright to the FreeBSD foundation for the years
Marcel Moolenaar [Wed, 29 May 2013 16:51:03 +0000 (16:51 +0000)]
Don't assign the copyright to the FreeBSD foundation for the years
this file is in FreeBSD. There's formality to this that hasn't
happened and Juniper is perfectly fine with being the holder.

Discussed with: eadler, imp, jhb

11 years agoAdd my entry.
Chris Rees [Wed, 29 May 2013 13:36:33 +0000 (13:36 +0000)]
Add my entry.

Approved by: bcr, gjb (mentors)

11 years agoForced commit to note that the sandbox issue was not about libraries, as
Dag-Erling Smørgrav [Wed, 29 May 2013 12:40:28 +0000 (12:40 +0000)]
Forced commit to note that the sandbox issue was not about libraries, as
I erroneously stated in the commit log, but about a CRIOGET ioctl failing
due to a preceding setrlimit(RLIMIT_NOFILES, 0) call.

11 years agoTurn the reassociate debug print into a DPRINTF.
Adrian Chadd [Wed, 29 May 2013 05:10:11 +0000 (05:10 +0000)]
Turn the reassociate debug print into a DPRINTF.

11 years agoFix a false -> AH_FALSE.
Adrian Chadd [Wed, 29 May 2013 04:21:42 +0000 (04:21 +0000)]
Fix a false -> AH_FALSE.

Now, why this hasn't tripped _any_ tinderbox builds yet, I dunno.
It's been like this for a while.

11 years agoRemove clause 3 and 4 from TNF licenses
Ed Maste [Wed, 29 May 2013 01:54:10 +0000 (01:54 +0000)]
Remove clause 3 and 4 from TNF licenses

Per the NetBSD Foundation statement
  Third parties are encouraged to change the license on any files which
  have a 4-clause license contributed to the NetBSD Foundation to a
  2-clause license.

11 years agoShuffle around the cleanup unpause calls a bit.
Adrian Chadd [Wed, 29 May 2013 01:40:13 +0000 (01:40 +0000)]
Shuffle around the cleanup unpause calls a bit.

11 years agoAdd a patch analygous to r248567, r248581, r251079 to the
Rick Macklem [Wed, 29 May 2013 00:32:49 +0000 (00:32 +0000)]
Add a patch analygous to r248567, r248581, r251079 to the
old NFS client to avoid the panic reported in the PR by
doing the vnode_pager_setsize() call after unlocking the mutex.

PR: 177335
MFC after: 2 weeks

11 years agoRevert a local change that sets the default for UsePrivilegeSeparation to
Dag-Erling Smørgrav [Wed, 29 May 2013 00:19:58 +0000 (00:19 +0000)]
Revert a local change that sets the default for UsePrivilegeSeparation to
"sandbox" instead of "yes".  In sandbox mode, the privsep child is unable
to load additional libraries and will therefore crash when trying to take
advantage of crypto offloading on CPUs that support it.

11 years agoRemove references to CVS_UPDATE and SUP_UPDATE to catch up with r251084.
Glen Barber [Tue, 28 May 2013 23:52:01 +0000 (23:52 +0000)]
Remove references to CVS_UPDATE and SUP_UPDATE to catch up with r251084.

MFC after: 1 month
X-MFC-With: r251084, r251085

11 years agoFix typo introduced in r251084.
Glen Barber [Tue, 28 May 2013 23:46:13 +0000 (23:46 +0000)]
Fix typo introduced in r251084.

MFC after: 1 month
X-MFC-With: r251084

11 years agor245757 introduced warning output if update method is set to CVS_UPDATE
Glen Barber [Tue, 28 May 2013 23:43:47 +0000 (23:43 +0000)]
r245757 introduced warning output if update method is set to CVS_UPDATE
or SUP_UPDATE.

CVS exporter for head/ is turned off for nearly one month now.

It is finally time to swing the ax at these update methods.

Reviewed by: eadler
MFC after: 1 month

11 years agoPost-r248567, there were times when the client would return a
Rick Macklem [Tue, 28 May 2013 22:36:01 +0000 (22:36 +0000)]
Post-r248567, there were times when the client would return a
truncated directory for some NFS servers. This turned out to
be because the size of a directory reported by an NFS server
can be smaller that the ufs-like directory created from the
RPC XDR in the client. This patch fixes the problem by changing
r248567 so that vnode_pager_setsize() is only done for regular files.

Reported and tested by: hartmut.brandt@dlr.de
Reviewed by: kib
MFC after: 1 week

11 years agosleep: Improve nanosleep() error handling:
Jilles Tjoelker [Tue, 28 May 2013 22:07:31 +0000 (22:07 +0000)]
sleep: Improve nanosleep() error handling:

 * Work around kernel bugs that cause a spurious [EINTR] return if a
   debugger (such as truss(1)) is attached.

 * Write an error message if an error other than [EINTR] occurs.

PR: bin/178664

11 years agoo Change the locking scheme for swp_bcount.
Attilio Rao [Tue, 28 May 2013 22:07:23 +0000 (22:07 +0000)]
o Change the locking scheme for swp_bcount.
  It can now be accessed with a write lock on the object containing it OR
  with a read lock on the object containing it along with the swhash_mtx.
o Remove some duplicate assertions for swap_pager_freespace() and
  swap_pager_unswapped() but keep the object locking references for
  documentation.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc

11 years agoAvoid reading back certain registers following a write. This is an optimization.
David C Somayajulu [Tue, 28 May 2013 22:00:37 +0000 (22:00 +0000)]
Avoid reading back certain registers following a write. This is an optimization.

Submitted by: David C Somayajulu
Approved by: George Neville Neil

11 years agoUpdate comments to reflect use of svn/svnup to keep the src/ tree up
Glen Barber [Tue, 28 May 2013 21:57:55 +0000 (21:57 +0000)]
Update comments to reflect use of svn/svnup to keep the src/ tree up
to date.

MFC after: 3 days

11 years agoTemporarily revert r251058 - it breaks documented use of makeoptions
Peter Wemm [Tue, 28 May 2013 21:29:05 +0000 (21:29 +0000)]
Temporarily revert r251058 - it breaks documented use of makeoptions
including the tinderbox.

 http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-i386-i386.full
 make: don't know how to make modules-all. Stop
 make: stopped in /obj/i386.i386/src/sys/PAE
 *** Error code 2

11 years agoMFp4 @229086:
Pawel Jakub Dawidek [Tue, 28 May 2013 21:25:28 +0000 (21:25 +0000)]
MFp4 @229086:

Make use of Capsicum to protect kdump(1), as it might be used to parse data
from untrusted sources:

- Sandbox kdump(1) using capability mode.
- Limit stdin descriptor (where opened file is moved to) to only
  CAP_READ and CAP_FSTAT rights.
- Limit stdout descriptor to only CAP_WRITE, CAP_FSTAT and CAP_IOCTL.
  Plus limit allowed ioctls to TIOCGETA only, which is needed for
  isatty() to work.
- Limit stderr descriptor to only CAP_WRITE and CAP_FSTAT. In addition
  if the -s option is not given, grant CAP_IOCTL right, but allow for
  TIOCGWINSZ ioctl only, as we need screen width to dump the data.
- Before entering capability mode call catopen("libc", NL_CAT_LOCALE),
  which opens message catalogs and caches data, so that strerror(3)
  and strsignal(3) can work in a sandbox.

Sponsored by: The FreeBSD Foundation
Discussed with: rwatson

11 years agoMFp4 @229085:
Pawel Jakub Dawidek [Tue, 28 May 2013 21:21:46 +0000 (21:21 +0000)]
MFp4 @229085:

Rearrange the code so we don't call ioctl(TIOCGWINSZ) if the -s option is given,
as the result won't be used then.

Sponsored by: The FreeBSD Foundation

11 years agoRemove the advertising clause from the Regents of the University of
Ed Maste [Tue, 28 May 2013 21:05:06 +0000 (21:05 +0000)]
Remove the advertising clause from the Regents of the University of
California's license, per the letter dated July 22, 1999.

11 years agoRenumber clauses to reduce diffs to other versions
Ed Maste [Tue, 28 May 2013 20:57:40 +0000 (20:57 +0000)]
Renumber clauses to reduce diffs to other versions

NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.

11 years agoRemove the advertising clause from the Regents of the University of
Ed Maste [Tue, 28 May 2013 20:37:48 +0000 (20:37 +0000)]
Remove the advertising clause from the Regents of the University of
California's license, per the letter dated July 22, 1999.

11 years agoFix warnings from newer clang versions about constexpr member functions
Dimitry Andric [Tue, 28 May 2013 20:11:28 +0000 (20:11 +0000)]
Fix warnings from newer clang versions about constexpr member functions
not being implicitly const in libc++'s <chrono> header.  The warnings
have been introduced because of new language rules recently adopted by
the C++ WG.  More info:

<http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3598.html>

MFC after: 3 days

11 years agoRevert r251023 until a more proper solution is found
Hans Petter Selasky [Tue, 28 May 2013 18:51:30 +0000 (18:51 +0000)]
Revert r251023 until a more proper solution is found
for ATI based USB controllers.

MFC after: 1 week

11 years agoAdded missing SCSI quirks from r241784
Steven Hartland [Tue, 28 May 2013 14:44:37 +0000 (14:44 +0000)]
Added missing SCSI quirks from r241784

Re-ordered SSD quirks alphabetically so they are easier to maintain.

Removed my email and PR reference from comments on each quirk.

Added quirks for more SSDs:
* Crucial M4
* Corsair Force GT
* Intel 520 Series
* Kingston E100 Series
* Samsung 830 Series

Reviewed by: pjd (mentor)
Approved by: pjd (mentor)
MFC after: 1 week

11 years ago- Fix wording. [1]
Mark Johnston [Tue, 28 May 2013 13:54:26 +0000 (13:54 +0000)]
- Fix wording. [1]
- Improve the descriptions in the FILES section. [2]

Reported by: Jason McIntyre [1]
Obtained from: NetBSD [2]
MFC after: 3 days

11 years agoDuring buildkernel, print a banner before building modules.
Dag-Erling Smørgrav [Tue, 28 May 2013 09:52:28 +0000 (09:52 +0000)]
During buildkernel, print a banner before building modules.

11 years agomdoc: silence a few mandoc lint warnings.
Joel Dahl [Tue, 28 May 2013 09:33:46 +0000 (09:33 +0000)]
mdoc: silence a few mandoc lint warnings.

11 years agoRemove redundant checks.
Michael Tuexen [Tue, 28 May 2013 09:25:58 +0000 (09:25 +0000)]
Remove redundant checks.

MFC after: 2 weeks

11 years agoFix cexp regression tests that have an infinite real part. The signs of the
Tijl Coosemans [Tue, 28 May 2013 08:50:50 +0000 (08:50 +0000)]
Fix cexp regression tests that have an infinite real part. The signs of the
result depend on the cosine and sine of the imaginary part.
Small values are used in the new tests such that cosine and sine are well
defined.

Reviewed by: das

11 years agoThe getcontext() from the __fillcontextx() call in the
Konstantin Belousov [Tue, 28 May 2013 04:54:16 +0000 (04:54 +0000)]
The getcontext() from the __fillcontextx() call in the
check_deferred_signal() returns twice, since handle_signal() emulates
the return from the normal signal handler by sigreturn(2)ing the
passed context.  Second return is performed on the destroyed stack
frame, because __fillcontextx() has already returned.  This causes
undefined and bad behaviour, usually the victim thread gets SIGSEGV.

Avoid nested frame and the need to return from it by doing direct call
to getcontext() in the check_deferred_signal() and using a new private
libc helper __fillcontextx2() to complement the context with the
extended CPU state if the deferred signal is still present.

The __fillcontextx() is now unused, but is kept to allow older
libthr.so to be used with the new libc.

Mark __fillcontextx() as returning twice [1].

Reported by: pgj
Pointy hat to: kib
Discussed with: dim
Tested by: pgj, dim
Suggested by: jilles [1]
MFC after: 1 week

11 years agoStyle(9)
Steve Kargl [Mon, 27 May 2013 22:45:05 +0000 (22:45 +0000)]
Style(9)

Approved by: das (implicit)
Reported by: jh

11 years agoChange the closeallfds() routine to use closefrom() when it is
Garance A Drosehn [Mon, 27 May 2013 22:19:01 +0000 (22:19 +0000)]
Change the closeallfds() routine to use closefrom() when it is
available (closefrom() was added to FreeBSD in 8.0-release).
The selection is made at compile-time, as I still compile a
FreeBSD-based version of lpr&friends on other platforms.

While testing I out that (at least on my system) lpd has been
closing 11095 fd's, when there are only 6 fd's open.  The old
code took 120 times more clocktime than calling closefrom().
(although that was still less than 2/1000-ths of a second!)

Reviewed by: jilles
MFC after: 2 weeks

11 years agocap_rights_limit(2): CAP_ACCEPT also permits accept4(2).
Jilles Tjoelker [Mon, 27 May 2013 21:37:19 +0000 (21:37 +0000)]
cap_rights_limit(2): CAP_ACCEPT also permits accept4(2).

11 years ago* Update polynomial coefficients.
Steve Kargl [Mon, 27 May 2013 20:43:16 +0000 (20:43 +0000)]
* Update polynomial coefficients.
* Use ENTERI/RETURNI to allow the use of FP_PE on i386 target.

Reviewed by: das (and bde a long time ago)
Approved by: das (mentor)
Obtained from: bde (polynomial coefficients)

11 years agoPartially apply the capitalization of the heading word of the sequence
Konstantin Belousov [Mon, 27 May 2013 18:45:45 +0000 (18:45 +0000)]
Partially apply the capitalization of the heading word of the sequence
and fix typo.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoUse slightly more idiomatic expression to get the address of array.
Konstantin Belousov [Mon, 27 May 2013 18:39:39 +0000 (18:39 +0000)]
Use slightly more idiomatic expression to get the address of array.

Tested by: dim, pgj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoThe _MC_HASFPXSTATE and _MC_IA32_HASFPXSTATE flags have the same bit
Konstantin Belousov [Mon, 27 May 2013 18:36:46 +0000 (18:36 +0000)]
The _MC_HASFPXSTATE and _MC_IA32_HASFPXSTATE flags have the same bit
value on purpose, but the ia32 context handling code is logically more
correct to use the _MC_IA32_HASFPXSTATE name for the flag.

Tested by: dim, pgj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoThe ia32_get_mcontext() does not need to set PCB_FULL_IRET. The
Konstantin Belousov [Mon, 27 May 2013 18:31:15 +0000 (18:31 +0000)]
The ia32_get_mcontext() does not need to set PCB_FULL_IRET.  The
usermode context state is not changed by the get operation, and
get_mcontext() does not require full iret as well.

Tested by: dim, pgj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoWhen reporting the fault details, also print %rsp.
Konstantin Belousov [Mon, 27 May 2013 18:29:20 +0000 (18:29 +0000)]
When reporting the fault details, also print %rsp.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoWhen handling an exception from the attempt from loading the faulting
Konstantin Belousov [Mon, 27 May 2013 18:26:08 +0000 (18:26 +0000)]
When handling an exception from the attempt from loading the faulting
context on return from the trap handler, re-enable the interrupts on
i386 and amd64.  The trap return path have to disable interrupts since
the sequence of loading the machine state is not atomic.  The trap()
function which transfers the control to the special handler would
enable the interrupt, but an iret loads the previous eflags with PSL_I
clear.  Then, the special handler calls trap() on its own, which now
sees the original eflags with PSL_I set and does not enable
interrupts.

The end result is that signal delivery and process exiting code could
be executed with interrupts disabled, which is generally wrong and
triggers several assertions.

For amd64, the interrupts are enabled conditionally based on PSL_I in
the eflags of the outer frame, as it is already done for
doreti_iret_fault.  For i386, the interrupts are enabled
unconditionally, the ast loop could have opened a window with
interrupts enabled just before the iret anyway.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoFix some regressions caused by the switch from gcc to clang. The fixes
David Schultz [Mon, 27 May 2013 08:50:10 +0000 (08:50 +0000)]
Fix some regressions caused by the switch from gcc to clang. The fixes
are workarounds for various symptoms of the problem described in clang
bugs 3929, 8100, 8241, 10409, and 12958.

The regression tests did their job: they failed, someone brought it
up on the mailing lists, and then the issue got ignored for 6 months.
Oops. There may still be some regressions for functions we don't have
test coverage for yet.

11 years agoWorkaround for for a problem seen with ATI Technologies EHCI
Hans Petter Selasky [Mon, 27 May 2013 06:32:07 +0000 (06:32 +0000)]
Workaround for for a problem seen with ATI Technologies EHCI
controller hardware most likely present on UHCI chipsets aswell. The
bug manifests itself when issuing isochronous transfers and bulk
transfers towards the same device simultaneously. From time to time it
happens that either the completion IRQ was missing or that the
completion IRQ was happening before the ITD/SITD was completely
written back to memory. The workaround assumes that double buffered
isochronous transfers are used, and that a second interrupt is
generated at the beginning of the next isochronous transfer to
complete the previous one. Possibly skipping the interrupt at the last
isochronous frame is possible, but will then break single buffered
isochronous transfers. For now we can live with some extra interrupts.

MFC after: 1 week

11 years agoFix ONFI chip detection.
Grzegorz Bernacki [Mon, 27 May 2013 06:24:31 +0000 (06:24 +0000)]
Fix ONFI chip detection.

Submitted by: Alexander Fedorov <alexander.fedorov@rtlservice.com>

11 years agoAdd DTS for AM335x EVM with properly muxed PWM and LCD pins, and
Oleksandr Tymoshenko [Mon, 27 May 2013 00:26:29 +0000 (00:26 +0000)]
Add DTS for AM335x EVM with properly muxed PWM and LCD pins, and
LCD panel description

11 years agoAdd PWM and LCDC nodes to base DTS for AM335x-based devices
Oleksandr Tymoshenko [Mon, 27 May 2013 00:23:59 +0000 (00:23 +0000)]
Add PWM and LCDC nodes to base DTS for AM335x-based devices

11 years agoAM335x LCD controller driver with syscons support
Oleksandr Tymoshenko [Mon, 27 May 2013 00:23:01 +0000 (00:23 +0000)]
AM335x LCD controller driver with syscons support

Limitations:
- Raster mode only
- 24 and 32 bpp only

11 years agoAdd PWM module driver for AM335x. Only eCAS subsystem is supported
Oleksandr Tymoshenko [Mon, 27 May 2013 00:13:27 +0000 (00:13 +0000)]
Add PWM module driver for AM335x. Only eCAS subsystem is supported

Export function to configure eCAS submodule from another drivers.
It's used to control LCD panel backlight on AM335x EVM.

11 years agoAdd SCM registers definitions for AM335x platform
Oleksandr Tymoshenko [Mon, 27 May 2013 00:09:04 +0000 (00:09 +0000)]
Add SCM registers definitions for AM335x platform

11 years agoAdd clock definitions for LCD controller and PWM module
Oleksandr Tymoshenko [Mon, 27 May 2013 00:06:24 +0000 (00:06 +0000)]
Add clock definitions for LCD controller and PWM module

11 years agoMigrate ath(4) to now use if_transmit instead of the legacy if_start
Adrian Chadd [Sun, 26 May 2013 22:23:39 +0000 (22:23 +0000)]
Migrate ath(4) to now use if_transmit instead of the legacy if_start
and if queue mechanism; also fix up (non-11n) TX fragment handling.

This may result in a bit of a performance drop for now but I plan on
debugging and resolving this at a later stage.

Whilst here, fix the transmit path so fragment transmission works.

The TX fragmentation handling is a bit more special.  In order to
correctly transmit TX fragments, there's a bunch of corner cases that
need to be handled:

* They must be transmitted back to back, in the same order..
* .. ie, you need to hold the TX lock whilst transmitting this
  set of fragments rather than interleaving it with other MSDUs
  destined to other nodes;
* The length of the next fragment is required when transmitting, in
  order to correctly set the NAV field in the current frame to the
  length of the next frame; which requires ..
* .. that we know the transmit duration of the next frame, which ..
* .. requires us to set the rate of all fragments to the same length,
  or make the decision up-front, etc.

To facilitate this, I've added a new ath_buf field to describe the
length of the next fragment.  This avoids having to keep the mbuf
chain together.  This used to work before my 11n TX path work because
the ath_tx_start() routine would be handed a single mbuf with m_nextpkt
pointing to the next frame, and that would be maintained all the way
up to when the duration calculation was done.  This doesn't hold
true any longer - the actual queuing may occur at any point in the
future (think ath_node TID software queuing) so this information
needs to be maintained.

Right now this does work for non-11n frames but it doesn't at all
enforce the same rate control decision for all frames in the fragment.
I plan on fixing this in a followup commit.

RTS/CTS has the same issue, I'll look at fixing this in a subsequent
commit.

Finaly, 11n fragment support requires the driver to have fully
decided what the rate scenario setup is - including 20/40MHz,
short/long GI, STBC, LDPC, number of streams, etc.  Right now that
decision is (currently) made _after_ the NAV field value is updated.
I'll fix all of this in subsequent commits.

Tested:

* AR5416, STA, transmitting 11abg fragments
* AR5416, STA, 11n fragments work but the NAV field is incorrect for
  the reasons above.

TODO:

* It would be nice to be able to queue mbufs per-node and per-TID so
  we can only queue ath_buf entries when it's time to assemble frames
  to send to the hardware.

  But honestly, we should just do that level of software queue management
  in net80211 rather than ath(4), so I'm going to leave this alone for now.

* More thorough AP, mesh and adhoc testing.

* Ensure that net80211 doesn't hand us fragmented frames when A-MPDU has
  been negotiated, as we can't do software retransmission of fragments.

* .. set CLRDMASK when transmitting fragments, just to ensure.

11 years agoUnbreak ia64 tinderbox: 64-bit support was made conditional upon
Marcel Moolenaar [Sun, 26 May 2013 22:11:13 +0000 (22:11 +0000)]
Unbreak ia64 tinderbox: 64-bit support was made conditional upon
__amd64__, and thus limited. Eliminate 2 trivial conditionals by
casting the 64-bit integral, holding an address, via (uintptr_t)
to (void *) and replace the last remaining check for __amd64__
with a check for __LP64__ instead.

11 years agos/recieve/receive
Jens Schweikhardt [Sun, 26 May 2013 18:57:59 +0000 (18:57 +0000)]
s/recieve/receive

11 years agoRemove backwards compat layer which was added in r71419 (in 2001).
Eitan Adler [Sun, 26 May 2013 14:54:06 +0000 (14:54 +0000)]
Remove backwards compat layer which was added in r71419 (in 2001).

This change is not intended for MFC.

Reviewed by: peter

11 years agoPull in r182656 from upstream llvm trunk:
Dimitry Andric [Sun, 26 May 2013 14:14:42 +0000 (14:14 +0000)]
Pull in r182656 from upstream llvm trunk:

  LoopVectorize: LoopSimplify can't canonicalize loops with an
  indirectbr in it, don't assert on those cases.

  Fixes PR16139.

This should fix clang assertion failures when optimizing at -O3, similar
to:

  Assertion failed: (TheLoop->getLoopPreheader() && "No preheader!!"),
  function canVectorize, file
  contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp, line 2171.

Reported by: O. Hartmann <ohartman@zedat.fu-berlin.de>
PR: ports/178332, ports/178977
MFC after: 3 days

11 years agoMove libmd.so.5 to the proper place and add missing lib32 entry.
Antoine Brodin [Sun, 26 May 2013 09:25:14 +0000 (09:25 +0000)]
Move libmd.so.5 to the proper place and add missing lib32 entry.

11 years agoRework the comment I initially wrote when SHLIB_LDSCRIPT was introduced.
Jeremie Le Hen [Sat, 25 May 2013 22:17:14 +0000 (22:17 +0000)]
Rework the comment I initially wrote when SHLIB_LDSCRIPT was introduced.
The build system is really intricate and I had a hard time to remind the
whole picture even when reading my own words.  This one will hopefully
be better.

11 years agoMake the malloc(3) family of functions weak and make their non-weak
Marcel Moolenaar [Sat, 25 May 2013 18:59:11 +0000 (18:59 +0000)]
Make the malloc(3) family of functions weak and make their non-weak
implementations visible for use by applications. The functions $F that
are now weak symbols are:
allocm, calloc, dallocm, free, malloc, malloc_usable_size,
nallocm, posix_memalign, rallocm, realloc, sallocm

The non-weak implementations of $F are exported as __$F.

Submitted by: stevek@juniper.net
Reviewed by: jasone@, kib@
Approved by: jasone@ (jemalloc)
Obtained from: juniper Networks, Inc

11 years agoAdd C11 macros CMPLX(), CMPLXF() and CMPLXL().
Ed Schouten [Sat, 25 May 2013 18:55:55 +0000 (18:55 +0000)]
Add C11 macros CMPLX(), CMPLXF() and CMPLXL().

Clang allows us to initialize complex numbers using an array
initializer, casted to a complex type. GCC has a builtin called
__builtin_complex().

11 years agoAdd missing #includes, to keep Clang silent.
Ed Schouten [Sat, 25 May 2013 18:04:24 +0000 (18:04 +0000)]
Add missing #includes, to keep Clang silent.

11 years agoFix some statical clang analyzer warnings.
Hans Petter Selasky [Sat, 25 May 2013 17:09:58 +0000 (17:09 +0000)]
Fix some statical clang analyzer warnings.

11 years agoFix <uchar.h> in for C++11.
Ed Schouten [Sat, 25 May 2013 16:58:12 +0000 (16:58 +0000)]
Fix <uchar.h> in for C++11.

It turns out that in C++11, char16_t and char32_t are built-in types;
language keywords. Just fix this by putting traditional _*_T_DECLARED
blocks around the definitions. We'll just predefine these in
<sys/_types.h>.

This also opens up the possibility to define char16_t in other header
files, if ever needed (e.g. if we would gain a <ctype.h> for
char16_t/char32_t).

11 years agoPrevent shadowing.
Ed Schouten [Sat, 25 May 2013 15:36:15 +0000 (15:36 +0000)]
Prevent shadowing.

The name line_number seems to be used as a function parameter name for
one of the Lex functions. Change the name to linenumber.

11 years agosigreturn(2): Remove ancient compatibility warning about 4.2BSD.
Jilles Tjoelker [Sat, 25 May 2013 13:59:40 +0000 (13:59 +0000)]
sigreturn(2): Remove ancient compatibility warning about 4.2BSD.

The HISTORY subsection still says that sigreturn() was added in 4.3BSD.

11 years agoMake some tiny improvements to iconv_open().
Ed Schouten [Sat, 25 May 2013 12:13:54 +0000 (12:13 +0000)]
Make some tiny improvements to iconv_open().

- Remove an unneeded variable.
- Fix whitespace bugs.
- Fix typoes in comment.
- Improve string handling a bit. Don't handroll strstr() and don't
  terminate a strdup()'ed string. Instead, simply strndup() the part we
  need.

11 years agoOnly call free() on something we allocated.
Ed Schouten [Sat, 25 May 2013 12:11:20 +0000 (12:11 +0000)]
Only call free() on something we allocated.

If we were already provided a struct _citrus_iconv (e.g. through
iconv_open_into()), we should not call free() in case io_init_context()
fails. Instead, call it on the pointer of the allocated object, which
will be NULL in case of iconv_open_into().

11 years agoRevert r250972 to fix build.
Glen Barber [Sat, 25 May 2013 07:17:16 +0000 (07:17 +0000)]
Revert r250972 to fix build.