summaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/asm
Commit message (Collapse)AuthorAgeFilesLines
* Allow LinuxKPI types to be used in bootloaders, by checking for theHans Petter Selasky2020-11-181-2/+2
| | | | | | | | | | | | _STANDALONE definition. No functional change intended. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367789
* compat: clean up empty lines in .c and .h filesMateusz Guzik2020-09-013-3/+0
| | | | Notes: svn path=/head/; revision=365080
* Implement the atomic fetch add unless functions for the LinuxKPI.Hans Petter Selasky2020-04-203-0/+42
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=360127
* LinuxKPI: Add atomic_long_sub macro.Johannes Lundberg2019-06-211-0/+1
| | | | | | | | | | Reviewed by: imp (mentor), hps Approved by: imp (mentor), hps MFC after: 1 week Differential Revision: D20718 Notes: svn path=/head/; revision=349276
* LinuxKPI: Update user_access_begin for Linux v5.0.Johannes Lundberg2019-05-151-0/+4
| | | | | | | | | | | | Check the new LINUXKPI_VERSION macro for backwards compatibility. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Notes: svn path=/head/; revision=347620
* Remove no longer needed ifdefs in the LinuxKPI, after r341787.Hans Petter Selasky2018-12-102-16/+0
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D18450 Reviewed by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341789
* Fix some build of LinuxKPI on some platforms after r341518.Hans Petter Selasky2018-12-051-0/+8
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341591
* Use atomic_fcmpset_XXX() instead of atomic_cmpset_XXX() when possibleHans Petter Selasky2018-08-093-27/+17
| | | | | | | | | | | in the LinuxKPI. Suggested by: mjg @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=337527
* Update the list of architectures having atomic_fcmpset_{8,16,64}(9) andMarius Strobl2018-08-072-9/+7
| | | | | | | atomic_swap_{64,int}(9) respectively as of r337433. Notes: svn path=/head/; revision=337434
* Implement atomic_long_cmpxchg() function in the LinuxKPI.Hans Petter Selasky2018-08-061-0/+15
| | | | | | | | | Submitted by: Johannes Lundberg <johalun0@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=337374
* Don't refer to non-existing atomic functions, even though not compiled,Hans Petter Selasky2018-08-011-5/+38
| | | | | | | | | | | in the LinuxKPI. Found by: rpolka @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=337056
* Implement the user_access_begin(), user_access_end(), usafe_get_user() andHans Petter Selasky2018-06-111-0/+13
| | | | | | | | | | | | unsafe_put_user() function macros in the LinuxKPI. Submitted by: Johannes Lundberg <johalun0@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Notes: svn path=/head/; revision=334953
* Rewrite code using atomic_fcmpset_int() in the LinuxKPI.Hans Petter Selasky2018-06-061-6/+7
| | | | | | | | | | Suggested by: mjg@ MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Notes: svn path=/head/; revision=334718
* Implement the atomic_dec_if_positive() function in the LinuxKPI.Hans Petter Selasky2018-06-061-0/+16
| | | | | | | | | | Submitted by: Johannes Lundberg <johalun0@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Notes: svn path=/head/; revision=334712
* Implement the rdmsrl_safe() function macro in the LinuxKPI.Hans Petter Selasky2018-06-061-0/+1
| | | | | | | | | | Submitted by: Johannes Lundberg <johalun0@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Notes: svn path=/head/; revision=334710
* Fix the definitions of get_cpu() and put_cpu().Mark Johnston2018-04-051-2/+2
| | | | | | | | | | They are supposed to disable preemption. Reported by: rstone MFC after: 5 days Notes: svn path=/head/; revision=332079
* linuxkpi whitespace cleanupEd Maste2018-03-231-1/+1
| | | | | | | | | Reviewed by: hselasky, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14807 Notes: svn path=/head/; revision=331433
* Optimise xchg() to use atomic_swap_32() and atomic_swap_64().Hans Petter Selasky2018-02-181-7/+7
| | | | | | | | | Suggested by: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329524
* Fix implementation of xchg() function macro in the LinuxKPI.Hans Petter Selasky2018-02-181-6/+35
| | | | | | | | | | The exchange operation must be atomic. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329523
* Compile fix for GCC in the LinuxKPI.Hans Petter Selasky2018-02-171-4/+4
| | | | | | | | | | | | Older versions of GCC don't allow flexible array members in a union. Use a zero length array instead. MFC after: 1 week Reported by: jbeich@ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329447
* Allow the cmpxchg() macro in the LinuxKPI to work on pointers withoutHans Petter Selasky2018-02-161-30/+35
| | | | | | | | | | generating compiler warnings, -Wint-conversion . Requested by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=329371
* The LinuxKPI atomics do not have acquire nor release semantics unlessHans Petter Selasky2017-09-183-16/+15
| | | | | | | | | | | specified. Fix code to use READ_ONCE() and WRITE_ONCE() where appropriate. Suggested by: kib @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=323705
* Add a couple of trivial headers to the LinuxKPI.Mark Johnston2017-08-201-0/+36
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=322713
* Add more #ifdef arch checks to the linuxkpiJustin Hibbits2017-06-072-2/+4
| | | | | | | | | | | | arm, mips, and powerpc all implement pmap_mapdev_attr() and pmap_unmapdev(), so add those archs to the checks. powerpc also includes the atomic_swap_*() functions, so add that to the supported list as well. Not tested except by compiling powerpc. Reviewed by: markj Notes: svn path=/head/; revision=319656
* Add get_cpu() and put_cpu().Mark Johnston2017-05-211-0/+8
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=318590
* Add on_each_cpu() and wbinvd_on_all_cpus().Mark Johnston2017-05-011-0/+40
| | | | | | | | | Reviewed by: hselasky MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10550 Notes: svn path=/head/; revision=317651
* Implement a series of physical page management related functions inHans Petter Selasky2017-03-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | the LinuxKPI for accessing user-space memory in the kernel. Add functions to hold and wire physical page(s) based on a given range of user-space virtual addresses. Add functions to get and put a reference on, wire, hold, mark accessed, copy and dirty a physical page. Add new VM related structures and defines as a preparation step for advancing the memory map capabilities of the LinuxKPI. Add function to figure out if a virtual address was allocated using malloc(). Add function to convert a virtual kernel address into its physical page pointer. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=316033
* Function macros are preferred in the LinuxKPI.Hans Petter Selasky2017-03-231-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=315859
* Extend cmpxchg() to support 8- and 16-bit values, and add xchg().Mark Johnston2017-03-221-22/+40
| | | | | | | | | | These are needed to support updated revisions of the DRM code. Reviewed by: hselasky (previous version) MFC after: 2 weeks Notes: svn path=/head/; revision=315719
* Implement more LinuxKPI atomic functions and macros.Hans Petter Selasky2017-02-163-0/+32
| | | | | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=313808
* Allow passing a constant atomic_t to atomic_read().Hans Petter Selasky2017-02-161-2/+2
| | | | | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=313807
* Define ATOMIC_LONG_INIT() in the LinuxKPI.Hans Petter Selasky2016-05-261-0/+2
| | | | | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=300725
* Implement "atomic_long_add_unless()" in the LinuxKPI and fix theHans Petter Selasky2016-05-231-1/+16
| | | | | | | | | | | implementation of "atomic_long_inc_not_zero()". Found by: ngie @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=300517
* Define more copy to/from userspace functions in the LinuxKPI.Hans Petter Selasky2016-05-231-0/+3
| | | | | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=300502
* Add support for atomic_long_inc_not_zero() to the LinuxKPI.Hans Petter Selasky2016-05-231-0/+1
| | | | | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=300491
* Add more PAGE related defines to the LinuxKPI. Move the definition ofHans Petter Selasky2016-05-131-1/+1
| | | | | | | | | | | "pgprot_t" to "linux/page.h" similar to what Linux does. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=299673
* Fix handling of IOCTLs in the LinuxKPI.Hans Petter Selasky2016-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=299530
* Add more atomic LinuxKPI functions.Hans Petter Selasky2016-05-112-0/+118
| | | | | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=299415
* Use function macros when possible to avoid stray substitutions.Hans Petter Selasky2016-05-101-17/+17
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=299363
* Add missing semicolon and properly wrap macro argument.Hans Petter Selasky2016-05-101-12/+12
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=299361
* Allow the argument for the cpu_to_xxxp() and xxx_to_cpup() macros toHans Petter Selasky2016-05-101-12/+12
| | | | | | | | | | | point to a constant. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=299360
* Update and add various macros to the LinuxKPI and resolve a macroHans Petter Selasky2016-01-261-0/+2
| | | | | | | | | | | redefinition issue in the cxgb driver. MFC after: 1 week Sponsored by: Mellanox Technologies Reviewed by: np @ Notes: svn path=/head/; revision=294839
* Implement 64-bit atomic operations for the LinuxKPI.Hans Petter Selasky2016-01-211-0/+104
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=294521
* LinuxKPI atomic fixes:Hans Petter Selasky2016-01-212-22/+22
| | | | | | | | | | | | | | | - Fix implementation of atomic_add_unless(). The atomic_cmpset_int() function returns a boolean and not the previous value of the atomic variable. - The atomic counters should be signed according to Linux. - Some minor cosmetics and styling while at it. Reviewed by: alfred @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=294520
* Make all the LinuxKPI include files compile standalone.Hans Petter Selasky2015-11-032-1/+3
| | | | | | | Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=290335
* Finish process of moving the LinuxKPI module into the default kernel build.Hans Petter Selasky2015-10-298-0/+505
- Move all files related to the LinuxKPI into sys/compat/linuxkpi and its subfolders. - Update sys/conf/files and some Makefiles to use new file locations. - Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn adds the LinuxKPI to all LINT builds. - The LinuxKPI can be added to the kernel by setting the COMPAT_LINUXKPI option. The OFED kernel option no longer builds the LinuxKPI into the kernel. This was done to keep the build rules for the LinuxKPI in sys/conf/files simple. - Extend the LinuxKPI module to include support for USB by moving the Linux USB compat from usb.ko to linuxkpi.ko. - Bump the FreeBSD_version. - A universe kernel build has been done. Reviewed by: np @ (cxgb and cxgbe related changes only) Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=290135