Commit Graph

6406 Commits

Author SHA1 Message Date
Augustin Cavalier
9708b08060 KPath: Use a default buffer size of B_PATH_NAME_LENGTH without + 1.
B_PATH_NAME_LENGTH == PATH_MAX, and PATH_MAX is inclusive of the final
NULL terminator, so we don't need a + 1 here.

The original KPath default was to not use + 1, but that was changed in
42e3c6f978 due to all the consumers that did.

But all those consumers are wrong, it appears; they should just be
using the default length instead. So now we do that.
2024-11-22 16:56:15 -05:00
Augustin Cavalier
cc9ea55c59 file_systems/QueryParser: Coerce types up front, and handle B_TIME_TYPE better.
* If we coerce types inside the switch(), then the "type already converted"
   check at the beginning will fail every time, causing us to reconvert,
   which is surely bad for performance.

 * B_TIME_TYPE should be INT32 or INT64 depending on what its size is.

May help with #19080.
2024-11-21 23:19:09 -05:00
Augustin Cavalier
f72d1684e5 kernel/debug: Initialize the frame buffer console much earlier, if possible.
Previously it was not initialized until "post-VM", but there are
a number of ways VM initialization can go wrong that it would
be nice to know about without needing a serial port.

On arches which map the whole physical memory into the kernel
address space (x86_64, at least), we can get the bluescreen facility
initialized using KERNEL_PMAP_BASE. On other architectures, we
just fail to init then, and do the usual setup later on.

A slight bit of extra code cleanup in blue_screen_init_early:
we now just call module->info.std_ops() rather than a
frame-buffer-console specific method.
2024-11-19 21:35:31 -05:00
Augustin Cavalier
a9b5f684f1 kernel/fs: Make io_context rw_lock'ed.
Applications that don't call open() or like functions too often,
and call many FD-related methods across multiple threads at once
(like "git status") now don't wait on the context lock as much.

("git status" performance isn't much improved because threads just
hit the "unused vnodes" lock instead.)
2024-11-18 13:25:43 -05:00
Jim906
9bb1816c14 block_cache: enable prefetching
* Allocate blocks and add them to the hash table so they are
  available for a future block_cache_get call.
* Make use of prefetching in FAT driver.
* A client filesystem may request to prefetch a block run that
  contains some blocks that are already cached.  The request will
  be truncated at the first such block in the run.
* Fixes #19186.

Change-Id: I8d2e3cff15e5b46569438e0dc085e2b391aa57a5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8525
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-11-16 18:26:21 +00:00
Augustin Cavalier
de8d5cfb5f bootloader & kernel: Unify computation of splash logo and icons placement.
Removes some more code duplication.

Change-Id: I9423be740015bef996b77bf2c30652fdadbd8a50
2024-11-12 23:51:52 -05:00
Augustin Cavalier
029e447bde bootloader & kernel: Unify bitmap blitting routines.
They were more-or-less duplicated between the two.
2024-11-12 23:44:31 -05:00
X512
2b0aa4245b BShape: use BShape::Private class to access private methods.
Avoid declaring random friend classes in public header. Allow to access
private methods from arbitrary source if needed.

Change-Id: Iac2cf0ca59e483aa0657e3fe1fc47080c661cf8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8534
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-11-11 16:56:19 +00:00
Augustin Cavalier
36708e6ab8 network: Let modules process all ancillary data at once, and adjust UNIX.
This way, modules can decide to do different things based on having
all the ancillary data available. In particular, the UNIX module will
now post only one message header for all the FDs, even if they came
from multiple sets of ancillary data.

This should fix "Message needs unreceived descriptors" from the Chromium
IPC code (which is used by Firefox).
2024-11-05 15:23:24 -05:00
Augustin Cavalier
e9c9b2e448 kernel/condition_variable: Make the debug type fetcher a static function.
No behavioral change intended.
2024-11-05 13:46:53 -05:00
Jérôme Duval
6beff0d163 kernel/libnetwork: add accept4() from POSIX.1/2024
* add SOCK_NONBLOCK and SOCK_CLOEXEC
* also extends the type parameter on socketpair() and socket()

Change-Id: I73570d5bfb57c2da00c1086149c9f07547ba61ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8515
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-11-04 17:55:40 +00:00
Jérôme Duval
966076b273 kernel/libroot: add dup3() from POSIX.1-2024
this adds a parameter to the dup2 syscall. Adjust strace.

Change-Id: Icc2d0e054365865d38e5d596843a47c95100ca59
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8514
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-11-04 17:55:40 +00:00
Jérôme Duval
11cd4af6e1 kernel/libroot: add pipe2() from POSIX.1-2024
this adds a parameter to the create_pipe syscall. Adjust strace.

Change-Id: I83e9f039eb28c862458654b66c03e2e21a258822
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8513
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-11-04 17:55:40 +00:00
John Scipione
406f30c616 Tracker: Commands.h (and tracker_private.h) updates
* Add kDeleteSelection command alias in Commands.h, keep kDelete.
* Add kMoveSelectionToTrash and use it in place of kMoveToTrash.
  - kMoveToTrash in kept in tracker_private.h for use outside.
* Create a new constant kRestoreSelectionFromTrash for Tracker.
  - Move kRestoreFromTrash to tracker_private.h

Change-Id: I3cdefe97e8359fb53bacfc3319b046b051c6f7db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8225
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-10-17 16:21:51 +00:00
Augustin Cavalier
8fbb862695 fs_shell: Adjust following block_cache API change. 2024-10-17 12:15:11 -04:00
Augustin Cavalier
086f997e50 kernel/vm: Move most kernel debugger routines to a new vm_debug.cpp.
Reduces the size of vm.cpp by over 800 lines.
No behavioral change intended.
2024-10-16 14:43:20 -04:00
Augustin Cavalier
0a5c9ef0a4 kernel: Move get_mount_point from VMUtils to KPartition.
There's nothing VM-specific about it; it just builds paths
that partitions should be mounted at.

Also move the tests.
2024-10-16 14:25:17 -04:00
Augustin Cavalier
5f87420792 kernel: Add maxAddress constraint to vm_allocate_early_physical_page.
Needed by the x86 PAE code.

Change-Id: I982dfa96427addfc903205f49f53a46462534843
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8457
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-16 16:17:13 +00:00
Augustin Cavalier
916e681ca5 kernel.h: Add a HOWMANY macro and make use of it. 2024-10-14 13:53:50 -04:00
Augustin Cavalier
875b13d582 bootloader: Overhaul heap region allocation.
Previously, there was only platform_init_heap/platform_release_heap,
which allocated a single static heap region for the heap to use,
and any subsequent heap allocations had to go through the standard
platform_allocate_region, which allocates regions visible both
to the bootloader and the kernel.

But as mentioned in previous changes, it isn't always easy to
release regions allocated that way. And besides, some bootloaders
(like EFI) use a completely separate mechanism to allocate
bootloader-local memory, which will never get "leaked" into
the kernel.

So instead, refactor all platforms to instead provide two
new methods: platform_{allocate,free}_heap_region. On EFI
this is easy to implement; on most other platforms we have
logic based more on the old platform_init_heap or allocate_region.

(On the BIOS loader in particular, we can only fully release
the memory if it's the last thing we allocated in the physical
addresses. If the "large allocation" threshhold is lowered
back to 16 KB, then we are unable to do this enough times
that we will run past the end of the 8 MB identity map and
thus fail to boot. But with the larger threshhold, we don't
leak nearly as much, and don't hit the threshhold.)

This should further reduce the amount of bootloader memory
permanently "leaked" into the kernel's used memory, though
on some platforms it may still be nonzero.

Change-Id: I5b2257fc5a425c024f298291f1401a26ea246383
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8440
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-10 16:13:11 +00:00
Augustin Cavalier
d1ef184af6 bootloader: Add remove_{physical|virtual}_allocated_range methods.
Will be used in following commits.

Change-Id: Ica89d28cbf6980aca8dc347dfdcb200a0e637e9a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8442
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-10 16:13:11 +00:00
Augustin Cavalier
1db0961121 kernel/vm: Remove an obsolete comment.
page_num_t is typedef'd to phys_addr_t, so it's 64-bits on 32-bit
platforms with PAE. In fact it's been so since the introduction
of phys_addr_t, so this comment was obsolete from the start...
2024-10-10 11:20:20 -04:00
Owen Anderson
df59dfec3b arm64: Set MMU granule sizes to a consistent value in bootloader.
Change-Id: Ia36885df6dec5ac0ac9ce41271115aa7a8c3e6df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8418
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-30 15:48:51 +00:00
Owen Anderson
1fa60a5cda arm64: Fix TLB flushing in interrupts to handle kernel vs user space
Change-Id: Id19236345cf05284c8c5f02360a4a2b3f22fd16d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8365
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-30 15:48:51 +00:00
Augustin Cavalier
b47e8b0cad build: Unify BeOS ABI compatibility ifdefs around __HAIKU_BEOS_COMPATIBLE.
_BEOS_R5_COMPATIBLE_ was defined in ArchitectureRules while
__HAIKU_BEOS_COMPATIBLE is defined in HaikuConfig.h (which is
in the include path for sys/types, SupportDefs, and other
base headers.)
2024-09-24 12:09:33 -04:00
Owen Anderson
c2f3786ab0 arm64: Save all integer registers in exception handlers.
* This is needed in order to support syscalls and other exceptions
  that need to be able to inspect/modify userspace register contents.

Change-Id: I8a638c0c40dd44ed882adad0591ae3bf5493a6b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8329
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>
2024-09-18 19:34:15 +00:00
Jérôme Duval
0f807f4401 kernel/x86: dump hwpstate, cpb, proc_feedback features
Change-Id: I06b6da05013c7271d0a97d5aa3af2b6f416496a9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8331
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-18 16:21:44 +00:00
Michael Lotz
32a3bddfdf x86: Implement PAT support for memory type configuration.
Using the page attribute table to set the memory type on a per page
mapping basis is the more modern and flexible approach to physical
memory type handling compared to using MTRRs.

Most of the needed infrastructure was already in place, as setting the
page table entry attributes was already done for uncachable and
write-back memory types. Using the PAT now also allows to set the last
remaining memory type of write-combining through the PTE flags. The PAT
is configured to have entry 4 mean write-combining and the PAT bit in
the PTE is set to point to that.

When PAT is supported and not disabled, MTRRs are completely ignored
and left as set up by the system firmware, where the basic uncachable
and RAM ranges are supposed to be set up. These configurations are then
overridden by the PTE flags as needed.

Change-Id: I0a74b3fc7d3ba9fa384251290ce41621b69d3a02
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8340
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-17 20:45:28 +00:00
Michael Lotz
8271b4a8bf x86/arch_vm: Allow arch_vm_set_memory_type to override type.
We allow requesting an explicit memory type when calling
map_physical_memory but default to the uncached B_MTR_UC when not given.

When called without an explicitly requested memory type, allow
arch_vm_set_memory_type to modify and return an effective memory type.
When an overlapping range already exists, the effective memory type is
set to the one of the existing mapping. If there is an explicit memory
type request that conflicts with an existing range, or if multiple
overlaps with conflicting types would be produced, the mapping is
disallow (and a panic is triggered under KDEBUG).

This effectively detects and panics when conflicting aliases of physical
memory would be created. This is also useful on an MTRR based setup,
as such overlaps cannot be properly represented.

When using the page attribute table (PAT) to set the memory type on a
per page virtual memory mapping basis, this is needed to prevent
aliasing of the same physical memory with different types. As per the
specs, such aliasing is unsupported and may result in undefined
operations that lead to system failure.

The mechanism is extended to the general arch_vm_set_memory_type as such
aliasing prevention also seems to apply to other architectures (at least
on ARM, aliasing is also strongly discouraged).

Change-Id: I7aaf6ea8415e92e74cd1643b67793a6857619eea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8339
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-17 20:45:28 +00:00
Augustin Cavalier
2eb83002c5 strace: Add FlagsTypeHandler for the mutex option flags.
So that MUTEX_SHARED etc. are displayed in strace output.
Also fix indentation, and the name of the "toFlags" parameter
in syscall definitions.
2024-09-16 15:36:12 -04:00
Owen Anderson
edb17c548f Revert "arm64: Use DEVICE_GRE memory when mapping MTR_WC."
This reverts commit 0caf23319c.
This change is not safe because changing MAIR may invalidate
early mappings. It's also not clear if it's needed, as e.g.
FreeBSD does not use Device GRE mappings.

Change-Id: I95a904ee928281d44989ce707ed1ac59985a308d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8268
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Milek7 Milek7 <me@milek7.pl>
2024-09-10 18:46:23 +00:00
Augustin Cavalier
b4798ac6a7 kernel: Add assertions to ensure vm_page_reservation is destroyed with a count of 0.
Inspired by some of jpelczar's changes.
2024-09-10 12:13:38 -04:00
Augustin Cavalier
f4e0ce8d61 kernel/lock: Fix ABI compatibility between KDEBUG and non-KDEBUG builds.
This breaks kernel ABI on KDEBUG builds (but not non-KDEBUG builds),
but it does so in order to resolve a long-standing incompatibility
between them: until now, any kernel add-ons built against one which
made use of these lock facilities could not be run on the other;
instead you would get hangs and/or crashes.

After this change, kernel add-ons built with a KDEBUG configuration
should work on a non-KDEBUG kernel, while add-ons built with a
non-KDEBUG configuration will fail to load on a KDEBUG kernel
with unresolved symbols, preventing incorrect and broken operation.
2024-09-09 22:35:05 -04:00
Augustin Cavalier
cf5249749d libbsd: Use timespec_to_bigtime for time conversions in kqueue.
The FreeBSD manpage indicates that it will fail with EINVAL if
an invalid timespec is passed.
2024-09-09 17:33:04 -04:00
Augustin Cavalier
6a2d53e723 Debugger: Use BString::HashValue().
Previously BString::HashValue() had an identical hash to the one
in StringUtils::HashValue(), but now it uses hashdjb2, so this
means Debugger will now use that also.

Tested basic Debugger functionality, seems to still work.

Change-Id: Ia341daa56249967a494df46e6e0a69a74c8b5fe2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8266
Reviewed-by: Rene Gollent <rene@gollent.com>
2024-09-09 18:13:29 +00:00
Augustin Cavalier
67c0b8f2d1 BString, HashString: Replace string hashes with hashdjb2. 2024-09-09 13:39:29 -04:00
Augustin Cavalier
e9254dd79c Package Kit, WebPositive: Standardize string hashes.
Use either HashString or BString::HashValue (both of which currently
use the "modified hashpjw".)
2024-09-09 13:39:28 -04:00
Augustin Cavalier
788da26bbc kernel: Let user_debugger take care of tracking syscall runtime.
If we just use the kernel entry time, then the pre-syscall tracing
routine (with a debugger message send) will be counted in the syscall's
runtime.

Makes the output of timing in strace and strace -c much more accurate,
however it won't include the "syscall overhead" (time spent in the
syscall entry routines, etc.) But we already can't account for time
spent in the userland-to-kernel transition, so that should probably
be measured some other way if knowing it is desired.

In fact, on architectures which used the generic syscall dispatcher
(e.g. RISC-V), this is the behavior that already existed. So this just
makes x86 consistent with them.

Change-Id: I8cef6111e478ab49b0584e15575172eea77a8760
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8240
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-07 15:31:15 +00:00
PulkoMandy
58bfdd0cb5 intel_extreme: DPLL configuration for Tiger Lake
The DPLL selection registers have changed again somewhere between
Skylake and Tiger Lake. Our code was trying to read/write the Skylake
registers on hardware where they don't exist anymore.

Introduce the new Tiger Lake registers and implement enough of it to get
things working on my machine (but probably only on my machine). Also
add a bit of specialization of DisplayPort which I think was not done
correctly on previous hardware either: for DisplayPort, the link rate is
selected from a handful of allowed frequencies, instead of closely
matching the pixel clock.

Things left TODO:
- Write a proper PLL allocation system to ensure each display gets
  assigned its own PLL (unless multiple displays use the same timings).
  For now it is hardcoded to what I want on my machine.
- Fix the DisplayPort PLL computation to use the values from Intel
  datasheets, not the ones used by my machine which are somehow
  different.
- Fix the DisplayPort PLL computation to select one of the several
  available frequencies, allowing resolutions higher than Full HD which
  require higher clocks.
- Fix DisplayPort link training or whatever must happen after the PLL is
  set up, since changing the PLL results in a non-working display and we
  don't get it back.

Unfortunately this still isn't enough to bring up both displays to life
at the same time. I think it is not very far, but the secondary display
(as decided by the BIOS) remains off for now even after successfully
setting it all up.

Early testing on other machines is welcome.

Change-Id: I37209bb14f32c99944bdc8ef6eef75e2550e18ed
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7367
Reviewed-by: Alexander von Gluck <alex@terarocket.io>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-09-07 09:13:31 +00:00
Augustin Cavalier
6d1f6cad34 Package Kit: Allocate attribute handlers with BumpAllocator.
On my development VM, there were over 300,000 calls to malloc()
from EntryAttributeHandler::HandleAttribute() alone, which had
the most out of any AttributeHandler, but the others were still
significant (over another 10,000 at least.) On systems with more
packages and more attributes, there would be of course more calls
to malloc().

Since the Handlers are allocated and freed in a "stack"-like
configuration, we can use a simple "bump" allocation strategy
with the AttributeHandlerContext to avoid calling malloc() at all.
In my testing, the most memory that was used appeared to be around
2 KB or so (and the smallest was 216 bytes), so a single slab
should suffice for this.

AttributeHandlerContext seems to be created/destroyed around 530 times
during the boot process on my test machine; allocating and freeing the
allocator's slab page that many times should be negligible (allocations
that large still go through the block allocator.)

Performance-wise, the total time we spend with AttributeHandlerContext
objects "alive" goes from around ~172ms to ~156ms. So, not as much an
improvement as one might hope, but that just goes to show that our
kernel malloc() is pretty efficient. And this change will also keep
short-lived objects off the heap during a period when we are allocating
many long-lived objects, anyway.

Change-Id: I810888434aad788511f2af30143335009b34ee78
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8230
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-06 19:15:42 +00:00
Augustin Cavalier
3be79a33b0 kernel/util: Introduce BumpAllocator.
A basic bump allocator that can handle arbitrary amounts of allocations,
so long as all are allocated and freed in a "stack"-like manner.

(Actually it could be extended to support non-stack-like operation,
but that would require more logic that isn't needed at the moment.)

Change-Id: I47077146ea282600130778d312f7d86bd8c032e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8238
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Michael Lotz <mmlr@mlotz.ch>
2024-09-06 19:15:42 +00:00
Michael Lotz
b90dc7a4f3 virtio: Explicitly request queue sizes where needed.
Ensure that allocated queues can hold the amount of descriptors that
were previously communicated to DMAResources in virtio_block and
virtio_scsi. The queue allocations will now fail with B_BUFFER_OVERFLOW
if the requested size cannot be provided.

When requestedSizes are set to 0, no requirement is placed and the queue
is sized to its advertised maximum. The requestedSizes argument can be
NULL which implies all 0.

Change-Id: Ifb1e032d48f8c07aedfe2bf941f32783842c8c12
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8220
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-09-05 15:16:11 +00:00
Michael Lotz
171cfa834d kernel/util: Add a MutexTryLocker AutoLock variant.
This can be used to replace mutex_trylock/mutex_unlock pairs. Once the
locker has been created, the success of the locking attempt needs to be
checked via locker.IsLocked().

Change-Id: Iba4b4ce21cac5059a3577a84a6eebe28d2cc4058
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8179
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-05 15:16:11 +00:00
Augustin Cavalier
df44e515de SinglyLinkedList: The sole Iterator is really ConstIterator.
It behaves the same way as DoublyLinkedList's ConstIterator,
so let's name it the same way for consistency.
2024-09-04 14:15:20 -04:00
Augustin Cavalier
3e6902c3f4 SinglyLinkedList: Rename Size to Count.
So that it has the same naming as DoublyLinkedList.
No functional change. It seems there aren't any users
of this API in the default build at the moment.
2024-09-04 14:04:46 -04:00
Owen Anderson
0caf23319c arm64: Use DEVICE_GRE memory when mapping MTR_WC.
* This is the closest thing ARM has the semantics of write-combining
  MTR on x86.

Change-Id: I12a1582e0af871e2ab729262e90695ffe928c85b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8223
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-04 17:15:24 +00:00
Owen Anderson
50bb52021c arm64: Fixes to the page fault handler.
* Improve atomicity of PTE updates.
* Centralize a few constants.

Change-Id: Iaeeb82e9dc7f7ca97d13ba816fb72c6475754310
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8171
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-03 21:33:08 +00: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.
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
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>
2024-09-01 13:34:36 +00:00