Commit Graph
68671 Commits
Author SHA1 Message Date
Augustin Cavalier 924599c310 L2CAP: Change from SOCK_STREAM to SOCK_SEQPACKET.
This is the same as what FreeBSD does.
2026-03-16 13:21:46 -04:00
Augustin Cavalier 7512053757 kernel/smp: Refactor ICI broadcast/multicast to invoke the current CPU too.
Since the methods now don't just "send", the names are changed
also (which is fitting since they're now API-incompatible.)

The changes in the TranslationMaps to adopt this fixes a correctness
issue: previously TLB invalidations would be done either with or
without interrupts enabled depending on how they were invoked.
Now, they'll always be done with interrupts disabled. (This is
the same fix that was recently done to x86.)

The idea with processing the ICIs on the current CPU too is
that presumably the other CPUs will take just as much, if not
more, time processing the ICI than the sending CPU. So, we might
as well do the processing while we wait, rather than before or after.

Testing shows this to indeed be the case. On a bare metal i3, kernel
map invalidations (with global invalidations always forced) across
a boot-to-desktop go from around ~60.8ms cumulative before,
to ~51.8ms cumulative after this change.

Change-Id: Icd0343d462de7cf11043e6438f47b02f6b88bb8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10472
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-16 13:41:00 +00:00
Oscar Lesta 988ca40b01 cpp_rng: remove unused includes.
Change-Id: I5e2e1245f5b3e7d8bd104e9f0529b8dc1e4a5a85
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10530
Reviewed-by: waddlesplash <[email protected]>
2026-03-16 13:36:37 +00:00
Augustin Cavalier 000c32a568 asix88xxx: Import drivers from FreeBSD to replace usb_asix.
The homegrown usb_asix was partially based on the upstream FreeBSD
driver anyway, and hasn't seen much maintenance in recent years.
We might as well replace it with the FreeBSD version. In the process,
also add the "axge" driver, supporting the Gigabit version of this
hardware.

Tested by smrobtzz with the AX88179A: "it seems to work perfectly".

Change-Id: I37fdfc2cef6100916d6034817f117286f7f443b2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9600
Reviewed-by: waddlesplash <[email protected]>
2026-03-16 13:17:57 +00:00
Augustin Cavalier 9936387223 freebsd_network: Add everything needed for USB ethernet drivers.
Change-Id: I152d3fcdb50b9473f06c2164b9abb38b7c9d7e40
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9598
Reviewed-by: waddlesplash <[email protected]>
2026-03-16 13:17:57 +00:00
Sam Roberts c0374aed39 freebsd_network: Add missing check for endpoint direction.
Signed-off-by: Augustin Cavalier <[email protected]>
2026-03-16 08:54:00 -04:00
Augustin Cavalier d59105d001 freebsd_network: Synchronize some mbuf routines with upstream FreeBSD.
Also delete an OpenBSD compatibility section that isn't used.

This includes a fix to mbufq_full (made in 2019 in FreeBSD)
to allow for mbufqs of unlimited size, apparently needed by
some drivers, found by @smrobtzz while testing USB ethernet
drivers.
2026-03-16 08:50:43 -04:00
Augustin Cavalier 913f501fbd kernel: Use uint64 for seconds in datetime conversion routines. 2026-03-16 08:35:51 -04:00
Sam Roberts b249bfc563 usb_ecm: Use appropriate langid when fetching MAC address
The AX88179A has an English MAC address and will STALL if you
don't remind it of this fact.

Change-Id: Id4b1d9b8ff69327787d826ce42e6d78bc3cbcc30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10529
Reviewed-by: waddlesplash <[email protected]>
2026-03-16 12:28:46 +00:00
Nathan Patrizi 74613b3c9a ramdisk: Remove IOSchedulerSimple and handle IORequests directly
* Handle IO requests directly in the ramdisk instead of using
  IOSchedulerSimple as the request ordering being done is not needed.
* Fixes potential data corruption issues on the ramdisk caused by
  reordering partial write requests in IOSchedulerSimple.

Fixes #16951

Change-Id: I2d6c20016b54e8cb5b1d257989edada10c1d2376
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10490
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-16 12:27:28 +00:00
mohammedrattia cc14954ea8 bluetooth: fixing L2capClient testing Jamfile
- L2capClient SimpleTest couldn't compile because "bluetooth" isn't available library its correct name is "libbluetooth.so"
- I testing this on Haiku and it compiled normallly with only this change
- before the edit it was giving me error "-lbluetooth is unknown"

Change-Id: I88e59b0c1867c202d3e9916e5fa3964da22cb9e1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10524
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-16 12:25:36 +00:00
mohammedrattia 01d996da1a bluetooth: Refactoring LocateDelegateFromMessage() function
- This is just small refactoring edit. LocateDelegateFromMessage() and LocateLocalDeviceImpl() are doing exactly the same thing except for looking for hci_id in the first one, so I used the second in the first to enhance readability.
- I didn't test this specifically but bluetooth server compiles and do its functions normally.

Change-Id: Ic687f219e407a262155aaceed95176edb5c6ce70
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10525
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-16 12:20:08 +00:00
vighnesh-sawant c122595a54 bluetooth: Make RemoteDevice::Authenticate actually pair after
connecting

Sends an auth request to the controller, if connection was initated by
us

Change-Id: I32af0a24b902d0223bb4e773258ea9e9749a899c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10527
Reviewed-by: waddlesplash <[email protected]>
2026-03-16 12:19:26 +00:00
vighnesh-sawant aa864b9d41 bluetooth: Add support for SSP and refactor AcceptConnection and
CreateConnection

Move expecting commands from RemoteDevice::Authenticate to where they
are called.In SSP we expect for the events after ConnectionComplete.
For the state machine, LINK_KEY_NOTIFY tells us the end of the pairing
in both pairings, so we clear all expected events there for the ones we added in
ConnectionComplete, In SimplePairingComplete we clear the ones added
in IOCapabilityRequest. Tested with both bluetooth 2.1 and older pairing.

Change-Id: Ia208506c9f289d9f44dc3b8b0e4cd8a726a5d726
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10526
Reviewed-by: waddlesplash <[email protected]>
2026-03-16 12:19:26 +00:00
vighnesh-sawant dbf6744326 bluetooth: Prevent duplicates in RemoteDevicesView
Loops through and compares baddr,if its matching does not add it again
and frees it.

Change-Id: I2590852fb9c4a9f21facf5a600f45e11aeecb4d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10494
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-16 12:19:26 +00:00
vighnesh-sawant e7eb60f1a7 bluetooth: Implement EIR parsing for HCI_EVENT_EXTENDED_INQUIRY_EVENT
This parses only EIR_NAME_SHORT and EIR_NAME_COMPLETE, others are not
yet usefull, adds a way to fetch the cached friendly name and adds a
friendlyName field to RemoteDevice. Refactors DeviceListItem to work on
RemoteDevice as it's only being used for that.Also adds a check if the
cached name is complete or not. If not ask for the complete name.

Change-Id: I7e37fb9cf44cb5598ef348fdd4d781c5ae04e24e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10489
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-16 12:19:26 +00:00
Kacper Kasper ee10ca4b42 Preconfigure SSH server on test image
* This allows logging in to freshly built image using ssh.

Change-Id: I15baeee455827b73f12e1a222b166bd7975786dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10426
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Kacper Kasper <[email protected]>
Reviewed-by: Priyanshu Gupta <[email protected]>
2026-03-15 20:55:27 +00:00
Autocomitter 36367253cd Update translations from Pootle 2026-03-14 08:10:57 +00:00
John Davis 51805ac6d3 kernel/x86: Fix IO-APIC initialization on non-PCI systems
Currently the IO-APIC is fully initialized after PCI initialization
resulting in the IO-APIC not being initialized on systems without a
PCI bus (i.e. Hyper-V Gen2 VMs). This change moves IO-APIC
initialization to occur during early init, deferring PCI interrupt
enumeration and routing until after PCI initialization has been
completed.

Change-Id: I00be0be05d2e7668c3c6bc7af3afc4ff8d04a129
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10414
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: X512 X512 <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-13 18:08:44 +00:00
John Davis a0c9ad5269 hyperv: Implement heartbeat support
Adds support for the Hyper-V heartbeat integration component as part
of a new hyperv_ic driver.

Change-Id: I130ccc946d1f3ea30d87abf403d23c2cc34a1c57
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10427
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-03-13 14:06:07 +00:00
Sam Roberts e438946e25 kernel/arm64: Add kernel support for Samsung UART
Tested on M1 MacBook Air.

Change-Id: Idda9b2a168642b55a9e30336be1c4f4936670035
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10487
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-13 08:34:54 +00:00
Sam Roberts 013f25498a arm64: Correct kernel base address
* KERNEL_BASE differed from the base the kernel was linked for
* arch_mmu_is_kernel_address was off-by-one

Change-Id: Ic5a4a509e330bba2503532cc75f1fdaa85ad4f07
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10488
Reviewed-by: waddlesplash <[email protected]>
2026-03-12 19:16:54 +00:00
vighnesh-sawant c0336fd788 bluetooth: Add support for HCI_EVENT_EXTENDED_INQUIRY_RESULT
Follow up of a4e1f4d8ce,
this contains only response per event.

Change-Id: I6582f9530a273699048c04481fa0ef4a31a315ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10486
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-12 17:01:16 +00:00
vighnesh-sawant 230470d6d4 bluetooth: Add support for HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
Follow up of a4e1f4d8ce, details given
in that commit message on parsing of this event message

Change-Id: Icc0b54bdafe3cb167553d2fda3f62762d2d2595e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10485
Reviewed-by: waddlesplash <[email protected]>
2026-03-12 17:01:16 +00:00
John Davis 6e270b5f8c hyperv: Add mmio_size attribute to device nodes
Some devices such as graphics and PCI passthrough bridges require
MMIO space. Add this as a device node attribute if present.

Change-Id: Id374ff61c29c1ccad10e3a7f3f7053c14d02aa5e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10483
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-03-12 15:09:09 +00:00
John Davis 19630fa076 hyperv: Fix definition of HV_MS_TO_US
Definition is intended to be used where bigtime_t is accepted
and should be signed.

Change-Id: I6ebe21c55ae47b0b4f46f0df655942b582759d51
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10482
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-12 15:09:09 +00:00
Sam Roberts d2819f9e83 arm64: Add apple,s5l UART driver
This is the debug UART found in Apple SoCs. Tested on M1 MacBook Air.

Registers definitions were taken from:
  - https://github.com/AsahiLinux/m1n1/blob/18eb02fa92789dfcdab8e00e8b1cace7ab002718/src/uart_regs.h
  - https://www.sistemasorp.es/blog/S3C2410%20-%20datasheet.pdf

Change-Id: I2e4c8b7927fc823cedca421e1a2623b91f5ef112
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10480
Reviewed-by: waddlesplash <[email protected]>
2026-03-11 23:38:03 +00:00
Sam Roberts 5bb69a0f33 build: Fixes for arm64 macOS
* macOS ships an ancient version of GNU Bison which wants
  an '=' after %name-prefix

* macOS awk doesn't support strftime, so try to find a working
  awk.

* _haiku_build_{open,openat,fcntl} are declared and defined with
  different prototypes (variadic vs non-variadic). This is bad
  on its own, but it "happens to" work on most platforms since
  variadic parameters are usually passed in registers, same as other
  arguments. On arm64 macOS, variadic parameters are always passed
  on the stack, so you get weird and confusing bugs when using
  these functions.

Change-Id: I8cee9ecac0ac9b039be6b7e35ceaf8ad7c0f4c44
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10468
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-11 02:21:34 +00:00
Augustin Cavalier a2e4f9f75f kernel/x86: Use call_single_cpu_sync in get_cpuid.
Sends a more targeted ICI than a broadcast.
2026-03-10 17:55:12 -04:00
Augustin Cavalier 1d740a6700 kernel/smp: find_free_message expects interrupts enabled.
Use thread_pin instead of disable_interrupts in the call_*
methods.
2026-03-10 17:54:33 -04:00
Augustin Cavalier e867e95538 kernel/smp: Deduplicate call_*_cpu.
* Rename call_single_cpu for consistency.

 * Combine call_all_cpus implementations into one, like call_single_cpu.
2026-03-10 15:33:33 -04:00
Augustin Cavalier 334e90a2ac kernel/smp: Just return free messages using a write spinlock.
There isn't much value in using extra atomics here.
2026-03-10 15:21:27 -04:00
Augustin Cavalier 3c28d298f7 kernel: Don't fail if the private string.h is included under GCC2. 2026-03-10 13:10:25 -04:00
Augustin Cavalier 918b2dfaab BMessage: Eliminate UsePrivateHeaders kernel. 2026-03-10 13:10:25 -04:00
Augustin Cavalier b350405e06 kernel/smp: Refactor smp_msg structure allocation.
The SMP_MAX_CPUS * 4 fixed pool size apparently goes all the way
back to NewOS, which supported only 4 CPUs max. As ours is now
64, this means the fixed pool size was very large even on systems
with only a few cores. So, instead, allocate 4 messages per CPU
(though often more, due to rounding up to the page size; e.g.
on x86_64, 1 page fits 56 smp_msgs.)

Also, put them a dedicated area, to keep them a bit more segmented
from the kernel heap, in case of problems.
2026-03-10 13:04:46 -04:00
Augustin Cavalier 10d0685a9e EFI: Fix some more instances of memcpy on other architectures. 2026-03-10 12:20:00 -04:00
Augustin Cavalier 69499b0e00 kernel: Use compiler-builtin memset, memcpy, memmove, memcmp.
Since the kernel is built with -ffreestanding, and thus -fno-builtin,
the compiler ignores the function names and doesn't perform optimizations
(e.g. inlining for small values) that it otherwise could. So, here,
we add a string.h that supplements the default, and uses #define to
reinstate the builtins, and thus the optimizations.

Linux and FreeBSD at least apparently do the same. A quick compile
benchmark in a VM doesn't show much difference, maybe a slight
decrease in sys time.
2026-03-10 12:00:59 -04:00
Augustin Cavalier ff861e0ea3 kernel, lib, drivers: Prepare for use of builtin string.h operations.
This fixes various -Werror=class-memaccess that are triggered
when using the builtins.
2026-03-10 12:00:59 -04:00
Augustin Cavalier 2adbc5705a Eliminate "UsePrivateHeaders kernel" from most of userland.
Now that the DoublyLinkedList and other classes are in a "util"
directory, this isn't needed.
2026-03-10 12:00:58 -04:00
Augustin Cavalier 103ca61228 bluetooth: Eliminate the need for kernel headers in userland. 2026-03-10 12:00:57 -04:00
Augustin Cavalier 18c93b9569 PPP: Eliminate the need for kernel headers in userland.
Also fix some -Werrors.
2026-03-10 12:00:57 -04:00
vighnesh-sawant a4e1f4d8ce bluetooth: Fixes HCI_EVENT_INQUIRY_RESULT parsing when multiple
responses are returned

According to the Bluetooth Core Specification, Vol. 4, Part E, 7.7.2, for HCI_Inquiry_Result a struct of arrays is returned, and not
an array of structs. The previous code parsed it as if it is an array of
structs, so fixed that. Refactored MessageReceived so that that its
easier to implement HCI_EVENT_EXTENDED_INQUIRY_RESULT and
HCI_EVENT_INQUIRY_RESULT_WITH_RSSI going forward.

Change-Id: I9c258d1e26a4b6aa33d7acf730bddaeccf5d754b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10408
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-10 15:44:14 +00:00
Pascal Abresch 7e7ae37854 showimage,stylededit: remove bs_printf
Change-Id: If5d562376f8a889aa482f300d817e17272deb29e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10453
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: humdinger humdinger <[email protected]>
2026-03-10 14:11:18 +00:00
John Davis 32a55535a4 app_server: Fix incorrect size for bitmap hardware cursor
Currently the size of the bitmap cursor passed to the accelerant
is the upper bounds coordinate. This is incorrect and should be
the actual size of the cursor.

Change-Id: I7be05a78125d0c22843c2ace56a8ab5bda67a014
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10456
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-03-10 14:09:25 +00:00
anujbillore-0-0 119da82d54 btrfs: Fix name access and hash collision in directory lookup
Use entry->name instead of entry+1 for accessing directory
entry names. Fix Lookup() to iterate all entries with the same
hash and compare names to find the correct one, returning
B_ENTRY_NOT_FOUND if no match is found.

Change-Id: I86c3680d830491b3f78c52590047205894e2b5d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10449
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2026-03-10 12:25:26 +00:00
anujbillore-0-0 ba83d20148 btrfs: Add more validation checks in IsValid()
Check that sector_size and node_size are powers of 2,
that node_size >= sector_size, total_size is non-zero,
and num_devices is non-zero.

Addresses the TODO comment in IsValid().

Change-Id: Id2c084f6b649a0315de1454a072ab1dcf3d0a3dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10448
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-03-10 12:24:51 +00:00
anujbillore-0-0 d754d09549 btrfs: Fix pointer arithmetic in WriteSuperBlock()
The checksum was being calculated over the wrong memory region.
&fSuperBlock+N advances by N*sizeof(btrfs_super_block) bytes,
not N bytes. The correct form is (uint8*)&fSuperBlock+N which
advances by exactly N bytes past the start of the superblock,
correctly skipping the checksum field.

Change-Id: I8dba6410f2cd2d2d66e3cf484d4ac1f599449021
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10447
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-10 12:24:28 +00:00
anujbillore-0-0 d7d78c9749 btrfs: Fix code style in kernel_interface.cpp
Fix missing spaces after comment markers on lines 172 and 469,
and fix spaces-instead-of-tabs indentation on line 871.

No functional changes.
Hashtags: gsoc2026
Change-Id: I722cbccba634348d63e60527fa96bd9ec9b639ca
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10446
Reviewed-by: Adrien Destugues <[email protected]>
2026-03-10 12:23:33 +00:00
Augustin Cavalier dd2eeb7dff kernel/smp: Style fixes.
No functional change intended.
2026-03-09 21:08:52 -04:00
Augustin Cavalier dd24eecac1 kernel/smp: Distinguish CPUSet::GetBit from GetBitAtomic.
I checked all invocations of GetBit; as far as I can tell,
only the two adjusted here in smp.cpp are done while the Set
may be concurrently modified, and even then I don't know
that they really need to be atomics, anyway.
2026-03-09 20:58:54 -04:00