Commit Graph
68636 Commits
Author SHA1 Message Date
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
Augustin Cavalier 11280e1b51 kernel/device_manager: Remove unnecessary includes of Locker.h. 2026-03-05 13:35:14 -05:00
John Davis 4d75e43574 hyperv: Implement additional driver functions
* Switch instance ID from string to raw attribute
* Implement device allocate/free GPADL functions
* Add definitions and functions for additional VMBus packet types

Change-Id: I01e9a30f567358fad520df95b1c14b7ea9671915
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10402
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-05 18:14:42 +00:00
Augustin Cavalier a3fe30c940 kernel/fs: Rename create_vnode to file_create_vnode.
Matches dir_create_vnode. As discussed on the review
for the previous commit.
2026-03-05 13:00:18 -05:00
Jérôme Duval 99fe0add21 kernel/fs: a path ending with slash means a directory
for get_dir_path_and_leaf: the leaf is .
for create_vnode: when a name is ., can't be created.
this means dir_create() can ignore trailing slashes (like #2016)

this fixes golang test TestRootConsistencyCreate/file_symlink_slash

Change-Id: Ib0ee956a8e2d28b572d44ba1be25a6d1341b0dfa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10387
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-05 17:53:22 +00:00
Augustin Cavalier 585ac6895e kernel/user_mutex: Let single-threaded applications sleep on mutexes.
It seems some single-threaded applications do use them, which doesn't
result in a deadlock because they use timeouts (or maybe wait on
signals, too.)
2026-03-05 12:46:31 -05:00
X512 02683a08de View: optimize Fill/StrokePolygon with raw points array argument
Converting points array to `BPolygon` has significant cost, including
heap allocation, when drawing a lot of polygons.

Change-Id: I81e6b4031bac4beadcc79412c58eedddffc00a82
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10337
Reviewed-by: waddlesplash <[email protected]>
2026-03-05 02:42:51 +00:00
Augustin Cavalier 7ef695df5c kernel: Allocate user_mutex_contexts when adding the second thread to a team.
This allows us to gracefully fail if memory allocation fails,
rather than panic()ing. If a single-threaded application tries
to wait on a non-shared user_mutex in single-threaded mode, it
will now be dropped into the debugger.
2026-03-04 21:42:03 -05:00
Augustin Cavalier e6569ec320 kernel: Add an AssertLocked() to Team.
The mutex member is private, so this is necessary for other methods
to assert the team mutex is locked.
2026-03-04 21:38:43 -05:00
Augustin Cavalier f1425c9e61 freebsd_network: Include <thread.h> first, to avoid ASSERT incompatibilities. 2026-03-04 21:35:11 -05:00
John Scipione f41b44fa34 Tracker: Place window background images at top-left of extent
... instead of top-left of view bounds.

This only affects backgrounds inside windows (not on Desktop).

The view bounds may be scrolled over but we don't want to draw the
background from the scrolled over position, we want to draw from
the top-left of the window which is the top-left of the extent.

We also have to set the icon origin in the view state to the extent
instead of the view because it will be different if scrolled.

Change-Id: Ieff9d0a66086d116d46ffbd713b2dcd45d312870
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10413
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-04 22:42:42 +00:00
John Scipione c91678c156 Tracker: We only need to consider visible poses for extent
... if filtering use filtered pose list instead.

Change-Id: I77c666a6c061a3ac0d1c1174f7bd430ff7ce22c9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10412
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-04 22:42:42 +00:00
John Scipione e8633deca7 Tracker: FrameResized() handling only on Desktop
... not on Desktop windows.

Change-Id: I7bcfac19b54fb2b1e94438143403fe6880a3090e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10411
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-04 22:42:42 +00:00
Kacper Kasper bd6b50bed7 Refactor Support Kit tests
* Use CPPUNIT_TEST(_SUITE) macros and autoregistration.
* Remove unnecessary header files.
* Consolidate Archivable, Autolock, MemoryIO and MallocIO tests into
  one .cpp file.
* This structure makes it easier to add new tests - from adding .cpp
  and .h + updating Addon.cpp file (3 files), only one .cpp file is
  needed now.
* Convert string_utf8 test from standalone app to CppUnit test.

Change-Id: I18d90eb66b7cfc5576626b66ed85e47eb64547bf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10399
Reviewed-by: Kacper Kasper <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-04 17:58:38 +00:00
Augustin Cavalier ff0cd4274c SoftwareUpdater: Move "complete" logic to ProgressApplyingChangesDone.
This is more like how pkgman does it. Behaviorally, users should
not notice a difference.
2026-03-03 17:45:42 -05:00
Augustin Cavalier 61c7d7e4ee Package Kit: Move a number of headers into the source directory.
These classe aren't used, and probably shouldn't be used, outside
Package Kit itself.

Also drop some files from libpackage_build that are not needed.
2026-03-03 17:45:28 -05:00
Augustin Cavalier 5f0f0b02b4 Package Kit, pkgman, SoftwareUpdater: Offer to delete old state directories.
This adds a new job to the Package Kit, and an invocation
in pkgman after changes are applied. The job takes a time_t before,
and an int32 minToKeep, and (after confirmation) deletes all state
directories which were last modified before that time, but also
keeps at least the minimum specified.

pkgman defaults to calling it with (now - 30 days, minimum 10).
SoftwareUpdater does the same, but without bothering the user
and just defaults to doing the cleanup.

Change-Id: I15f5232b11daba5955e7fa07f696ad7785507931
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10404
Reviewed-by: waddlesplash <[email protected]>
2026-03-03 22:14:57 +00:00
Augustin Cavalier 79ab5081b2 Package Kit: Rename InstallationLocationInfo::OldState to ActiveState.
It doesn't refer to some random old state, but the currently active
one. (If the currently active state is the default one, then it will
return nothing.) So, this should make things clearer.

Change-Id: Ib3fe842f5fb51eaf2ef2f31bad8b292b47a3fb36
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10403
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-03 22:14:57 +00:00