This will be useful in the case of cloned device caches based
around physical memory, e.g. for framebuffers.
Change-Id: If2b864208e86f436e91379b73c4b866b0bd5e1d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10558
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
It can't work if the framebuffer is mapped per-application.
Instead, use the accelerant hook to get the framebuffer.
The BScreen methods this disables were deprecated and marked
private already, so no Haiku applications should be affected.
(If really necessary they could be reimplemented with BWindowScreen.)
Remove first _GetCardInfo in BWindowScreen; we invoke it
later, closer to where the buffer is actually used.
Tested with ParticlesII (which uses BWindowScreen) on VESA
with the new user-only-mapping accelerant.
Change-Id: I405bcfa8cb1eb2d0c346fafbc6233bef15196134
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10572
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This paves the way for accelerants to map the framebuffer in
user memory, not kernel memory. It uses the ServerMemoryAllocator
in order to avoid mapping the framebuffer multiple times in
client applications.
While at it, clean up some names.
Tested with DirectWindowStars and GLTeapot, both work.
Change-Id: I4e0c003fae99891044af0a5e6e1d6a4506da6430
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10571
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Instead of the kernel heap being a compile-time parameter, make it
a runtime parameter (if DEBUG_HEAPS is specified, at least; otherwise
we're hardwired to the slab heap as before.)
This is similar to what's done in userland: there LD_PRELOAD and
MALLOC_DEBUG control the heaps, here "kernel_malloc" and then
"guarded_heap_options" kernel settings control the heap.
While at it, apply fixes to the guarded and debug heaps to ensure
a minimum alignment of sizeof(void*), if no specific alignment
is requested.
Tested with a lot of build configurations (DEBUG_HEAPS 0, 1;
DEBUG_HEAPS_DEFAULT slab, guarded; USE_DEBUG_HEAPS_FOR_OBJECT_CACHE
0, 1) and with various parameters specified in the bootloader.
* Insert/Remove can't fail, so drop status_t return values.
* "TransferAreas" is really "TakeAreasFrom", so rename it. This
avoids confusion with the "transfer_area" API call, which moves
an area to another address space (keeping the same cache.)
* Give arch_vm_supports_protection a team_id argument (primarily
to allow the kernel address space to be more restricted than
user ones.)
* Move invocation of arch_vm_supports_protection to a static method,
and also call fix_protection from there.
* Consolidate protection checks.
Adds support for the Hyper-V SCSI controller as part of the hyperv_scsi
driver. This driver enables the use of Hyper-V generation 2 VMs as
the SCSI controller is the only storage method supported.
IDE hard disks can be supported in the future on generation 1 VMs by
this driver, but this will require a mechansim to prevent the ATA
bus manager from handling hard disks and conflicting with this one.
Change-Id: Iabb9c0471578caf1ef80754f39a09e1ce0eb4249
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10504
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
* E2H (EL2 Host) is enabled by default and usually can't be disabled
on CPUs with FEAT_VHE. Since EL2 becomes a superset of EL1 with
E2H, we can simply do nothing and everything that expects EL1
will Just Work
* Changed some register bits numbers to avoid C integer promotion
issues
* sEmptyTable needs to be filled in earler, before the kernel team
is created. Otherwise, we put the uninitialized value of sEmptyTable
in TTBR0, which immediately pends SError on Apple M1
Change-Id: I84ff7fd9134448f27315dadfd12bdd9df8c75b10
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10547
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
These allow us to move a lot of the basic logic out of the
TranslationMaps. In the process, it extends the fix applied
to x86 in the previous commit to all the other maps.
Following upon a KDL reported by atomozero, on wait-for-free-SMP-messages
on an unblock occurring with interrupts disabled.
In changing cpu_ent, move disabled to the beginning to avoid
enlarging the structure unncessarily.
On a 4-core VM, this skips around 200 sends during boot, and
over 3000 during a rebuild of HaikuDepot + mime_db (cold). On
bare metal (i3, 2x2), it skips around 150 during boot, and a bit
below 3000 during a rebuild of HaikuDepot + mime_db (over a much
longer time than in the VM, as the hardware is slower.)
Performance in the VM doesn't look much different. But this might
help in VirtualBox, or other situations where ICI latency is far
above what it should be.
Since the methods now don't just "send", the names are changed
also (which is fitting since they're now API-incompatible.)
The changes in the TranslationMaps to adopt this fixes a correctness
issue: previously TLB invalidations would be done either with or
without interrupts enabled depending on how they were invoked.
Now, they'll always be done with interrupts disabled. (This is
the same fix that was recently done to x86.)
The idea with processing the ICIs on the current CPU too is
that presumably the other CPUs will take just as much, if not
more, time processing the ICI than the sending CPU. So, we might
as well do the processing while we wait, rather than before or after.
Testing shows this to indeed be the case. On a bare metal i3, kernel
map invalidations (with global invalidations always forced) across
a boot-to-desktop go from around ~60.8ms cumulative before,
to ~51.8ms cumulative after this change.
Change-Id: Icd0343d462de7cf11043e6438f47b02f6b88bb8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10472
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
connecting
Sends an auth request to the controller, if connection was initated by
us
Change-Id: I32af0a24b902d0223bb4e773258ea9e9749a899c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10527
Reviewed-by: waddlesplash <[email protected]>
CreateConnection
Move expecting commands from RemoteDevice::Authenticate to where they
are called.In SSP we expect for the events after ConnectionComplete.
For the state machine, LINK_KEY_NOTIFY tells us the end of the pairing
in both pairings, so we clear all expected events there for the ones we added in
ConnectionComplete, In SimplePairingComplete we clear the ones added
in IOCapabilityRequest. Tested with both bluetooth 2.1 and older pairing.
Change-Id: Ia208506c9f289d9f44dc3b8b0e4cd8a726a5d726
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10526
Reviewed-by: waddlesplash <[email protected]>
This parses only EIR_NAME_SHORT and EIR_NAME_COMPLETE, others are not
yet usefull, adds a way to fetch the cached friendly name and adds a
friendlyName field to RemoteDevice. Refactors DeviceListItem to work on
RemoteDevice as it's only being used for that.Also adds a check if the
cached name is complete or not. If not ask for the complete name.
Change-Id: I7e37fb9cf44cb5598ef348fdd4d781c5ae04e24e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10489
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Currently the IO-APIC is fully initialized after PCI initialization
resulting in the IO-APIC not being initialized on systems without a
PCI bus (i.e. Hyper-V Gen2 VMs). This change moves IO-APIC
initialization to occur during early init, deferring PCI interrupt
enumeration and routing until after PCI initialization has been
completed.
Change-Id: I00be0be05d2e7668c3c6bc7af3afc4ff8d04a129
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10414
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: X512 X512 <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Some devices such as graphics and PCI passthrough bridges require
MMIO space. Add this as a device node attribute if present.
Change-Id: Id374ff61c29c1ccad10e3a7f3f7053c14d02aa5e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10483
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
* macOS ships an ancient version of GNU Bison which wants
an '=' after %name-prefix
* macOS awk doesn't support strftime, so try to find a working
awk.
* _haiku_build_{open,openat,fcntl} are declared and defined with
different prototypes (variadic vs non-variadic). This is bad
on its own, but it "happens to" work on most platforms since
variadic parameters are usually passed in registers, same as other
arguments. On arm64 macOS, variadic parameters are always passed
on the stack, so you get weird and confusing bugs when using
these functions.
Change-Id: I8cee9ecac0ac9b039be6b7e35ceaf8ad7c0f4c44
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10468
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Since the kernel is built with -ffreestanding, and thus -fno-builtin,
the compiler ignores the function names and doesn't perform optimizations
(e.g. inlining for small values) that it otherwise could. So, here,
we add a string.h that supplements the default, and uses #define to
reinstate the builtins, and thus the optimizations.
Linux and FreeBSD at least apparently do the same. A quick compile
benchmark in a VM doesn't show much difference, maybe a slight
decrease in sys time.
I checked all invocations of GetBit; as far as I can tell,
only the two adjusted here in smp.cpp are done while the Set
may be concurrently modified, and even then I don't know
that they really need to be atomics, anyway.
Currently, a packet being read is split into header and data buffers.
Change to a single buffer to simplify logic in drivers, especially
for those that receive packets with variable sized headers.
This change also implements the pending send size functionality for
the receive buffer.
Change-Id: Ic4a3698fcfe813fbcf4fd9c1941102b5adaeb3b2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10418
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Converting points array to `BPolygon` has significant cost, including
heap allocation, when drawing a lot of polygons.
Change-Id: I81e6b4031bac4beadcc79412c58eedddffc00a82
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10337
Reviewed-by: waddlesplash <[email protected]>
This allows us to gracefully fail if memory allocation fails,
rather than panic()ing. If a single-threaded application tries
to wait on a non-shared user_mutex in single-threaded mode, it
will now be dropped into the debugger.
* Use CPPUNIT_TEST(_SUITE) macros and autoregistration.
* Remove unnecessary header files.
* Consolidate Archivable, Autolock, MemoryIO and MallocIO tests into
one .cpp file.
* This structure makes it easier to add new tests - from adding .cpp
and .h + updating Addon.cpp file (3 files), only one .cpp file is
needed now.
* Convert string_utf8 test from standalone app to CppUnit test.
Change-Id: I18d90eb66b7cfc5576626b66ed85e47eb64547bf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10399
Reviewed-by: Kacper Kasper <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This adds a new job to the Package Kit, and an invocation
in pkgman after changes are applied. The job takes a time_t before,
and an int32 minToKeep, and (after confirmation) deletes all state
directories which were last modified before that time, but also
keeps at least the minimum specified.
pkgman defaults to calling it with (now - 30 days, minimum 10).
SoftwareUpdater does the same, but without bothering the user
and just defaults to doing the cleanup.
Change-Id: I15f5232b11daba5955e7fa07f696ad7785507931
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10404
Reviewed-by: waddlesplash <[email protected]>
It doesn't refer to some random old state, but the currently active
one. (If the currently active state is the default one, then it will
return nothing.) So, this should make things clearer.
Change-Id: Ib3fe842f5fb51eaf2ef2f31bad8b292b47a3fb36
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10403
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This header gets included in the build platform, so we can't use
the private recursive_lock.
Eliminates another statically created BLocker, due to gDefaultTokens.
The lighter "struct mutex" is in a private header, so we can't
inline it in a public one, so just use pthread_mutex here.
By adjusting padding, the class size stays the same (72 bytes
on 32-bit, 96 bytes on 64-bit; confirmed via static_assert.)
A quick benchmark running "new/delete BMessage" in a loop on 4
threads at once goes from 30-36 seconds before this commit
to around 13-17 seconds, sometimes as low as 3 seconds, afterwards,
so clearly this is a significant improvement.
This also eliminates another BLocker allocated on application startup.