aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
...
* MFV r286765: 5817 change type of arcs_size from uint64_t to refcount_tAlexander Motin2015-08-141-25/+108
| | | | | | | | | | | | | | | | | | | | | | | Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com> Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Alex Reece <alex@delphix.com> Reviewed by: Richard Elling <richard.elling@richardelling.com> Approved by: Garrett D'Amore <garrett@damore.org> Author: Prakash Surya <prakash.surya@delphix.com> illumos/illumos-gate@2fd872a734cf486007a8dba532cec52bfb4d40e5 As a way to make it more difficult to introduce bugs into the ARC, and to make it easier to diagnose issues when bugs do creep in, it would be beneficial to change the type of the arc_state_t's arcs_size field to be a refcount_t instead of a uint64_t. This would allow us to make stricter checks when incrementing and decrementing the value with debugging enabled, but still fallback to simple, fast atomic operations when debugging is disabled. Notes: svn path=/head/; revision=286766
* MFV r285025: 6033 arc_adjust() should search MFU lists for oldest bufferAlexander Motin2015-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | | when adjusting MFU size. illumos/illumos-gate@31c46cf23cd1cf4d66390a983dc5072d7d299ba2 https://www.illumos.org/issues/6033 When we're looking for the list containing oldest buffer we never actually look at the MFU lists even when we try to evict from MFU. looks like a copy paste error, the fix is here: Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com> Reviewed by: Xin Li <delphij@delphij.net> Reviewed by: Prakash Surya <me@prakashsurya.com> Approved by: Matthew Ahrens <mahrens@delphix.com> Author: Alek Pinchuk <alek@nexenta.com> Obtained from: illumos Notes: svn path=/head/; revision=286764
* MFV r277431: 5497 lock contention on arcs_mtxAlexander Motin2015-08-148-638/+1625
| | | | | | | | | | | | | | | | | | | Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Richard Elling <richard.elling@richardelling.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: Prakash Surya <prakash.surya@delphix.com> illumos/illumos-gate@244781f10dcd82684fd8163c016540667842f203 This patch attempts to reduce lock contention on the current arc_state_t mutexes. These mutexes are used liberally to protect the number of LRU lists within the ARC (e.g. ARC_mru, ARC_mfu, etc). The granularity at which these locks are acquired has been shown to greatly affect the performance of highly concurrent, cached workloads. Notes: svn path=/head/; revision=286763
* Revert part of r205231, introducing multiple ARC state locks.Alexander Motin2015-08-141-278/+148
| | | | | | | | This local implementation will be replaced by one from Illumos to reduce code divergence and make further merges easier. Notes: svn path=/head/; revision=286762
* s/as/at/ in previous commit.Marcel Moolenaar2015-08-131-1/+1
| | | | | | | Pointed out by: jmallett@ Notes: svn path=/head/; revision=286741
* Remove arm64 workaround for Clang 3.4 crashEd Maste2015-08-131-1/+1
| | | | Notes: svn path=/head/; revision=286740
* Avoid left-shifting negative signed values in bxe(4).Dimitry Andric2015-08-131-3/+3
| | | | | | | | Reviewed by: davidcs MFC after: 3 days Notes: svn path=/head/; revision=286733
* Add a new PPS driver for AM335x (beaglebone) timer hardware. This can beIan Lepore2015-08-134-1/+560
| | | | | | | used as a module or compiled-in. Notes: svn path=/head/; revision=286728
* Change md(4) to use weak symbols as start, end and size for the embeddedMarcel Moolenaar2015-08-134-13/+73
| | | | | | | | | | | | | | | | | root disk. The embedded image is linked into the kernel in the .mfs section. Add rules and variables to kern.pre.mk and kern.post.mk that handle the linking of the image. First objcopy is used to generate an object file. Then, the object file is linked into the kernel. Submitted by: Steve Kiernan <stevek@juniper.net> Reviewed by: brooks@ Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D2903 Notes: svn path=/head/; revision=286727
* Instead of having separate do_sync functions for ARM_ARCH 6 vs.Marcel Moolenaar2015-08-131-8/+2
| | | | | | | | | | | ARM_ARCH >= 7, use the dmb() macro defined in machine/atomic.h Submitted by: Steve Kiernan <stevek@juniper.net> Reviewed by: imp@ Differential Revision: https://reviews.freebsd.org/D3355 Notes: svn path=/head/; revision=286726
* The Broadcom BCM56060 chip has a Cortex-A9R4 core.Marcel Moolenaar2015-08-133-0/+4
| | | | | | | | | Submitted by: Steve Kiernan <stevek@juniper.net> Reviewed by: imp@ Differential Revision: https://reviews.freebsd.org/D3357 Notes: svn path=/head/; revision=286725
* Constify the pointers to eventtimer and timecounter name strings.Ian Lepore2015-08-132-2/+2
| | | | | | | | | The need for this appears as soon as you try to set the names to something that isn't a "quoted literal". (I'm actually confused why quoted strings aren't a problem as well, we must have some warning disabled.) Notes: svn path=/head/; revision=286724
* Fix text mode operation.Marcel Moolenaar2015-08-132-4/+8
| | | | | | | | | | | | | | | | | | We first map 64KB at 0xA0000 and then determine whether to work in text or graphics mode. When graphics mode, the mapping is precisely what we need and everything is fine. But text mode, has the frame buffer relocated to 0xB8000. We didn't map that much to safely add 0x18000 bytes to the base address. Now we first check whether to work in text or graphics mode and then map the frame buffer at the right address and with the right size (0xA0000+64KB for graphics, 0xB8000+32KB for text). PR: 202276 Tested by: ed@ Notes: svn path=/head/; revision=286723
* Move lle update code from from gigantic ip_arpinput() toAlexander V. Chernikov2015-08-131-94/+167
| | | | | | | | | | | | separate bunch of functions. The goal is to isolate actual lle updates to permit more fine-grained locking. Do all lle link-level update under AFDATA wlock. Sponsored by: Yandex LLC Notes: svn path=/head/; revision=286722
* arm64: turn unknown el0 exception into a SIGILLEd Maste2015-08-131-0/+39
| | | | | | | | | | | | | It seems we get EXCP_UNKNOWN from QEMU when executing zeroed memory. Print a register dump here and signal illegal instruction. Also print a register dump for other invalid exceptions, before panic. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3370 Notes: svn path=/head/; revision=286721
* Use g_conf_printf_escaped() to escape illegal symbols in file name.Andrey V. Elsukov2015-08-131-3/+6
| | | | | | | | PR: 202289 MFC after: 1 week Notes: svn path=/head/; revision=286720
* Add missing cddl/contrib/opensolaris/uts/common/fs/zfs/bqueue.c thatPeter Wemm2015-08-131-0/+1
| | | | | | | | | was left out of r286705. Forgotten by: mav Notes: svn path=/head/; revision=286718
* MFV 286711: 6096 ZFS_SMB_ACL_RENAME needs to cleanup betterAlexander Motin2015-08-131-0/+1
| | | | | | | | | | | | Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Reviewed by: George Wilson <gwilson@zfsmail.com> Approved by: Robert Mustacchi <rm@joyent.com> illumos/illumos-gate@8f5190a540d64d2debee6664bbc740e4c38f5b7f Notes: svn path=/head/; revision=286712
* MFV 286709:Alexander Motin2015-08-131-2/+4
| | | | | | | | | | | | | | | 6093 zfsctl_shares_lookup should only VN_RELE() on zfs_zget() success Reviewed by: Gordon Ross <gwr@nexenta.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Dan McDonald <danmcd@omniti.com> illumos/illumos-gate@0f92170f1ec2737ee5a0e51b5f74093904811452 Notes: svn path=/head/; revision=286710
* MFV 286707: 5959 clean up per-dataset feature count codeAlexander Motin2015-08-128-153/+182
| | | | | | | | | | | | | | | | | | Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: George Wilson <george@delphix.com> Reviewed by: Alex Reece <alex@delphix.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Matthew Ahrens <mahrens@delphix.com> illumos/illumos-gate@ca0cc3918a1789fa839194af2a9245f801a06b1a A ZFS feature flags (large blocks) tracks its refcounts as the number of datasets that have ever used the feature. Several features of this type are planned to be added (new checksum functions). This code should be made common infrastructure rather than duplicating the code for each feature. Notes: svn path=/head/; revision=286708
* MFV r286704: 5960 zfs recv should prefetch indirect blocksAlexander Motin2015-08-1230-347/+1295
| | | | | | | | | | | | | | | | | | | 5925 zfs receive -o origin= Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Author: Paul Dagnelie <pcd@delphix.com> While running 'zfs recv' we noticed that every 128th 8K block required a read. We were seeing that restore_write() was calling dmu_tx_hold_write() and the indirect block was not cached. We should prefetch upcoming indirect blocks to avoid having to go to disk and blocking the restore_write(). Allow an incremental send stream to be received as a clone, even if the stream does not mark it as a clone. Notes: svn path=/head/; revision=286705
* Reinstate unify_tcp_port_space and associated code that was lost duringNavdeep Parhar2015-08-121-1/+49
| | | | | | | | | | | | | the last OFED update (r278886). iWARP on FreeBSD is properly integrated with the network stack and the iWARP drivers _never_ operate out of any private TCP port-space that is invisible to the kernel. Instead, an iWARP connection shows up as a TCP socket (which is what it is) fully visible to the kernel and standard tools like netstat, sockstat, etc. Notes: svn path=/head/; revision=286703
* If a specific timecounter has been chosen via sysctl, and a new timecounterIan Lepore2015-08-121-5/+13
| | | | | | | | | | | with higher quality registers (presumably in a module that has just been loaded), do not undo the user's choice by switching to the new timecounter. Document that behavior, and also the fact that there is no way to unregister a timecounter (and thus no way to unload a module containing one). Notes: svn path=/head/; revision=286701
* Make LAG LACP fast timeout tunable through IOCTL.Hiren Panchasara2015-08-124-1/+22
| | | | | | | | | | | Differential Revision: D3300 Submitted by: LN Sundararajan <lakshmi.n at msystechnologies> Reviewed by: wblock, smh, gnn, hiren, rpokala at panasas MFC after: 2 weeks Sponsored by: Panasas Notes: svn path=/head/; revision=286700
* When the wait*(2) syscalls wait for any process (P_ALL), they shouldMariusz Zaborski2015-08-121-0/+4
| | | | | | | | | | | ignore processes created with the pdfork(2) syscall. PR: 201054 Approved by: pjd (mentor) Discussed with: emaste, rwatson Notes: svn path=/head/; revision=286698
* Remove all dregs of the old PPS driver from this code, in preparation forIan Lepore2015-08-122-435/+165
| | | | | | | | | | | | | | | | | | | | | | | | redoing it as a separate driver. Now that each hardware timer is handled by a separate instance of the timer driver, it no longer makes sense to bundle the pps driver with the regular timecounter code. (When all 8 timers were handled by one driver there was no choice about this.) Split the hardware register definitions out to their own file, so that the new pps driver (coming in a separate commit later) can share them. With the PPS driver gone, the question of which hardware timer to use for what purpose becomes much easier (some instances can't do the PPS capture). Now we can just hardcore timer2 for eventtimer and timer3 for timecounter. This also now only instantiates devices for the 2 hardware timers actually used to implement eventtimer and timecounter. This is required so that other drivers can come along and attach to other hardware timers to provide other functionality. (In addition to PPS, this hardware can also do PWM stuff, general pulse width and frequency measurements, etc. Maybe some day we'll have drivers for those things.) Notes: svn path=/head/; revision=286696
* Remove a bogus printf that whines every time loading a driver moduleIan Lepore2015-08-121-2/+0
| | | | | | | triggers a fresh round of probing. Notes: svn path=/head/; revision=286693
* Add a MODULE_VERSION(), because other things MODULE_DEPEND() on this.Ian Lepore2015-08-121-0/+1
| | | | Notes: svn path=/head/; revision=286692
* MFV r284763: 5981 Deadlock in dmu_objset_find_dpAlexander Motin2015-08-125-4/+40
| | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@1d3f896f5469c69c1339890ec3d68e9feddb0343 https://www.illumos.org/issues/5981 When dmu_objset_find_dp gets called with a read lock held, it fans out the work to the task queue. Each task in turn acquires its own read lock before calling the callback. If during this process anyone tries to a acquire a write lock, it will stall all read lock requests.Thus the tasks will never finish, the read lock of the caller will never get freed and the write lock never acquired. deadlock. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Arne Jansen <jansen@webgods.de> Notes: svn path=/head/; revision=286689
* MFV r284762: 5269 zpool import slowAlexander Motin2015-08-1210-60/+239
| | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@12380e1e701fda28c9e9f32d01cafb54af279eb5 https://www.illumos.org/issues/5269 When importing a pool (at boot or with zpool import) with many filesystem, the process can take minutes. It doesn't matter whether the pool has been exported cleanly or uncleanly. The problem is that each dataset has its own log chain. On import, all datasets have to be checked if there are logs to replay. The idea is to speed up this process by paralellizing it. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: George Wilson <george@delphix.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Dan McDonald <danmcd@omniti.com> Author: Arne Jansen <jansen@webgods.de> Notes: svn path=/head/; revision=286686
* MFV r286682: 5765 add support for estimating send stream size withAlexander Motin2015-08-124-35/+130
| | | | | | | | | | | | | | | | lzc_send_space when source is a bookmark Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Christopher Siden <christopher.siden@delphix.com> Reviewed by: Steven Hartland <killing@multiplay.co.uk> Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com> Approved by: Albert Lee <trisk@nexenta.com> Author: Max Grossman <max.grossman@delphix.com> illumos/illumos-gate@643da460c8ca583e39ce053081754e24087f84c8 Notes: svn path=/head/; revision=286683
* Perform cleanups in response to D3307.Ed Schouten2015-08-121-0/+7
| | | | | | | | | | | | - Document the kern_kevent_anonymous() function. - Add assertions to ensure that we don't silently leave the kqueue linked from a file descriptor table. Reviewed by: jmg Differential Revision: https://reviews.freebsd.org/D3364 Notes: svn path=/head/; revision=286681
* Add the last remaining system calls: send() and recv().Ed Schouten2015-08-121-4/+100
| | | | | | | | | | | There is still one TODO item for these calls: add file descriptor passing. The data structures are already prepared for this. It's just the translation that's missing. Obtained from: http://github.com/NuxiNL/freebsd Notes: svn path=/head/; revision=286680
* Add a routine to return the hardware instance/unit number from ti,hwmods,Ian Lepore2015-08-122-0/+35
| | | | | | | | | | | | given the hardware name. The ti,hwmods property is used (among other things) to associate an fdt node with a specific instance of some hardware. For example given a device node that contains the property ti,hwmods = "timer3", if you call this passing "timer" as the hwmod string to look for it would return 3. Notes: svn path=/head/; revision=286678
* MFV r286224: 5695 dmu_sync'ed holes do not retain birth timeAlexander Motin2015-08-122-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@70163ac57e58ace1c5c94dfbe85dca5a974eff36 https://www.illumos.org/issues/5695 In dmu_sync_ready(), a hole block pointer will have it's logical size explicitly set as it's necessary for replay purposes. To "undo" this, dmu_sync_done() will zero out any hole that it finds. This becomes a problem when using the "hole_birth" feature, as this will also wipe out any birth time that might have happened to be set on the hole. ... As a fix, the logic to zero out a hole is only applied to old style holes with a birth time of zero. Holes created with the "hole_birth" feature enabled will have a non-zero birth time, and will be skipped (thus preserving the ltime, type, and level information as well). In addition, zdb was updated to also print the ltime, type, and level information for these new style holes. Previously, only the logical birth time would be printed. Author: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: George Wilson <george@delphix.com> Reviewed by: Christopher Siden <christopher.siden@delphix.com> Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com> Notes: svn path=/head/; revision=286677
* Add the CNTHCTL_EL2 register bits missed in r286674Andrew Turner2015-08-121-0/+7
| | | | Notes: svn path=/head/; revision=286675
* Set the counter-timer virtual offset to a know value, it may not have beenAndrew Turner2015-08-121-0/+8
| | | | | | | | | | set by the boot code and are reset to an implementation defined value that may be unknown. Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=286674
* Crunchgen needs to be bootstrapped to pick up the STRIP->STRIPBINWarner Losh2015-08-121-1/+1
| | | | | | | | | | | changes to prevent the 'rescue: not found' errors from happening. Bump FreeBSD_version to 1100078 since there's been no version bumps since this change was made. Only people that installed since r284356 really need to do this bootstrapping, but since crunchgen needs to bootstrap for other reasons, bumping the number was the simplest. Notes: svn path=/head/; revision=286672
* Properly return ENOTDIR when calling *at() on a non-vnode.Ed Schouten2015-08-121-0/+2
| | | | | | | | | We already properly return ENOTDIR when calling *at() on a non-directory vnode, but it turns out that if you call it on a socket, we see EINVAL. Patch up namei to properly translate this to ENOTDIR. Notes: svn path=/head/; revision=286670
* Remove unused TCPTV_SRTTDFLT. We initialize srtt with TCPTV_SRTTBASE when weHiren Panchasara2015-08-121-1/+0
| | | | | | | | | | don't have any rtt estimate. Differential Revision: D3334 Sponsored by: Limelight Networks Notes: svn path=/head/; revision=286669
* Add support for the Broadcom TruManage integrated serial port.Marcel Moolenaar2015-08-121-0/+2
| | | | | | | PR: 191266 Notes: svn path=/head/; revision=286668
* Better support memory mapped console devices, such as VGA and EFIMarcel Moolenaar2015-08-1210-145/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | frame buffers and memory mapped UARTs. 1. Delay calling cninit() until after pmap_bootstrap(). This makes sure we have PMAP initialized enough to add translations. Keep kdb_init() after cninit() so that we have console when we need to break into the debugger on boot. 2. Unfortunately, the ATPIC code had be moved as well so as to avoid a spurious trap #30. The reason for which is not known at this time. 3. In pmap_mapdev_attr(), when we need to map a device prior to the VM system being initialized, use virtual_avail as the KVA to map the device at. In particular, avoid using the direct map on amd64 because we can't demote by virtue of not being able to allocate yet. Keep track of the translation. Re-use the translation after the VM has been initialized to not waste KVA and to satisfy the assumption in uart(4) that the handle returned for the low-level console is the same as later returned when the device is probed and attached. 4. In pmap_unmapdev() remove the mapping from the table when called pre-init. Otherwise keep the mapping. During bus probe and attach device resources are mapped and unmapped multiple times, which would have us destroy the mapping used by the low-level console. 5. In pmap_init(), set pmap_initialized to signal that we're not pre-init anymore. On amd64, bring the direct map in sync with the translations created at that time. 6. Implement bus_space_map() and bus_space_unmap() for real: when the tag corresponds to memory space, call the corresponding pmap_mapdev() and pmap_unmapdev() functions to construct and actual handle. 7. In efifb.c and vt_vga.c, remove the crutches and hacks and simply call pmap_mapdev_attr() or bus_space_map() as desired. Notes: 1. uart(4) already used bus_space_map() during low-level console setup but since serial ports have traditionally been I/O port based, the lack of a proper implementation for said function was not a problem. It has always supported memory mapped UARTs for low-level consoles by setting hw.uart.console accordingly. 2. The use of the direct map on amd64 without setting caching attributes has been a bigger problem than previously thought. This change has the fortunate (and unexpected) side-effect of fixing various EFI frame buffer problems (though not all). PR: 191564, 194952 Special thanks to: 1. XipLink, Inc -- generously donated an Intel Bay Trail E3800 based eval board (ADLE3800PC). 2. The FreeBSD Foundation, in particular emaste@ -- for UEFI support in general and testing. 3. Everyone who tested the proposed for PR 191564. 4. jhb@ and kib@ for being a soundboard and applying a clue bat if so needed. Notes: svn path=/head/; revision=286667
* Unignore signals when starting CloudABI processes.Ed Schouten2015-08-121-0/+19
| | | | | | | | | | | | | | | | | | As CloudABI processes cannot adjust their signal handlers, we need to make sure that we start up CloudABI processes with consistent signal masks. Though the POSIx standard signal behavior is all right, we do need to make sure that we ignore SIGPIPE, as it would otherwise be hard to interact with pipes and sockets. Extend execsigs() to iterate over ps_sigignore and call sigdflt() for each of the ignored signals. Reviewed by: kib Obtained from: https://github.com/NuxiNL/freebsd Differential Revision: https://reviews.freebsd.org/D3365 Notes: svn path=/head/; revision=286662
* Use CAP_EVENT instead of CAP_PDWAIT.Ed Schouten2015-08-122-3/+4
| | | | | | | | | | | The cloudlibc pdwait() function ends up using FreeBSD's kqueue() in combination with EVFILT_PROCDESC. This depends on CAP_EVENT -- not CAP_PDWAIT. Obtained from: https://github.com/NuxiNL/freebsd Notes: svn path=/head/; revision=286661
* In x2APIC mode, IPI generation is atomic because it is performed byKonstantin Belousov2015-08-121-3/+5
| | | | | | | | | | | | | | | | | | single ICR MSR write. This is in contrast with the xAPIC mode, where we must read current ICR value, do bit fiddling and perform two 32-bit register writes. As a consequence, there is no need to disable interrupts around ICR value calculation and write. Note that typical users of ipi_raw() and ipi_vectored() take spinlock, which already disables interrupts. For them, the change removes unneeded CLI and POPFL/Q instructions. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=286659
* Initialization of smp_tlb_wait does not require release semantic, noKonstantin Belousov2015-08-122-2/+2
| | | | | | | | | | | | | | data is synchronized by store/load to the variable. The lapic_write_icr() function ensures that store buffers are flushed before IPI command is issued. Discussed with: bde Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=286658
* AP should load aps_ready with acquire semantic to see BSP updates toKonstantin Belousov2015-08-122-2/+2
| | | | | | | | | | | | | | | | the SMP structures, synchronized with the load by release store in release_aps(). The change is formal, x86 strong memory model implicitely provided the guarantees. Discussed with: bde Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=286657
* Make blocking CloudABI futex operations work.Ed Schouten2015-08-121-0/+121
| | | | | | | | | | | | | | | | | | | Blocking on locks and condition variables can be accomplished by polling and using the special filters CONDVAR, LOCK_RDLOCK and LOCK_WRLOCK. For now it wouldn't make sense to implement this functionality into kqueue() itself, for the reason that they are CloudABI specific and would require us to resize 'struct kevent' to hold all of the parameters of interest. Add a bandaid to the CloudABI poll system call to call into the futex code directly if it detects specific combinations of events that are used by the C library. Obtained from: https://github.com/NuxiNL/freebsd Notes: svn path=/head/; revision=286656
* Fix set of sign extension bugs in r286625.Alexander Motin2015-08-121-4/+5
| | | | Notes: svn path=/head/; revision=286655
* Make poll() and kqueue() on CloudABI work.Ed Schouten2015-08-121-4/+242
| | | | | | | | | | | | | | | | | | | | | This change implements two functions, cloudabi64_kevent_copyin() and cloudabi64_kevent_copyout(), that convert CloudABI structures to FreeBSD's struct kevent. CloudABI uses two structures: subscription_t and event_t. The former is used for input, whereas the latter is used for output. Unlike struct kevent, fields aren't overloaded for multiple purposes or for separate event types. For poll() we call into the newly introduced kern_kevent_anonymous() function that allows us to poll without a file descriptor. This function is not only used by poll(), but also by functions such as sleep() and clock_nanosleep(). Reviewed by: jmg Obtained from: https://github.com/NuxiNL/freebsd Differential Revision: https://reviews.freebsd.org/D3308 Notes: svn path=/head/; revision=286654