aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/linuxkpi
Commit message (Collapse)AuthorAgeFilesLines
* Add missing header file when building the LinuxKPI module separately.Hans Petter Selasky2020-11-181-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367788
* LinuxKPI: Implement ACPI bits required by drm-kmod in base systemEmmanuel Vadot2020-11-091-0/+5
| | | | | | | | | | | | | | | It includes: ACPI_HANDLE() implementation. AC and VIDEO ACPI events notification support. Replacement of hand-rolled GPLed _DSM method evaluation helpers with in-base ones. Submitted by: wulf Differential Revision: https://reviews.freebsd.org/D26603 Notes: svn path=/head/; revision=367521
* linuxkpi: Add dmi_* functionEmmanuel Vadot2020-10-021-0/+1
| | | | | | | | | | | | dmi function are used to get smbios values. The DRM subsystem and drivers use it to enabled (or not) quirks. Reviewed by: hselasky Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26046 Notes: svn path=/head/; revision=366373
* Implement extensible arrays API using the existing radix tree implementationHans Petter Selasky2020-08-271-1/+2
| | | | | | | | | | | | in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D25101 Reviewed by: kib @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=364860
* Introduce LINUXKPI_GENSRCS.Konstantin Belousov2020-03-201-8/+1
| | | | | | | | | | | | | | Centralize the list of generated files required by linuxkpi consumers, into the common variable. This way, consumers that use the variable are insulated from possible changes in the list. Reviewed by: hselasky, imp Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24137 Notes: svn path=/head/; revision=359185
* Add pci_iov_if.h header as a dependency for Linuxkpi consumers.Konstantin Belousov2020-03-181-0/+1
| | | | | | | | Sponsored by: Mellanox Technologies MFC after: 2 weeks Notes: svn path=/head/; revision=359095
* linuxkpi: Move shmem related functions in it's own fileEmmanuel Vadot2020-02-211-0/+1
| | | | | | | | | | | | | For drmkpi (D23085) we don't want the Linux struct file as we don't emulate everything. Also the prototypes should be in shmem_fs.h to have 100% compatibility with Linux. Reviewed by: hselasky MFC after: Maybe Differential Revision: https://reviews.freebsd.org/D23764 Notes: svn path=/head/; revision=358217
* LinuxKPI: Finalize import of seq_file.Johannes Lundberg2019-05-161-0/+1
| | | | | | | | | | | | | | seq_file.h and linux_seq_file.c was imported form ports earlier but linux_seq_file.c was never compiled in with the module. With this commit base seq_file will replace ports seq_file and it required a few modifications to not break functionality and build. Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Notes: svn path=/head/; revision=347892
* Implement the dump_stack() function in the LinuxKPI.Hans Petter Selasky2018-10-301-1/+2
| | | | | | | | | Submitted by: Johannes Lundberg <johalun0@gmail.com> MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=339924
* Sort SRCS.Mark Johnston2017-06-261-3/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=320386
* Implement parts of the hrtimer API in the LinuxKPI.Mark Johnston2017-06-261-0/+1
| | | | | | | | | Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11359 Notes: svn path=/head/; revision=320364
* Augment wait queue support in the LinuxKPI.Mark Johnston2017-06-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | In particular: - Don't evaluate event conditions with a sleepqueue lock held, since such code may attempt to acquire arbitrary locks. - Fix the return value for wait_event_interruptible() in the case that the wait is interrupted by a signal. - Implement wait_on_bit_timeout() and wait_on_atomic_t(). - Implement some functions used to test for pending signals. - Implement a number of wait_event_*() variants and unify the existing implementations. - Unify the mechanism used by wait_event_*() and schedule() to put the calling thread to sleep. This is required to support updated DRM drivers. Thanks to hselasky for finding and fixing a number of bugs in the original revision. Reviewed by: hselasky MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10986 Notes: svn path=/head/; revision=319757
* Implement support for mutexes with deadlock avoidance in the LinuxKPI.Hans Petter Selasky2017-03-091-0/+1
| | | | | | | | | | | When locking a mutex and deadlock is detected the first mutex lock call that sees the deadlock will return -EDEADLK . MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=314970
* Cleanup the LinuxKPI slab implementation.Hans Petter Selasky2017-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Put large functions into linux_slab.c instead of declaring them static inline. Add support for more memory allocation wrappers like kmalloc_array() and __vmalloc(). Make sure either the M_WAITOK or the M_NOWAIT flag is set and mask away unused memory allocation flags before calling FreeBSD's malloc() routine. Move kmalloc_node() definition to slab.h where it belongs. Implement support for the SLAB_DESTROY_BY_RCU feature when creating a kmem_cache which basically means kmem_cache memory is freed using call_rcu(). MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=314905
* LinuxKPI workqueue cleanup.Hans Petter Selasky2017-03-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes the workqueue implementation behave more like in Linux, both functionality wise and structure wise. All workqueue code has been moved to linux_work.c Add an atomic based statemachine to the work_struct to ensure proper operation. Prior to this change struct_work was directly mapped to a FreeBSD task. When a taskqueue has multiple threads the same task may end up being executed on more than one worker thread simultaneously. This might cause problems with code coming from Linux, which expects serial behaviour, similar to Linux tasklets. Move all global workqueue function names into the linux_xxx domain to avoid symbol name clashes in the future. Implement a few more workqueue related functions and macros. Create two multithreaded taskqueues for the LinuxKPI during module load, one for time-consuming callbacks and one for non-time consuming callbacks. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=314843
* sys/modules: normalize .CURDIR-relative paths to SRCTOPEnji Cooper2017-03-041-3/+3
| | | | | | | | | | | This simplifies make output/logic Tested with: `cd sys/modules; make ALL_MODULES=` on amd64 MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314651
* Optimise unmapped LinuxKPI page allocations.Hans Petter Selasky2017-02-221-0/+1
| | | | | | | | | | | | | | | | | | | | | When allocating unmapped pages, take advantage of the direct map on AMD64 to get the virtual address corresponding to a page. Else all pages allocated must be mapped because sometimes the virtual address of a page is requested. Move all page allocation and deallocation code into an own C-file. Add support for GFP_DMA32, GFP_KERNEL, GFP_ATOMIC and __GFP_ZERO allocation flags. Make a clear separation between mapped and unmapped allocations. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=314106
* Replace dummy implementation of RCU in the LinuxKPI with one based onHans Petter Selasky2017-02-211-0/+2
| | | | | | | | | | | | the in-kernel concurrency kit's ck_epoch API. Factor RCU hlist_xxx() functions into own rculist.h header file. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=314050
* Add support for LinuxKPI tasklets.Hans Petter Selasky2017-02-211-0/+1
| | | | | | | | | | | | | | Tasklets are implemented using a taskqueue and a small statemachine on top. The additional statemachine is required to ensure all LinuxKPI tasklets get serialized. FreeBSD taskqueues do not guarantee serialisation of its tasks, except when there is only one worker thread configured. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=314043
* Make the LinuxKPI task struct persistent accross system calls.Hans Petter Selasky2017-02-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | A set of helper functions have been added to manage the life of the LinuxKPI task struct. When an external system call or task is invoked, a check is made to create the task struct by demand. A thread destructor callback is registered to free the task struct when a thread exits to avoid memory leaks. This change lays the ground for emulating the Linux kernel more closely which is a dependency by the code using the LinuxKPI APIs. Add new dedicated td_lkpi_task field has been added to struct thread instead of abusing td_retval[1]. Fix some header file inclusions to make LINT kernel build properly after this change. Bump the __FreeBSD_version to force a rebuild of all kernel modules. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=314040
* Finish process of moving the LinuxKPI module into the default kernel build.Hans Petter Selasky2015-10-291-4/+7
| | | | | | | | | | | | | | | | | | | | | | - 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
* Rename linuxapi[.ko] into linuxkpi[.ko], to reflect that it is aHans Petter Selasky2015-10-221-0/+18
kernel programming interface module, KPI, to avoid confusion with the existing Linux userspace binary compatibility shims. Bump the FreeBSD_version number. Reviewed by: np @ Suggested by: dumbbell @ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=289749