summaryrefslogtreecommitdiffstats
path: root/sys/compat/linuxkpi/common/src
Commit message (Collapse)AuthorAgeFilesLines
* MFC r317148:markj2017-05-031-9/+27
| | | | Drop Giant before sleeping in linux_wait_for_{timeout_,}common().
* MFC r310559 and r310583:hselasky2017-01-091-0/+76
| | | | | | | Implement register and unregister chrdev in the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies
* MFC r309732:hselasky2016-12-191-2/+2
| | | | | | | Prefix some _pci_xxx() functions in the Linux KPI with linux_ and make sure the IRQ number used by these functions is unsigned. Sponsored by: Mellanox Technologies
* MFC r309733:hselasky2016-12-191-1/+1
| | | | | | | MSIX can support more than 256 IRQs. Make sure the invalid IRQ number set in the LinuxKPI is big enough. Sponsored by: Mellanox Technologies
* Add a missing error check for a malloc() call in idr_get().markj2016-06-141-1/+2
| | | | | | | Submitted by: Matt Joras <mjoras@isilon.com> Approved by: re (gjb) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* The SCHEDULER_STOPPED() macro already contains a predict false statement.hselasky2016-05-271-2/+2
| | | | | | | | Remove superfluous unlikely() wrapper. Suggested by: glebius MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement Linux module parameters as read-only tunable SYSCTLs.hselasky2016-05-251-0/+3
| | | | | | | | | | | | | | | | | Bool module parameters are no longer supported, because there is no equivalent in FreeBSD. There are two macros available which control the behaviour of the LinuxKPI module parameters: - LINUXKPI_PARAM_PARENT allows the consumer to set the SYSCTL parent where the modules parameters will be created. - LINUXKPI_PARAM_PREFIX defines a parameter name prefix, which is added to all created module parameters. Sponsored by: Mellanox Technologies MFC after: 1 week
* Add checks for SCHEDULER_STOPPED() so that code using the LinuxKPI canhselasky2016-05-251-0/+5
| | | | | | | | | run after a panic(). This for example allows a LinuxKPI based graphics stack to receive prints during a panic. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Use the DROP_GIANT() and PICKUP_GIANT() macros instead of makinghselasky2016-05-241-4/+4
| | | | | | | assumptions about how the Giant mutex is locked. MFC after: 1 week Sponsored by: Mellanox Technologies
* Set "current" for all PCI enumeration callbacks.hselasky2016-05-242-4/+31
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Set an invalid IRQ number when no PCI IRQ is available in the LinuxKPI.hselasky2016-05-231-1/+1
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add more list_xxx() functions to the LinuxKPI.hselasky2016-05-231-0/+42
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Properly implement "cpu_has_clflush" macro.hselasky2016-05-161-0/+12
| | | | | | Suggested by: kib, jhb MFC after: 1 week Sponsored by: Mellanox Technologies
* Fix handling of IOCTLs in the LinuxKPI.hselasky2016-05-121-7/+78
| | | | | | | | | | | | | | | | | | | | 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
* Create a dummy "task_struct" on the stack which is returned byhselasky2016-05-121-14/+69
| | | | | | | | | | "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-111-0/+135
| | | | | | 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
* 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-302-2/+2
| | | | | | Mostly on comments but there are some user-visible messages as well. MFC after: 2 weeks
* Add wait_event_interruptible_timeout to linuxkpi.np2016-03-311-10/+0
| | | | | | | Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: hselasky@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D5776
* Run the LinuxKPI PCI shutdown handler free of the Giant mutex.hselasky2016-03-071-2/+5
| | | | | MFC after: 1 week Sponsored by: Mellanox Technologies
* As <machine/pmap.h> is included from <vm/pmap.h>, there is no need toskra2016-02-222-2/+0
| | | | | | | include it explicitly when <vm/pmap.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373
* Implement idr_preload(), idr_preload_end(), idr_alloc() andhselasky2016-01-211-15/+94
| | | | | | | | idr_alloc_cyclic() in the LinuxKPI. Bump the FreeBSD version to force recompilation of all KLDs due to IDR structure size change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
* Initialize vm_page_prot to VM_MEMATTR_DEFAULT instead of 0.jhb2016-01-201-1/+1
| | | | | | | | | | | | | | | If a driver's Linux mmap callback passed vm_page_prot through unchanged, then linux_dev_mmap_single() would try to apply whatever VM_MEMATTR_xxx value 0 is to the mapping. On x86, VM_MEMATTR_DEFAULT is the PAT value for write-back (WB) which is 6, while 0 maps to the PAT value for uncacheable (UC). Thus, any mmap request that did not explicitly set page_prot was tried to map memory as UC triggering the warning in sg_pager_getpages(). Tested by: np Reported by: Krishnamraju Eraparaju @ Chelsio MFC after: 3 days Sponsored by: Chelsio Communications
* Implement support for PCI suspend, resume and shutdown events in thehselasky2016-01-151-0/+46
| | | | | | | | LinuxKPI. Fix a few spaces to tabs. Bump the FreeBSD version to force recompilation of existing KMODs. MFC after: 1 week Sponsored by: Mellanox Technologies
* LinuxKPI style changes:hselasky2016-01-081-0/+109
| | | | | | | | | | | - Properly prefix internal functions with "linux_" instead of only a single underscore to avoid future namespace collisions. - Make some functions global instead of inline to ease debugging and to avoid unnecessary code duplication. - Remove no longer existing kthread_create() function's prototype. MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement RCU mechanism using shared exclusive locks.hselasky2016-01-051-1/+8
| | | | | MFC after: 1 week Sponsored by: Mellanox Technologies
* Minor LinuxKPI code cleanup:hselasky2015-12-312-28/+166
| | | | | | | | | | | | | - Declare some static functions in linux_compat.c instead if inside various header files. - Prefix FreeBSD local functions in the LinuxKPI with "linux_" to avoid symbol name conflicts in the future and to make debugging easier. - Make the "struct kobj_ktype" declaractions constant to shave off a few bytes from the data segment. MFC after: 1 week Sponsored by: Mellanox Technologies
* Make the kobject refcounting compliant with Linux. Refcounting on thehselasky2015-12-311-4/+1
| | | | | | | | parent kobject cannot be factored out and must be done by the kobject consumers. MFC after: 1 week Sponsored by: Mellanox Technologies
* Reduce memory consumption when allocating kobject strings in thehselasky2015-12-281-1/+44
| | | | | | | | | LinuxKPI. Compute string length before allocating memory instead of using fixed size allocations. Make kobject_set_name_vargs() global instead of inline to save some bytes when compiling. MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement drain_workqueue() function.hselasky2015-12-211-0/+1
| | | | | MFC after: 1 week Sponsored by: Mellanox Technologies
* Minor workqueue cleanup:hselasky2015-12-211-0/+44
| | | | | | | | - Make some functions global instead of inline to ease debugging. - Fix some minor style issues. MFC after: 1 week Sponsored by: Mellanox Technologies
* Add assert and note about the size of "unsigned long" inside thehselasky2015-11-131-0/+8
| | | | | | LinuxKPI for the future. Sponsored by: Mellanox Technologies
* Build fixes:hselasky2015-11-121-5/+3
| | | | | | | | | | - Add some missing I/O functions for non-i386 and amd64 platforms. - Stub ioremap() to NULL using a macro to ensure non-existing memory attributes are not referred when they do not exist. - Add more header files to linux/list.h to resolve driver compilation issues on Sparc64 and PowerPC platforms. Sponsored by: Mellanox Technologies
* Finish process of moving the LinuxKPI module into the default kernel build.hselasky2015-10-296-0/+3623
- 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
OpenPOWER on IntegriCloud