aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/cloudabi
Commit message (Collapse)AuthorAgeFilesLines
* Drop cloudabiKonstantin Belousov2021-09-2114-3545/+0
| | | | | | | | | | | | | According to https://github.com/NuxiNL/cloudlibc: CloudABI is no longer being maintained. It was an awesome experiment, but it never got enough traction to be sustainable. There is no reason to keep it in FreeBSD. Approved by: ed (private mail) Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D31923
* umtx: Split umtx.h on two counterparts.Dmitry Chagin2021-07-291-1/+1
| | | | | | | | | | | | To prevent umtx.h polluting by future changes split it on two headers: umtx.h - ABI header for userspace; umtxvar.h - the kernel staff. While here fix umtx_key_match style. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D31248 MFC after: 2 weeks
* cloudabi and linux ABIs: do not call umtx_thread_cleanup() from thr_exit syscallKonstantin Belousov2021-07-071-3/+0
| | | | | | | | | | | These ABIs do not use umtx at all, so there is nothing to clean. Cloudabi references to umtx keys do not require any cleanups anyway. Requested by: dchagin Reviewed by: dchagin, markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D30987
* kern_linkat: modify to accept AT_ flags instead of FOLLOW/NOFOLLOWEdward Tomasz Napierala2021-04-251-1/+1
| | | | | | | | This makes this API match other kern_xxxat() functions. Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29776
* Rename kern_mmap_req to kern_mmapBrooks Davis2021-01-251-2/+8
| | | | | | | | | | | | Replace all uses of kern_mmap with kern_mmap_req move the old kern_mmap. Reand rename kern_mmap_req to kern_mmap . The helper saved some code churn initially, but having multiple interfaces is sub-optimal. Obtained from: CheriBSD Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28292
* Split out cwd/root/jail, cmask state from filedesc tableConrad Meyer2020-11-171-1/+1
| | | | | | | | | | | | | | | | No functional change intended. Tracking these structures separately for each proc enables future work to correctly emulate clone(2) in linux(4). __FreeBSD_version is bumped (to 1300130) for consumption by, e.g., lsof. Reviewed by: kib Discussed with: markj, mjg Differential Revision: https://reviews.freebsd.org/D27037 Notes: svn path=/head/; revision=367777
* Do not leak oldvmspace if image activation failedKonstantin Belousov2020-09-231-1/+1
| | | | | | | | | | | | | | | | and current address space is already destroyed, so kern_execve() terminates the process. While there, clean up some internals of post_execve() inlined in init_main. Reported by: Peter <pmc@citylink.dinoex.sub.org> Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26525 Notes: svn path=/head/; revision=366085
* vfs: track sequential reads and writes separatelyThomas Munro2020-06-211-1/+2
| | | | | | | | | | | | | | | | | | For software like PostgreSQL and SQLite that sometimes reads sequentially while also writing sequentially some distance behind with interleaved syscalls on the same fd, performance is better on UFS if we do sequential access heuristics separately for reads and writes. Patch originally by Andrew Gierth in 2008, updated and proposed by me with his permission. Reviewed by: mjg, kib, tmunro Approved by: mjg (mentor) Obtained from: Andrew Gierth <andrew@tao11.riddles.org.uk> Differential Revision: https://reviews.freebsd.org/D25024 Notes: svn path=/head/; revision=362460
* cloudabi: use new capsicum helpersMateusz Guzik2020-02-151-5/+5
| | | | Notes: svn path=/head/; revision=357955
* Add sys/systm.h to several places that use vm headers.Konstantin Belousov2020-02-041-1/+2
| | | | | | | | | | It is needed (but not enough) to use e.g. KASSERT() in inline functions. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=357512
* shm: correct KPI mistake introduced around memfd_createKyle Evans2020-01-051-1/+1
| | | | | | | | | | | | | | | | | When file sealing and shm_open2 were introduced, we should have grown a new kern_shm_open2 helper that did the brunt of the work with the new interface while kern_shm_open remains the same. Instead, more complexity was introduced to kern_shm_open to handle the additional features and consumers had to keep changing in somewhat awkward ways, and a kern_shm_open2 was added to wrap kern_shm_open. Backpedal on this and correct the situation- kern_shm_open returns to the interface it had prior to file sealing being introduced, and neither function needs an initial_seals argument anymore as it's handled in kern_shm_open2 based on the shmflags. Notes: svn path=/head/; revision=356372
* vfs: drop the mostly unused flags argument from VOP_UNLOCKMateusz Guzik2020-01-031-4/+4
| | | | | | | | | | | Filesystems which want to use it in limited capacity can employ the VOP_UNLOCK_FLAGS macro. Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D21427 Notes: svn path=/head/; revision=356337
* Fix the last few cases that grab without busy or valid. The grab functions mustJeff Roberson2019-12-021-2/+3
| | | | | | | | | | return the page in some held state for consistency elsewhere. Reviewed by: alc, kib, markj Differential Revision: https://reviews.freebsd.org/D22610 Notes: svn path=/head/; revision=355313
* [2/3] Add an initial seal argument to kern_shm_open()Kyle Evans2019-09-251-1/+2
| | | | | | | | | | | | | | | | | | | | | Now that flags may be set on posixshm, add an argument to kern_shm_open() for the initial seals. To maintain past behavior where callers of shm_open(2) are guaranteed to not have any seals applied to the fd they're given, apply F_SEAL_SEAL for existing callers of kern_shm_open. A special flag could be opened later for shm_open(2) to indicate that sealing should be allowed. We currently restrict initial seals to F_SEAL_SEAL. We cannot error out if F_SEAL_SEAL is re-applied, as this would easily break shm_open() twice to a shmfd that already existed. A note's been added about the assumptions we've made here as a hint towards anyone wanting to allow other seals to be applied at creation. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D21392 Notes: svn path=/head/; revision=352697
* kern_shm_open: push O_CLOEXEC into caller controlKyle Evans2019-07-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The motivation for this change is to allow wrappers around shm to be written that don't set CLOEXEC. kern_shm_open currently accepts O_CLOEXEC but sets it unconditionally. kern_shm_open is used by the shm_open(2) syscall, which is mandated by POSIX to set CLOEXEC, and CloudABI's sys_fd_create1(). Presumably O_CLOEXEC is intended in the latter caller, but it's unclear from the context. sys_shm_open() now unconditionally sets O_CLOEXEC to meet POSIX requirements, and a comment has been dropped in to kern_fd_open() to explain the situation and add a pointer to where O_CLOEXEC setting is maintained for shm_open(2) correctness. CloudABI's sys_fd_create1() also unconditionally sets O_CLOEXEC to match previous behavior. This also has the side-effect of making flags correctly reflect the O_CLOEXEC status on this fd for the rest of kern_shm_open(), but a glance-over leads me to believe that it didn't really matter. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21119 Notes: svn path=/head/; revision=350464
* Introduce funlinkat syscall that always us to check if we are removingMariusz Zaborski2019-04-061-2/+4
| | | | | | | | | | | | the file associated with the given file descriptor. Reviewed by: kib, asomers Reviewed by: cem, jilles, brooks (they reviewed previous version) Discussed with: pjd, and many others Differential Revision: https://reviews.freebsd.org/D14567 Notes: svn path=/head/; revision=345982
* Create new EINTEGRITY error with message "Integrity check failed".Kirk McKusick2019-01-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | An integrity check such as a check-hash or a cross-correlation failed. The integrity error falls between EINVAL that identifies errors in parameters to a system call and EIO that identifies errors with the underlying storage media. EINTEGRITY is typically raised by intermediate kernel layers such as a filesystem or an in-kernel GEOM subsystem when they detect inconsistencies. Uses include allowing the mount(8) command to return a different exit value to automate the running of fsck(8) during a system boot. These changes make no use of the new error, they just add it. Later commits will be made for the use of the new error number and it will be added to additional manual pages as appropriate. Reviewed by: gnn, dim, brueffer, imp Discussed with: kib, cem, emaste, ed, jilles Differential Revision: https://reviews.freebsd.org/D18765 Notes: svn path=/head/; revision=343111
* Implement O_BENEATH and AT_BENEATH.Konstantin Belousov2018-10-251-2/+2
| | | | | | | | | | | | | | Flags prevent open(2) and *at(2) vfs syscalls name lookup from escaping the starting directory. Supposedly the interface is similar to the same proposed Linux flags. Reviewed by: jilles (code, previous version of manpages), 0mp (manpages) Discussed with: allanjude, emaste, jonathan Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D17547 Notes: svn path=/head/; revision=339748
* Improve handling of control message truncation.Mark Johnston2018-08-071-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a recvmsg(2) or recvmmsg(2) caller doesn't provide sufficient space for all control messages, the kernel sets MSG_CTRUNC in the message flags to indicate truncation of the control messages. In the case of SCM_RIGHTS messages, however, we were failing to dispose of the rights that had already been externalized into the recipient's file descriptor table. Add a new function and mbuf type to handle this cleanup task, and use it any time we fail to copy control messages out to the recipient. To simplify cleanup, control message truncation is now only performed at control message boundaries. The change also fixes a few related bugs: - Rights could be leaked to the recipient process if an error occurred while copying out a message's contents. - We failed to set MSG_CTRUNC if the truncation occurred on a control message boundary, e.g., if the caller received two control messages and provided only the exact amount of buffer space needed for the first. PR: 131876 Reviewed by: ed (previous version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16561 Notes: svn path=/head/; revision=337423
* Eliminate the overhead of gratuitous repeated reinitialization of cap_rightsMatt Macy2018-05-091-4/+2
| | | | | | | | | | | | | | | - Add macros to allow preinitialization of cap_rights_t. - Convert most commonly used code paths to use preinitialized cap_rights_t. A 3.6% speedup in fstat was measured with this change. Reported by: mjg Reviewed by: oshogbo Approved by: sbruno MFC after: 1 month Notes: svn path=/head/; revision=333425
* sys/cloudabi: Avoid relying on GNU specific extensionsEitan Adler2018-03-071-1/+1
| | | | | | | | | An empty initializer list is not technically valid C grammar. MFC After: 1 week Notes: svn path=/head/; revision=330602
* sys/linux: Fix a few potential infoleaks in cloudabiEitan Adler2018-03-031-0/+4
| | | | | | | | | Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com> MFC After: 1 month Sponsored by: DARPA/AFRL Notes: svn path=/head/; revision=330359
* Allow timed waits with relative timeouts on locks and condvars.Ed Schouten2018-01-042-23/+26
| | | | | | | | | | | | | | | | Even though pthreads doesn't support this, there are various alternative APIs that use this. For example, uv_cond_timedwait() accepts a relative timeout. So does Rust's std::sync::Condvar::wait_timeout(). Though I personally think that relative timeouts are bad (due to imprecision for repeated operations), it does seem that people want this. Extend the existing futex functions to keep track of whether an absolute timeout is used in a boolean flag. MFC after: 1 month Notes: svn path=/head/; revision=327560
* Import the latest CloudABI definitions, version 0.16.Ed Schouten2017-10-181-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | The most important change in this release is the removal of the poll_fd() system call; CloudABI's equivalent of kevent(). Though I think that kqueue is a lot saner than many of its alternatives, our experience is that emulating this system call on other systems accurately isn't easy. It has become a complex API, even though I'm not convinced this complexity is needed. This is why we've decided to take a different approach, by looking one layer up. We're currently adding an event loop to CloudABI's C library that is API compatible with libuv (except when incompatible with Capsicum). Initially, this event loop will be built on top of plain inefficient poll() calls. Only after this is finished, we'll work our way backwards and design a new set of system calls to optimize it. Interesting challenges will include integrating asynchronous I/O into such a system call API. libuv currently doesn't aio(4) on Linux/BSD, due to it being unreliable and having undesired semantics. Obtained from: https://github.com/NuxiNL/cloudabi Notes: svn path=/head/; revision=324727
* Merge pipes and socket pairs.Ed Schouten2017-09-052-36/+9
| | | | | | | | | | | | | | | Now that CloudABI's sockets API has been changed to be addressless and only connected socket instances are used (e.g., socket pairs), they have become fairly similar to pipes. The only differences on CloudABI is that socket pairs additionally support shutdown(), send() and recv(). To simplify the ABI, we've therefore decided to remove pipes as a separate file descriptor type and just let pipe() return a socket pair of type SOCK_STREAM. S_ISFIFO() and S_ISSOCK() are now defined identically. Notes: svn path=/head/; revision=323177
* Complete the CloudABI networking refactoring.Ed Schouten2017-08-302-45/+1
| | | | | | | | | | | | | | Now that all of the packaged software has been adjusted to either use Flower (https://github.com/NuxiNL/flower) for making incoming/outgoing network connections or can have connections injected, there is no longer need to keep accept() around. It is now a lot easier to write networked services that are address family independent, dual-stack, testable, etc. Remove all of the bits related to accept(), but also to getsockopt(SO_ACCEPTCONN). Notes: svn path=/head/; revision=323015
* Sync CloudABI compatibility against the latest upstream version (v0.13).Ed Schouten2017-08-252-79/+2
| | | | | | | | | | | | | | | | | | | With Flower (CloudABI's network connection daemon) becoming more complete, there is no longer any need for creating any unconnected sockets. Socket pairs in combination with file descriptor passing is all that is necessary, as that is what is used by Flower to pass network connections from the public internet to listening processes. Remove all of the kernel bits that were used to implement socket(), listen(), bindat() and connectat(). In principle, accept() and SO_ACCEPTCONN may also be removed, but there are still some consumers left. Obtained from: https://github.com/NuxiNL/cloudabi MFC after: 1 month Notes: svn path=/head/; revision=322885
* Upgrade to the latest sources generated from the CloudABI specification.Ed Schouten2017-07-264-126/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CloudABI specification has had some minor changes over the last half year. No substantial features have been added, but some features that are deemed unnecessary in retrospect have been removed: - mlock()/munlock(): These calls tend to be used for two different purposes: real-time support and handling of sensitive (cryptographic) material that shouldn't end up in swap. The former use case is out of scope for CloudABI. The latter may also be handled by encrypting swap. Removing this has the advantage that we no longer need to worry about having resource limits put in place. - SOCK_SEQPACKET: Support for SOCK_SEQPACKET is rather inconsistent across various operating systems. Some operating systems supported by CloudABI (e.g., macOS) don't support it at all. Considering that they are rarely used, remove support for the time being. - getsockname(), getpeername(), etc.: A shortcoming of the sockets API is that it doesn't allow you to create socket(pair)s, having fake socket addresses associated with them. This makes it harder to test applications or transparently forward (proxy) connections to them. With CloudABI, we're slowly moving networking connectivity into a separate daemon called Flower. In addition to passing around socket file descriptors, this daemon provides address information in the form of arbitrary string labels. There is thus no longer any need for requesting socket address information from the kernel itself. This change also updates consumers of the generated code accordingly. Even though system calls end up getting renumbered, this won't cause any problems in practice. CloudABI programs always call into the kernel through a kernel-supplied vDSO that has the numbers updated as well. Obtained from: https://github.com/NuxiNL/cloudabi Notes: svn path=/head/; revision=321514
* Include <sys/systm.h> to obtain the memcpy() prototype.Ed Schouten2017-03-241-0/+1
| | | | | | | | | | | | | I got a report of this source file not building on Raspberry Pi. It's interesting that this only fails for that target and not for others. Again, that's no reason not to include the right headers. PR: 217969 Reported by: Johannes Jost Meixner MFC after: 1 week Notes: svn path=/head/; revision=315892
* Make file descriptor passing for CloudABI's recvmsg() work.Ed Schouten2017-03-222-7/+81
| | | | | | | | | | | | Similar to the change for sendmsg(), create a pointer size independent implementation of recvmsg() and let cloudabi32 and cloudabi64 call into it. In case userspace requests one or more file descriptors, call kern_recvit() in such a way that we get the control message headers in an mbuf. Iterate over all of the headers and copy the file descriptors to userspace. Notes: svn path=/head/; revision=315736
* Make file descriptor passing work for CloudABI's sendmsg().Ed Schouten2017-03-222-0/+54
| | | | | | | | | | | | | Reduce the potential amount of code duplication between cloudabi32 and cloudabi64 by creating a cloudabi_sock_recv() utility function. The cloudabi32 and cloudabi64 modules will then only contain code to convert the iovecs to the native pointer size. In cloudabi_sock_recv(), we can now construct an SCM_RIGHTS cmsghdr in an mbuf and pass that on to kern_sendit(). Notes: svn path=/head/; revision=315700
* Rework r313352.Konstantin Belousov2017-02-131-14/+14
| | | | | | | | | | | | | | | Rename kern_vm_* functions to kern_*. Move the prototypes to syscallsubr.h. Also change Mach VM types to uintptr_t/size_t as needed, to avoid headers pollution. Requested by: alc, jhb Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D9535 Notes: svn path=/head/; revision=313696
* Add kern_vm_mmap2(), kern_vm_mprotect(), kern_vm_msync(), kern_vm_munlock(),Edward Tomasz Napierala2017-02-061-54/+34
| | | | | | | | | | | | | kern_vm_munmap(), and kern_vm_madvise(), and use them in various compats instead of their sys_*() counterparts. Reviewed by: ed, dchagin, kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9378 Notes: svn path=/head/; revision=313352
* Add kern_listen(), kern_shutdown(), and kern_socket(), and use themEdward Tomasz Napierala2017-01-302-22/+9
| | | | | | | | | | | | | instead of their sys_*() counterparts in various compats. The svr4 is left untouched, because there's no point. Reviewed by: ed@, kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9367 Notes: svn path=/head/; revision=312988
* Add kern_lseek() and use it instead of sys_lseek() in various compats.Edward Tomasz Napierala2017-01-301-8/+5
| | | | | | | | | | | | I didn't touch svr4/, there's no point. Reviewed by: ed@, kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9366 Notes: svn path=/head/; revision=312987
* Revert crap accidentally committedBaptiste Daroussin2017-01-281-1/+0
| | | | Notes: svn path=/head/; revision=312927
* Revert r312923 a better approach will be taken laterBaptiste Daroussin2017-01-281-0/+1
| | | | Notes: svn path=/head/; revision=312926
* Catch up with changes to structure member names.Ed Schouten2017-01-175-33/+33
| | | | | | | Pointer/length pairs are now always named ${name} and ${name}_len. Notes: svn path=/head/; revision=312355
* cloudabi: use fget_cap instead of hand-rolling capability readMateusz Guzik2016-09-231-22/+10
| | | | | | | | | This has a side effect of unbreaking the build after r306272. Discussed with: ed Notes: svn path=/head/; revision=306282
* capsicum: propagate rights on accept(2)Mariusz Zaborski2016-09-221-1/+1
| | | | | | | | | | | | | Descriptor returned by accept(2) should inherits capabilities rights from the listening socket. PR: 201052 Reviewed by: emaste, jonathan Discussed with: many Differential Revision: https://reviews.freebsd.org/D7724 Notes: svn path=/head/; revision=306174
* Move the linker script from cloudabi64/ to cloudabi/.Ed Schouten2016-08-211-0/+51
| | | | | | | | It turns out that it works perfectly fine for generating 32-bits vDSOs as well. While there, get rid of the extraneous .s file extension. Notes: svn path=/head/; revision=304557
* Use memcpy() to copy 64-bit timestamps into the syscall return values.Ed Schouten2016-08-211-2/+2
| | | | | | | | | | On 32-bit platforms, our 64-bit timestamps need to be split up across two registers. A simple assignment to td_retval[0] will cause the top 32 bits to get lost. By using memcpy(), we will automatically either use 1 or 2 registers depending on the size of register_t. Notes: svn path=/head/; revision=304555
* Import the new automatically generated system call table for CloudABI.Ed Schouten2016-08-191-8/+0
| | | | | | | | | | | | | | | | | | Now that we've switched over to using the vDSO on CloudABI, it becomes a lot easier for us to phase out old features. System call numbering is no longer something that's part of the ABI. It's fully based on names. As long as the numbering used by the kernel and the vDSO is consistent (which it always is), it's all right. Let's put this to the test by removing a system call (thread_tcb_set()) that's already unused for quite some time now, but was only left intact to serve as a placeholder. Sync in the new system call table that uses alphabetic sorting of system calls. Obtained from: https://github.com/NuxiNL/cloudabi Notes: svn path=/head/; revision=304478
* Eliminate use of sys_fsync() and sys_fdatasync().Ed Schouten2016-08-151-8/+2
| | | | | | | | | | Make the kern_fsync() function public, so that it can be used by other parts of the kernel. Fix up existing consumers to make use of it. Requested by: kib Notes: svn path=/head/; revision=304185
* Let CloudABI use fdatasync() as well.Ed Schouten2016-08-151-3/+2
| | | | | | | | Now that FreeBSD supports fdatasync() natively, we can tidy up CloudABI's equivalent system call to use that instead. Notes: svn path=/head/; revision=304182
* Provide the CloudABI vDSO to its executables.Ed Schouten2016-08-102-0/+93
| | | | | | | | | | | | | | | | | | | CloudABI executables already provide support for passing in vDSOs. This functionality is used by the emulator for OS X to inject system call handlers. On FreeBSD, we could use it to optimize calls to gettimeofday(), etc. Though I don't have any plans to optimize any system calls right now, let's go ahead and already pass in a vDSO. This will allow us to simplify the executables, as the traditional "syscall" shims can be removed entirely. It also means that we gain more flexibility with regards to adding and removing system calls. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D7438 Notes: svn path=/head/; revision=303941
* Add implementation of robust mutexes, hopefully close enough to theKonstantin Belousov2016-05-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013. A robust mutex is guaranteed to be cleared by the system upon either thread or process owner termination while the mutex is held. The next mutex locker is then notified about inconsistent mutex state and can execute (or abandon) corrective actions. The patch mostly consists of small changes here and there, adding neccessary checks for the inconsistent and abandoned conditions into existing paths. Additionally, the thread exit handler was extended to iterate over the userspace-maintained list of owned robust mutexes, unlocking and marking as terminated each of them. The list of owned robust mutexes cannot be maintained atomically synchronous with the mutex lock state (it is possible in kernel, but is too expensive). Instead, for the duration of lock or unlock operation, the current mutex is remembered in a special slot that is also checked by the kernel at thread termination. Kernel must be aware about the per-thread location of the heads of robust mutex lists and the current active mutex slot. When a thread touches a robust mutex for the first time, a new umtx op syscall is issued which informs about location of lists heads. The umtx sleep queues for PP and PI mutexes are split between non-robust and robust. Somewhat unrelated changes in the patch: 1. Style. 2. The fix for proper tdfind() call use in umtxq_sleep_pi() for shared pi mutexes. 3. Removal of the userspace struct pthread_mutex m_owner field. 4. The sysctl kern.ipc.umtx_vnode_persistent is added, which controls the lifetime of the shared mutex associated with a vnode' page. Reviewed by: jilles (previous version, supposedly the objection was fixed) Discussed with: brooks, Martin Simmons <martin@lispworks.com> (some aspects) Tested by: pho Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=300043
* Sync in the latest CloudABI system call definitions.Ed Schouten2016-03-312-14/+14
| | | | | | | | | | | | | | | | | Some time ago I made a change to merge together the memory scope definitions used by mmap (MAP_{PRIVATE,SHARED}) and lock objects (PTHREAD_PROCESS_{PRIVATE,SHARED}). Though that sounded pretty smart back then, it's backfiring. In the case of mmap it's used with other flags in a bitmask, but for locking it's an enumeration. As our plan is to automatically generate bindings for other languages, that looks a bit sloppy. Change all of the locking functions to use separate flags instead. Obtained from: https://github.com/NuxiNL/cloudabi Notes: svn path=/head/; revision=297468
* Replace the CloudABI system call table by a machine generated version.Ed Schouten2016-03-2412-76/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type definitions and constants that were used by COMPAT_CLOUDABI64 are a literal copy of some headers stored inside of CloudABI's C library, cloudlibc. What is annoying is that we can't make use of cloudlibc's system call list, as the format is completely different and doesn't provide enough information. It had to be synced in manually. We recently decided to solve this (and some other problems) by moving the ABI definitions into a separate file: https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt This file is processed by a pile of Python scripts to generate the header files like before, documentation (markdown), but in our case more importantly: a FreeBSD system call table. This change discards the old files in sys/contrib/cloudabi and replaces them by the latest copies, which requires some minor changes here and there. Because cloudabi.txt also enforces consistent names of the system call arguments, we have to patch up a small number of system call implementations to use the new argument names. The new header files can also be included directly in FreeBSD kernel space without needing any includes/defines, so we can now remove cloudabi_syscalldefs.h and cloudabi64_syscalldefs.h. Patch up the sources to include the definitions directly from sys/contrib/cloudabi instead. Notes: svn path=/head/; revision=297247
* Call cap_rights_init() properly.Ed Schouten2016-02-241-1/+1
| | | | | | | | Even though or'ing the individual rights works in this specific case, it may not work in general. Pass them in as varargs. Notes: svn path=/head/; revision=295965