We can't call user_debug_image_deleted with the lock held, so clear
the list and remove all images before unlocking and looping again.
This also means we free() without the lock held, which should
reduce contention.
The callgrind information should contain a path to an ELF file,
not an identifier. We thus only add the identifer when we don't
have something that looks like a path (or is the commpage.)
This allows applications that analyze callgrind output to merge
images with the same ELF file.
The data section could theoretically be before the text section,
but it also may not exist and have a size of 0. The commpage
image is one such image with those qualities, and so we
would thus always find it as having a hit when encountering it
in the list.
And since data_size might be 0, just do < instead of <= and -1.
This massively fixes the profiler's output.
The profiler depends on this, and it's likely to invoke the scheduler
of its own accord anyway.
This logic could possibly be abstracted into a generic function, seeing
as it's the same across all architectures...
The "-k" argument (which never did anything before) is now inverted
compared to what it used to be, i.e. now specifying it will profile
kernel frames, too, whereas by default only user frames will be
sampled.
The infos[i] will only have B_EVENT_INVALID in the case where
select() returned an error and we set it ourselves; or for
wait_for_objects, it will now always be set as one of the select
flags, so we can't rely on it there.
Failing to deselect objects (or, in the case where we did receive
B_EVENT_INVALID, deselecting them again incorrectly) can cause
memory corruptions and use-after-frees.
Fixes at least one KDL inadvertently introduced after the previous
refactorings, but the double-deselect problems predate that commit.
In the preceding commit, I missed that "events" was cleared
inside the select loop, making a use later on useless.
Now we don't clear it in the loop, but wait till the end
to do so. (Considering we return without clearing it in
case of out-of-memory or other problems, this may not
even be necessary, but it at least preserves existing
behavior.)
This also corrects an oversight in pthread_join() that not all
potential error codes of wait_for_thread were accounted for
(in particular EDEADLK wasn't.)
This is a non-standard extension, but is present on both Linux
and FreeBSD, at least.
Change-Id: Ie96e7a261e863ab491bee30349360df7ff3d0e80
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5099
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Adjust wait_for_objects/select/poll implementations to handle this
properly (use the original array's selected-events values, not
the select info's values, and ignore errors if events were reported.)
event_queue is not adjusted and will behave differently after this
change (specifically it will not allow such FDs to be added,
which matches behavior of epoll/kqueue elsewhere.)
Change-Id: Icea26efce894f00697afd29f3bf51b7e60e522ab
Put the extensions above the "Haiku thread API bridge",
fix their indentation, and make them standard instead of weak symbols.
(musl does not declare these functions as weak symbols, at least.)
This appears to be a typo for LC_CTYPE, and as such nothing
ever used it. Environment settings are set up by SetupEnvironment
anyway, and if unset just default to C/POSIX locale, so this
isn't needed here.
Avoids open/read/close of a FD on every application startup.
May help with #18947 (especially as opening files on devfs is
somewhat more expensive than on a regular filesystem.)
Exploring can take a while, and if we hold the device manager
lock the whole time, we'll block a lot of other things on the
system (including open() calls to anything in devfs.)
So, instead of holding the lock continuously, we now lock it
only temporarily, and instead add protection against deadlocks
when called by other threads besides the explore thread.
Tweaking the colors for the character view.
* Don't use hard coded colors, but B_LIST_* colors.
B_LIST_* has the advantage over B_DOCUMENT_* that there's a
*_SELECTED_COLOR, too, for the the currently selected char.
* Make the disabled characters - those not part of the currently set
font, but taken from a fallback font - a bit darker. Those lacked
contrast before IMO.
* Dark themes need some special consideration when using disable_color.
They need to be lightened where bright themes get darkened.
* Added special treatment for the color of selected items. Needed
for people (e.g. me) that run a bright theme (= dark text on light
background), but have light text on dark background for selected items.
Fixes #18948
Change-Id: I44e5be6a38e1d531238889b96ca65db0cf49b83f
Change-Id: Ic02ced0540edf29808fcead5dec64758a963e7e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7841
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Zero-test sectorsPerCluster.
* This value will be checked more thoroughly later by parse_bpb().
* Fixes #11119.
Change-Id: I2318fbf3ea7f3c6c49b317ddd7d895757cf5944d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7840
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
This commit introduces enhancements to the Find Panel, focusing
on improving user experience and functionality. The primary
changes include:
1. Menu Bar Integration
- Added a Menu Bar and migrated the more-options section into this
Menu Bar for a more organized and intuitive interface.
2. Saving a Query
- Save as Option: This allows users to save a query to any location
on their storage drive. A save panel enables marking the saved
query as a template or a query file.
- Save Option: Treats Queries and templates as documents, enabling users
to override changes to the file without opening the Save as Panel
repeatedly. Context-sensitive activation of this option is also enabled.
3. Opening a Query:
- Users can open a query via the Find Panel, which brings up a File Panel for
Selection, streamlining query/query template management.
4. Templates Menu:
- Provides a convenient way to select templates. Newly saved templates
immediately updated in this menu.
5. Options Menu:
- Clear Templates: Deletes all the templates from the filesystem and
refreshes the template menu.
- Clear History: Deletes either all query files or only temporary query
files from the filesystem.
6. Improved User Flow For Saving Queries:
- Queries are treated similarly to document files, containing properties
specific to the search. Users can override and save details using the
same file.
7. History Menu:
- The History menu has also been moved into the menu bar. Here it is
segregated into temporary and saved query files. This is helpful to
slowly shift the chain of thought to only show the saved queries in the
history menu.
Summing up, these changes aim to shift parts of the Find Panel into the
Menu Bar, fitting it along the newer design. It also adds in the required
features to treat queries and query template files as mutable documents
which can be easily saved or retrieved.
Change-Id: I9c13ddd77a7628a0440e59c57b6bb22dab6437c0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7817
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
* B_ABSOLUTE_REAL_TIME_TIMEOUT is used for kernel timers, and
must be used for absolute timeout values, rather than the
B_ABSOLUTE_TIMEOUT flag. Discovered whilst implementing
`pthread_timedjoin_np`.
Change-Id: I37ae057073ff5efeecc00406b132abf51bebbdc2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5100
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
It's now at HaikuArchives and supplied in a package at HaikuPorts.
EXR images are rare and mostly used in pretty specific cases, so it
isn't re-added to the default install.
Catalogs are left in-tree until they are purged from Pootle.
Change-Id: I54e478a30e02bdefd1b8fa53c4b66d84ffb04185
We already used it for the individual date and time formats, so it
only makes sense to use it for the combined datetime format.
This fixes failures to initialize datetime data for non-POSIX locales
after the ICU upgrade, as the "full" format is now longer and contains
characters such as U+202F (NARROW NO-BREAK SPACE) which result in the
UTF-8 encoding being too large to fit in the fixed-size buffer.
This menu item has extra decorations around the label, that need the
menu to be a bit wider than just what would be needed to fit the string.
Otherwise, the string can be truncated.
The problem is not visible in the current usage in Tracker (in open
panel favorite menu) because other items force the menu to be wide
enough. However, I tried to reuse this code in another app and hit this
problem.
Change-Id: If5d2475c22d9943e26b45c415fcd6e4df3d5fc4c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7834
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>
FreeBSD's equivalent routine (lapic_write_icr) does not read
these registers; in fact the only thing that does read them
are its initialzation routines, and then its code to check
the interrupt delivery status (same as we do.)
Additionally, APIC_INTR_COMMAND_1_MASK only contains the bits
that are set by the OS, not the ones set by the APIC, which
means that APIC_DELIVERY_STATUS (bit 12) isn't included
and we are thus writing it back here, which doesn't
seem correct.
Change-Id: I2c74b7b8de3cd8295c8dd86e5a7c6530dc5648ed
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7827
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>
Since we always compile the kernel with modern GCC, we might as well
take advantage of modern C++ features. In addition to providing
a sanity check, "final" is also an optimization, since it allows
the compiler to devirtualize calls made directly to a "final" class.
Change-Id: Iedb0ee8834637771f5b6113c17342dbf67e99042
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7826
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>