Only the x86 and PPC implementations look like they would have worked,
while the builtin is available and will work across all architectures.
We already use it unconditionally in some parts of libroot.
Change-Id: I2dffb3b2c7cdd605092382b9d649151adb921bb4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6942
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This is the loop that runs on all CPUs besides the one
actually running the kernel debugger. It's functionally
a spin-loop around a few different variables, and so it
should be safe to use cpu_pause() here, just as real
spinlocks do.
(cpu_pause() just runs a "pause" or equivalent instruction,
it doesn't use the CPU-idle modules, which indeed may be
unsafe to use in KDL.)
A glance at FreeBSD seems to indicate they also do this
when their kernel debugger is active.
Seriously improves power consumption while KDL is active:
even running in a VM with only a few cores, there would be
obvious fan spin-up when entering KDL. After this change,
there's barely any at all (while overall CPU usage % remains
basically identical.)
I looked at this code as a reference when writing similar code in another
project, and realized then that this was broken to the point where I
don't think anyone could have actually used it:
1. Writes larger than the buffer should only return the amount written
by this Write() call, not the amount flushed beforehand.
2. fDirty was only set if there were bytes remaining after the first
write to the buffer. So, if you wrote small amounts of data, they
would be silently discarded most of the time!
3. When filling the buffer, we might as well flush simultaneously.
This allows the logic to be consolidated into a loop and remove the
duplicate memcpy. In case of failure, just return the bytes-written
as the write could be retried later.
4. Flush() should always return an error or 0, not bytes written.
While at it, add some basic tests for this class.
Change-Id: I2de01d0b31e3fe22863cef21dd7b0b62ed47121b
* Remove unused/unneeded parameters to Dequeue.
* Make use of StackOrHeapArray.
* Reorder syscall-entry checks for efficiency.
* Inline the unlock-block method and unset variables in the process.
* Reorder code for clarity and to reduce indentation.
When breaking out of _RemovePackageContentRootNode() by encountering
a specified "endPackageNode", we need to unlock all directories.
This case is only possible to encounter when _AddPackageContentRootNode()
fails partway and invokes _Remove() to remove the just-added nodes.
Fixes a hang/deadlock encountered by Diver while testing some (disabled)
HaikuPorts recipes.
hrev55571 introduced several new pure virtual functions in Node,
none of which are implemented in Handle or ExecDevice any of their
descendants.
This change fixes the build after the Node/ConsoleNode refactor.
Change-Id: I098005df063160fd984e70da29ddb24a1d7a7133
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6940
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev55571 introduced several new pure virtual functions in Node,
none of which are implemented in Handle or any of its descendants.
This change fixes the build after the Node/ConsoleNode refactor.
Change-Id: I825b90a114d83105f46d566e7fe1f644ba997ec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6939
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Remove the TFilteredQuery::GetNextDirents() stub as it was preventing the
results from showing
* Fix the getopt string so that a -p argument is recognized
* Move the folder_params declaration out one level so that it doesn't go
out of scope when needed
* Clean up the help output
Change-Id: If37c300b4b67773ffc33fd637c2ef9add3c12275
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6901
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Renaming "Low battery" to "Battery low" so it's right next to
"Battery charged" in the Sounds prefs event list.
* Adding "Battery critical" sound. I think it makes sense to have
a different - more urgent - sound when there's only 15% left,
compared to "Low" (30%).
Change-Id: I46b5975e5797a9c3a84d4619e697be162e79b1cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6900
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Putting a "using namespace" statement (_USING_ICON_NAMESPACE in this
case) in a header file causes all source files that include that
header to use that namespace, regardless of whether they actually
wanted to.
Change-Id: I3ebf4ea3366f5f2b9068e3da88f40a7b4d98fd6b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6897
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Some of the Haiku-specific modifications that were previously unmarked
are now clearly marked with #ifdef __HAIKU__.
BIND9-specific files containing private APIs never exposed in public
headers have been removed.
Tested with wget, curl, pkgman (Network Kit), WebPositive (WebKit/curl),
and Falkon (QtWebEngine/Chromium). All DNS-related operations seem
to still work just fine.
(One patch also imported from NetBSD trunk for GCC 12+ compatibility.)
Change-Id: I4a349577b24b4df008fd9cba5d3a322cd24397f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6879
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This has not been included in the build for years, probably since the
initial NetResolv merge. Services are now returned via the "protocols"
file, and getservent() has no need for these utility functions.
Change-Id: If18bdd9593463b38a9aaedb7a621d0ddc15530e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6878
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
There was a TODO comment about this, which dated all the way back
to the original OpenTracker import over 20 years ago.
There's still more cleanup needed, so I left another TODO.