The port pool now being created in BMediaRoster init, we must make sure
the media roster is initialized before doing anything else.
Change-Id: I5a3cc61c993e9be4078772bbf341b637d951d239
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1734
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Change-Id: I8084e0fa2ffbaf04242fa14617807d83abbd5586
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1556
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
If a new pose is going to be placed below the current view bounds, we
definitely do not need to do any drawing. If it is above or inside the view
bounds we do this special drawing method.
Overall this method of doing updates is complicated and hard to adjust without
introducing drawing artifacts. As noted in the TODO, this should be rethought
from scratch.
But for now in one case of over 8000 files in a single directory this improved
the loading speed from about 8 or 9 seconds to 1. Queries results also load
much faster. I am testing in a VM with a single CPU on a host with an SSD, so
others may see better performance with more CPUs, or less with a spinning hard
drive.
But at least now the drawing won't be the bottleneck.
Should finally fully fix#3011, or at least good enough for close.
Change-Id: I3806ffa7674e404c9db24edb33d6ab4eb2d825f7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1726
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This is a very simple reader for the media kit, useful to make sure
ffmpeg isn't at fault when you get a crash. Also, unlike ffmpeg it
allows you to see the full backtrace.
-Resolve some issues.
-Added the connected devices code in the main window.
-Replace BUTTON_DEFAULTS and BUTTON_REVERT with kMsgDefaults and kMsgRevert.
Change-Id: I3b0c86fc581056859239df0fbf2c085b8d168136
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1619
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Change-Id: I9f1c47728297d7e29033beed7338bbd44d6d13cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1492
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Chế Vũ Gia Hy <cvghy116@gmail.com>
Add a preliminary set of unit tests for BKeymap and fix these issues:
* BKeymap::operator=() caused a crash by allocating a zero-byte array to hold
the other object's character data.
* BKeymap::SetToCurrent() and SetToDefault() leaked memory by not freeing an
existing character array before allocating a new one.
* BKeymap::SetToCurrent() incorrectly determined the size of the current
keymap's character array, causing GetChars() to fail whenever the current
keymap was loaded. Now SetToCurrent() uses the _get_key_map() private
function, which accurately reports the size of the array.
This commit also updates a Jamfile by replacing a use of "UseHeaders" to
include private header files with the more concise and expressive
"UsePrivateHeaders".
Change-Id: If6f71b209f1bd395be57835c4dd89f0e3f845994
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1724
Reviewed-by: Ryan Leavengood <leavengood@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
Letting it get deleted statically can cause segfaults since it is needed for
some final quit messages.
This mimic changes Axel made for the DormantNodeManager and
TimeSourceObjectManager.
I also pulled PortPool into its own file and header.
Fixes#15135.
Change-Id: Ie64753e1876d58b52f7cb95536c6be3df2e6d40c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1721
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
I had app_server crash on me because of an uncaught allocation
exception. I don't know if this will fix it but it's better to try to
survive even if it may result in some UI glitches.
Change-Id: I09dd2a7e6ff63d52f51389d7418d1a1d1810af00
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1720
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Without this, the BufferCache keeps a reference to these buffers inside the
media_addon_server until the media_addon_server quits, which is pretty much
never.
Should fix#4954 and #14755, and possibly #13614 and #14047, though I think
they may be something else.
Switched from std::map to our HashMap to get something which works in gcc2 and
gcc8.
Change-Id: I26463899724b9d1520d97fec785e435f536eaf3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1717
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Thinking over this carefully, I realized that adding checks to
every ioctl implementation in every driver would be very prohibitive,
because there, one has to check is_called_via_syscall() in addition
to IS_USER_ADDRESS(), and this would have to be done in every case.
So that would take a massive amount of work, and it would be
very easy to miss a case.
Instead, we can take advantage of the fact that all we really care
about is the buffer not existing within the kernel address space.
This should allow using constants in the umappable range between
0x0 and the beginning of the user address space, too.
Change-Id: I2eeb46e806a5aac32e152c72076a042aa847be0d
This works around "yet another" Intel CPU bug. AMD is unaffected.
Linux chose to use an altcodepatch for Intel only; FreeBSD did
a bunch of benchmarks and determined the effect this had (if any)
was so far out in the decimal places that just adding it unconditionally
was the easier and simplest solution.
(FreeBSD commit: https://github.com/freebsd/freebsd/commit/f4038696064b86260)
Fixes#15236.
Avoids waking up every 100ms to do nothing.
Change-Id: I48c7be41f6102a76b7e770ea45c665ab991c79f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1700
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Ignore unknown fields (also called attributes) which are from a package
file with a different minor version number. Previously it would halt
with an error when encountering such a field, even though it can safely
be skipped over (if it was unsafe, we would have incremented the major
version number).
The use case is a future package attribute for pre-uninstall scripts.
If they're not run, that just leaves some debris after uninstalling
(like symbolic link desktop icons).
* Use the B_NOT_SUPPORTED error code when reading unknown package
attributes. Don't treat it as an error if the package is a
different minor version, just skip it.
* Print unknown package attribute index numbers rather than stopping,
since they may be from future package file formats and can be safely
skipped otherwise. Mention the relevant enum so you can find it in
the source code. It's a pity that the previous abstraction layer
isn't present, since it tells us what data type the attribute is
(string, number, etc), so we could have printed its value too.
First step of two for enhancement #13427
See https://review.haiku-os.org/c/haiku/+/1504 to generate packages
with a different minor version number (second step of the enhancement).
Change-Id: I6db1897824a1713b3d5fab6fdfb990ee5923cd52
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1714
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This makes pkgman functional in minimum-profile images.
Change-Id: I3578886743fecbf76779ac1b4b76762d8ce1be3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1715
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Normal boots should not be slowed down by old package states.
Should fix#12498.
Later I will fix the package kit to merge old states so they don't build up
indefinitely.
Change-Id: I6830dd4ed65a3a659c0a68590238be0dcefff451
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1703
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Add a missing dependency (libedit) that prevented Debugger from
starting, and include Debugger in the Applications menu in the Taskbar.
Change-Id: I43c69fe969e51a3a59d1f2d9aa65c00b20848b87
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1713
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This synchronizes us to upstream commit 4da8b88f53b545e0695e5a90ee.
This version is a pretty significant refactor with some important
performance optimizations to cross-thread deallocations, so it
probably will have a noticeable performance gain on Haiku.
On most applications, there appears to be either no change or a
slight (1-3MB) increase in the amount of used memory, likely because
of the changes to the default "map more memory" flag. We can revert
this if it proves to be a problem, but I don't think it will be.
We allow teams to clone areas within themselves, but I'm not sure
exactly what use that has. The kernel can of course clone anything
it wants to, still.
Hopefully this will prove substantially less disruptive than the
reverse change last year, as the preceding commits are likely the
only major consumers of this API, rather than a variety of drivers
that need to be individually tested.
It now lives in OS.h. The idea is that this will now be
accessible to userland applications, so userland memory
is protected from access by other processes, just as
kernel memory is.
No functional change (the constants are still the same,
though I've changed some to use shifts to make clear
which bits are allocated are which are unused.)
Sparcv9 runs Openboot in 64 bit mode, which means the cell size is
64bit. Use intptr_t where appropriate to make the open firmware calls
work.
Beware, some values are still 32bit, this matters for example for
of_getprop, if you get 32bits into a 64bit variables it will be in the
MSB of it (big endian only weakness...) and confuse things. See for
example in console.cpp, where the input and output handles are retrieved
as 32bit values. It seems wise to check the expected size when using
of_getprop in these cases, instead of just checking for errors.
Change-Id: Ie72ebc4afe7c6d7602a47478f0bfb6b8247004b8
Reviewed-on: https://review.haiku-os.org/c/1369
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The video mode hook gets passed a menu and an item, but is actually
interested in the submenu pointed by the item and the items inside that.
Don't reuse the passed parameters and instead declare new local
variables.
Change-Id: Id17adde552fac2c248afa78380ff299fb21bc968
Reviewed-on: https://review.haiku-os.org/c/1693
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
No functional change intended, added some copyrights
in the process.
Change-Id: Ic6ebe276bb939c425d65aff1b3b07c7c2e27a33a
Reviewed-on: https://review.haiku-os.org/c/1698
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Fixes#15230.
The comment pretty much explains it. I think needing this means this code could
be redesigned, but I don't know enough yet to make that fix.
It also feels like this whole job system and Command pattern is overly
complicated when good old functions would be fine, certainly for pkgman. But
maybe this is used more heavily in HaikuDepot.