Commit Graph
67562 Commits
Author SHA1 Message Date
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
Máximo Castañeda 72f8f120b0 API docs: fix syntax
Lack of closing tag discards page for generation.

Change-Id: Ibe5b5618c59a29e063b46d1897145a59ab57c8dc
2025-02-21 13:01:07 +01:00
Máximo Castañeda a73a1b0318 input_server: fix private method name
As noticed by Oscar Lesta.

Change-Id: I4e9a401540a363d2ce1189eb8ceed891a98254cd
2025-02-21 12:34:55 +01:00
Vladimir SerbinenkoandAugustin Cavalier 874ba40fd6 bootloader/efi: Make sure PML4 is below 4GB.
See inline comment.

Co-authored-by: Augustin Cavalier <[email protected]>
Change-Id: I94e1af7e176c3d2a98629eb68ded0616d20394fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9023
Reviewed-by: waddlesplash <[email protected]>
2025-02-21 04:16:16 +00:00
Augustin Cavalier 22dfef3281 bootloader: panic if an ELF is non-relocatable and got placed at the wrong location.
Otherwise we'll just fault when entering the kernel.

Change-Id: Ib847ed4c02bccd36dce03b47ae2d4e79293c94d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9025
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-21 04:08:51 +00:00
Augustin Cavalier 0463b9511c bootloader: Refactor semantics of platform_allocate_region() functions.
This cleans up a lot of subtle or hidden inconsistencies:

 * Drop the "exactAddress" parameter. It was added in hrev15708 (2005),
   but all callers in all bootloaders passed "false" to it until 2022,
   when one codepath in the ARM32 EFI loader started using it.

 * Adjust EFI's platform_allocate_lomem to platform_allocate_region_below,
   and add a platform_assign_kernel_address_for_region(). This allows the
   aforementioned ARM EFI codepath to continue to do what it wants,
   which is to get an identity-mapped trampoline page, without having
   functions with confusingly different semantics ("allocate_lomem"
   assigned the virtual addresses as identity-mapped unconditionally,
   but it didn't insert these into the virtual allocated ranges.)

   This also paves the way for other EFI loaders to use this method
   to allocate memory below whatever default the boot services
   would give us.

 * Drop fixed virtual address allocation for all arches on EFI, with the
   exception of fixed addresses inside KERNEL_LOAD_BASE, same as on
   other boot platforms. Anything which wants fixed virtual addresses
   outside that region can use the new "assign kernel address" method.

 * Validate kernel base and size against kMaxKernelSize, instead of
   assuming it fits. This matches behavior of other boot platforms.
   Ideally we would have some more generic routine for mapping the
   kernel, but this suffices for now.

Tested with x86_64 and ARM; both still boot (well, ARM boots as
far as it did before this commit, anyway.)

Change-Id: Ieb4fba752994101191a2335cb5395eb2b726fcbb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9024
Reviewed-by: waddlesplash <[email protected]>
2025-02-21 04:08:51 +00:00
Vladimir Serbinenko e364871049 bootloader: Support x2apic
On my darp10-b EFI works and leaves APIC configured in x2apic mode. While
we can switch it back to xapic, it's better to support x2apic properly.

Change-Id: Ia00c69ccffc508497f45217462cdb6868c4629f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9005
Reviewed-by: waddlesplash <[email protected]>
2025-02-21 02:27:20 +00:00
Vladimir Serbinenko 801a0ee83d kernel: Change x86_*_msr to be an inline function on 32-bit platform
Change-Id: Ida5ff96cda06ca4463f15b636f1275977f3ec0ac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9015
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-21 02:27:20 +00:00
Daniel Martín 2013cf27d1 VMCache: Fix typo on AddConsumer() description comment
Change-Id: Ie444550e1785cf13095f72c048ed592a63ceeedd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9026
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-20 22:21:13 +00:00
PulkoMandy 85fc17e562 Migrate syscalls documentation from the website to Haiku internals book
Change-Id: I997049a1e174e7dd346e1342a2513a67e118a93b
2025-02-20 22:38:20 +01:00
Augustin Cavalier b190b70845 kernel/x86: Do not hang forever if the serial line is dead.
Some newer hardware does not have COM1 at all. It seems this isn't
easy to detect, and so the best solution is just to use a maximum
spins timeout. This is in fact what FreeBSD does already, and the
"timeout" value of 256K unsuccessful spins is the same one they use
(see "COMC_TXWAIT" definition).

If the timeout happens once, then just disable serial or mark it
as timing out and don't try again (unless we eventually load
a settings file that specifies a new serial port.)

Tested on a custom build of QEMU hacked to reply to all reads
to the serial ports with zeroes (by just adding "return 0" to
"serial_ioport_read".)

Fixes #18561. May fix #19425.
2025-02-19 20:01:32 -05:00
Chris Roberts 9090152e40 screen_blanker: minor code optimization
No functional change.  I had been testing a minimum time before
showing the password window while still keeping the screen locked.
We can simplify the check for now though.

Change-Id: Id67c1ea07bb04ae477cd2f021fb15725c0144dbe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9022
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-20 00:22:26 +00:00
Chris Roberts 682c0438e7 ScreenSaver: trailing whitespace cleanup
Change-Id: I26d0806eea8d3ae6059d0dec3b1439dbb44e3b9c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9021
Reviewed-by: waddlesplash <[email protected]>
2025-02-20 00:22:26 +00:00
John Scipione d6c5aee9f9 Tracker: Draw all columns, fixes bug invalidating off-screen columns
AFAIK this has always been this way, however, the confusion seems to
be that pose->CalcRect() takes false for minimal rect while pose->Draw()
takes true for full-draw so they are opposites of each other.

This means we draw all columns on Invalidate(), not just the first one.

Change-Id: I40ddf5fa75b46d6da987fd5d5f83cdc4782fa851
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9019
Reviewed-by: waddlesplash <[email protected]>
2025-02-19 22:05:05 +00:00
John Scipione 6848bca37f Tracker: Raise opacity of dragged and cut items, fixes #19429
Change-Id: If498bb79a55697b2c270f3f21383d3c4f3a3d567
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9014
Reviewed-by: waddlesplash <[email protected]>
2025-02-19 22:05:05 +00:00
John Scipione 40bb2f8c9f Tracker: Make drag fade rect a bit bigger and compose it
Change-Id: I2bfa9b5416cced7627f87613180c6b7c192be0d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9013
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-19 22:05:05 +00:00
John Scipione c24d316399 Tracker: Gray text on selected items in inactive windows, fixes #19428
Change-Id: If73faba3682c5360a15e4e87983d8c377216cb5b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9017
Reviewed-by: waddlesplash <[email protected]>
2025-02-19 22:05:05 +00:00
John Scipione 82c55a447b Tracker: Use drawView instead of view in one place
Change-Id: I8ae87ca92c0749ce41bc11d1d59dcbcf38d9f25e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9016
Reviewed-by: John Scipione <[email protected]>
2025-02-19 22:05:05 +00:00
Augustin Cavalier a4f506a803 kernel/vm: Handle commitment > size in set_memory_protection more gracefully.
See inline comment: this can happen in the case of fork() pretty easily.
If it happens more often than that, something may be wrong; so for now,
at least, add a syslog print (under KDEBUG only) indicating that a full
recompute of the area commitment is being done.

Fixes #19337.
2025-02-19 15:26:36 -05:00
Augustin Cavalier 2deebfa44b BMenuBar: Move new reserved field to the proper place.
Without this, the amount of padding on the end of the class changes,
which could affect the ABI of any classes that inherit from this one.
2025-02-19 15:10:55 -05:00