Commit Graph
68070 Commits
Author SHA1 Message Date
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
Jérôme Duval 2858af6540 Terminal: CSI REP min value is 1
Change-Id: I73666750b92ed64affb975dcba207c972567ea88
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9634
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-09-10 11:06:52 +00:00
Jérôme Duval 6ec9699bb5 Terminal: add support for DECRQM
* report mouse state, report cursor blink, report bracketed state
* introduce modes for flags to simplify the code
* keep modes in TerminalBuffer, TermParse can then write responses.

Change-Id: Id9961e90a96420ee63aca17375bd7f0a748d083a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9633
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-10 11:06:52 +00:00
Augustin Cavalier 368d09fdac freebsd_network: Clean up attach logic and separate USB logic.
USB code now goes in a separate static library.

This also paves the way for supporting more busses than PCI
and USB in the compat layer.

Tested with realtekwifi, still works.
2025-09-09 19:05:57 -04:00
Augustin Cavalier a1b4eeff4d freebsd_network: Overhaul MII attach code.
* Move ukphy ("unknown phy") code into the compat layer rather
   than duplicating it across many drivers.

 * Move MIIbus related code to a separate static library.

 * Genericize most attach methods that touched the MII bus directly
   to not need the code that's now in the static library.

Tested with rtl81xx, still works.
2025-09-09 16:59:21 -04:00
Augustin Cavalier 2aab5f5f14 FlatControlLook: Pull in color tinting changes.
This partially synchronizes to "upstream" commit 3c144bdfe53c61e2589e209d419f28f94ac77151.
Some of the more functional changes and new features I didn't import,
but mostly just the color tinting changes to match the new control colors.
2025-09-09 13:23:28 -04:00
Augustin Cavalier b9438b95f5 kernel/slab: Alter behavior of the ObjectDepot under PARANOID_KERNEL_FREE.
Instead of reusing objects as fast as possible, use two magazines per
CPU, and allocate and free objects from separate magazines, always
exchanging full and empty ones with the depot. Furthermore, reverse
the ordering of objects in full magazines, to get FIFO rather than
LIFO behavior.

sys time on "git status" and "compile HaikuDepot" benchmarks in
a 4-core VM seems increased by about 5% at most (e.g. 8.2s -> 8.6s.)
This may help with further catching use-after-free and other like
problems, so it seems worth it to leave enabled on KDEBUG.
2025-09-08 17:21:38 -04:00
PulkoMandy 902a3c1292 Devices: actually use isapnp_devids to show known ACPI node names
- Update the file with the latest version (from
  https://uefi.org/sites/default/files/resources/devids%20%285%29.txt)
- Tweak the Jamfile and awk script a bit to fix conflicts with acpi
  device IDs structures, add missing const, allow tabs in the input file
  instead of spaces (it is not formatted consistently)
- Match the hid or cid of ACPI devices to show well known names from the
  file if available and we have nothing better.

Change-Id: Iea11ca44c8fef245d044a7535e7e7a13230be848
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9632
Reviewed-by: waddlesplash <[email protected]>
2025-09-08 21:16:13 +00:00
Augustin Cavalier e3d01e53a2 kernel/slab: Use FIFO queuing for PARANOID_KERNEL_FREE only.
FIFO does seem to be a slight performance hit, and the security benefits
are probably not too large in the end. So just use LIFO otherwise.
2025-09-08 14:06:51 -04:00
Augustin Cavalier cac7959664 openbsd_network: Increment the OPACKETS counter in ifq_dequeue.
Otherwise it's never incremented, and the number of transmitted
packets in ifconfig would stay 0.
2025-09-08 13:12:27 -04:00
X512 508ff7e831 app_server: consolidate BRegion sending format
Change-Id: I6ba33fb3583f1292af7119c16964f7bec16aef54
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9629
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-09-08 16:42:25 +00:00
X512 647aba7574 ServerLink: move Read*/Attach* method implementations to LinkSender/Receiver
Change-Id: Ib4dec3348b1438bbdfbaf18146d8aebb1978c39c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9631
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-08 16:42:25 +00:00
Jim906 0f9d0e5cda nfs4: Improve debug output
* Make more info available from Dump functions.
* Allow locking to fail in Dump functions to avoid deadlocks caused by
  debug output.
* Make corrections to the nfs4_unlink() changes in hrev59023.

Change-Id: I8e5431baacb3cfa0baaedd2695c597549e746d2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9628
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-09-08 15:58:36 +00:00
PulkoMandy 7270c1788f Missing NULL check for CurrentWebView()
Should fix #19722

Change-Id: Ie3ff6ee15559a2726ca88eabdb8dbab2a81447e5
2025-09-07 11:29:27 +02:00
Augustin Cavalier 01f5b3146f kernel/fs: Add some missing descriptor open_mode checks. 2025-09-04 12:48:04 -04:00
Andrew Lindesay 5b41bc0066 HaikuDepot: Fix scrollbar position on row removal
Resolves #19728

Change-Id: Ie480bbd05eee84b417a83fc2ab5e822431ee7233
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9627
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-09-04 15:42:27 +00:00
Augustin Cavalier 01d48fcd27 Rename "tty" driver to "pty".
It was already that way in the source tree.
2025-09-03 19:21:03 -04:00
Augustin Cavalier c04a71fb41 Change a number of B_FILE_ERROR into B_IO_ERROR.
B_FILE_ERROR == EBADF == "Bad file descriptor". It's used
when there's no valid file descriptor, or when attempting
a read or write operation on a file descriptor not opened
with that mode. All other places should use B_IO_ERROR or
some other like value, instead.
2025-09-03 19:16:06 -04:00
Augustin Cavalier 64322ea7d0 ramfs: Remove open-mode checks in read and write hooks.
The VFS already does this for us, other filesystems don't
check this either.
2025-09-03 18:57:02 -04:00
Augustin Cavalier f7c3fa972c tty: Notify disconnections properly, and with B_SELECT_DISCONNECTED.
The tty_notify_select_event() at the end of tty_close_cookie()
checked if the other_tty's open_count was > 0 before notifying.
But in the case where the master is closing all children,
it will drop to 0 and leave things still in the select pool.
So we should notify unconditionally here.

Additionally, use B_SELECT_DISCONNECTED (i.e. POLLHUP). This matches
what Linux seems to do.

Fixes #19714.
2025-09-03 18:37:47 -04:00
Augustin Cavalier 5da70510b3 kernel/fs: Fallback in vfs_request_io if read_pages/write_pages aren't available.
Add a comment indicating why we don't call them unconditionally.

Fixes #19642.
2025-09-03 17:02:56 -04:00
Augustin Cavalier 2199532364 file_systems: Overlay layers only support being mounted with super volumes.
Fixes #16669.
2025-09-03 16:39:34 -04:00
Augustin Cavalier 92209b9023 kernel/slab: Add checks to object_cache_alloc for 0xdeadbeef.
We should always find it if PARANOID_KERNEL_FREE is enabled
and the object size is at least 2 pointers.
2025-09-03 15:43:04 -04:00
Augustin Cavalier bc50ada648 kernel/slab: Use FIFO instead of LIFO queueing for the object cache.
This should make use-after-frees more likely to be caught by the
standard paranoia facilities (and make them less likely to be
exploitable as memory will take longer to be reused.)
2025-09-03 15:41:58 -04:00
Jérôme Duval 0937305b84 gnu/sched.h: fix CPU_COUNT on gcc2 C89
Change-Id: Ia193e342d2bbac8060189f062e35aca47426444e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9626
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-03 15:10:23 +00:00
Joachim Mairböck b54f586058 sys/wait.h: add WCOREDUMP as alternative to WIFCORED
As this is part of POSIX since 2024, WCOREDUMP is the new default name.
WIFCORED is retained under _DEFAULT_SOURCE.

Fixes #19735.

Change-Id: Ic3f65e47b436bae92fe82ef73c3094be6bc9f29d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9622
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-01 16:33:57 +00:00
Jim906 53930893f4 nfs4: Improve compliance with VFS policy
* Eliminate the use of acquire_vnode as a probe to see whether a node
  has been constructed on the client side.
* Put the root node in unmount.
* In DirectoryCache::_LoadSnapshot(), don't mark a node removed unless
  certain that no other hard links exist.  The old logic might cause
  problems if, after marking a node removed, the client found another
  link to the file in another server directory.

The reason for removing the asserts from FileSystem::GetInode() is
that, with get_vnode calls replacing acquire_vnode calls, this may be
called earlier in the process of file creation, before
FileSystem::fInoIdMap contains an entry for the new file.

The changed logic in _LoadSnapshot isn't directly related to the new
VFS asserts.  It is meant to correct a problem that I noticed
incidentally when making the other changes.

Change-Id: I075485bc68ea9443be899add948116f0a0bca047
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9624
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-09-01 15:59:09 +00:00
Jérôme Duval e1e1c75a1f gnu/sched.h: fix CPU_* definitions to match glibc
add CPU_COUNT and cpu_set_t

Change-Id: I9b92cab27a8bb4fda71a99721801013647e02588
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9618
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-01 08:00:26 +00:00