opnsense-src/sys/dev/hyperv
Jessica Clarke cb75bb5126 vmbus: Avoid gratuitous ifdef and use more generic implementation instead
Checking for __LP64__ is non-portable as it assumes that ILP32 and LP64
are the only two ABIs that exist, but CheriBSD supports an additional
ABI where long is still 64-bit but pointers are 128-bit capabilities,
and thus __LP64__ is not defined. We could change this to check the
value of __SIZEOF_LONG__, since the code here only cares about that
aspect of the ABI, however in this instance, the only real reason an
ifdef is used at all is to be able to get log2(sizeof(u_long)), but if
we instead multiply and divide rather than shift, and let the compiler
optimise that to a shift, we can just use sizeof(u_long) instead. Note
also that VMBUS_EVTFLAGS_MAX could always just have been defined as
VMBUS_EVTFLAGS_SIZE / sizeof(u_long).

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D50630
2025-07-10 20:33:33 +01:00
..
hvsock Remove remaining mentions of pr_usrreq. 2025-05-08 16:29:15 +02:00
include sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
input newbus: replace leftover device unit wildcards 2025-06-21 05:57:45 +03:00
netvsc Hyper-V: hn: rewrite hn rsc swtich to avoid sysctl hang 2025-02-04 13:39:14 +00:00
pcib Replace calls to bus_generic_attach with bus_attach_children 2024-12-06 17:26:16 -05:00
storvsc hyperv/storvsc: Avoid conditional asserts in storvsc_xferbuf_prepare() 2025-03-31 07:15:45 -04:00
utilities sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
vmbus vmbus: Avoid gratuitous ifdef and use more generic implementation instead 2025-07-10 20:33:33 +01:00