Hans Petter Selasky
0df8bab666
Define asm macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-11-16 16:23:45 +00:00
Hans Petter Selasky
1799873e3a
Implement ktime_get_ts64() function macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-11-16 16:19:16 +00:00
Ben Widawsky
3d40cdf014
linuxkpi: Add GFP flags needed for ttm drivers
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Requested by: bwidawsk
MFC after: 3 days
Approved by: emaste (mentor)
2018-11-01 15:30:01 +00:00
Hans Petter Selasky
e35079db73
Implement the dump_stack() function in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 3 days
Sponsored by: Mellanox Technologies
2018-10-30 16:42:56 +00:00
Hans Petter Selasky
bf05cd05ac
Implement __KERNEL_DIV_ROUND_UP() function macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 3 days
Sponsored by: Mellanox Technologies
2018-10-30 16:32:52 +00:00
Hans Petter Selasky
8ad9551d36
Implement dma_pool_zalloc() in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 3 days
Sponsored by: Mellanox Technologies
2018-10-29 19:02:36 +00:00
Tijl Coosemans
642909fdfb
Define linuxkpi readq for 64-bit architectures. It is used by drm-kmod.
...
Currently the compiler picks up the definition in machine/cpufunc.h.
Add compiler memory barriers to read* and write*. The Linux x86
implementation of these functions uses inline asm with "memory" clobber.
The Linux x86 implementation of read_relaxed* and write_relaxed* uses the
same inline asm without "memory" clobber.
Implement ioread* and iowrite* in terms of read* and write* so they also
have memory barriers.
Qualify the addr parameter in write* as volatile.
Like Linux, define macros with the same name as the inline functions.
Only define 64-bit versions on 64-bit architectures because generally
32-bit architectures can't do atomic 64-bit loads and stores.
Regroup the functions a bit and add brief comments explaining what they do:
- __raw_read*, __raw_write*: atomic, no barriers, no byte swapping
- read_relaxed*, write_relaxed*: atomic, no barriers, little-endian
- read*, write*: atomic, with barriers, little-endian
Add a comment that says our implementation of ioread* and iowrite*
only handles MMIO and does not support port IO.
Reviewed by: hselasky
MFC after: 3 days
2018-10-22 20:55:35 +00:00
Alan Cox
49bfa624ac
Eliminate the arena parameter to kmem_free(). Implicitly this corrects an
...
error in the function hypercall_memfree(), where the wrong arena was being
passed to kmem_free().
Introduce a per-page flag, VPO_KMEM_EXEC, to mark physical pages that are
mapped in kmem with execute permissions. Use this flag to determine which
arena the kmem virtual addresses are returned to.
Eliminate UMA_SLAB_KRWX. The introduction of VPO_KMEM_EXEC makes it
redundant.
Update the nearby comment for UMA_SLAB_KERNEL.
Reviewed by: kib, markj
Discussed with: jeff
Approved by: re (marius)
Differential Revision: https://reviews.freebsd.org/D16845
2018-08-25 19:38:08 +00:00
Alan Cox
44d0efb215
Eliminate kmem_alloc_contig()'s unused arena parameter.
...
Reviewed by: hselasky, kib, markj
Discussed with: jeff
Differential Revision: https://reviews.freebsd.org/D16799
2018-08-20 15:57:27 +00:00
Hans Petter Selasky
6402bc3d1e
Use atomic_fcmpset_XXX() instead of atomic_cmpset_XXX() when possible
...
in the LinuxKPI.
Suggested by: mjg @
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-08-09 09:39:32 +00:00
Marius Strobl
e545f5a8a3
Update the list of architectures having atomic_fcmpset_{8,16,64}(9) and
...
atomic_swap_{64,int}(9) respectively as of r337433.
2018-08-07 18:59:02 +00:00
Hans Petter Selasky
549dcdb34e
Implement current_work() function in the LinuxKPI.
...
Tested by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-08-06 10:48:20 +00:00
Hans Petter Selasky
db119089be
Implement atomic_long_cmpxchg() function in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-08-06 08:40:02 +00:00
Hans Petter Selasky
f698bc4d76
Define __poll_t type in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-08-06 08:35:16 +00:00
Hans Petter Selasky
62baacef3f
Implement ktime_add_ms() and ktime_before() in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-08-03 09:02:57 +00:00
Hans Petter Selasky
a76c73aadc
Don't refer to non-existing atomic functions, even though not compiled,
...
in the LinuxKPI.
Found by: rpolka @
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-08-01 19:10:46 +00:00
Alan Somers
6040822c4e
Make timespecadd(3) and friends public
...
The timespecadd(3) family of macros were imported from NetBSD back in
r35029. However, they were initially guarded by #ifdef _KERNEL. In the
meantime, we have grown at least 28 syscalls that use timespecs in some
way, leading many programs both inside and outside of the base system to
redefine those macros. It's better just to make the definitions public.
Our kernel currently defines two-argument versions of timespecadd and
timespecsub. NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define
three-argument versions. Solaris also defines a three-argument version, but
only in its kernel. This revision changes our definition to match the
common three-argument version.
Bump _FreeBSD_version due to the breaking KPI change.
Discussed with: cem, jilles, ian, bde
Differential Revision: https://reviews.freebsd.org/D14725
2018-07-30 15:46:40 +00:00
Hans Petter Selasky
986e3bed8b
Implement the ip_eth_mc_map() function in the LinuxKPI.
...
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-06-12 08:43:49 +00:00
Hans Petter Selasky
35555d474b
Implement the kstrtobool() and kstrtobool_from_user() functions
...
in the LinuxKPI.
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-11 16:26:33 +00:00
Hans Petter Selasky
93ed9ab20b
Implement the user_access_begin(), user_access_end(), usafe_get_user() and
...
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
2018-06-11 15:42:29 +00:00
Hans Petter Selasky
71ee95ddf7
Define ARCH_KMALLOC_MINALIGN in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-07 11:44:11 +00:00
Hans Petter Selasky
d150e15285
Wrap timespec64 into timespec in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-07 11:41:42 +00:00
Hans Petter Selasky
a041e75a34
Move the EXPORT_SYMBOL_XXX() function macros into own header file.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-07 11:34:59 +00:00
Hans Petter Selasky
422d8af4df
Implement the dev_pm_set_driver_flags() function macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-07 11:29:07 +00:00
Hans Petter Selasky
40ddfc7604
Make some list functions RCU safe in the LinuxKPI.
...
While at it rename hlist_add_after() into hlist_add_behind().
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-06 15:49:01 +00:00
Hans Petter Selasky
17e2a84e9a
Rewrite code using atomic_fcmpset_int() in the LinuxKPI.
...
Suggested by: mjg@
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-06 15:31:47 +00:00
Hans Petter Selasky
e6e028d01f
Implement the __add_wait_queue_entry_tail() function in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-06 15:19:30 +00:00
Hans Petter Selasky
7e95e98db8
Implement the might_sleep_if() function macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-06 15:10:11 +00:00
Hans Petter Selasky
ab98f1e8d8
Rename two structure field members while keeping backwards compatibility in
...
the LinuxKPI. Add a comment saying in which Linux version this change was made.
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-06 15:06:21 +00:00
Hans Petter Selasky
1b092623b2
Implement the init_wait_entry() function macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-06 14:59:23 +00:00
Hans Petter Selasky
23dcf4359e
Implement the atomic_dec_if_positive() function in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-06 13:59:51 +00:00
Hans Petter Selasky
9e067b2256
Implement the ktime_compare() and ktime_after() functions in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-06 13:37:31 +00:00
Hans Petter Selasky
a16387c1d4
Implement the rdmsrl_safe() function macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-06 13:29:52 +00:00
Hans Petter Selasky
7a13eeba18
Declare and set the global "system_highpri_wq" workqueue structure pointer
...
in the LinuxKPI.
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-05 15:49:35 +00:00
Hans Petter Selasky
c6d920309c
Implement the INIT_DELAYED_WORK_ONSTACK() function macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-05 15:46:16 +00:00
Hans Petter Selasky
7f346854b8
Define the __kernel_size_t type in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-05 15:42:35 +00:00
Hans Petter Selasky
5a1d03bb7c
Implement the task_pid_vnr() function macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-05 15:40:09 +00:00
Hans Petter Selasky
747d9a8165
Add "access" function pointer to the "vm_operations_struct" structure
...
in the LinuxKPI. While at it document when to use the "virtual_address" or
the "address" field in the "vm_fault" structure.
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-05 15:37:28 +00:00
Hans Petter Selasky
0d2dce0b78
Implement mul_u32_u32() function in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-05 15:30:36 +00:00
Hans Petter Selasky
f446b7cab4
Implement timer_setup() and from_timer() function macros in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-05 15:20:20 +00:00
Hans Petter Selasky
57a865f808
Implement the __sg_alloc_table_from_pages() function based on the existing
...
sg_alloc_table_from_pages() function in the LinuxKPI.
This basically allow segments to have a limit, max_segment.
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-01 12:09:07 +00:00
Hans Petter Selasky
6fad8d171a
Implement radix_tree_iter_delete() in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-01 11:42:09 +00:00
Hans Petter Selasky
0a85496223
Improve high resolution timer support in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-01 11:33:14 +00:00
Hans Petter Selasky
f03ae7e802
Add more GFP macro definitions in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
2018-06-01 11:14:59 +00:00
Hans Petter Selasky
13a5c70b91
Implement support for the PCI_BUS_NUM() function macro in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-05-31 13:17:34 +00:00
Hans Petter Selasky
f1aa567bfe
Implement support for the kvmalloc_array() function in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-05-31 13:13:08 +00:00
Hans Petter Selasky
f6d4552417
Correct macroname in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-05-31 12:55:38 +00:00
Hans Petter Selasky
cbea4f294f
Define __initconst in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-05-31 12:50:42 +00:00
Hans Petter Selasky
7ce7605ece
Implement bitmap_complement() in the LinuxKPI.
...
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-05-31 12:48:24 +00:00
Hans Petter Selasky
69d6653ba4
Implement idr_is_empty() in the LinuxKPI and make idr_remove() API compatible
...
with upstream Linux by returning the pointer to the removed element.
Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
2018-05-31 12:35:21 +00:00