summaryrefslogtreecommitdiffstats
path: root/sys/compat/linuxkpi
Commit message (Collapse)AuthorAgeFilesLines
* MFC r317148:markj2017-05-031-9/+27
| | | | Drop Giant before sleeping in linux_wait_for_{timeout_,}common().
* MFC r312888:mjg2017-03-141-1/+0
| | | | | | | | | | | | Introduce __read_mostly and __exclusive_cache_line macros. The intended use is to annotate frequently used globals which either rarely change (and thus can be grouped in the same cacheline) or are an atomic counter (which means it may benefit from being the only variable in the cacheline). Linker script support is provided only for amd64. Architectures without it risk having other variables put in, i.e. as if they were not annotated. This is harmless from correctness point of view.
* MFC r310559 and r310583:hselasky2017-01-093-4/+115
| | | | | | | Implement register and unregister chrdev in the LinuxKPI. Obtained from: kmacy @ Sponsored by: Mellanox Technologies
* MFC r310589:hselasky2017-01-091-2/+29
| | | | | | | | Implement more list header file functions. Add definition guard for the list_head structure. Obtained from: kmacy @ Sponsored by: Mellanox Technologies
* MFC r310553:hselasky2017-01-091-12/+38
| | | | | | | | | Improve LinuxKPI device support. Only delete own BSD devices and not the ones obtained through devclass_get_device(). Some minor code cleanups while at it. Obtained from: kmacy @ Sponsored by: Mellanox Technologies
* MFC r310557:hselasky2017-01-091-2/+2
| | | | | | | | Use correct integer type when computing the maximum physical address for kmem_alloc_contig(). Obtained from: kmacy @ Sponsored by: Mellanox Technologies
* MFC r309737:hselasky2016-12-191-5/+65
| | | | | | | Add more LinuxKPI PCI definitions. Obtained from: kmacy @ Sponsored by: Mellanox Technologies
* MFC r309736:hselasky2016-12-191-3/+3
| | | | | | Prefer function macros over regular macros in the LinuxKPI. Sponsored by: Mellanox Technologies
* MFC r309732:hselasky2016-12-193-17/+17
| | | | | | | 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 r309731:hselasky2016-12-191-7/+18
| | | | | | | | | | | | Prefix the Linux KPI's kmem_xxx() functions with linux_ to avoid conflict with the opensolaris kernel module. This patch solves a problem where the kernel linker will incorrectly resolve opensolaris kmem_xxx() functions as linuxkpi ones, which leads to a panic when these functions are used. Submitted by: gallatin @ Sponsored by: Mellanox Technologies
* MFC r309733:hselasky2016-12-192-1/+2
| | | | | | | MSIX can support more than 256 IRQs. Make sure the invalid IRQ number set in the LinuxKPI is big enough. Sponsored by: Mellanox Technologies
* MFC r309734:hselasky2016-12-192-2/+2
| | | | | | | | Avoid malloc() warnings when using the LinuxKPI by zero-checking the allocation flags. Obtained from: kmacy @ Sponsored by: Mellanox Technologies
* MFC 306480sephe2016-10-111-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | linuxkpi: Fix PCI BAR lazy allocation support. FreeBSD supports lazy allocation of PCI BAR, that is, when a device driver's attach method is invoked, even if the device's PCI BAR address wasn't initialized, the invocation of bus_alloc_resource_any() (the call chain: pci_alloc_resource() -> pci_alloc_multi_resource() -> pci_reserve_map() -> pci_write_bar()) would allocate a proper address for the PCI BAR and write this 'lazy allocated' address into the PCI BAR. This model works fine for native FreeBSD device drivers, but _not_ for device drivers shared with Linux (e.g. dev/mlx5/mlx5_core/mlx5_main.c and ofed/drivers/net/mlx4/main.c. Both of them use pci_request_regions(), which doesn't work properly with the PCI BAR lazy allocation, because pci_resource_type() -> _pci_get_rle() always returns NULL, so pci_request_regions() doesn't have the opportunity to invoke bus_alloc_resource_any(). We now use pci_find_bar() in pci_resource_type(), which is able to locate all available PCI BARs even if some of them will be lazy allocated. Submitted by: Dexuan Cui <decui microsoft com> Reviewed by: hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8071
* MFC r306451:hselasky2016-10-101-9/+20
| | | | | | | | The IORESOURCE_XXX defines should resemble a bitmask while SYS_RES_XXX are not bitmasks. Fix return value of pci_resource_flags() to reflect this change. 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
* Fallback to arc4rand() in the LinuxKPI when read_random() returnshselasky2016-06-072-4/+7
| | | | | | | zero. This can happen for virtual machines. MFC after: 1 week Sponsored by: Mellanox Technologies
* The SCHEDULER_STOPPED() macro already contains a predict false statement.hselasky2016-05-272-5/+5
| | | | | | | | Remove superfluous unlikely() wrapper. Suggested by: glebius MFC after: 1 week Sponsored by: Mellanox Technologies
* Define ATOMIC_LONG_INIT() in the LinuxKPI.hselasky2016-05-261-0/+2
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add support for runtime modifiable module parameters in the LinuxKPI.hselasky2016-05-261-21/+25
| | | | | | | | | Linux module parameters have a permissions value. If any write bits are set we are allowed to modify the module parameter runtime. Reflect this when creating the static SYSCTL nodes. Sponsored by: Mellanox Technologies MFC after: 1 week
* Add more module parameter macros to the LinuxKPI.hselasky2016-05-261-0/+6
| | | | | Obtained from: kmacy @ Sponsored by: Mellanox Technologies
* Add support for boolean module parameters in the LinuxKPI.hselasky2016-05-261-0/+6
| | | | | Requested by: kmacy @ Sponsored by: Mellanox Technologies
* Implement Linux module parameters as read-only tunable SYSCTLs.hselasky2016-05-252-200/+83
| | | | | | | | | | | | | | | | | 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-253-1/+13
| | | | | | | | | 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
* Add __iowrite32_copy() to the Linux kernel compatibility layer.kevlo2016-05-241-7/+12
| | | | Reviewed by: hselasky
* 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-243-4/+37
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Use make_dev_s() instead of make_dev() to avoid race settinghselasky2016-05-241-8/+37
| | | | | | | | "si_drv1". Convert panic() into regular error while at it. Suggested by: jhb @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement "atomic_long_add_unless()" in the LinuxKPI and fix thehselasky2016-05-231-1/+16
| | | | | | | | implementation of "atomic_long_inc_not_zero()". Found by: ngie @ MFC after: 1 week Sponsored by: Mellanox Technologies
* A missing definition needed by ktime_to_ms().hselasky2016-05-231-0/+1
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Fix some data types and add "inline" keyword for __reg_op() function.hselasky2016-05-231-17/+18
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement ror32() in the LinuxKPI.hselasky2016-05-231-0/+6
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Define more copy to/from userspace functions in the LinuxKPI.hselasky2016-05-231-0/+3
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add more printf() related functions to the LinuxKPI.hselasky2016-05-231-1/+33
| | | | | | 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 ktime related functions to the LinuxKPI.hselasky2016-05-231-0/+32
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement "kref_put_mutex()" for the LinuxKPI.hselasky2016-05-231-0/+19
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Add more list_xxx() functions to the LinuxKPI.hselasky2016-05-232-0/+61
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Make header file standalone by including definitions for neededhselasky2016-05-231-0/+1
| | | | | | | | linux_wait_xxx() functions. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* Implement "_outb()" to the LinuxKPI for i386 and amd64 only.hselasky2016-05-231-0/+8
| | | | | | Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
* 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
* 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
OpenPOWER on IntegriCloud