Commit Graph
67581 Commits
Author SHA1 Message Date
Augustin Cavalier a23e085678 m68k, arm: Rename arch_string.S to memcpy.S.
As it only contains a memcpy implementation.
2025-03-05 12:53:16 -05:00
Augustin Cavalier 62793934a1 x86, x86_64: Move (userland) memcpy, memset out of arch_string.S/.cpp.
Put the C++ versions in files with their own names, and
rename the assembly thunks to "commpage_string.S", as it
really just invokes the commpage versions.

The kernel x86 arch_string.S is left alone for the moment
as it will be replaced in the near future anyway.
2025-03-05 12:48:54 -05:00
Augustin Cavalier 8a86fccb1b arm64, riscv64: Drop arch_string.S.
It was empty and unused on these architectures.
2025-03-05 11:57:05 -05:00
Augustin Cavalier 1707ab1299 runtime_loader: Use posix_string_arch as built for libroot.
Instead of using individual files from it.
This will make changes to how it is built easier to make.
2025-03-05 11:55:27 -05:00
Augustin Cavalier 2b52ddef79 libroot/string: Use '==' and not '-' and '== 0' for all except the last comparison.
Should make the code clearer and save a branch in the loop.
Also add Haiku, Inc. to copyright notice.
2025-03-05 11:12:41 -05:00
Augustin Cavalier 5d46b254d4 libroot/string: Apply the same optimization to strncmp as in strcmp. 2025-03-05 10:45:55 -05:00
Oscar Lesta 3096860403 bin/keymap: show help with -h, use -H for --header.
This is less surprising than having it the other way around.

Adjusted the "MkKeymapHeader1" action on src/servers/input/Jamfile accordingly.

Change-Id: I9fb8f8d7d0cfde493c03755beafbff73222cba93
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9066
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-03-05 13:01:05 +00:00
John Scipione cb4a168e37 Tracker: menu parameter is ambiguous, rename to parent instead
Change-Id: I9a8811ff8c142efcdfbebae0c2b6e438290eafcd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9061
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-04 14:50:27 +00:00
Augustin Cavalier 2e3af8f296 ralinkwifi: Import MT7601U driver from FreeBSD.
It's branded as a MediaTek device, but the firmware
copyright is Ralink.

From upstream b96864412700a2a5b5e9aaf5d6513ec062cfc96f.
Includes adaptations to make it compile on Haiku.
2025-03-03 16:46:01 -05:00
Augustin Cavalier 1f00d7e571 freebsd_network: Add firmware_get_flags.
Needed by the MT7601U driver.
2025-03-03 16:28:39 -05:00
Augustin Cavalier 640cf189a0 ralinkwifi: Cleanup interrupts glue. 2025-03-03 16:20:20 -05:00
Augustin Cavalier 5059b85380 kernel/condition_variable: Add a cpu_pause in the RemoveFromVariable loop.
All the other spin-loops have this, so this loop should too.
2025-03-03 15:13:21 -05:00
Augustin Cavalier a0c4b9a162 SCSI: Use ConditionVariable::NotifyOne, not NotifyAll.
This matches the previous behavior (which just used release_sem
or _etc with a count of 1.) The one waiter might delete the object
containing the condition variable on wakeup, so the difference
does matter.
2025-03-03 15:12:31 -05:00
Augustin Cavalier 73e7455250 BBlockCache: Don't use weak symbols except on Haiku.
We may compile on systems that don't use ELF (e.g. Darwin/macOS.)
Avoid a dependency on the feature where we don't need it.
2025-03-03 14:47:51 -05:00
Augustin Cavalier d56e1a13aa kernel/locks: Make the assertion in mutex_destroy print a backtrace of the owning thread. 2025-03-03 14:43:30 -05:00
Augustin Cavalier 752c6e8b9e kernel/thread: Fix a TODO in get_next_thread_info().
Just find the previous thread and then get the one after it in
the general case. This avoids problems with "unsorted" thread lists
as found in the kernel team or when IDs wrap, with the previous
logic only kept as a fallback if the last-fetched thread
does not exist anymore.
2025-03-03 14:36:01 -05:00
Augustin Cavalier 0c76e02c58 libroot/string: Compare size_ts in memcmp(), not uint32_ts.
Should get a small bit more of performance on 64-bit architectures.
2025-03-03 14:16:05 -05:00
Augustin Cavalier 333274ddfb kernel/thread: Free death entries if they aren't used.
Otherwise they will be leaked.

I added a dprintf() in this codepath, it happened a small number of
times on boot and when running a compile job.
2025-03-03 14:15:05 -05:00
Augustin Cavalier da6325cd03 kernel/thread: Make thread_death_entry use DoublyLinkedList. 2025-03-03 14:08:02 -05:00
Augustin Cavalier 61d76848f0 kernel/thread: Convert Team::thread_list to a DoublyLinkedList.
Increase the size of the Thread structure by another pointer,
but makes thread insertions and removals constant-time.
2025-03-03 13:49:49 -05:00
Augustin Cavalier f6ca5f1927 kernel/team: Actually fetch child thread times for B_TEAM_USAGE_CHILDREN.
Previously this code iterated over children, but only ever looked
at the parent team's thread times.

It seems this has been broken since the code was originally
introduced in 2004.
2025-03-03 12:31:54 -05:00
Augustin Cavalier 76b7ab4c8e kernel: Move struct Thread declaration above struct Team.
Paves the way for using DoublyLinkedList. No functional change.
2025-03-03 11:46:32 -05:00
Augustin Cavalier d9399d4673 iaxwifi200: Merge changes from upstream OpenBSD.
Includes changes to support "MA" devices (but these also need
new firmware.)
2025-03-01 15:58:59 -05:00
Autocomitter e38d10fd9f Update translations from Pootle 2025-03-01 08:07:27 +00:00
Vladimir Serbinenko 0f5e47bf84 bootloader/efi/64: Support GDT being above 4GiB
On my darp10-b it ends up way above 4GiB. Fix is to add 64-bit entries to
32-bit GDT. Then we use this temporary GDT in order to enter 64-bit mode
and then reload correct gdt once we're in 64-bit mode

Change-Id: I69ec32904bbbb23adbe695de0538dc2100f40b48
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9004
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-28 17:11:12 +00:00
Augustin Cavalier 101b09cc05 Tracker: Set message in ModelMenuItem after the try/catch block.
Otherwise the ownership isn't clear: if the exception is thrown
after the item partially initializes, the message might get
deleted by a destructor already. This way, the ownership is clear.
2025-02-27 22:07:13 -05:00
Augustin Cavalier 5341b58f5f BBlockCache: Don't cache anything if a debug heap is in use.
Otherwise, BMessage allocations and frees don't really get
checked by the debug heaps, which isn't helpful. Use a
public debug heap function with a weak definition to detect this.

While at it, drop the full MIT license from the header and use
the common shorthand.

Should help with diagnosing #18905.
2025-02-27 21:32:44 -05:00
Augustin Cavalier bc376a296b SCSI: Explicitly use UINT32_MAX and UINT64_MAX in DMA attributes. 2025-02-27 12:56:42 -05:00
Augustin Cavalier ecef10e688 Tracker: Use BStrings and BObjectList in handling MostUsedNames.
Avoids some potential races.
2025-02-27 12:56:21 -05:00
Adrien Destugues e1bdecd0d7 docs/develop: Import oco's article on profiling applications
- Create a new "debugging" section and move two other articles there as
  well
2025-02-27 13:31:53 +01:00
Augustin Cavalier b20e1e7e6a BFS: Re-lock the stream node after starting a new transaction. 2025-02-26 19:02:19 -05:00
Augustin Cavalier 37e5d3b9d9 Tracker: Fix use-after-free in FindPanel. 2025-02-26 17:14:40 -05:00
Augustin Cavalier cf2838a3eb BFS: Write-lock the stream inode in BPlusTree::MakeEmpty().
I was experimenting with forcing the CheckVisitor to always rebuild all
indices, when I got a KDL from a Tracker process that I had running
a query in the background. The fault address was invalid (0x7b4493418),
and the stack trace was bfs_read_query -> GetNextMatching ->
TreeIterator::Traverse. That method read-locks inodes, and it looks
like query references to inodes are managed correctly.

This seems like the most plausible culprit for missing locks. I didn't
manage to reproduce the KDL, unfortunately, but hopefully this resolves
it nonetheless.
2025-02-26 17:09:30 -05:00
Augustin Cavalier 4bfbc6ebba kernel/fifo: Refactor to use more atomics and fewer locks.
The ring buffer is now mostly atomic, with only a lock needed on the
write end, not the read end (removing this wouldn't be possible without
switching to allocating chunks of the ring non-linearly, and probably
isn't worth it.)

The big "request lock" is now broken up into 2 spinlocks and a R/W lock,
all of which stay unlocked or read-locked only except for short periods.

"stress-ng --pipe 1" (with "--timeout 5s --metrics") goes from ~230 MB/s
to ~2.5 GB/s in my VMware setup with this change (it concurrently reads
and writes 4KB buffers). This is still a ways off from the ~7 GB/s that
Linux gets on this same setup, but a significant improvement nonetheless.

Compile performance seems about the same; there might be an 0.2-0.8s
improvement (both with and without -pipe) out of ~24s in a rebuild of
libroot (with 4 cores), or that could be just noise.

Change-Id: I9d911f82bb36ed3149e759b94632294a0aa33a41
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9058
Reviewed-by: waddlesplash <[email protected]>
2025-02-26 19:17:11 +00:00
X512 71368ea719 BPicture: remove point count argument from private draw bezier callback
Fill/StrokeBezier always have 4 points so passing point count is not
needed. Point count is not passed to BView drawing API and not stored in
BPicture data.

Change-Id: Iddb32bd493143d4450acfb76bdc56fc02136448e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8560
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-26 19:00:33 +00:00
captain0xff 31fa85b59b screen: Removed some duplicate code from ScreenMode.cpp
Change-Id: Iea290aca3098980dd614a636d06f62a6baf4b793
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9064
Reviewed-by: waddlesplash <[email protected]>
2025-02-26 18:00:43 +00:00
Jérôme Duval 91880bad83 kernel/vm: when resizing down a VMCache, fill a partial page with zeros
* factored out file_cache
* fix two gVisor tests: MMapFileTest.ReadSharedTruncatePartialPage
and MMapFileTest.WriteSharedTruncatePartialPage
* fix #19438

Change-Id: Ia7f119478d306ab6d867632e4a5270733f0b29df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9060
Reviewed-by: waddlesplash <[email protected]>
2025-02-26 17:14:18 +00:00
Augustin Cavalier 30c9648a4f libroot: Update glob from FreeBSD upstream.
From upstream commit dc36d6f9bb1753f3808552f3afd30eda9a7b206a.
Adaptations made in line with previous changes.
2025-02-25 14:15:01 -05:00
Augustin Cavalier 45d0d854ee libroot: Replace dirname, basename with musl versions.
From latest musl release (1.2.5).

Change-Id: I6850b6fc9f05a46348a6d858bc58d66e34d0a172
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9059
Reviewed-by: waddlesplash <[email protected]>
2025-02-25 18:20:14 +00:00
Augustin Cavalier 4b099fb795 libroot: define restrict for GCC < 4.
Should fix GCC 2 build.
2025-02-24 16:14:26 -05:00
Augustin Cavalier 0b67b191c5 libroot: Add memcmp optimization similar to the strcmp one.
And cleanup the strcmp one a bit for consistency.
2025-02-24 15:24:25 -05:00
Augustin Cavalier 979d83f98b libroot: Replace some more string functions with musl's. 2025-02-24 15:18:44 -05:00
Augustin Cavalier ce7c098db2 libroot: Replace memmove() with musl's.
Includes an optimization to use memcpy where possible, and protection
against aliasing undefined behavior.

Also clean up the Jamrules for the kernel's usage of musl methods.
2025-02-24 14:12:28 -05:00
Oscar Lesta 1ee5848178 src/bin: combine query and filteredquery commands.
Change-Id: I59f005370b8aea5a2837c5992b4e1a7f06436b19
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9057
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-24 18:10:44 +00:00
PulkoMandy 1fbf09c309 Internals documentation: add notes about the process without vendor branches
This is still used in various places, so we should be clear about how it
is supposed to be done. It should avoid people learning from repeating errors
that others have already made.

Change-Id: I2468e51e62658bfad499c22294dd8a34c8aa8c90
2025-02-23 10:35:42 +01:00
Chris Roberts 83e62d7028 userlandfs_server: switch to B_MULTIPLE_LAUNCH
When userlandfs_server is set to something other than multiple
launch then it becomes impossible to mount userland filesystems
of different types at the same time.

Change-Id: I1e41ddb938af8813f76409f0911c577571936450
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9053
Reviewed-by: waddlesplash <[email protected]>
2025-02-22 21:32:54 +00:00
Chris Roberts 086e20b2cd SetupEnvironment: add ~/config/apps to the PATH
Change-Id: Ifd5f35e24b8fadbf984a1fa9bd099ba98b1a49a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9043
Reviewed-by: waddlesplash <[email protected]>
2025-02-22 21:26:14 +00:00
Chris Roberts 7aeeeccb9e screen_blanker: activate the window before hiding the cursor
In some situations an app launching in the background will steal our
status as the active application which causes HideCursor() to fail when
the screensaver resumes.  This is particularly noticeable when the
screen lock is used early in the boot and things like Tracker and
Deskbar are still launching.

Change-Id: I37c432d277ce30716b9c98ad6a500c9313cbea92
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9045
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-22 21:25:44 +00:00
Autocomitter e0ff6a67ac Update translations from Pootle 2025-02-22 08:12:50 +00:00
John Scipione 39083dd0f7 BMenu: Fix infinite loop regression on right-click drag
... wait while B_INTERRUPTED instead of != B_BAD_SEM_ID.

Change-Id: I58f81762bddec1e7f4b01e2b7806c395632ba992
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9028
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-02-22 05:29:57 +00:00