X512 pointed out that ServerLink is inherited by PortLink which is
used by all windows, so the original change had the unintended effect
of allocating another semaphore for every window, which isn't wanted.
So, just use a static mutex here also.
* Currently the DEL key is intercepted by a shortcut registration for
the Tracker "Move To Trash" menu option.
* Allow key event propagation to continue if a shortcut that does not
use the CMD key is disabled.
Fixes#19870
Change-Id: If16d3858cee61dfd1862b379fbcfeffebe617341
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10226
Reviewed-by: waddlesplash <[email protected]>
* Added static_cast<uint32> to resolve type mismatch warnings between
signed integer(fSlots[level] and slot) and unsigned integers(ItemCount()) during compile
* eliminated a potential unsigned underflow vunerability when a node
is empty in NextLeaf() traversal logic
Change-Id: I8534f31cac9dec41e04e16989427dc7d9abb26ef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10363
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Fruit De La Passion <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Fallback to DBG2 if SPCR is not present while discovering UART serial
devices. DBG2 is newer than SPCR but does not provide the same
information, and it appears that both can exist on the same system.
This has only been tested in Hyper-V which exposes DBG2.
Change-Id: I6a75114f4287b6db289b544c3b80a66a625fb6c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10354
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
* Fix warnings by adding two casts
* Activate Werror for all graphics drivers
* Remove options to disable Werror for individual graphics drivers, can later be re-introduced, if *really* necessary.
* Part of ticket #9460
uintptr_t is intentionally used although a physical address is concerned. Using phys_addr_t would require additional casts at other places.
Change-Id: Ife6dbcf809b6537427f318460e41cdc056e7d964
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10386
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
The case where no BApplication has been created at the time of fork
is not blocked by this change (as it might be useful in fork-to-background
before creating a BApplication.)
Reinitializing or recreating a BApplication where one already exists,
though, is not supported by the kits, and just leads to problems.
And when the global destructors are invoked after a fork, such as by
exit(), then the parent team's state may be corrupted due to the
deletion of BLocker semaphores or other global state.
So, we thus set be_app to an invalid pointer, and if terminate_after()
is called with this pointer, we invoke debugger().
(We should really just prevent semaphores from being used across
processes unless explicitly specified, but that would be an
API compatibility break from BeOS, so we'll need to do it carefully,
or not until after R1.)
Would have clearly caught the problem in #18576 and the linked thread.
They don't work properly after a fork, and if exit() is called
from the forked child, the parent won't be able to use them
anymore.
In BBitmap and BPicture, replace them with mutexes. For AppServerLink,
make the private ServerLink inherit from BLocker, and then use
that one directly.
This also is a slight efficiency gain, as we don't need to create
multiple semaphores from the static initializers now, which is
just a waste of time in the case of applications that don't
even need these locks but link to libbe.so (e.g. CLI tools.)
Part of #18576.
This now does what notify_if_stat_changed used to, fixing a
race: if some thread was modifying a file, and some other thread
(or the same thread, in some other mtime-updating operation)
updated that file and this called MarkUnmodified() before the
first thread close()d it, then when the first thread called close(),
no node monitor notification would've been sent, as fModified
would've already been unset.
So, now every time we are to mark a file "unmodified", we also
send the node monitor notification at the same time.
Fixes the remainder of #19910.
This reverts commit 902921a554.
This broke resolution of CNAMEs, including the Haiku package repos.
Since pkgman uses our own HTTP implementation, which doesn't set
AI_V4MAPPED at all, this shouldn't have been a behavioral change for
it at all, much less having broken it.
Change-Id: If38b6a81c1144101ddea7d1f8d401326675479e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10388
Reviewed-by: waddlesplash <[email protected]>
If a context switch happened between the messsage being
sent and received, we don't need to invalidate.
Brief testing on a 4-core VM shows this happens relatively
rarely during compile jobs (expected, most processes are
single-threaded), but very often while running multiprocess
web browsers. Some INVALIDATE_PAGES are skipped, but mostly
INVALIDATE_PAGE_LIST is (by the thousands.)
Change-Id: If32ed95139e0db3770054f6ef3f72c9aecb9394d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10350
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This will be useful on architectures that support ASIDs, and on
ones that don't, it can be used to avoid a race between invalidation
messages being sent and context switches occurring on other CPUs.
In this commit, no behavioral change intended on any architecture.
Change-Id: I6d2ee4b69150f9ff8503329761266ddbdb550eab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10349
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
- Directory entry names were compared using strncmp() with
entry->namelen bytes, which could incorrectly report names
as equal when one name is a prefix of another (e.g. "dir1"
and "dir10").
- Move util functions hashFunction and hashLowerBound to Utility header.
- Disable xfs TRACE logs to not pollute syslogs.
Change-Id: I2b158bfa6b815d7576a880055f794ffe89d0eb22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10357
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This way we don't need to call barrier_unlock() in every thread
after exiting the wait loop, some syscalls. We can also avoid
spinning on the barrier mutex in "ensure_idle" (which is renamed
"ensure_none_exiting" for clarity), and instead lock it once and wait
for some thread to unblock all.
Overall, this strategy appears to be as much as 25% faster
than the previous, testing with pthread_barrier_test.
It seems the old design had at least one possible but very narrow
race in the "last one out" logic: if that thread was suspended
between the atomic_add() and the assignment of barrier->lock, and
all three other threads then ran past the add() in the next run,
then when the last-one-out woke up, it would clear the WAITING
flag spuriously.
This may help with #19876.
The runtime_loader previously used resize_area without properly
reserving address space first. This worked in most cases but failed when
ASLR was disabled or when address space was crowded.
* Add kHeapReservationSize constant (1MB) for virtual address space.
* Create area at exact address within reservation
fixes#19345
Change-Id: I952f11475ad041056833de6a248bfea4a9a2e397
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10360
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Fix crash when formatting a partition as FAT on a registered disk image.
This is caused by the physical block size being reported as 0.
Fixes#19911
Change-Id: Ibe7fb22ea17a87d26dc37a737175674ec10ff618
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10355
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
The differences lead to skipping the last position in a row in some
parts of the code but other still considering it, with some ill effects
when the font metrics and window size conspire. Example: Mangal or Lohit
Hindi fonts in the default 18pt size and minimum width window.
Change-Id: Id7bb857ddca1abb4961735586dedde8daa555dcf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10345
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Máximo Castañeda <[email protected]>
* Conversion from BTestSuite to CppUnit::TestSuite excluded some
test suites due to empty name.
Change-Id: I8ab597df82c8cafd9911415c217e32ecbf7efef6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10352
Reviewed-by: Adrien Destugues <[email protected]>
* Rework ByteOrderTest and DateTimeTest to use autoregistration.
* Functional changes in ByteOrderTest are confirmed in git history
to be R5 compatibility fixes. This doesn't include B_ASCII_TYPE -
it seems it has never been part of is_type_swapped().
* Autoregistered test names start with a number - this is because
RTTI is used to create them. Disabling RTTI is not an option
because CppUnit in our repo has a broken macro which always sets
the name to "ATestFixtureType". This is probably fixed in newer
CppUnit versions.
Change-Id: I56ab5df6e998b6f47fca3c3458a56a761c1740a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10266
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Kacper Kasper <[email protected]>
When the point is the top bound of the next block, it's that block what
we are looking for, not the current guess. Fixing the limits also fixes
the binary search landing on an invisible block and returning a failure
when it should have returned the next visible one.
Change-Id: I7508432567cbbaf00048f01e7589cecd25c9ccf4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10344
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Fixes scrolling the character view when dropping text and the blocks
list when hovering if the affected character is in that block.
Change-Id: I8d6714b37b4243d729dd69c312fe5682465f198a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10342
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Hyper-V does not use the standard hypervisor CPUID leaf for TSC
frequency reporting, causing time drift on Gen1 VMs as the PIT is
considered unreliable. Gen2 VMs do not emulate a PIT and require
the use of this MSR.
Change-Id: I38cbdb9f8de7259b5cb4bc195d0e6585d76782c2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10339
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Mozilla Location Service was killed by Mozilla.
This is a (mostly) compatible replacement that does not need a secret key.
The differences are:
- No API key: instead Beacon DB asks users to identify themselves by
user agent
- The content type for the request has to be set to application/json
Change-Id: I4fd95ff66f1d77c2380e393800c0a09a7f4f0cf5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10329
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tracker extensively uses vfs_rewind_dir() hook before it lists all entries as icons, implement this hook so Tracker can correctly list all entries on mounted XFS volumes
Change-Id: Ia52640577f5f92fb1b46df3d14f5ac5ad7ae1943
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10314
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>