kernel: Use lockowned() instead of (lockstatus(&lock, curthread) != 0).
It is sufficient and more lightweight.
Most of these lockstatus() were added by me.
Discussed-with: aly
kernel/acpi: Sync hw.acpi.apple_darwin_osi tunable handling with FreeBSD.
Better comments, a few missing braces and a failure message for
unsupported machines.
sdhci - Add quirk for ADMA2 use to make O2 Micro OZ620 and OZ777 work.
- This adds a quirk flag, for SDHC controllers that don't support ADMA2 for
transfers with a length that is not a multiple of full 512 byte blocks.
- On those controllers, we'll fall back to PIO when we get such a transfer
request.
sdhci.4: Mention all tunables and sysctls, and other updates.
- Mention sdhci_acpi attaching controllers via ACPI.
- Be more technically correct on what kinds of cards it can support.
- Add some definitely working chips to list of actually tested devices.
- Mention fastest supported speeds: 50MHz HighSpeed, and DDR52 only on eMMC.
<sys/cdefs.h>: Copy attributes for strong/weak references.
GCC 9 and later take issue with mismatched attributes between aliased
functions. At the same time, the 'copy' attribute was added to copy
the attributes for these cases.
Change __{strong,weak}_reference() to use it. Fixes GCC 12.5's
-Wmissing-attribute warnings.
This is based on a patch by Scott Parlane <scott at parlanenz.com>, which
was based on the change made in linux for the same issue.
refactor: remove dead i386/ILP32 code from kernel, userland, and tests (2)
* Put the platform fall-through test in kgdb back in, just removing
the i386 part.
refactor: remove dead i386/ILP32 code from kernel, userland, and tests
DragonFly is x86_64-only. Remove permanently dead #ifdef __i386__,
userland tools, and regression tests. The code is never compiled.
refactor: remove large #if 0 dead code blocks
Remove 3200+ lines of permanently dead code guarded by #if 0 across
kernel, drivers, VFS, and userland. Several blocks have author comments
explicitly requesting removal. Code can be inspected in git history.
kldload(8): Warn when a module exists in current dir but not loaded
When a bare filename is specified, kldload(8) only searches it in the
paths defined by 'kern.module_path' kenv/sysctl. When the same module
exists in the current directory, it will not be loaded. This can cause
surprise and confusion.
To not change the behavior as well as keep consistent with FreeBSD, emit
a warning in this case. The FreeBSD implementation looks unnecessarily
complex, so I chose to do it in another way.
In addition, improve the verbose message to also print the actual module
path.
Sync the man page with FreeBSD's.
u4b/uvc: Group UVC-related prototypes to help future sync
* Move three prototypes from usbdi.h to usb_device.h, because their
implementations are in usb_device.c.
* Group the prototypes for UVC together, so it helps sync the other
parts with FreeBSD.
kern: Fix device_delete_child() to detach parent first
When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().
Obtained-from: FreeBSD (commit: d3bf5efc1ff19b102b176512a66110ec84ac982d)
u4b: Sync usbdevs and quirs with FreeBSD
* Keep a few our additions in usbdevs and usb_quirk.h.
* Fix usb_quirk_str[] to include new quirks added for uvc(4).
* Remove a few duplicate from usbdevs.
* Fix serial/u3g.c and serial/uftdi.c to use the new product defines.
cam: Fix xpt_bus_register()/xpt_bus_deregister() to return errno
xpt_bus_register and xpt_bus_deregister returns a hybrid error that's
neither a cam_status, nor an errno, but a mix of both. Update
xpt_bus_register and xpt_bus_deregister to return an errno. The vast
majority of current users compare against zero, which can also be
spelled CAM_SUCCESS. Nobody uses CAM_FAILURE, so remove that symbol
to prevent comfusion (nothing returns it either).
Where the return value is saved, ensure that the variable 'error' is
used to store an errno and 'status' is used to store a cam_status where
it makes the code clearer (usually just in functions that already mix
and match). Where the return value isn't used at all, avoid storing it
at all.
Obtained-from: FreeBSD (commit 30f8afd0270e0bb70e1e0df1cf8de7a841797a30)