Revert "edk2: enable static asserts for *INT64 alignment"
This fails when using WITH_BEARSSL. It seems like we build the EFI bits
of libsecureboot (which is really just part of libsa in this case), even
when building the BIOS loader. Revert for now to unbreak the build.
This reverts commit 2fa4bdd7f9e99698a6652db405c3165fdcd41c1d.
Reported by: freebsd at walstatt-de.de
stand/efi/Makefile: fix build order
Move liblua32efi and ficl32efi before .WAIT, otherwise there's a race
between the interpreter and the loader being built.
Reported by: kbowling
Discussed with: kevans
Fixes: d15cc7625dde9bcb6a63ee59cccf14f3b93b15bf
ukbd: fix SET_REPORT wValue always using report ID 0 for LED output
ukbd_set_leds_callback() built the SET_REPORT control request with
USETW2(req.wValue, UHID_OUTPUT_REPORT, 0) before the loop that
determines the actual HID report ID from sc_id_numlock,
sc_id_scrolllock, or sc_id_capslock. The data payload was already
correctly prefixed with the real report ID when id != 0, but the
control request's wValue told the device to set report ID 0, which
does not exist on devices that use non-zero report IDs for LED output.
Apple Internal Keyboard / Trackpad (0x05ac:0x0274) uses report ID 1
for LED output. The mismatch caused the device to STALL every
SET_REPORT request, so the capslock LED could never be updated.
Move the USETW2 call to after the LED-detection loop so that wValue
carries the correct report ID.
Signed-off-by: Joshua Rogers <Joshua at Joshua.Hu>
Reviewed by: wulf
[2 lines not shown]
LinuxKPi: idr: use macros for lock idr lock operations
Our idr implementation is using a mtx lock which in the past has
already caused problems (613723bac219c).
In order to make it easier to tackle the problem start by factoring
out all the operations related to the idr->lock into macros as we
have often done in other parts of code as well.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: wulf, emaste
Differential Revision: https://reviews.freebsd.org/D55392
LinuxKPI: 802.11 suspend/resume: fix the is_pci_dev check
Shortly before I committed the works from a year ago, jhb added a
function ("is_pci_device") so that the check against the devclass
does not have to be coded in every driver. Use this instead in main
(and stable/15 in case the works get MFCed).
At the same time this fixes the check (the old one was wrong) as we
attach to the LinuxKPI 802.11 driver, e.g., iwlwifi and thus we need
to check the parent of the parent and not just the parent to be
of the devclass "pci" in the identify bus function. The was the
first error. The second was (and this is why it worked) that we
checked for == instead of != and so the wrong check became true again.
Discussed with: jhb
Fixes: 11d69a4558de ("LinuxKPI: 802.11: add support for s/r")
MFC after: 3 days
X-MFC after: ffcf5e356644 ("pci: Add is_pci_device helper function")
Sponsored by: The FreeBSD Foundation
rtwn/usb: add ID for D-Link DWA-121 rev B1 to rtwn RTL8188EU
Add the device ID to the usbdevs table in order to be able to use
it in the rtwn/usb driver for the RTL8188EU attachment.
(I adjusted the name to B1 compared to the original submission)
PR: 291839
MFC after: 3 days
linux: Add support for PR_SET_VMA to prctl(2)
Implement dummy support for PR_SET_VMA with PR_SET_VMA_ANON_NAME in
prctl(2). This prevents applications from receiving EINVAL when
attempting to name anonymous memory regions.
bsd.sys.mk: also suppress gcc -Wc++1[47]-extensions warnings for >= 12
This is a direct commit to stable/14, which does not yet default to
C++17 for most in-tree programs. In some cases, this would trigger gcc
-Wc++1[47]-extensions warnings with libc++ 21.
mdmfs: Use standard bool definition
Include `<stdbool.h>` instead of defining a local bool enum.
This avoids duplicating a standard type name and keeps the
source compatible with headers that provide bool as a macro,
or in case of C23 that compilers provide it as keyword.
Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: fuz
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/2203
rpcsvc: Remove obsolete bool definition from yp_prot.h
`yp_prot.h` has carried a SunRPC-era typedef of `bool` guarded by
`BOOL_DEFINED`, but the header itself does not use it. The YP/RPC
interfaces use `bool_t` for protocol booleans.
Defining `bool` in a public header collides with modern C headers
that provide `bool` as a macro or keyword, such as `<stdbool.h>`
and C23-aware assert handling. Drop the compatibility typedef and
leave `bool` definition to the consumer's language mode.
Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: fuz
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/2203
imgact_elf: add sysctl kern.elfXX.phnums for the number of program headers
that are accepted in the activated image or interpreter.
Requested by: jhb
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D57328
edk2: enable static asserts for *INT64 alignment
The ia32 loader is now built with -malign-double, so these should pass.
Differential Revision: https://reviews.freebsd.org/D55386
stand: compile ia32 EFI loader with -malign-double
The UEFI spec says:
> Structures are aligned on boundaries equal to the largest internal
> datum of the structure and internal data are implicitly padded to
> achieve natural alignment.
Unlike the old Intel EFI toolkit, the EDK2 headers expect ia32 builds to
use -malign-double to achive this.
Make EFI versions of libsa32, liblua32, and ficl32. With the difference
being that they are compiled with -malign-double.
Differential Revision: https://reviews.freebsd.org/D55385
netlink/route: extend pre-2.6.19 Linux compat shim to del/getroute
Commit f34aca55adef ("netlink/route: provide pre-2.6.19 Linux compat shim",
2024-06) fixed the partial fix for net/bird2 on the netlink path by mapping the
legacy 8-bit struct rtmsg::rtm_table field onto the modern 32-bit RTA_TABLE
attribute when the latter is absent.
That fix, however, was only applied to rtnl_handle_newroute. The two sibling
handlers: rtnl_handle_delroute and rtnl_handle_getroute were left looking at
attrs.rta_table directly. They are reachable from exactly the same client
(bird, in its netlink scan path), so any FIB number that fits in 8 bits
silently maps to RT_TABLE_UNSPEC in those handlers.
Reviewed by: melifaro (previous version)
Approved by: emaste
MFC after: 1 week
Sponsored by: Netflix
netlink: Check permissions for interface flag changes
Reviewed by: pouria, melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57332
netlink: Use early exit pattern in _nl_modify_ifp_generic
No functional change.
Reviewed by: pouria, melifaro
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57349
tools/test/stress2/misc: Fix and enable new tests
The previously committed versions of these tests failed to prevent
duplicate file names in the list of files to process, leading to
missing files when a "mv" commando tried to operate on a file that
had already been renamed.
The test for filenames containing UTF-16 surrogate pairs stays
disabled, since the required kernel changes have not been committed,
yet.
Work around unterminated-string-initialization warnings in acpidb
ACPICA 20250807 fixes these warnings by adding nonstring attributes, but
since ACPICA in stable/14 has not been updated for quite some time,
suppress the warning for clang >= 21 instead. Direct commit to
stable/14, since stable/15 and main already have ACPICA 20250807.
Merge commit b0d2b57f7e47 from llvm git (by Phoebe Wang):
[Headers][X86] Remove more duplicated typedefs (#153820)
They are defined in mmintrin.h
This fixes a -Werror warning in openzfs, which compiles for C99, and C99
does not allow for typedef redefinitions.
PR: 292067
MFC after: 1 month
(cherry picked from commit 20450c2e792084f06974cff9d2338e2d0406883f)