This breaks kernel C++ ABI.
This mostly just changes the definition (not the size) of string types,
but in at least one case (daddr_t) it does change the size (from 32-
to 64-bit.)
_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.)
* If this was set too small by EFI, some MMIO addresses could end up out
of range and trigger Address Size Faults.
Change-Id: I29280e1f536cfd64c4711b3b702418cd43699278
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8357
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* When booting in EL2, TTBR0_EL1 may not be initialized if VHE
extensions are not enabled. To handle this case, we need to use
TTBR0_EL2 until we transition to EL1, at which time the contents
of TTBR0_EL2 get copied to TTBR0_EL1.
Change-Id: Iadaa1f30d016397c5fd0426c891b3443dd8805e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8350
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
In "by attribute" mode, the attribute popup and AND/OR popup menus
are needlessly wide, while the text input field could be wider.
This change increases the weight of the text column, making those
popup menus less wide.
Fixes #19116
Change-Id: I347583cdb7d8e399f83f56cc2d167084e1483ba8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8356
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>
* _DisplayPartitionError() adds quotes to the partition name variable (%s).
So when calling it, the passed string musn't have the variable in quotes
already (\"%s\") or we'll end up with duplicate quotes.
* Anywhere else we see a partition name variable, it should have quotes.
This change fixes two places that didn't before.
Change-Id: I37e806c9dceea3c2a2b52a7cb139d7c32e976d5c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8353
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
The don't-wait and do-wait logic was very similar except for the
actual acquisition of the lock in the middle, so now they're combined.
This fixes another (minor) regression from 9e89f7c068
in that if a page's cache changed before we acquired its lock and
don't-wait was set, we would wind up waiting anyway.
This fixes a regression from 9e89f7c068.
Even if SwitchFromReadLock fails, the original read lock has been released,
and so we need to re-acquire the lock before continuing.
Should fix a KDL reported by X512.
The clock hands do not always point exactly at the hour marks, which is
easy to see using Magnify (or a flat screen with sufficiently large
pixels): when a hand tries to points at 3 or 12 hours exactly, the
resulting line is not horizontal or vertical.
This is because the hands lines hinge on an array of coordinates, which
are calculated at run time using pi, and the calculation used to
approximate pi value as 3.1415. This has been the case since respective
BeOS developer sample code from 1999 was imported into Haiku repository
in the initial commit in 2002. Interestingly, BeOS R5.0.3 clock demo
does not have this bug.
Use M_PI for the pi value, point the hands precisely and fix my bug
report #19083.
Change-Id: Ie71889daed2efccd1596586f95b629f3b8e14c03
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8352
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Previously wonderbrush was closed source and only available for 32bit
x86, but that is not the case anymore.
Fixes #19093
Change-Id: I05a34f7aaf82ea7cc2f65b7cbd39eeaf222d6143
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8351
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>
* It turns out that `end` is inclusive.
Change-Id: I1d29e975afcfc1c6812fdf9ac8bfbbb3ac1e46bc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8348
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
* Put disabled code behind #if 0 instead of comments, as per style guide.
* Clean up comments.
* Errors should be ERROR not INFO (but both are printed anyway
at the moment.)
No functional change intended.
* This could result in us inadvertently unmapping more pages than
intended.
Change-Id: I2513028cd18436aadd29749628944a853e65e1c4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8346
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
We automatically enable _DEFAULT_SOURCE if _GNU_SOURCE is defined.
Rather than having even more optional methods undefined unless
_GNU_SOURCE manually is, just change all remaining guarts to
use _DEFAULT_SOURCE instead.
Fixes #19095.
Change-Id: I5c7baf40b7fb37913e24279589fc1ae706448a45
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8330
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
The names chosen (e.g. "B_UNCACHED_MEMORY") follow the existing naming
conventions for memory-related constants, of putting the type at the end
of the name: B_KERNEL_BLOCK_ADDRESS, B_FULL_LOCK, B_READ_AREA, etc.
Resolves a very old TODO. No functional change intended.
Change-Id: I31491f6b3abc1e95f915aa302b9f2fb2af14774c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8316
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* 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>
It's needed in delete_area for arch_vm_unset_memory_type at least.
Instead just add a parameter indicating the area is already removed
from the areas map.
These are only relevant for MTRRs that describe physical memory ranges.
The change that introduced PAT removed the condition of MTRRs being
usable to always add the RAM ranges to the memory type ranges as
write-back, but this doesn't allow them to be used uncached for DMA.
Change-Id: I6cdd8f5a23a8f5cc582d25cf170c3e8d71d5e1fc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8344
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
When PAT is in use and MTRRs are ignored and left unchanged, it is still
useful to know what it was set up to by the firmware.
Change-Id: I6b0c0f1277659c81fa9b3e9b7bb2c5df92cfdf0f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8341
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
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>
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>
We set flags above the timeout check, so we need to use |= and
not lose the SHARED flag we already set.
Fixes some testcases in the POSIX testsuite, and the shared
semaphore code in Gecko/Firefox.
Except on kernel_cpp.cpp. We don't use it for most of libroot, so
we don't need it for most of runtime_loader either. The two preceding
changes were all that's necessary to fix things with builtins enabled.
Very slight performance improvement (the "run 1000 shells" benchmark
seems to decrease by about 0.4 seconds out of 16.5 or so.)