66545 Commits

Author SHA1 Message Date
Augustin Cavalier
b93d9fcf70 libroot: Clean up and unify link/linkat.
* Move Haiku -> POSIX error mapping to linkat.

 * Implement link in terms of linkat.
hrev58058
2024-09-03 11:20:51 -04:00
Augustin Cavalier
004833215d libroot: Return EBADF if a negative FD is specified to fdopendir.
And do some minor code cleanups.

Fixes #19060.
2024-09-03 11:20:07 -04:00
Augustin Cavalier
55e8238c72 libroot: Use AT_FDCWD rather than hardcoding -1 in many places.
AT_FDCWD is now -100, not -1, though the kernel accepts any negative
value at the moment.
2024-09-03 11:19:02 -04:00
Augustin Cavalier
90ae97dbac libroot: Remove another obsolete comment. 2024-09-03 11:16:54 -04:00
Augustin Cavalier
f27384b845 usb_audio: Reduce log spam.
Fixes #19037.

Change-Id: I1c0a0b39a5d725b95dff5f2d9dd7d61568030146
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8188
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58057
2024-09-02 22:33:40 +00:00
Augustin Cavalier
a062b2146e IORequest: Fix computation of parent-relative transfer offsets.
The local transferEndOffset should be relative to the parent (us),
not to the underlying filesystem. We thus need to subtract our
own offset from the operation's offset.

This fixes a regression from be8080575a5ae9e8ecba3494afdd081cb4fd94a2.
Errors transferring data should now be properly reported in more cases.
hrev58056
2024-09-02 17:57:32 -04:00
John Scipione
7e6bc7ce71 Deskbar & Tracker: Use menu font where appropriate
i.e. not on Deskbar team menu, menu field menus or the clock
options menu but all regular menus at the top of the window
and other context-click menus.

Change-Id: If551aecd040500973a92fda2138b6ffe03cda279
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8154
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
hrev58055
2024-09-02 21:18:03 +00:00
Augustin Cavalier
544336415d BFS: Give endian macros parentheses.
Some things that call these macros put expressions in them; to avoid
operator precedence problems we should put them in parens.

Change-Id: I57335ffb190c484778c4bc8075d5ca3597f1e7e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8184
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58054
2024-09-02 20:19:06 +00:00
Augustin Cavalier
0ef833e5e8 build: Only add haiku_source to package repository if HAIKU_INCLUDE_SOURCES is set.
This way, we won't build the source package unnecessarily for
nightly images when it isn't included in the build.
hrev58053
2024-09-02 15:59:58 -04:00
Augustin Cavalier
f9123b49e5 kernel/allocator: Adjust type of index variable. hrev58052 2024-09-02 15:28:39 -04:00
Augustin Cavalier
35d9b4075a kernel/allocator: Add missed change to block_allocator_init_boot(). hrev58051 2024-09-02 15:27:47 -04:00
Jarosław Pelczar
9e89f7c068 VMCache: Use rwlock for sCacheListLock
Lookups are more frequent than cache deletions.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
A compile benchmark seems to have little if any performance improvement.
However, this codepath will be hit when allocating pages that are
cached, so it may provide a more significant improvement once file
caches are fully utilized.
hrev58050
2024-09-02 14:47:35 -04:00
Augustin Cavalier
b33f369dde kernel/debug: Add ASSERT_UNREACHABLE.
Under KDEBUG it panics, under non-KDEBUG it's __builtin_unreachable,
allowing the compiler to optimize things a little more.
hrev58049
2024-09-02 14:16:40 -04:00
Augustin Cavalier
b973a1b377 kernel/util: Add fls to BitUtils.
Implemented using __builtin_clz where available, otherwise using
an algorithm derived from "Bit Twiddling Hacks" which is similar
to the one ramfs uses. GCC and Clang seem to unroll the loop on
x86 at least (but it doesn't matter there as the builtin exists,
implemented using the "bsr" instruction.)
2024-09-02 14:16:05 -04:00
Augustin Cavalier
31b7065940 kernel/slab: Remove terminating 0 from kBlockSizes.
And fix a read past the end of an array. Based on changes by jarekpelczar.
hrev58048
2024-09-02 13:21:22 -04:00
Jarosław Pelczar
2b162ce972 VMKernelArea: Ensure it's final class
Nobody should derive from it

Signed-off-by: Jarosław Pelczar <jarek@jpelczar.com>
2024-09-02 13:00:08 -04:00
Oscar Lesta
12aa283408 libtracker: avoid Tracker crash while changing resolutions.
After settings Backgrounds to None for all worskapces, I was getting a 100%
reproducible segment violation on "fShowingBitmap->fBitmap->Bounds()" with every
resolution change.

Change-Id: I2a3640a3c33e571d772c1b38b21087346215dca8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8176
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev58047
2024-09-02 15:19:56 +00:00
John Scipione
c9ce7be28c AbstractSpinner: live update text color when enabled
... whatever motivated this to only work on disabled text views
has been resolved.

Change-Id: I3ae9d056870f1163d3fa074ab9a1dad96c0192f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8168
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev58046
2024-09-01 22:55:30 +00:00
Owen Anderson
f73ff202af arm64: Implement VMSAv8TranslationMap::Protect in terms of ProcessRange.
Change-Id: I2825d265fec69c2ae033ee09ff0ead9b098a7ca9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8160
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
hrev58045
2024-09-01 22:48:50 +00:00
Owen Anderson
744bdd7337 arm64: Implement ClearFlags in terms of ProcessRange.
Change-Id: I36ac90a3dc9d0a7dbb8c3b448fd79f2121bac9f2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8159
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2024-09-01 22:48:50 +00:00
Owen Anderson
bb67bf75fb arm64: Implement VMSAv8TranslationMap::ClearAccessedAndModified
* Heavily inspired by the RISC-V equivalent.

Change-Id: I7d2ed14fb0a246223a23f7df659b6006326a7013
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8155
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-09-01 22:48:50 +00:00
Owen Anderson
baf574c96a arm64: Reimplement ProcessRange and use it to implement Map().
* Fully implement break-before-make PTE updating, fixing the
  race condition that necessitates it.
* Incorporate align-down logic into the normal flow of the table
  traversal.
* Drop support for huge pages and for table freeing for now. They
  can be reimplemented once we have a fully functional baseline.
* Further adoption of the new ProcessRange coming in subsequent
  patches.

Change-Id: I852c63aaeab48b847b4bb99b328dfe071d27bb29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8139
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2024-09-01 22:48:50 +00:00
Owen Anderson
aa4f1de9ad Fix clang build by making herror consistently weak.
* clang, unlike GCC, does not allow a weak declaration to override
  a strong definition. We need to make herror's definition in
  addition to declaring the weak alias above.

Change-Id: Iac1c00e66bdd73d6e214e2302e18a0d51b18c9d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8148
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2024-09-01 22:48:50 +00:00
Fabio Tomat
7f2dcab0e6 intel_extreme: enable support for GeminiLake and IceLake devices.
Change-Id: I192db4329b92723a3ea988dabb85e595bcc0d686
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8083
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Oscar Lesta <oscar.lesta@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
hrev58044
2024-09-01 13:34:36 +00:00
John Scipione
4d5c2f8da2 Tracker: BView => _inherited in Find window AttachedToWindow()
Does the same thing but _inherited is used so we can change the class.

Change-Id: I6c0bf7b35917da55a3bd4aa15b5bb80063f2b02a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8150
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>
hrev58043
2024-09-01 02:22:44 +00:00
Michael Lotz
be1d1fa3ab libroot_debug: Cleanup: Factor out duplicated code.
Change-Id: I2806055a1e1b1f6b1768184b36440195af41afa3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8167
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev58042
2024-08-31 20:03:47 +00:00
Michael Lotz
c08e54426e libroot_debug: Use overcommitting and MADV_FREE in guarded heap.
This allows both guard pages and freed allocations, when memory reuse is
disabled, to be returned to the system, massively reducing the pages that
are actually needed.

The guarded heap obviously still wastes a lot of memory due to using a
dedicated page for every tiny allocation. But with this change it
becomes realistic to run the full userland under the guarded heap for
more than a couple of minutes and with more complex applications than
before.

Change-Id: I479e822f9dbeea3968d41b66fc55b0d285a1f57e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8166
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-08-31 20:03:47 +00:00
Niklas Poslovski
252421dcb7 AboutSystem: Add myself to contributors list
Change-Id: Ic6a77722db35d6e8199c3c2c70b3fb0f7c2e403a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7950
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
hrev58041
2024-08-31 20:03:00 +00:00
Augustin Cavalier
494eb33b6a AVLTreeBase: Clear node's pointers after removal.
To be safe, in case something tries to double-remove.
hrev58040
2024-08-31 14:11:24 -04:00
Augustin Cavalier
4e88440d3f packagefs: Use ClassCache for UnpackingDirectory and UnpackingLeafNode.
This shifts another big chunk of packagefs memory usage into dedicated
object caches. It saves a small amount of memory since now we use
caches sized exactly to the object size plus alignment rather than
rounding up to the block allocator size, and also makes clearer in memory
usage statistics how much memory packagefs is using.
hrev58039
2024-08-31 13:16:46 -04:00
Augustin Cavalier
b60fa5fa05 packagefs: Use only one object_cache for all TwoKeyAVLTreeNodes.
Previously there were 6, all with the exact same object size.
2024-08-31 13:15:17 -04:00
Augustin Cavalier
706d9ddd10 packagefs: Use "pkgfs" in object cache names.
Makes the "slabs" KDL command output align better.
2024-08-31 13:14:10 -04:00
John Scipione
3399bac1b2 Tracker: Fix pose UpdateIcon() list mode top
We don't need to set the top here, it is already set by CalcRect()
a couple lines up. Our calculation was slightly off causing bug.

Fixes #12558

Change-Id: I022cc661cf55a9d016fd722c701f05fc1f9fea4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8165
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58038
2024-08-31 17:04:45 +00:00
Augustin Cavalier
1c22c2608f mknod[at]: Implement the case where the node type is S_IFIFO.
This is the only case the POSIX specification indicates is portable.
We may be able to implement some of the others that Linux or the BSDs
support if it turns out there are applications that want them, though.

Fixes #19032.
hrev58037
2024-08-31 11:56:21 -04:00
Augustin Cavalier
62b6a4181d mkfifo: Define in terms of mkfifoat().
Should be functionally equivalent, but makes it clearer what the
difference is. Also use AT_FDCWD (which is now -100) rather than -1.
2024-08-31 11:54:56 -04:00
Autocomitter
43f1c21fdb Update translations from Pootle hrev58036 2024-08-31 08:12:42 +00:00
Augustin Cavalier
07cfddfa0c kernel/x86: Rework handling of %edx in syscall handler (again.)
The previous change to this logic (9921f444625e360674f92db84ffae695492233a5)
apparently caused intermittent crashes with various applications. It
seems that EDX is not expected to be clobbered by functions that do not have 64-bit return values, and if it is, crashes result, like #19024.

This commit reworks the logic to not change %edx in the iframe at all
if we don't have a 64-bit return value, and then adjusts the debug logic
to clear %edx before invoking the post-syscall debugger hook. This means
we have to run the post-syscall debugger hook before clearing the
flags, but that should be fine (and perhaps even useful.)

Fixes #19024, and possibly other crashes that have cropped up on
32-bit x86 in the last few weeks, at least.

Change-Id: I3280033bc2dd05aca254555d6ee3b173a270ebf9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8158
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Michael Lotz <mmlr@mlotz.ch>
hrev58035
2024-08-30 20:50:07 +00:00
Michael Lotz
d8df56379c DHCPClient: Fix use of uninitialized timing values.
The fRenewalTime and fRebindingTime members were never initialized but
assumed to be initially set to 0 when not provided by the DHCP server.
This could lead to negative time values depending on the uninitialized
memory content and would always happen under libroot_debug where memory
is initially cleared to 0xcc. The negative times then lead to endless
loops of sending requests.

Change-Id: I74a5fbd0c75f7de925f591f09db663978ea3f0ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8157
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58034
2024-08-30 16:13:24 +00:00
Augustin Cavalier
729906049a DateTimeEdit: Use document colors.
Otherwise the controls look like they are "disabled" and can't be
edited.

Ideally this class would be refactored to use BAbstractSpinner rather
than drawing its own arrows, but that's a problem for another day.
hrev58033
2024-08-29 17:45:57 -04:00
Augustin Cavalier
33e9a82042 protocols/unix: Hold an extra reference during stream endpoint close.
See inline comment: otherwise it might be deleted when we
release it in Disconnect() but before we unlock it.

Also fix _LockConnectedEndpoints() to unset the locker object if
returning an error, rather than returning a locked endpoint that
we don't hold a reference to.

Fixes #18927.
hrev58032
2024-08-29 16:14:01 -04:00
Augustin Cavalier
e776c8dee5 libnetwork: Only build BeOS compatibility code if _BEOS_R5_COMPATIBLE_ is set. hrev58031 2024-08-29 15:30:08 -04:00
John Scipione
fc07afd4bc Create symbolic link when drag and dropping files from a virtual folder
... instead of making a copy like normal. This changes the default
behavior, you may override it by context-click dragging and selecting
Copy or holding the option key to force copy.

Implements #18729

Change-Id: Ib13bec347f300d25de77064ced79693ecbc3a85c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8144
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev58030
2024-08-29 16:46:02 +00:00
John Scipione
7616fbf28d Tracker: Change On => Target: before volume field in Find window
Change-Id: Ie1725007d1534736b7252024bfb0b1cbcc3c446a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8146
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev58029
2024-08-29 15:52:11 +00:00
John Scipione
6fd95ed760 Tracker: Fix "Find" window menu field truncating
Minimum menu field width is set by "multiple selections" string width
on volumes menu field or a smaller size that matches R1B4 on rest.
Maximum menu field width chosen to match current based on font size.

Set the max content width to truncate long mime-type names that don't
fit. Add room for the pop-up indicator.

Create member variables to hold menu fields. Resize the menu fields in
AttachedToWindow() after they have been marked because the width
depends on the marked item.

Set member pointers to NULL in constructor where not already set.
ASSERT variables we use are not NULL, they aren't but check anyway.

Use DefaultLabelSpacing() for the spacing between icon and text to make
them font sensitive. DefaultLabelSpacing() is 5px at 12pt font matching
current.

Fixes #18999

Change-Id: I0e52b5aa557c8b5d76f09e0b60fcb965e3ff65e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8143
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-08-29 15:52:11 +00:00
John Scipione
af440edade Tracker: Put On back before volume field in Find window
Change-Id: Id1138bd9e79b37e30df4c8079f0b0e8cbe3c4d03
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8145
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>
2024-08-29 15:52:11 +00:00
John Scipione
6d94fbc3cf Tracker: Style changes related to Find window
Change-Id: I78f416276f9e7357ddb18c91450c16a6f5abd37f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8147
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-08-29 15:52:11 +00:00
Owen Anderson
108f6fdc2f arm64: Clean up memory GetMemoryAttr.
* Introduce semantic constancts for more attributes.

Change-Id: Ib8f778b2bb09bff3791208d10b19393f6f445178
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8114
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: Adrien Destugues <pulkomandy@pulkomandy.tk>
hrev58028
2024-08-29 08:10:03 +00:00
Owen Anderson
18a27fe051 arm64: Full implementation of MakeTable
* Move towards defined constants for getting and setting PTE types.

Change-Id: Ia655b00b4de5ec49a01bf902626d63138e3bbeb1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8113
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-08-29 08:10:03 +00:00
Owen Anderson
aacfea4fb4 arm64/clang: Fix build with clang/lld
* Move .got to be adjacent to other relro sections.
* Use PC-relative accesses to set the fault handler in
  arch_debug_call_with_fault_handler.

Change-Id: I52eec7e2525c15ec50eb4b83e4740519a76cd4a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8111
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-08-29 08:10:03 +00:00
Owen Anderson
9fad0a5c70 arm64: Implement address space switching
* Reference count address spaces to reuse ASIDs as needed.
* Current implementation allows up to 256 actively scheduled tasks.

Change-Id: I71e10fdb6aa0c863a6beea54d4bc07032d9a6eb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8109
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-08-29 08:10:03 +00:00