66896 Commits

Author SHA1 Message Date
John Scipione
42df4f9689 Interface Kit: Adopt parent colors on controls
BControl adopts parent colors on AttachedToWindow(). Use the
adopted view and high colors for BControl derivatives before
using B_CONTROL or B_PANEL colors.

Affects the following controls:
Spinners
Checkboxes
Radio buttons
Sliders
Text controls
Buttons (get control text color already, don't pass it in.)

Affects control colors in HaikuControlLook and BeControlLook,
FlatControlLook control colors derived from HaikuControlLook.

Do not remove control flag before drawing label, we get the
correct label color now. The fallback colors are only for if
you override AttachedToWindow() on your BControl subclass to
prevent adopting parent colors.

Change-Id: I9357c0287898bff48c695a7869f3b8be108c02ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8235
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-05 17:45:01 +00:00
John Scipione
5333610f85 Interface Kit: Adopt parent colors on checkboxes and radio buttons
We do not always use radio buttons and check boxes on panel color,
use the parent colors instead if you have them. The label is left-
center aligned.

Change-Id: Id5cbd98e8ae88d3a65fb0735d45b2ad19c4afdf9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8233
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev58078
2024-09-05 15:19:09 +00:00
John Scipione
325c28a8ae package_daemon: Use document colors on problem and results window
... instead of list view background and panel text foreground.

Document color is appropriate here, this is not a list and we
don't want panel colors. Document color yields same result
as list color using default colors: black on white.

This changes the colors of the inside of the dialog that says:
"The following additional package changes have been made:" and
"The following problems have been encountered. Please select a
solution for each:"

fixes #19068

Change-Id: I5b721ad8703c73aa2da323eb189fa22033d44e5a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8232
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-09-05 15:19:09 +00:00
John Scipione
6cb94b77be package_daemon: Style fixes (100 char) related to status window colors
Change-Id: Icf8d43f6fb464adc967437b96f26eb98b3df8572
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8231
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-05 15:19:09 +00:00
Jérôme Duval
c27e4aff72 kernel: link with orphan sections warning
* this avoid letting the linker defaults to take precedence.
* add common/debuginfo.ld taken from ppc/kernel.ld for debug sections,
extended by me for Dwarf 4/5.
* put the __bss_start symbol in the .bss section.
* add asserts for expected empty sections on x86 or x86_64.

Change-Id: If34433a8d7d82b3f115fe6dbf5881c1f9ea42442
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8229
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev58077
2024-09-05 15:17:47 +00:00
Michael Lotz
b90dc7a4f3 virtio: Explicitly request queue sizes where needed.
Ensure that allocated queues can hold the amount of descriptors that
were previously communicated to DMAResources in virtio_block and
virtio_scsi. The queue allocations will now fail with B_BUFFER_OVERFLOW
if the requested size cannot be provided.

When requestedSizes are set to 0, no requirement is placed and the queue
is sized to its advertised maximum. The requestedSizes argument can be
NULL which implies all 0.

Change-Id: Ifb1e032d48f8c07aedfe2bf941f32783842c8c12
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8220
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
hrev58076
2024-09-05 15:16:11 +00:00
Michael Lotz
a6a15d5e71 virtio_rng: Use local ConditionVariableEntry.
In case the queue operation failed, the entry would stay attached to the
ConditionVariable and eventually trigger an assert when re-added on the
next iteration.

Change-Id: I347b5b1c86a7cabc12a6052f85266ef1c584c415
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8187
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-09-05 15:16:11 +00:00
Michael Lotz
16b96bccec kernel: Fix build of IORequest with tracing enabled.
Change-Id: Ic2e5637ffc037c93a4f8076162a02e56f29d8058
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8183
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-09-05 15:16:11 +00:00
Michael Lotz
49271f2383 virtio_scsi: Check return value of queue_request_v call.
This is similar to the change in virtio_block of the same name. Checking
the return value of queue_request_v and ensuring that the
ConditionVariableEntry is removed from the ConditionVariable by using a
local one.

Change-Id: I2e8e3304925cbec27a2004c8a26468946db3d46e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8182
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-05 15:16:11 +00:00
Michael Lotz
9afed349e3 virtio_block: Check return value of queue_request_v call.
Queueing can fail in which case there is no point in waiting for the
transaction to complete as it will always time out. Instead check the
return value and skip waiting.

This requires the use of a local ConditionVariableEntry or an extra
ConditionVariable::NotifyAll as otherwise the entry is never removed
from the variable. As the creation of the entry is not expensive,
using a local variable seems simpler.

Change-Id: Ie697659a35442d965bc5cf2a636ca41841f9acff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8181
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-09-05 15:16:11 +00:00
Michael Lotz
b6fcc22fd1 virtio_block: Use MutexTryLocker in do_io callback.
Change-Id: I0e2adb1332459555e52ef83172c6a939376b1b78
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8180
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-05 15:16:11 +00:00
Michael Lotz
171cfa834d kernel/util: Add a MutexTryLocker AutoLock variant.
This can be used to replace mutex_trylock/mutex_unlock pairs. Once the
locker has been created, the success of the locking attempt needs to be
checked via locker.IsLocked().

Change-Id: Iba4b4ce21cac5059a3577a84a6eebe28d2cc4058
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8179
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-05 15:16:11 +00:00
Michael Lotz
b9addf62e9 virtio: Allocate the same entry count for indirect descriptors.
The maximum supported descriptor count is used at least in virtio_block
as the maximum vector count for IO operations. When the indirect entry
count is set lower than the supported one and indirect descriptors are
used, virtio_block can overrun that count as it was given a higher max.
Queuing would then fail and lead to transfers that never complete and
timeout after 10 seconds because the return value was not checked.

This was easily reproducible with lots of disk IO under QEMU where such
indirect descriptors are used with a maximum of 256 while the previous
hardcoded indirect count was just 128.

Change-Id: Id6f87b318e93506b04e65807d627a1cf2e8e39b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8178
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-09-05 15:16:11 +00:00
Augustin Cavalier
0f90b34722 BFS: Terminology cleanup in BlockAllocator.
* Rename NumBlocks to NumBitmapBlocks, as this is the number
   of blocks in the block bitmap, not on the filesystem.

 * Rename AllocationGroup::Block(index) to Chunk(index), as it refers
   to a "chunk" of 32 bits within the bitmap block. This gives us
   one less usage of the term "block" in this file.

 * Remove superfluous comment.

No functional change intended.

Change-Id: If736387fcd9963a4a74bb0dde12ede81da5502f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8185
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58075
2024-09-05 15:14:19 +00:00
Andrew Lindesay
f6a5a98701 HaikuDepot: Fix Text Colors
The colors in the user usage conditions are
corrected.

Change-Id: I509441f5185ec521053045d2406d901a0644b0c7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8234
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev58074
2024-09-05 15:13:23 +00:00
Augustin Cavalier
f060b7ece8 packagefs: Use [] instead of [1] in StringData definition.
This lets the compiler skip adding padding, saving us 8
(or 7, depending on how you look at it) bytes per StringData
(on x86_64, that is.)
hrev58073
2024-09-04 18:53:57 -04:00
Augustin Cavalier
e3f2b2d790 packagefs: Print the hash table size in the StringPool overhead. 2024-09-04 18:52:49 -04:00
Augustin Cavalier
8e33a0dacf packagefs: Use SinglyLinkedList for PackageNodeAttribute.
We never actually remove these (except on destruction) and only
iterate over them sequentially, so just use a singly linked list.

Combined with previous changes, this reduces the size of NodeAttributes
from 64 to 48 bytes (on x86_64).
hrev58072
2024-09-04 14:21:58 -04:00
Augustin Cavalier
df44e515de SinglyLinkedList: The sole Iterator is really ConstIterator.
It behaves the same way as DoublyLinkedList's ConstIterator,
so let's name it the same way for consistency.
2024-09-04 14:15:20 -04:00
Augustin Cavalier
3e6902c3f4 SinglyLinkedList: Rename Size to Count.
So that it has the same naming as DoublyLinkedList.
No functional change. It seems there aren't any users
of this API in the default build at the moment.
2024-09-04 14:04:46 -04:00
Augustin Cavalier
d6dd251e6c packagefs: Remove some last remnants of V1 support.
* PackageData::fVersion is (for now) static const, until such time
   as there's a HPKGv3.

 * Remove locking from DataAccessor as it was only needed for V1.
2024-09-04 14:03:07 -04:00
Augustin Cavalier
e5f569eedd packagefs: Don't bother with depots for most of the object caches.
We want them for the heap buffers, but the rest will generally only
be used when other packagefs locks are acquired (during mounting
or unmounting of packages), so the depots are just a waste.
2024-09-04 13:50:09 -04:00
Augustin Cavalier
d4d360a0d7 ACPI: Reword the new comment in AcpiOsMapMemory for clarity's sake. hrev58071 2024-09-04 13:21:28 -04:00
Augustin Cavalier
3dc487fe1c kernel/fs: Ignore FD in fd_and_path_to_dir_vnode if an absolute path was specified.
This is the same thing fd_and_path_to_vnode does.
hrev58070
2024-09-04 13:16:56 -04:00
Owen Anderson
0caf23319c arm64: Use DEVICE_GRE memory when mapping MTR_WC.
* This is the closest thing ARM has the semantics of write-combining
  MTR on x86.

Change-Id: I12a1582e0af871e2ab729262e90695ffe928c85b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8223
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58069
2024-09-04 17:15:24 +00:00
Owen Anderson
4e4d316738 arm64: Reserve ASID 0 for the kernel.
Change-Id: I1b80d4d3d2e34e75bc4f521bb8e97b090ae40daa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8222
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-04 17:15:24 +00:00
Owen Anderson
32c542bdf3 arm64: Adding tracing points to VM subsystem
Change-Id: I7a777738ca2d152c3f07b9c3d498d536ccf7d4b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8221
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-04 17:15:24 +00:00
Owen Anderson
088b72e77c arm64: Clear low bits in the VA when querying.
Change-Id: I4e948c0ecc15a6765a176e6ecc6858a61dc14468
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8192
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-04 17:15:24 +00:00
Owen Anderson
8cb8c3d756 acpi: Map memory with writeback caching enabled.
* This fixes arm64 where disabling caching also disables
  unaligned accesses.
* This matches how FreeBSD implements this callback.

Change-Id: Iee081d4ecff05b05c3758502d0cdacfbc56b11d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8191
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
hrev58068
2024-09-04 10:24:00 +00:00
Owen Anderson
4b9a9eab69 arm64: Always disable interrupts while taking sAsidLock.
Change-Id: Ifce9acb8c29fbb7bce90ab1dbee901fbf47827a9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8190
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58067
2024-09-03 21:37:22 +00:00
Owen Anderson
4805230235 arm64: Flush TLB by ASID when servicing page faults.
Change-Id: Ib68f3f300890c0bdf8a9d335e0c76a22d9fe14c3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8189
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-03 21:37:22 +00:00
Owen Anderson
9406d2a4f2 arm64: Flush the entire ASID from the TLB anytime we reuse one.
Change-Id: I939e0512ecce4041a5625eb1962545f5468719ee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8174
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-03 21:37:22 +00:00
Owen Anderson
40f58daab3 arm64: Fix for Map() where a PA base was missing.
Change-Id: I7a3536357fe1a783757cd600ef9f651b0d6bb7bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8173
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev58066
2024-09-03 21:33:08 +00:00
Owen Anderson
26741b0f82 arm64: Defer allocating empty page table until later in vm init.
* Fixes double-locking panic.

Change-Id: I51f3b82e65ad3fad90fa777347f24ca0567f129d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8172
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2024-09-03 21:33:08 +00:00
Owen Anderson
50bb52021c arm64: Fixes to the page fault handler.
* Improve atomicity of PTE updates.
* Centralize a few constants.

Change-Id: Iaeeb82e9dc7f7ca97d13ba816fb72c6475754310
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8171
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-03 21:33:08 +00:00
Owen Anderson
a64e78a34e arm64: Clean up dead MMU code.
Change-Id: I67acc10f63d63d22900b56a6981af1c0eb25af7a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8162
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-03 21:33:08 +00:00
Owen Anderson
73c517437d arm64: Implement VMSAv8TranslationMap::Query and UnmapPage in terms of ProcessRange
Change-Id: I183ef62ecacab0f14bf533a845aaa96920d0e764
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8161
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-03 21:33:08 +00:00
Augustin Cavalier
2301efc9d9 pthread: Make rwlocks keep waiting on EINTR.
As specified by POSIX.

Fixes #16708.
hrev58065
2024-09-03 16:17:06 -04:00
Augustin Cavalier
4812636028 pthread: Return EINVAL for pthread_detach() if the thread is already detached.
Fixes #16706.
2024-09-03 15:55:44 -04:00
Augustin Cavalier
797b4eef8b pthread: pthread_cancel() on non-existent thread should return ESRCH.
As per POSIX. Fixes #16705.
2024-09-03 15:51:10 -04:00
Augustin Cavalier
95a871b37d libroot: Handle invalid timeouts being passed to unnamed_sem_timedwait.
According to the POSIX specification:

> The sem_timedwait() function shall fail if:
> [EINVAL]
> 	The process or thread would have blocked, and the abstime
>	parameter specified a nanoseconds field value less than zero
>	or greater than or equal to 1000 million.

Fixes #16693, #16694.
2024-09-03 15:38:19 -04:00
Augustin Cavalier
74181c7e1f libroot: _SC_SEM_NSEMS_MAX is functionally unlimited.
Haiku's Be-style semaphores have a global limit, but the
POSIX-style semaphores do not. Functionally there will be a limit
as to how many can be waited on at a time, but one will probably
hit thread limits before that happens.

This matches what FreeBSD does: specifies 256 for _POSIX_SEM_NSEMS_MAX
but then returns -1 for the sysconf value.

Fixes #16692.
hrev58064
2024-09-03 14:57:54 -04:00
Augustin Cavalier
8260adb68d gnulib-test-mbrtowc: Add test for the change in previous commit. 2024-09-03 14:35:47 -04:00
Augustin Cavalier
0559911493 ICUCtypeData: Fix conversion of surrogate pairs.
If a multibyte Unicode character is specified to MultibyteToWchar
one byte at a time, then resetting the state will lose the data
for the second character. We thus shouldn't re-read but instead
keep the existing character and just read the second one.

Fixes #19035.
2024-09-03 14:34:30 -04:00
Augustin Cavalier
c686c2216c ICUTimeConversion: Also override to "GMT" in Gmtime().
Otherwise, when the current locale timezone is one that has
an offset to GMT of 0, we would wind up with its name in tm_zone
and not "GMT".

Follows up to #19047.
hrev58062
2024-09-03 14:02:46 -04:00
Augustin Cavalier
5b4d5ef897 ICUTimeConversion: Handle GMT properly in _FillTmValues.
We can be called with a timezone that isn't the same as the one
set in the current locale, in particular from gmtime(). We thus need
to handle this case properly by checking that the gmtoff is really
the timezone in the locale, or if it's GMT, to just use a static
string for the tm_zone instead.

Fixes #19047.
hrev58061
2024-09-03 12:51:59 -04:00
Augustin Cavalier
6b468e5635 libroot: Replace fpurge implementation with upstream glibc's.
This doesn't seem to fix #19039 however.
hrev58060
2024-09-03 12:02:18 -04:00
Augustin Cavalier
0ab7cc6d60 BFile: Use AT_FDCWD instead of -1. hrev58059 2024-09-03 12:01:21 -04:00
Augustin Cavalier
a6de998330 runtime_loader: Use AT_FDCWD instead of -1. 2024-09-03 12:01:00 -04:00
Augustin Cavalier
136442cb5d kernel/fs: Accept only AT_FDCWD and -1 for negative FDs in path_to_vnode.
-1 was our previous value for AT_FDCWD, so we should retain support
for it here for the moment. All other negative values will now result
in an error.

Part of #19048.
2024-09-03 11:51:31 -04:00