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.
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]>
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]>
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]>
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]>
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]>
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]>
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.
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.
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]>
* 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]>
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]>
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]>
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]>
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.
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]>
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]>
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.
... 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]>
* 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]>
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]>
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]>