Commit Graph
68653 Commits
Author SHA1 Message Date
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
Augustin Cavalier 97a65a027d kernel/smp: Use rw_spinlocks for ICI locks.
This allows read spinlocks to be used in check_for_message
and return_free_message.

On a 4-core VM, there don't seem to often be concurrent readers
(a counter I setup got only about 400-500 hits for booting up
and starting a web browser, at most.) But on bare metal (i3,
2 cores x 2 hyperthreads) we get it a lot more: 30,000+ times
during boot alone.

Kernel map invalidation (with a hack to invalidate all every time)
across boot-to-desktop takes a cumulative ~68.0ms before this change,
and ~61.0ms after, on the bare metal system. (On the VM it's also lower
after this change.)

Presumably on systems with more CPUs it will get hit even more
often still. So this optimization seems worth it.
2026-03-09 20:58:54 -04:00
SED4906 ddff61f30e kernel/x86: Fix race in kernel TLB invalidation
Like the other race, this becomes an issue once
PCID is supported. If a user thread initiates a
TLB flush and is interrupted, it may have a new
PCID next time, so arch_cpu_invalidate_tlb_list
returns without invalidating any TLB entries...

Change-Id: I91016c2e244f9f5c1c482596f2f62952830644de
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10450
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-09 23:15:55 +00:00
Pascal Abresch 63c8acd7fd libroot: Clang build fix.
Fixes #19963.

Change-Id: I3bfd04b8082ade887aae9f02a3a6c27758002e17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10452
Reviewed-by: waddlesplash <[email protected]>
2026-03-09 22:23:07 +00:00
Nathan Patrizi c971c7adfc Tracker: Fix number format in items count
* Fix cases where the total/selected item count value was not formatted
  (e.g "1000/1,000 selected").
* Fix the item value format when type-ahead filtering.

Change-Id: Ia7f64443227ee1a03ce96ab441cb4ffc77d026df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10423
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-03-09 22:00:07 +00:00
mohammedrattia 2e00deeaa0 MediaPlayer: making Next() in support/FileReadWrite.cpp more efficient
This commit should fix: "TODO: Adding one char at a time is very inefficient!"
- Add data to string in bulk using memchr instead of char-by-char.
- Added some unit tests for FileReadWrite::Next in UnitTester
- Created Jamfile to make libmediaplayertest.so

Change-Id: I2916bd10c142609a8a64273f9b1eac9b98fcb260
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10397
Reviewed-by: Máximo Castañeda <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-03-09 20:42:11 +00:00
Jérôme Duval a645d9d409 network/stack: use the total length in socket_receive_no_buffer()
fix golang sys/unix/TestSendmsgBuffers

Change-Id: I70b5431a7223ed4143dcd0d6abce27d0b6c69bd5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10415
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-09 17:59:06 +00:00
Augustin Cavalier de74304510 kernel/x86: Always call arch_cpu_global_tlb_invalidate with interrupts disabled.
Fixes a race. Discovered by SED4906.

Change-Id: I2b267312e9f3ff32bafa2ac2784f5d4a9905e24e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10416
Reviewed-by: waddlesplash <[email protected]>
2026-03-09 17:37:05 +00:00
Nathan Patrizi 5d19bcda45 Tracker: Prevent crash when canceling empty trash operation
Prevent crash caused by canceling an empty trash operation while it is
calculating the total items and size. Fixes a double free caused in the
BObjectList destructor by ensuring the trash item is removed from the
list even if the user cancels.

Fixes #19725

Change-Id: I8355483f70399a8eb5f52f633ccfd5e219f17aad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10422
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-09 16:49:59 +00:00
John Scipione 81a9d6db7c Tracker: Minor tab => space style fix
Change-Id: I0413c53fc4aa03e907194843ee95cae83cf8bd0c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10420
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-09 16:45:27 +00:00
John Scipione ed34c67cdb Tracker: attrHash variable minor code simplication.
Change-Id: I609148f32ced27a19d8ffcf102ae3abce3894cb9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10419
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-09 16:45:27 +00:00
Oscar Lesta cf67dabcbd amd_pstates: was missing a ')' in a log string.
Change-Id: I07b4a706f876b1ffd4d56f30eede7f065158beef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10444
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-09 09:22:39 +00:00
John Davis 480c96550c hyperv: Refactor read packet function
Currently, a packet being read is split into header and data buffers.
Change to a single buffer to simplify logic in drivers, especially
for those that receive packets with variable sized headers.

This change also implements the pending send size functionality for
the receive buffer.

Change-Id: Ic4a3698fcfe813fbcf4fd9c1941102b5adaeb3b2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10418
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-03-07 09:06:41 +00:00
John Davis 76c0c7d4bb hyperv: Rename device type item name to reflect data type
Change-Id: I86d4d0dd08beef3b403d82713d2299840d73818f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10417
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-03-07 09:06:41 +00:00
Autocomitter 60b81a4ef7 Update translations from Pootle 2026-03-07 08:09:29 +00:00
John Davis a3eda7cbda hyperv: Add support for mouse device
This change adds driver support for the Hyper-V HID mouse (fixes #16665 and #18882).

Change-Id: I45ee1f3c2fad10f07080d7966184856bd0a22f61
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10334
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-03-06 15:53:52 +00:00
Augustin Cavalier 767d7cf9fa libroot & kernel: Replace strchr, strcpy with musl's versions.
They call out to other library functions, which are better optimized
than the old naive implementations.

Add -fno-builtin to the musl strings Jamfile, otherwise GCC
generates infinite recursion in strcpy, apparently.
2026-03-05 17:31:30 -05:00
Augustin Cavalier fb0556ae2b BFS: Remove the inode from the Removed list with the transaction lock held.
Fixes #19953.
2026-03-05 15:58:28 -05:00
Augustin Cavalier 26f8f18b1c BFS: Assert in RemovedInodes(), don't just have a comment.
This would've caught the cause of #19953.
2026-03-05 15:56:48 -05:00