summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for "cdev_add_ext()" to the LinuxKPI.hselasky2016-05-231-0/+12
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add more GFP related defines to the LinuxKPI.hselasky2016-05-231-0/+13
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add support for atomic_long_inc_not_zero() to the LinuxKPI.hselasky2016-05-231-0/+1
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add support for atomic_long_inc_not_zero() to the LinuxKPI.hselasky2016-05-231-1/+1
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Convert proto family in both directions. The linux and native values fordchagin2016-05-221-4/+12
| | | | | | | | local and inet are identical, but for inet6 values differ. PR: 155040 Reported by: Simon Walton MFC after: 2 week
* ndis(4): Undo unneeded workarounds in ndis' rand().pfg2016-05-221-2/+0
| | | | | | | | - Revert the change for seed(0) in r300384. I misunderstood the standard and while our random() implementation in libkern may be improved, it handles the seed(0) case fine. Pointed out by: bde, ache
* Add a missing errno translation for SO_ERROR optname.dchagin2016-05-221-2/+11
| | | | | | PR: 135458 Reported by: Stefan Schmidt @ stadtbuch.de MFC after: 1 week
* For future use move futex timeout code to the separate function anddchagin2016-05-221-41/+68
| | | | | | switch to the high resolution sbintime_t. MFC after: 1 week
* Due to lack the priority propagation feature replace sx by mutex. WIth thisdchagin2016-05-221-44/+77
| | | | | | commit NPTL tests are ends in 1 minute faster. MFC after: 1 week
* Add my copyright as I rewrote most of the futex code. Minor style(9) cleanupdchagin2016-05-221-3/+4
| | | | | | while here. MFC after: 1 week
* Minor style(9) cleanup, no functional changes.dchagin2016-05-221-117/+109
| | | | MFC after: 1 week
* ndis(4): adjustments for our random() specific implementation.pfg2016-05-221-1/+3
| | | | | | | | | - Revert r300377: The implementation claims to return a value within the range. [1] - Adjust the value for the case of a zero seed, whihc according to standards should be equivalent to a seed of value 1. Pointed out by: cem
* ndis(4): Avoid overflow.pfg2016-05-211-1/+1
| | | | | | | | This is a long standing problem: our random() function returns an unsigned integer but the rand provided by ndis(4) returns an int. Scale it down. MFC after: 2 weeks
* ndis(4): Better mimic the behavior of rand() on Windows.pfg2016-05-211-6/+3
| | | | | | | | | | | | | | | In ndis(4) we expose a rand() function that was constantly reseeding with a time depending function every time it was called. This essentially broke the reasoning behind seeding, and rendered srand() a no-op. Keep it simple, just use random() and srandom() as it's meant to work. It would have been tempting to just go for arc4random() but we want to mimic Microsoft, and we don't need crypto-grade randomness here. PR: 209616 MFC after: 2 weeks
* Add implementation of robust mutexes, hopefully close enough to thekib2016-05-172-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Only lock Giant when needed in the LinuxKPI.hselasky2016-05-161-6/+8
| | | | | | Suggested by: ngie @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement more Linux device related functions in the LinuxKPI. Whilehselasky2016-05-161-4/+118
| | | | | | | | | | | at it use NULL for some pointer checks. Bump the FreeBSD version to force recompilation of all kernel modules due to a structure size change. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Don't dereference parent pointer when it is NULL.hselasky2016-05-161-3/+3
| | | | | MFC after: 1 week Sponsored by: Mellanox Technologies
* Properly implement "cpu_has_clflush" macro.hselasky2016-05-162-1/+17
| | | | | | Suggested by: kib, jhb MFC after: 1 week Sponsored by: Mellanox Technologies
* Handle case of class being set, but not parent when callinghselasky2016-05-131-3/+7
| | | | | | | | device_register() in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add more PAGE related defines to the LinuxKPI. Move the definition ofhselasky2016-05-132-5/+22
| | | | | | | | "pgprot_t" to "linux/page.h" similar to what Linux does. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement "old_encode_dev()" for the LinuxKPI.hselasky2016-05-131-0/+6
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Define _IOC_SIZE() in the LinuxKPI.hselasky2016-05-131-1/+3
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add unlikely() statement to optimise the IS_ERR_VALUE() macro.hselasky2016-05-131-2/+4
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement nsecs_to_jiffies() in the LinuxKPI and while at ithselasky2016-05-131-13/+21
| | | | | | | | | | | | streamline the rest of the xxx_to_jiffies() functions to have a constant 64-bit argument and use identical range checks for the result. Specifically preserve msecs_to_jiffies(0) returning 0. See r282743 for further details. MFC after: 1 week Sponsored by: Mellanox Technologies
* Add more Linux defines. Improve some existing ones.hselasky2016-05-132-14/+100
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* The Linux error defines should all be positive, else frequently usedhselasky2016-05-131-2/+17
| | | | | | | | | error code checks might fail. ERESTART is in the BSD world defined as -1. While at it add more Linux error codes. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Fix handling of IOCTLs in the LinuxKPI.hselasky2016-05-124-20/+97
| | | | | | | | | | | | | | | | | | | | Linux requires that all IOCTL data resides in userspace. FreeBSD always moves the main IOCTL structure into a kernel buffer before invoking the IOCTL handler and then copies it back into userspace, before returning. Hide this difference in the "linux_copyin()" and "linux_copyout()" functions by remapping userspace addresses in the range from 0x10000 to 0x20000, to the kernel IOCTL data buffer. It is assumed that the userspace code, data and stack segments starts no lower than memory address 0x400000, which is also stated by "man 1 ld", which means any valid userspace pointer can be passed to regular LinuxKPI handled IOCTLs. Bump the FreeBSD version to force recompilation of all kernel modules. Discussed with: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Remove redundant "task_struct_set()".hselasky2016-05-121-2/+1
| | | | | | | This is done by the "linux_kthread_fn()". MFC after: 1 week Sponsored by: Mellanox Technologies
* Create a dummy "task_struct" on the stack which is returned byhselasky2016-05-123-23/+90
| | | | | | | | | | "current" inside all LinuxKPI file operation callbacks. The "current" is frequently used for various debug prints, printing the thread name and thread ID for example. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Match Linux behaviour and iterate the IDR tree unlocked. The caller ishselasky2016-05-111-6/+2
| | | | | | | responsible the IDR tree stays unmodified while iterating. MFC after: 1 week Sponsored by: Mellanox Technologies
* Return a proper error code instead of panicing when an I/O vectorhselasky2016-05-111-6/+6
| | | | | | | having the wrong number of entries is detected. MFC after: 1 week Sponsored by: Mellanox Technologies
* Add more IDR and IDA related functions to the LinuxKPI.hselasky2016-05-112-2/+179
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Factor out common code into "idr_find_layer_locked()" and fix invertedhselasky2016-05-111-24/+24
| | | | | | | | bitmap test for free entry in "idr_replace()". Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add missing destruction of mutex.hselasky2016-05-111-0/+1
| | | | | MFC after: 1 week Sponsored by: Mellanox Technologies
* Add more atomic LinuxKPI functions.hselasky2016-05-112-0/+118
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement ioremap_wt() and use that in the MEMREMAP_WT case for i386hselasky2016-05-101-1/+3
| | | | | | | | | and amd64. Suggested by: cem @ Discussed with: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add more LinuxKPI I/O functions.hselasky2016-05-101-1/+77
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Use function macros when possible to avoid stray substitutions.hselasky2016-05-101-17/+17
| | | | | MFC after: 1 week Sponsored by: Mellanox Technologies
* Add missing semicolon and properly wrap macro argument.hselasky2016-05-101-12/+12
| | | | | MFC after: 1 week Sponsored by: Mellanox Technologies
* Allow the argument for the cpu_to_xxxp() and xxx_to_cpup() macros tohselasky2016-05-101-12/+12
| | | | | | | | point to a constant. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Fix file polling bug.hselasky2016-05-091-1/+1
| | | | | | | | Ensure the actual poll result is returned by the "linux_file_poll()" function instead of zero which means no data is available. MFC after: 3 days Sponsored by: Mellanox Technologies
* sys/compat/linux*: spelling fixes.pfg2016-04-309-9/+9
| | | | | | Mostly on comments but there are some user-visible messages as well. MFC after: 2 weeks
* ndis: spelling fixes in comments.pfg2016-04-306-10/+10
| | | | No functional change.
* x86bios: spelling fix in a comment.pfg2016-04-301-1/+1
| | | | No functional change.
* x86bios_alloc(): Unsign a counter.pfg2016-04-291-1/+1
| | | | | | | The value can't even be signed so we can avoid the signed vs. unsigned comparison. Reviewed by: jkim
* ndis(4): it's rather unrealistic to expect a size_t here.pfg2016-04-281-1/+1
| | | | int was actually OK, and u_int is more than enough.
* ndis(4): unsign some indexes to prevent overflows.pfg2016-04-281-5/+5
| | | | | | | | | | The "len" parameter is uint32_t, indexing it with an int may end up in a signed integer overflow. strlen(3) returns an integer of size_t so the corresponding index should have that size. MFC after: 1 week
* osd(9): Change array pointer to array pointer type from void*cem2016-04-261-1/+1
| | | | | | | | | | | | | This is a minor follow-up to r297422, prompted by a Coverity warning. (It's not a real defect, just a code smell.) OSD slot array reservations are an array of pointers (void **) but were cast to void* and back unnecessarily. Keep the correct type from reservation to use. osd.9 is updated to match, along with a few trivial igor fixes. Reported by: Coverity CID: 1353811 Sponsored by: EMC / Isilon Storage Division
* sys: extend use of the howmany() macro when available.pfg2016-04-261-1/+1
| | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read.
OpenPOWER on IntegriCloud