Commit Graph
68097 Commits
Author SHA1 Message Date
Augustin Cavalier a1ef046ad7 kernel/locks: Dump reader threads in "rwlock" command under RW_LOCK_DEBUG.
This makes debugging rwlock deadlocks easier (under kernels with this
option enabled, anyway, which it isn't by default.)
2025-10-17 15:29:31 -04:00
PulkoMandy b1a1645de4 DriveSetup: convert main view to use layouts
Change-Id: I92f3c7e3b4fb6babfa0688524d549e254f1ecebc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9703
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-16 09:01:00 +00:00
Rich Felker 8cab127ab5 libroot/musl: strptime: implement conversion specifiers adopted for next POSIX issue
the %s conversion is added as the outcome of Austin Group tracker
issue 169 and its unspecified behavior is clarified as the outcome of
issue 1727.

the %F, %g, %G, %u, %V, %z, and %Z conversions are added as the
outcome of Austin Group tracker issue 879 for alignment with strftime
and the behaviors of %u, %z, and %Z are defined as the outcome of
issue 1727.

at this time, the conversions with unspecified effects on struct tm
are all left as parse-only no-ops. this may be changed at a later
time, particularly for %s, if there is reasonable cross-implementation
consensus outside the standards process on what the behavior should
be.

Change-Id: I54f4281b23576638f22e1dabf4179ccae6135c00
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9702
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-16 02:13:26 +00:00
Rich Felker 4972edeca6 libroot/musl: strftime: fix breakage in last change (uninitialized pointer access)
commit f47a5d400b8ffa26cfc5b345dbff52fec94ac7f3 overlooked that
strtoul was responsible for setting p to a const-laundered copy of the
format string pointer f, even in the case where there was no number to
parse. by making the call conditional on isdigit, that copy was lost.

the logic here is a mess and should be cleaned up, but for now, this
seems to be the least invasive change that undoes the breakage.

Change-Id: I2ccd5c949c9db63c8d4c8e752352f71ed494fbdb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9701
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-16 02:13:26 +00:00
Rich Felker 18079f66df libroot/musl: strftime: don't attempt to parse field width without seeing a digit
strtoul will consume leading whitespace or sign characters, which are
not valid in this context, thereby accepting invalid field specifiers.
so, avoid calling it unless there is a number to parse as the width.

Change-Id: Ia683e6e8f71db8a323fec78555f3adef1bc90e6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9700
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-16 02:13:26 +00:00
Alex Xu (Hello71) 5f4a1d9171 libroot/musl: __year_to_secs: fix dangling pointer
The lifetime of the compound literal ends after the "if" statement's
implicit block. gcc also warns about this.

Change-Id: I408d77638ab82c5305bfcd31affb2b14070652f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9699
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-16 02:13:26 +00:00
nipos 832ccec747 ShowImage: Properly implement wrapping from last to first/first to last image
Fixes #19321

Change-Id: Iab8f4d508aed2809a3398ffd8b3dce6af609c72a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9607
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-15 12:17:59 +00:00
Humdinger c928bd3270 TextSearch: add context menu
A right-click opens a popup menu with useful items of the "Actions"
menu of the main window menu.

Change-Id: Ie2eb832fee48d642cec66f0a3c7212570eedb6c0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9657
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-15 10:02:24 +00:00
PulkoMandy 913c5a4298 Time: Make middle dot of clock visible in dark mode
_DrawHands modifies the high color when drawing the shadow. This
resulted in the middle dot being drawn with the shadow color.

Fixes #19633

Change-Id: I32886c56dfb22d4a83fca9164c326ddbc3fcf0de
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9601
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-15 08:26:00 +00:00
Jérôme Duval 7c089760c6 efi: fix header guard comment
Change-Id: I5528185d0b130fa8095b62d7865e51f22a68d8b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9692
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-15 06:52:57 +00:00
Jérôme Duval 6ce67a5336 smbios: support getting address from EFI
* prefer v3 over v2
* adding efi attributes in gBootVolume KMessage is a bit of a hack, but
shouldn't hurt older kernels.

Change-Id: If5ea19dafa5a845872eb8d577e77a6935539ce20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9685
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-15 06:52:57 +00:00
Jérôme Duval 4719b3c5c3 boot_loader: rename gBootVolume to gBootParams
this will be used to hold other boot parameters, for instance smbios root pointers.

Change-Id: I004a8abe553241816c0a004225e088bad1c11b47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9691
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-15 06:52:57 +00:00
PulkoMandy fc746f4acf sdhci: use clock timing presets
This allows the controller to set up its own timing registers with
default values automatically. It is especially useful when working with
multiple MMC devices, as the controller can switch to the right speed
automatically for each transaction.

Change-Id: I356f5fd289ce55d72ad1cbb5cd27f019ea6f767b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9697
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-15 06:09:43 +00:00
PulkoMandy 7645cb2eb4 sdhci: Add timeout to wait for transfer complete
To ease debugging, print the status register periodically when the
expected interrupt doesn't happen.

Change-Id: I9edb84d6c7d8259f64a3b92d86ead6d4431a6bf8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9696
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-15 06:09:43 +00:00
PulkoMandy 84ec76aeaf sdhci: move transfer_mode setup to ExecuteCommand
This allows to do things in the order specified in the specification,
and keeps the calling code simpler.

Change-Id: I3c81b9501712db4b1cff09a7b146cd2436c74be3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9695
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-15 06:09:43 +00:00
PulkoMandy eefb965db8 sdhci: initialize timeout_control register
The default value can be too small, in which case data transfers always
fail with a timeout. Since we previously didn't enable the data timeout
interrupt, this would lock things up completely.

May fix #17031, #17604, #19081.

Change-Id: I422ac599515d1199cdf69daac6ceae649e116de4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9694
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-15 06:09:43 +00:00
PulkoMandy 0336840df1 sdhci: unmask all error interrupts in the status register
Without this, the general error bit in the normal interrupt register
never gets set, and the corresponding interrupt never happens.

Change-Id: Ic950e55ab04ba7409a4f10bbab8f7a3ce9f08a49
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5057
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-15 06:09:43 +00:00
PulkoMandy 660f1dc9dd sdhci: readable dump of capabilities register
Change-Id: If97b8fbc20f4d064561698d8bf9601d7ed42d083
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9693
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-15 06:09:43 +00:00
PulkoMandy c66bb38463 Fix various Doxygen warnings in Haiku book.
- Return tags for methods that don't return anything
- ingroup without matching defgroup
- confusion between ref, a, and link tags (they are not the same)
- missed API changes (BObjectList templated owning, new url
  encode/decode API)
- duplicate defgroup definitions

Change-Id: I94a31b04a10a62e71659522c5ed77098728c0843
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9689
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-14 19:18:14 +00:00
PulkoMandy 4d9e77db67 sdhci: use condition variables for interrupt synchronization
This makes the code safer and easier to read.

Things work up to the first sector read, that tries to use a DMA
transfer. The "transfer complete" interrupt for it never happens.

I assume I am not setting up the SDMA correctly, but I have not found
what I'm missing yet. The old code accidentally gets past the first
transfers while it's not actually complete, and fails in the same way
as the new code during the second one.

Change-Id: I7c82aa0da4aea91b6c60165a50d656115270a3c4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9682
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-14 19:18:14 +00:00
PulkoMandy 51a2c5498c sdhci: cleanup, no functional changes.
Change-Id: Ie9b85e9a527b125db2f95ef9ee046daea20f7894
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9681
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-14 14:08:14 +00:00
PulkoMandy f6195731ea Add documentation for kernel condition variables API
Change-Id: Ib747c0b4559dba9c2985771447ea95c1a430e085
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9676
Reviewed-by: waddlesplash <[email protected]>
2025-10-14 14:08:14 +00:00
PulkoMandy 92cbc8ab0d Remove some obsolete build rules
CLucene and Taglib have not been updated since the switch to package
management. The old rules do not wrk since they relied on the
haiku-files.org domain. The libraries can be reintroduced as build
packages if we ever decide to resume the project that needed them
(general file content indexing).

Change-Id: Id7e3fb7c5b9070addaaa9763053d7d006f2b3484
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9690
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-14 12:02:35 +00:00
Augustin Cavalier 959feb6161 kernel/fs: Add missing early return in create_socket_fd.
May fix #19682 and others.
2025-10-13 23:16:45 -04:00
Jérôme Duval ba952ac9c0 nvme: support 64 LBAF formats
Change-Id: Ia1cc446ba1985f5e3ce80a8046aac6947b20d710
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9688
Reviewed-by: waddlesplash <[email protected]>
2025-10-13 16:04:55 +00:00
Augustin Cavalier f7d2fc176e kernel/slab: Add some more info to a paranoid ASSERT in object_cache_alloc.
This was triggered in #19782. Ultimately more information will be
needed to diagnose what overwrote the memory, and this is a start.
2025-10-10 21:16:20 -04:00
Augustin Cavalier 9359d0860b BWindow: Fix confusion between modifiers and "prepared modifiers".
The former must have B_NO_COMMAND_KEY if the shortcut has no command key,
while the latter should simply not have B_COMMAND_KEY.

This mixup meant that modifiers flags without either set were
passed back to BMenuItem, which then used them when calling
RemoveShortcut(), but that method expects B_NO_COMMAND_KEY
to be specified, so the shortcuts weren't really removed,
resulting in use-after-frees.

Fixes #19426 and related issues.
2025-10-10 16:20:03 -04:00
Augustin Cavalier 4ccb957d6c x86_acpi_cstates: Port to the new ACPI and CPUIDLE APIs.
Tested by OscarL and confirmed to be working on at least
one machine, though on others it hangs, so leaving out
of the default builds for now.

This adds an "acpi_processor_id" field to x86 arch_cpu_info,
gleaned from the MADT, so we can match our cpu_ents to ACPI
processor objects. (FreeBSD does a similar mapping, see
their acpi_cpu_probe method.)

Change-Id: Idb5e3c1fc1efaa4256d60ea17dd1824345369687
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9637
Reviewed-by: waddlesplash <[email protected]>
2025-10-10 18:24:56 +00:00
X512 31f0983fb2 remove accidentally set executable file bit
Change-Id: I6eb500ee8dc3ad0e699c3c3ec5e07d4a75264eb5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9686
Reviewed-by: waddlesplash <[email protected]>
2025-10-10 15:31:55 +00:00
Sam Roberts 262dd3c9d9 unzip: Compile with std=c99
Allows building with GCC >=15, which defaults to c23 and disallows
function declarations without parameters and old-style function
declarations.

Fixes #19584

Change-Id: Idb141b804e80d3909558abecd2c74538cb3766ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9684
Reviewed-by: waddlesplash <[email protected]>
2025-10-09 16:39:23 +00:00
X512 47538c534f ClientMemoryAllocator: use map and reference count
- Resolve TODO about using map for server area_id lookup.

- Remove server cloned area delete request logic because it is less
  efficient and robust. Cloned area delete request messages may be
  missed if client message queue is full so it may cause cloned area
  leak.

- Implement reference counting for cloned areas instead.

Change-Id: Ie434ad36c2761ab0df00d341d55a6cea67b69830
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9667
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-06 15:10:48 +00:00
X512 5247c8c14f app_server: add screen ID for BScreen::ReadBitmap
For consistency and future multiple screen support.

Change-Id: I65363a0476d6244dfc9d2a3f26546fc43a9394f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9679
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-06 15:10:16 +00:00
Máximo Castañeda 1e76bade06 Tracker scripting: count visible items
When using type-ahead filtering, the list of all entries is not the same
as the list of the visible ones. `PoseAtIndex`, `FindPose` and
`SelectPoses` all  work on the visible entries, so count those.

Fixes: #5529
Change-Id: I65cf67e544f515508b08bb661ee594244ab94952
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9680
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-05 19:58:42 +00:00
PulkoMandy f32dba563a condition_variable: fix NotifyOne possibly not notifying
The notify loop normally checks all pending condition variable entries
and notifies either all of them, or only the first one.

In the case where the first one is being removed from the condition
variable just as the notification happens, it is skipped, however, in
the case of NotifyOne, that should lead to attempting to notify the next
one.

It looks like an oversight in 6d3065508f,
where the notified threads counter was changed in a similar way, but
these two lines of code were not.

The problem seems pretty unlikely, as it would need:
- Multiple threads waiting on the same condition variable,
- The first one being removed just as the variable is notified

Change-Id: I0492c56b15b6b2871954e9114df046ec94539971
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9677
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-10-05 19:58:16 +00:00
Jérôme Duval 5cf29a22c5 ipv6: handle IPV6_V6ONLY
Haiku only accepts v6only. Fix #19773

Change-Id: Ica3788d097019fd00f83de02f44245896a4a01d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9663
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-03 17:36:54 +00:00
nipos 9584a7511e AutoRaise: Scale icon to fit the deskbar size.
Fixes #19741

Change-Id: I85858a6515361c0e03824dc156c679c8099e90e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9630
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-01 13:13:18 +00:00
Augustin Cavalier 779ae8bcd3 EHCI: Try to use physical buffers directly when possible.
EHCI has more DMA restrictions than XHCI, so if we can't use them,
we just fall back to copying the buffers as before.

Tested in QEMU, system booted successfully. However, it seems that
quite a lot of disk I/O can't use physical buffers here, probably
due to packagefs' use of uncached reads.

Change-Id: I4d35642ee1a8f5ba2531f6658f8cbbef5a7785ac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9613
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-10-01 13:09:34 +00:00
Humdinger f65a156bf8 TextSearch: Fix show/trim actions of selected sub-items
"Show in Tracker" or "Trim to selection" actions don't work when
applied to selected sub-items. With this change, we get the top-level
item of those sub-items to get to the file's path to fix this.

Change-Id: Idfda52d7cbd04598e52f6226f422f3afc6895d75
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9659
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-10-01 11:01:01 +00:00
PulkoMandy fc3e0e860a usb_rndis: improve logging and error handling
- On read errors, make sure to reset the read buffer pointer and not
  return any more packets from the incorrectly read buffer
- Fix a case where an error didn't stop the processing, and we would
  return a zero-byte packet to the network stack instead of an error
- Make sure to use different log messages for different error cases
- Use strerror where appropriate
- Add some TRACE calls to be able to fully trace the code.

There seem to be an error at the XHCI level where it has an "USB
Transaction" error (converted to a B_DEVICE_CRC_ERROR Haiku error code).
After that, despite cancelling that transfer and clearing the HALT
feature, it is not possible to receive anything from the receive
endpoint and the connexion is stuck (it appears sending data still
works, at least from the network stack point of view).

Change-Id: I58687a6eb7b19ba7e7ca594c55499b60fb8b5b26
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9658
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-28 14:01:31 +00:00
X512 b6f74b4905 app_server: do not pass BAffineTransform as-is over server link
BAffineTransform is not POD type and contains vtable. Reading it from
byte stream as-is will cause vtable corruption.

Change-Id: I1371444444ffa47f77a88f5f82b3fe6ea031b14c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9660
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-23 01:54:28 +00:00
Augustin Cavalier db179db57b kernel/events: Fix double-free in create_select_sync.
The wait_for_objects_sync destructor already deletes the set.

Fixes #19566.
2025-09-19 13:17:04 -04:00
Jim906 dc64aa7e6d nfs4: Improve delegation handling
* Use the delegation stateid instead of the open stateid when sending
  a read, write, or write stat request.
* Ensure that the uid and gid of a request reflect the user who opened
  the file in question.
* Add measures to avoid deadlocks when a delegation is recalled.
* Fix a race condition in which OpenState can be deleted before an IO
  job is done with it.
* Possible fix for #19694.

The NFS 4.0 RFC specifies that the if a delegation is held, the
delegation stateid should be used for IO requests, and for SETATTR
(write stat) requests that set file size.

Change-Id: I9604ef58e3232f64d1e02ab180c603220e967e1d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9587
Reviewed-by: waddlesplash <[email protected]>
2025-09-18 19:06:20 +00:00
Augustin Cavalier 771bccb4b9 network/stack: Assume no hook means no ancillary data.
At least for process_ancillary_data_no_container, anyway,
which is only used by the IP modules at present.

Fixes #19756.
2025-09-17 17:21:30 -04:00
Augustin Cavalier bc5eb45ad5 tests: Fix unix_dgram_test after socket signals refactor.
Some calls now need MSG_NOSIGNAL.
2025-09-17 17:06:38 -04:00
Augustin Cavalier 6b4d2c8127 tests: Add a test for #19755 to the SocketTests. 2025-09-17 17:05:49 -04:00
Augustin Cavalier 17ec872f61 network/stack: There may be no data specified in the header.
This is an odd case, but we must not crash if it does happen.

Fixes #19755.
2025-09-17 17:03:02 -04:00
Augustin Cavalier 1b745b2d9d HaikuBootstrap: tty is now pty. 2025-09-17 15:19:55 -04:00
Augustin Cavalier 39a01464d8 x86_cstates: Log errors indicating why C-states can't be used.
As long as we have MWAIT and invariant TSC, anyway.

Also add a check for VENDOR_INTEL for the C5/C6 state disabling.
2025-09-17 15:19:37 -04:00
magnetProgramming 358e90524a Icon-O-Matic: Warn when exporting unsupported gradients to SVG
SVG does not support conic, diamond, xy, or sqrt_xy gradients.
Show a one time warning and export them as linear approximations.

Fixes #19533.

Change-Id: Id49d9ea098a47088c0865d5a8609b657b0bcc45b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9636
Reviewed-by: Zardshard Zardshard <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-17 01:27:26 +00:00
Jérôme Duval 59a481a049 Terminal: support for overlined text
Change-Id: I7444acb1da4c225b4af5a527fb5b0cd2d5ac2b5d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9635
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-10 11:06:52 +00:00