Changes the logic flow around reverting the position of
the request / response buffers when the buffer is logged
during trace logging.
Change-Id: I025ca9988b32447e225e3ad1b1d4da1174d2d122
Reviewed-on: https://review.haiku-os.org/599
Reviewed-by: Rene Gollent <rene@gollent.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Corrections to some areas where the 'position' of a
data stream was not being set correctly before reading.
Change-Id: I0030a113008028d5480dc36d034cf06915d928de
Reviewed-on: https://review.haiku-os.org/588
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
getsockname() now set the socket family and zero all other fields
of sockaddr if an unnamed socket is passed as an argument. This allows
retrieving the socket family from an unnamed socket.
This change is compatible with POSIX and appears to aligns with
Linux, FreeBSD, DragonflyBSD and OpenBSD behaviors.
Fixes#14312
Change-Id: I55dbf4d6738399941bef71e6b3d7201cf78876df
Reviewed-on: https://review.haiku-os.org/594
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Fixes#13622.
The "media_node_framework" is such a huge mess. We really should sit down
and design a MediaKit2 someday that doesn't require ~15,000 lines of media
node support code just to have a "fully functioning media player."
It seems to be as if not faster than the built-in method now as far
as I can tell, and this means one less arch-specific difference.
I haven't ripped all of it out yet, though.
It has been deprecated since FFmpeg ~3.0, and is internally implemented
using these functions now, so this should largely be a no-op change.
AVCodecEncoder still uses it.
All of the functions it calls are deprecated and no longer needed,
as FFmpeg loads all codecs automatically now, and uses pthreads internally
for locking as needed.
From mmlr's analysis in #13370 comment:22: "We actually do ignore a missing
routing in case the interrupt line is 0. In this case it isn't 0 but 0xff,
which is invalid and generally treated the same as 0 in the rest of the code.
Ignoring the missing routing on 0xff seems like the way to go here."
Indeed, I managed to locate a footnote in the PCI 3.0 specification which
confirms that this is the case on x86, and a commit in the Linux kernel
which essentially does the same thing this change does:
https://github.com/torvalds/linux/commit/e237a5518425155faa508a087f2826
Interestingly, that commit is only from 2016, while PCI 3.0 is from 2004.
This probably fixes#13370 ("Haiku doesn't MBR boot on Ryzen"), and potentially
other interrupt-routing-related boot failures.
Change-Id: I88129f6507c62d24cb50cf5c78597ca7bd7872d7
Reviewed-on: https://review.haiku-os.org/590
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* There was an off-by-one error in initialization code;
BRect(0, 0, 15, 15) does not create 16x16 bitmap - it is 15x15.
As a result vector icons were rendered at 15x15 and then scaled to
16x16.
Change-Id: If1b57148e5a887a4bf71e01606d3d0d6fd0ed149
Reviewed-on: https://review.haiku-os.org/585
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We do not know anything about the symbols we are being asked to demangle;
it is entirely possible they are malformed, or that we parse them incorrectly,
which previously led to buffer overflows. E.g. the "2","8" in "SetTo__Q28_GLOBAL_"
is presently incorrectly parsed as a length, leading to an access 21 bytes past
the end of the string.
This caused a page fault under the guarded heap, a fact I had the misfortune
to discover when trying to attach Debugger to a guarded-heap'd application
which somehow ran the demangler under the guarded heap also, and that symbol
above was in runtime_loader, so it crashed while loading its symbols.
So now we do what the GCC3+ demangler does here, and keep track of the input
buffer through the use of a state class, which will prevent us from incrementing
past the buffer's end.
I've tested this patch using the new haikuc++filt utility against libtracker
(indeed, it took multiple rounds of testing to get the diff to be 0 bytes)
and it seems to work exactly as before, though now without out-of-bounds
accesses.
As this demangler is also used in the kernel, it's possible that some
triple-faults on x86_gcc2[h] are caused by this bug (although that would
be rare; one of the incorrectly-parsed symbols would have to be in the
stack trace, and then it would have to read past the end of the buffer
containing the symbol.)
Change-Id: I343991cebd7d2887812c8c6b3dc2e0df2fcd79fa
Reviewed-on: https://review.haiku-os.org/579
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Built as "haikuc++filt" so you can keep it in PATH without replacing GCC's.
The implementation is a very close copy of "demumble", which is
under the Apache 2 license, so this is also. Most of the modifications
to "demumble" were to strip out Windows symbol support, and then
add GCC2 symbol support (this required reworking of the main loop,
as we detect GCC2 symbols in a different way than Itanium symbols.)
I've also added a command-line flag to ignore GCC2 symbols when stream-
processing, which is sometimes useful when demangling GCC3+ symbols.
Running this under guarded heap with some random SOs shows that there are
some symbols which apparently cause memory corruption in the GCC2 demangler.
I haven't yet looked into that, though.
They may still be running at the point we detach from the window, and
as we stop watching everything else at that point (and the threads
themselves depend on the window looper as the global "lock"), we
need to tear them down then.
We especially cannot do this in the destructor, as there are some
virtual methods that the threads need during their teardown which
obviously will not work in ~BPoseView.
Fixes#13371, and potentially other Tracker crashes that occured
as a result of closing the window while the add-poses tasks were
still operational.
Change-Id: Ib7ec0d1d413096be899a05887399f5b087eb8f99
Reviewed-on: https://review.haiku-os.org/574
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Fixes the tests added in the previous commit, and also #8552.
Change-Id: Idf9459474bc66054f94cf66065ed6fcf9c60cece
Reviewed-on: https://review.haiku-os.org/572
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
BeOS R5 treats NULL passed as the "replace with" argument as if it were
an empty string. Our BString currently does nothing.
Change-Id: I54b661e4ea8335ce531e6b6e3de2095a41112cd7
Reviewed-on: https://review.haiku-os.org/571
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The action vm_page_fault takes should depend on whether the iframe to be
handled is a user iframe or not. The check for the user flag in the
error code does however only check if the fault happend in user or
kernel space. Use IFRAME_IS_USER() instead which checks the privilege
level of the iframe. Under 32 bit x86 this also handles vm86
compatibility mode properly.
This is the same logic as used on FreeBSD (TRAPF_USERMODE).
Fixes#13930.
Change-Id: I9c348b6ab4c60daaaaa2c0fe33bcc3336aa29f7b
Reviewed-on: https://review.haiku-os.org/560
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Patch by Pete Goodeve, ticket #9134.
(Removed play_sample_rate and record_sample_rate as suggested in
patch review, adjusted hda.settings accordingly.)
Tune buffer size and buffer count with an optional settings file
/boot/home/config/settings/kernel/drivers/hda.settings. Same as
it's done for the auich driver.
Pete:
> I [...] request 4 buffers of 1024 frames, I get a nice 13-14ms latency.
Change-Id: I3c1c64375d22b525afb970d5e8379b22b8514438
Reviewed-on: https://review.haiku-os.org/521
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Thanks Axel and Jerome for the reviews!
Change-Id: I4f116c540cf59ba74b79d9d2f95ed40edc9c4174
Reviewed-on: https://review.haiku-os.org/557
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Fixes#12034, and a variety of other strange "no wireless networks
appear" bugs that have plagued Haiku for years.
Change-Id: I734cb8084e8a626b8e03511519609bf80c1559eb
Reviewed-on: https://review.haiku-os.org/552
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This depends on the previous commit to return the correct error code
from ioctl().
If there are no VAPs running (which is the case after a forced disconnect
from an access point), scans will fail. In that case, we call
IEEE80211_IOC_HAIKU_COMPAT_WLAN_UP, which will restart a VAP, and then
initiate the scan.
Change-Id: I732aefe67e386dbb0ed3d232ed9deda678132601
Reviewed-on: https://review.haiku-os.org/551
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Previously, if a device driver returned an error of any kind, -1 was
propagated the rest of the way up through the stack instead of the
actual error code.
Change-Id: I6839763c6b2eb86d6112d3732e6cb80d022f1fe8
Reviewed-on: https://review.haiku-os.org/550
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* _VirtualWidth() ignores invisible columns
This makes the horizontal scrollbar match the width of the visible columns.
Also trigger an initial update of the scrollbars.
* Fixes#14480
Change-Id: I7d4b27a8fdca58c150ac47f9b948b127fb275fdf
Reviewed-on: https://review.haiku-os.org/543
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
This fixes the (intermittently) crashing test added in the previous commit,
and should also fix#12024 and #14348.
Note that this is a slight behavioral departure from BeOS, though since
BeOS crashed when this was done previously, it shouldn't cause any
other problems.
Change-Id: I90b6132ff7741b8d6cb601375a9b11fc3ffacb40
Reviewed-on: https://review.haiku-os.org/541
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Adds/removes items as rapidly as possible from the menu from the
main thread while the menu is open. That part works. Then it deletes
all of the BMenuItems and then closes the menu, which crashes,
as the BMenuItems do not notify the BMenu they are being deleted.
I tested this on BeOS and it seems that this model crashes there also
(looking through the code comments, it seems there are a number of
testcases found throughout the years like this.) Removing the items
before deleting them indeed fixes the crashes on both BeOS
and Haiku.
Change-Id: I8624f966bdc17030ddca05b97aa57b518ab420c5
Reviewed-on: https://review.haiku-os.org/540
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
...if the row is present in the list, but continue to return false if the
row is not currently visible on the screen.
Part of #11675. Cherry-picked from https://review.haiku-os.org/442.
BFS does this as part of journal management, but not as part of block
cache synchronization (which makes sense, as flushing it then would
defeat the purpose of the drive's write cache.) No other file system
seems to touch it at all, so we should do it as part of an explicit sync.
This may help with some of the filesystem corruption issues, as it seems
that on slow disks, the drive might not have enough time to flush the cache
before it is powered off (or on some SATA/AHCI based disks, it is not flushed
before close at all), so triggering it here and, as the ioctl is supposed to be
synchronous, waiting for it also, seems to make sense.
Change-Id: I7d9992c21ca4b59c839711dcc96c973b4b8df052
Reviewed-on: https://review.haiku-os.org/530
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* The difference is visible when control background doesn't match
panel background.
Change-Id: Ie3a034acaa52929becd6601520e0e05f32ecc8d8
Reviewed-on: https://review.haiku-os.org/537
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
When URLs combine a base URL with a relative part, the relative part's
path component was being pre-processed. This removed any ".." from the
path and in some cases in the unit test cases, the ".." should have been
retained and then only later applied to the base URL. This changes
fixes this so that the relative part is not pre-processed and is applied
with it's path in a raw state.
Completes Fixes for #14377
Change-Id: I9cebb8599889494e11f40a3b54c87ebca3ed1a21
Reviewed-on: https://review.haiku-os.org/529
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Here's what happens:
* BPackageManager created a BRefreshRepositoryRequest with a BContext
of an empty DecisionProvider and itself.
* Since there is no internet access, the FetchFileJobs that the refresh
class queued fail. Specifically, the first one does, but then as the
subsequent ones depend on it, they are all aborted.
* As some jobs were aborted, the StateListener is notified.
* The state listener of course has the BPackageManager class as one of
the listeners, and so calls it, because even though the handler methods
of BRefreshRepositoryRequest, they are powerless to stop event propagation.
* The BPackageManager's highest subclass' implementation gets called, which is
of course pkgman's.
* pkgman decides to DIE() upon receiving word that a job was aborted.
There are thus four potential solutions to this issue:
* Rewrite the package kit's event & job handling systems to not be so
screwed up in terms of propagation. Seriously, there is way too much
stuff that we send to the "user" in here, and as you can see, it can
get *extremely* convoluted even for supposedly "simple" tasks. This
is probably the best "long-term" solution; but obviously is far too
involved for the present.
* Only partially rework event handling; specifically in the SupportKit to
allow JobStateListeners to stop further propagation. This is probably
the best "medium-term" solution.
* Do not pass the package manager as the JobStateListener to the
RefreshRepositoryRequest. This would have the downside that the
regular notifications about download state, etc. would not be returned
at all, which we don't want. We could make a shim ... but that would be
a lot of code for little benefit. The prior solution makes more sense.
* Completely ignore "JobAborted" notices in pkgman. In fact, this is the
solution that virtually all other consumers of this API take (although
some of them seem to have TODOs about it), including package_daemon,
HaikuDepot, etc., and so it's the one I've taken here. If a "job aborted"
error is actually fatal, then it's the Package Kit's problem.
Fixes#13075.
"Elementary streams" were introduced with MPEG-2, but did not find much use
outside of internal data interchange until now, which finds some HEVC
files being actually distributed in this format.
The first four bytes (00 00 00 01) are common to all (packetized?) elementary
streams, while the three following (40 01 0c) identify a HEVC stream. Actually
I could not find good data on these; all the HEVC files I saw (and some hex-
dumps on online mailing lists of more) contain these three bytes in common
while following ones appear to be the internal header. (I didn't dig deeply
enough into FFmpeg's source code to find out the "real deal.")
Fixes#12565.
Resetting the drawing mode to B_OP_COPY was not right, since the previous mode could be anything.
Use WritePush/PopState() instead.
Change-Id: If9cba2c46bf372fd0164d951fcc49696cf72d576
In the AS_CLIP_TO_PICTURE case, the "picture" variable was shadowing the outer "picture" variable.
Change-Id: I3b9de2432f93a683aaccdb899051a14ebf9b7e6e
* Make the status message view have a minimum height of the logo
view's height.
* Properly add the views to the BGroupView layout.
* Instead of trying to set the explicit minimum size from the status
view information, just invalidate the GroupLayout. This seems to fix
a number of bugs relating to text overflowing the view, while it doesn't
fix others (e.g. orphan words on their own lines are still not drawn
in some cases, which appears to be a BTextView bug.)
* Use BString::SetToFormat instead of snprintf in some places.
As far as I can make out, fixes#13608.
All other functions in this file that locate the TTeamGroup via FindTeam()
do a NULL check afterwards, so the fact that this one did not just looks
like an oversight.
Fixes#14457.
Change-Id: I52ada3447b638db07622fa51746e75ce6cce7a46
Reviewed-on: https://review.haiku-os.org/518
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
* Set url (identifier) as generic hpkg.haiku-os.org url
* Set base-url (actual repo location) as eu.hpkg.haiku-os.org (our eu mirror)
* Drop old "repository" url mess
I had a realization that haikudepot operates off of the base-url, if
we continue using old url's after r1beta1, we're going to be stuck
with all the symlinks and redirects for a looooong time.
This also opens the chance for us to go off of the generic "url"
for haikudepot identification, which will let it work when users
leverage mirrors.
Change-Id: Ic8fa954190cc26602911e133dd3c25ce2a96ce9d
Change-Id: I669c73a990b0fff84cf5d37b5a4cc57ad97905ff
Reviewed-on: https://review.haiku-os.org/514
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
Suppress -Werror=class-memaccess pointed out by gcc8.
* Remove unneed memset(), since media_format is cleared by constructor.
* Use media_format::Clear() instead of memset()
Change-Id: I02e19c1fab1f1b3f6c348e1d3ac63536d5c829b2
Reviewed-on: https://review.haiku-os.org/484
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
A URL in string form should be able to be parsed and then verbatim
regenerated according to 'UrlTest'. This change fixes this ability
for the case where there is a '?' initiating a query or a '//'
initiating a host/authority section.
Partly Fixes#14377
Change-Id: I6547253c3cdc22d79514edf75284e9725d1a2d17
Reviewed-on: https://review.haiku-os.org/512
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
untested.
Change-Id: Icbb3ddf8c0f840fae0e2107ca211728036ba8aa7
Reviewed-on: https://review.haiku-os.org/510
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
* De-escalate the severety of data loss from "high risk" to "risk".
* Remove the advice to not create partitions with DriveSetup. It's been tested
and been working well since the last alpha. Do recommend making backups of
all partitions.
* Remove description how to add Haiku to Grub. It's too much detail and the
user would have to memorize the info. Add a link to our Booting guide
instead.
* Mention BootManager as an alternative to boot Haiku, refering to the
Userguide for more info.
* Alpha -> Beta
* Only give normal thanks instead of "a lot" and don't beg to like us.
Sounded a bit desperate...
Change-Id: I212513fde01287f5d1c9c5c9891827aaf0b7e1ea
Reviewed-on: https://review.haiku-os.org/502
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit 1edc131debcf8ea1c9cd9eafd41c356f0432d9a5)
Reviewed-on: https://review.haiku-os.org/508
The kernel's handling of SIGABRT is just to terminate the application
immediately without doing anything else (it only notifies the debugger if
there's one installed for this application already.) More serious faults
(e.g. SIGSEGV) originate in the kernel and handle this logic before they
even invoke the signal handler.
So the correct solution is to do the same here in libroot. This incurs
a very, very slight performance penalty of the syscall time for sigaction(),
though I expect whatever applications are causing SIGABRT to be invoked more
than once a second will call raise() directly instead of abort()...
string_for_size uses KiB, etc., and so when the two are combined (e.g.
pkgman's progress display), it looked especially strange to have two
different units.
This allows applications to theoretically open() the poke device but
then change their uid/euid to something more restrictive. The mem
device is not even this permissive; but I can think of some scenarios
in which this might be useful.
As the comment says, there are a number of scenarios when this is
the case, e.g. non-interactive SSH sessions.
Change-Id: I3a10043820039f344b3f036f7861c81f6fb7ef05
Reviewed-on: https://review.haiku-os.org/499
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Our implementation of tsleep does this. It seems very few things
actually use that, though, so the issue referenced in the previous
commit may be one of the first things to use pause/tsleep.
Change-Id: Id2edb2268b3b078b9ded5d634cfa241599f882f1
Reviewed-on: https://review.haiku-os.org/490
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This is much simpler than the prior condvar-based method and should be
functionally equivalent. It seems tsleep() cause a NULL dereference,
though (which will be fixed in the next commit), so this probably
also fixes#14355.
Change-Id: I36968de38ceb0a1c0896cae8839821f5ca383504
Reviewed-on: https://review.haiku-os.org/489
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* PRE_BETA_2 is now the default in master.
* For libbe: R1/alpha4 used internal=8, but nobody bumped master
at the same time, so now we are on internal=9.
Fix -Werror=class-memaccess pointed out by gcc8.
* Use TerminalLine::Clear() instead of memset()
* Use rgb_color::operator=() instead of memcpy()
Change-Id: I41360e245fd55c526d9c2802a2f247ba22583080
Reviewed-on: https://review.haiku-os.org/483
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* Incremental rendering allows the user to see how the render is progressing.
* Can move to a new location before the render finishes. Render will automatically restart at the new location.
* Multi-threaded rendering now renders from a horizontal line in the center, giving a better experience.
* Improved behavior for scrollwheel zooming. Now zooms with the mouse as the origin, as is the standard behavior in other applications such as map viewers.
* Added lots of TRACE statements internally, which can be turned on in the code for debugging.
Change-Id: I1ad39a262ebe5c1b51d46b8cc09fb4de5113b9de
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
The limits were wrong in several places. Checked the sandy bridge, ivy
brige and haswell docs, they all say mostly the same.
- The value of p2 is either 7, 14, 5 or 10 depending on 1 bit in the
config register and on the display type. We can guess which values are
right according to the global P limit (5-80 when using 5/10,
28-something when using 14/7). The values are different because CRT
need a precise, but rather low pixel clock, while modern display
interface can accomodate being faster than required by a few MHz, but
need a much higher speed (the bits are transferred serially, so they
need to be at least 8 times faster than a DAC).
- The limits for N were obviously wrong, as the register is written with
N-2, so values less than 2 make no sense. Use 3-8 as specified in the
datasheet.
- The reference frequency (set by the driver) was wrong, too. It is
120MHz, not 96. It is 100MHz in some cases (FDI, etc), we should see
when this happens and switch to the right reference for PLL
computations.
- There was an attempt to minimize the value of N (a powersaving effort,
I guess?), but it would basically force the loop to stop at the first
value of N tested, resulting in way off timings in some cases.
- To ease testing and stop sending patches and syslogs back and forth
with vidrep, extract the "test mode" from pll.cpp into a proper test
executable, making it a little easier to experiment with the code and
fix the problems.
This should fix#13669 and possibly other cases of "out of range", black
screen, bad timings, etc.
Change-Id: Ic4c1c159701f352b7c1ef15a647f023c82ac26c
Reviewed-on: https://review.haiku-os.org/360
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Fix build on 64-bit.
* Test suite can now run from start to finish.
* Changes in OutlineListView test need an explanation:
for some reason when BApplication is created on heap, be_app is not
reset. This causes other tests to crash due to second BApplication
object being created.
Change-Id: Ic7d55f4622192f83572bfd83fa37f1f5fd641e22
Reviewed-on: https://review.haiku-os.org/465
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Replace class with struct, since PCIDev is previously declared
as a struct in pci.h
Pointed by clang [-Wmismatched-tags]
Change-Id: I6d85a8e4faa039c9905e4710715331e72beff413
Reviewed-on: https://review.haiku-os.org/481
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
As expected there was a lot of bikeshedding.
Just change the color of the path, green on success, red on failure.
Constraints taken into account:
- Keep the > for now
- Prompt should be as compact as possible for those of us using 80
column terminals.
- Prompt should not change size between success and error cases
Not taken into account:
- The feature should be accessible to colorblind people (we could
replace the > with another char but we couldn't find something that
looks suitable)
Fixes#10919.
Removing an interface triggers this sequence:
datalink_control() calls interface->ReleaseReference() which causes the
Interface destructor to be called. The Interface destructor calls
put_device_interface(fDeviceInterface) which destroys the
net_device_interface, then calls put_domain_datalink_protocols(this, datalink->domain)
in a loop. put_domain_datalink_protocols() tries to access the deleted
net_device_interface, hence the KDL.
Change-Id: I2326bcd6d1fd80a69e5fdfa6629563b38ecdbbac
Reviewed-on: https://review.haiku-os.org/469
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
* Store pointers in an addr_t instead of int32, for 64-bit's sake
* Use DebugSupport.h instead of userlandfs Debug.h and remove extra parentheses
* Create a header-only String class based on the userlandfs String and use it
* RecursiveLock instead of Locker.
* Jamfile cleanups and other misc. changes.
It isn't yet adapted to the new VFS API, so the build is still somewhat
broken.
This contains the contents of Haiku's sources, which is necessary
to include in "with source" builds for proper (L)GPL compliance,
mostly because we have GPL code in the tree.
TeamDebugger:
- When a job is aborted, instead of calling into the user interface directly
to reset the status message, post a message to do so. Also, only post the
message if we aren't already in a terminating state. Otherwise, if jobs
were still running while the team debugger is executing its destructor, it
would attempt to make calls to the already destroyed user interface. This
bug has likely been with us for quite some time, but was hidden by incorrect
ref counting in the past (see #12343).
ExpressionPromptWindow:
- Post a quit requested rather than quitting directly. As a consequence of
this oversight, the team window would never get the notification that the
prompt had been closed, and would consequently not reset its internal state
properly.
It seems the old one was just broken (see mailing list discussion.)
This new one was built from the generic one, but it was done using
a trunk build of Clang 8 with tuned optimization flags, and is
smaller (101 instructions) than GCC 8's (134 instructions) and
the old hand-optimized one (~125 instructions?) as well as being
targeted for ARMv7 instead of ARMv6 like the old one was.
In the future, we may want to look at newlib's ARM memcpy, which
is probably much more hand-optmized than this one is, but this
is at least better than what we had before.
Thanks to mmlr for spotting this. The wrong format specifier was used,
which would lead the server to get the wrong size and do strange things.
Chunked uploads should now work a lot better.
While I was at it, put the line termination in the printf to save a
write to the socket (these are unbuffered and each of them costs us a
syscall, and in some cases this has been found to confuse webservers as
we end up sending super small TCP packets).
Replace strncpy with strlcpy, since destination size equals
maximum number of characters to copy.
Pointed by gcc8 [-Werror=stringop-truncation]
Change-Id: I528a35bd071b1d13f16dcec2e8c2007b5bb072b2
Reviewed-on: https://review.haiku-os.org/473
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Increase array size, since gcc8 x86_64 warns 'sprintf' output
between 2 and 20 bytes into a destination of size 16
[-Werror=format-overflow=].
Change-Id: I641db97d963b64b0c3434cd498f29f4dcb61c373
Reviewed-on: https://review.haiku-os.org/472
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Since hrev52136 holding Shift while clicking the zoom button will
ignore the Deskbar and resize the window to take whole screen area
(the original behavior).
It'd be nice if the keyboard shortcut for zooming - Ctrl+Alt+Z
recognized an additionally held Shift in the same way.
Add shortcut to window.
Fixes#14365
Change-Id: I919ff2c3e8c41e022f8c675ea631daf18ff41eb3
Reviewed-on: https://review.haiku-os.org/470
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
As Stephan said, some apps ignore the return value of Encode(),
and since _OpenCodecIfNeeded() is called from there, this could
cause wasting of cpu cycles.
Change-Id: I80e1464d8532ebf80c514685ef3a25d98d8142fb
A codec context cannot be reopened, anymore.
Reorganize code accordingly.
Remove usage of the AVFormat context (which was not enabled, anyway) since it's no longer possible to do that.
Use av_frame_free() instead of av_free()
* Realized we already had a function which iterates over
an fdt node and maps it's memory regs. Make it work for
physical mappings or identity mappings.
Change-Id: I0e3e323798bc2dfcead1accc1d403b30a8ab188f
GCC provides these but Clang does not; these come from the ones Clang
was going to provide, but decided against it in favor of letting libc vendors
distribute them instead, hence the license headers.
For now, they are only enabled when building with Clang, as we still use GCC's
versions otherwise. But I've tested them with apps built with GCC 7 (as Clang
builds are still too broken at present) and they seem to work just fine. (They
will not build with GCC 2 of course, due to how they use __attribute__.)
To indicate this is a menu you can enter to select a previous
state to boot. Also rename "Latest version" to "Latest state" as
that is more correct.
Thanks waddlesplash for pointers.
Fixes#14362
This reverts commit 033f3450e3.
The discussion on the mailing list has tended towards changing the BFont API
so that these kind of fonts return true for IsFixed() as well as IsFullAndHalfFixed
if only to avoid the API ugliness of be_fixed_font->IsFixed() returning
false.
But since that change should not really affect applications, as BeOS ones will
probably not support CJK characters at all and Haiku ones should work properly,
and the present state of affairs has been pretty annoying to CJK users, we can
at least allow users to select full-and-half-fixed fonts as their default
fixed font, and begin dealing with whatever bugs that may cause now.
In USB, the interface and endpoint descriptors, and possibly other
vendor-specific descriptors, are nested inside the configuration
descriptors. This makes it possible to retrieve the complete information
about a configuration in one single call.
Our drivers do this, and so does libusb (the Device Kit doesn't, it only
cares about individual descriptors and does not provide access to the
vendor-specific ones).
The driver did not expose the full descriptor, only the part that
belongs strictly to the configuration. libusb worked around this by
getting the descriptor from the device directly, using a control
transfer. This should be ok, but apparently some devices get confused
when you do this too often or at unexpected times.
These changes introduce a variation of the GET_CONFIGURATION_DESCRIPTOR
ioctl that allows the caller to specify a size. This way, one can get
the complete descriptor (after getting the configuration-only part to
figure out the size needed, most likely). The data is copied from
structures stored by the driver, so no further communication with the
device is necessary, making this safe to the problems mentioned above,
and faster.
Change-Id: Id97e40ea0d45b8c051ae8548486c4751fc6aad2a
Reviewed-on: https://review.haiku-os.org/453
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
The ICU class is named MessageFormat, but on Haiku, it sounds too much
like something related to BMessage (which it isn't in the slightest)
and not part of the Locale system. It works almost entirely with BStrings,
so naming it BStringFormat makes much more sense.
OK'ed by PulkoMandy and Humdinger.
Gcc8 x86_64 warns sprintf() output between 2 and 9 bytes
into a destination of size 4. But, sprintf output can be
within 4 bytes since SMP_MAX_CPUS is 64 max.
So replace sprintf() with snprintf() and modify
format string to fix Wformat-overflow.
Change-Id: I7a23e6d98a5dd02a32a5aae573947a5650c82f7f
Reviewed-on: https://review.haiku-os.org/446
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Two files remain: "argv.c" and "argv.h", as these are still used by some
other, non-FS-related tests.
This was one of the last significant chunks of "no commercial use" code
in the tree, as it originally came from the "Filesystem Construction Kit,"
the sample code distributed with "Practical Filesystem Design with the Be FS",
and contained a sigifincant amount of BeOS kernel filesystem code in it
(the original README, not preserved here, noted that "the cache code is
the real Release 4 BeOS disk cache code".)
It has long been replaced by Ingo's from-scratch, MIT-licensed fs_shell
that lives in src/tools/fs_shell. Perhaps a note should be made somewhere
of this code's prior existence, but I don't think we will have much use for
it again, so confined to the dustbin of Git history it shall be.
src/tools is for tools used in the build or other miscellaneous utilites
that go along with Haiku itself. btrfs is, at least for now, just another
filesystem addon, so its shell should live here with all the others.
No functional change intended.
EachItemUnder selects items that are not in fact under the superitem
passed to the method.
ticket: #13730
Change-Id: I12a2e29204e1b9bbecd5704e60a02e3613a7f4fd
Reviewed-on: https://review.haiku-os.org/52
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Streaming means the stream is endless, so don't compute a duration.
ffmpeg computes an estimation using what it thinks is the file size, but
is instead some internal buffer size from BAdapterIO.
Fixes second part of #14326.
Since destination size equals number of characters to copy.
Pointed out by gcc8. [-Werror=stringop-truncation]
Change-Id: I8f2118129ec2324bb1f93857f5abfdf121c864f0
Reviewed-on: https://review.haiku-os.org/450
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Skipp_OSX <jscipione@gmail.com>
* This was making unresponsive the target window, making impossible
to cancel it at all. Now the current filename is reported at 20Hz,
well enough for good visual search progress feedback. Fixed#14175.
Signed-off-by: Kacper Kasper <kacperkasper@gmail.com>
Style fixes:
* Commit message formatting.
* Removed commented code and unnecessary whitespace.
DIESubprogram:
- Adjust to inherit from DIENamespace, as gcc can and will use it as a
container in some circumstances.
DIEClassBaseType:
- Add accessor for member functions.
DwarfImageDebugInfo:
- Adjust recursive walking for types to take into account any DIENamespace,
not just DW_TAG_namespace specifically.
- Factor out adding function to list into a helper.
- When retrieving the list of functions, perform a similar recursive walk as is
done when building the types table, as some subprograms are apparently not
always added to the root compilation unit entry. Curiously, this behavior
seems to be relatively specific to a struct/class type declared inside a
function in GCC's case, but based on the DWARF spec, there does not appear to
be any specific restriction as far as where these can be nested, so be a bit
more paranoid to ensure we don't encounter similar cases in the future.
On Haiku host, we need _GNU_SOURCE defined when stdio.h is included
to use fopencookie. We did that in libsolv sources, but we now include
stdio from BeOSBuildCompatibility.h which is included from the command
line. So set _GNU_SOURCE from command line as well.
Spotted while reading through the VM code while thinking about how to
implement vfork().
When axeld disabled this in 2005 (!), Haiku's kernel was still young,
BeOS drivers were still "a thing," and there was no distinction in this
function from being called by the kernel / not by the kernel.
Now, it's 2018, we manage all drivers ourselves, have SMAP enabled by
default when available, and as axeld recently noted on the mailing lists,
"there's not much reason we still use GCC2 for the kernel anyway." So we
probably don't care about any BeOS drivers that may be broken by this
(are there any still around?)
Besides the usual fixes to get this 13-year-old chunk to work again, there
are two functional changes:
1) Allow the kernel to clone whatever it likes into the user's address space.
It seems that this is often done legitimately (e.g. team creation), and
so attempting to distinguish those cases seems more work than it may be
worth right now.
The disadvantage is that drivers without proper checks may be "tricked"
into cloning areas they shouldn't; but I'm guessing if that's the case,
then something else is probably broken and the driver should be fixed.
It seems the reverse case (cloning a userland area into the kernel)
is much more common (in fact, it looks like all 4 of the 4 places
where clone_area is used in kernel-space outside the kernel itself
are doing this.)
2) At KDEBUG_LEVEL 2 and higher, throw a panic when attempting to clone
an area that does not have the protection flag set. This should make
finding any bugs exposed by this change much easier than "hardware doesn't
work" / "black screen on boot" / etc., as well as any potential future
bugs introduced in the process of driver development.
The Controller would always pause and resume playing, even if it found
out there was no position or volume to restore. Since pausing on http
streams appears to be broken, this is not a good idea. Just check if we
have something to restore, and leave the function if not.
Fixes#14326
* Consolidate all fdt code into fdt bus_manager
* Build boot and kernel static libraries
Change-Id: I2a69cd7e1f1276999a80734ff12918fd49b599e5
Reviewed-on: https://review.haiku-os.org/440
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
* This fixes booting Haiku on Raspberry Pi and qemu (-M raspi2)
* Makes several assumptions which need corrected.
/axi is broadcom only
size is fixed
* The final solution will be "probing" each simple-bus device
from the fdt. A lot of fdt support code needs written though
for "finding" compatible devices and determining the full size
of the devices in memory.
Change-Id: Ifd5fbab7490c8456247115f5aada618909f1bb9e
* Use strlcpy() and strlcat() instead of sprintf()
to suppress -Wformat-overflow pointed by gcc8.
* Add <string.h> to mga_std.h for strlcpy() and strlcat().
Change-Id: Ib038283fd213c9e0ac9f19482402b55d2e3f204a
Reviewed-on: https://review.haiku-os.org/429
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Affects *all* nodes, i.e., both directories and files. It is still possible
to override these, but it must be done in another system_package, not just by
mounting a package with newer datestamps on the conflicting files.
This is the pure version of axeld's proposal 2(d) from #10071. However,
as the haiku_secondary packages contain application mime_db entires and
are also 'system_package's, it does not fully solve that ticket.
This function is used when serializing a BPackageInfo object, which is not
done very often, and flags are used even less often. But both of these things
are done for the system packages, as they have the "system_package" flag
set, and are processed by "update_package_requires", and so this meant
that the "system_package" flag was turned into the "approve_license" flag.
This commit does not amount to any functional change: we still compare
purely by modification date alone. But it does de-duplify the code somewhat,
and makes it possible to easily implement changes to the comparison.
1. SDHCI PCI Bus: Discovering SDHC device from the PCI bus
and registers a child node(MMC bus) to which slots
are attached. SDHC registers are mapped by MMUIO,
they are binded in a structure(struct* registers).
A pin based interrupt handler is also installed,
which triggers the handler function and interrupts
are being taken care of. Added API's to set-up and
the clock for SD/MMC card, change frequency and
reset the registers.
2. Device Manager: Currently, busses subdir lists are har-
dcoded and in order to load the driver. We hard
coded the bus dir under PCI devices.
3. MMC Disk Driver: In order to register the slots under
/dev/disk/mmc and hence data transfer and other
operations can be done.
4. MMC Bus Manager: Setted up a bus manager to create an object
to do a particular for eg certain data transfer and
get freed until another operation is requested.
Change-Id: I369354da6b79adc6b6dfb08fe160334af1392a34
Reviewed-on: https://review.haiku-os.org/318
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
* Fix garbage put into videos while encoding.
* Testing welcome.
* Various fixes are still waiting to be merged into Haiku.
* Fixes sponsored by the V\OS project.
* av_get_context_default(1,2,3) are deprecated. The functions are supposed
to "reset" a codec context to a clean state so that it can be opened again.
It was used to allow using AVStream.codec as a decoding context
That behaviour is now deprecated, so that's why the function is too.
* hint: The code is probably still doing something bad in that regard.
* Unfortunately the macro removal did end up in the codecparam diff,
but was originally intended to be a commit alone I can't rewrite history
unfortunately, at least an explanation is given here. In any case the
code wasn't used so no functional change, this is mostly educated cleanup.
Untested, but this now better matches how the FreeBSD code does it.
Potentially fixes a bug where interrupts would be spuriously re-enabled
after the driver had disabled them, which may fix a KDL humdinger
reported to me via IRC.
memset uses rep stosb on x86 during boot, with memory
not set to write-combining, which makes it slow.
Instead we do aligned writes of 2 x four bytes at once.
Only clear the minimum of size and width * height * 4
UEFI framebuffer size can be huge, upto 512MB here,
and rep stosb seems to be around 25-30MB/s
This is written as generic as possible to work on
old compilers and different platforms, without
expecting boot memset to be optimized.
This makes it almost unnoticable compared to not
clearing.
It will probably be just stubs for the significant future, but,
here it is anyway.
Regarding the naming: Yes, the official name is "aarch64." However,
Linux, FreeBSD, and Zircon all call it "arm64", and so we will do the same.
I've configured it initially to be a Clang-only port, making no
changes to GCC buildtools whatsoever here. We'll see if that sticks,
however.
Check a range of characters to see if they have the same width.
Change-Id: I9cef12f78d1e1d01acc6284eae90dbfb86166fc6
Reviewed-on: https://review.haiku-os.org/47
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
It seems not all of the kernel includes this, but some use new/delete
anyway. Further, operator delete[] was not implemented at all.
Possibly fixes the ARM build.
Since they were being Use'd at global scope, the FreeBSD versions
of a number of POSIX headers were being used instead of the POSIX ones,
which breaks the build on non-x86 as these headers presently do not work
elsewhere.
Instead, just include the base directory, and then include the compat
headers manually in the one place that actually requires them.
Also fix all the other files that expected errno.h and others to
be included implicitly, which they now are not.
This should fix the PowerPC and (part of the) ARM builds.
Clang's equivalent of .tfloat is .x86_fp80, but apparently that
is not enabled for Haiku. So for now, use .double instead.
This is the same thing MinGW does.
This block was originally disabled in libbind, and we enabled it
independently; and so did NetBSD. But they also made one other
fix:
From: christos <christos@netbsd.org>
Date: Thu, 28 Dec 2017 15:12:15 +0000
Subject: [PATCH] PR/52837: Michael Kaufmann: getaddrinfo() resolves "127.0.0.1
www.example.com" to 127.0.0.1. Apply the patch from FreeBSD and explain the
rationale.
I attempted to merge NetBSD's new irs code, but their changes turned
out to be too invasive to do trivially, but in the process I had to
read our commit logs to find what we've changed, so at least I can
mark that.
Commits merged from the semi-official Git mirror of NetBSD
trunk (https://github.com/IIJ-NetBSD/netbsd-src/).
Commit authors/messages in chronological order follow:
---------------------------------------
From: christos <christos@netbsd.org>
Date: Thu, 28 Sep 2017 23:32:01 +0000
Subject: [PATCH] PR/52578: Benjamin M. Schwartz Set the AD bit when DNSSEC is
enabled (RFC 6840 Section 5.7).
From: lukem <lukem@netbsd.org>
Date: Fri, 2 Mar 2018 06:31:53 +0000
Subject: [PATCH] PR/48585: Set errno when returning NULL for AF_INET
In inet_ntop4(), errno wasn't set before returning NULL.
Seems like an oversight in the existing fix for PR/48585.
Noticed by code inspection.
Writes to videomem is slow without memory remapping
Can't do the mapping without leaving UEFI, so skipping
the clear. Afaict it should always be cleared by UEFI
This saves ~10 seconds of booting on my machine
(1920*1080*4 bytes)
EFI video mode (should have been it's own commit)
* Only do strcmp if there are enough params
* break when found
* <x86_gcc2>runtime_loader can also handle x86 binaries.
* At the moment the x86_64 kernel will execute the x86 runtime_loader
when it sees x86 and x86_gcc2 binaries. The reason is checking the GCC
version of a binary in the kernel seems cumbersome, the kernel should
just fallback using the x86_gcc2 runtime_loader when the x86 one is missing.
* gcc 7.x defines __arm__ and __ARM__ (and others)
* clang defines __arm__ and __arm
* cleanup a few related ifdef vs if macros
Change-Id: I5da4bafac590f6fa3e10e543688001c2449f840d
* B_MEDIA_SEEKABLE was once a flag with one bit set. Due
to the complexity of streaming mediums, I had to split
this flag into B_MEDIA_SEEK_BACKWARD and B_MEDIA_SEEK_FORWARD
and never noticed that this broke the flag check.
* Reported by Murai Takashi through gcc8.
Historically, FAT stored filenames as uppercase. Modern windows versions
will however be case-preserving. As a special case, all-uppercase files
from old FAT filesystems will be converted to all-lowercase. There are
two flags (one for filename and one for extension) indicating that this
should be done. We did not make the distinction between these two flags
when reading a filename.
We still don't set the flags properly when writing files, but we always
provide a long file name (even if the name would fit in the 8.3 pattern
for a short one, so when reading back our own entries, we should always
use the long filename and be safe.
Change-Id: I1618a5be22705de3a06534442b62074445069764
In hrev51623 the default BWindow::Zoom() method was changed to respect
Deskbar, that is to say that the Window will zoom to screen area minus
the area taken up by Deskbar.
Some have complained that they miss the old maximize to full screen
frame behavior. This commit updates the default BWindow::Zoom() method
so that pressing Shift+zoom will maximize the window ignoring Deskbar,
the window will resize itself to take up the entire screen frame.
Note that if you override Zoom() in your app window then shift+zoom
will no longer work, this trick only works for apps which use the
default BWindow::Zoom() method.
Change-Id: Ic9f8fcb54f58663663db737103f6a7b42171ef46
Only partially "tested", but I've audited this code pretty thoroughly, and
it seems the accelerant uses clone_area instead of direct pointer accesses
in all the correct places, so this should work.
This reverts commit ec1b18c58a.
This was not well enough reviewed, and it seems that at least some
consumers of the old API (e.g. WebPositive) need more than the new one provides.
Change-Id: Ie7ad1fc70dab889922424298661504b00f66d31d
* Broke use of non-standard modes in hrev51207. Code changed
when merging framebuffer driver back into vesa driver...
Change-Id: I688ae627de23f37ffc8614d8f189593f8833ae3e
... to better match BeOS.
Up until this point we have drawn buttons with a perfectly smooth
linear gradient that was nicely provided by Stippi. However, BeOS
used a more stylized gradient instead. This commit seeks to
reproduce this stylized gradient on BeDecorator adjusting itself
for larger button sizes.
Consolidate and correct colors. button, light1, light2, and
shadow1 colors are the same on close and zoom buttons. Zoom has
a lighter shadow2 than close button. Try to get as close to the
colors used on BeOS as possible. Added comments indicating the
colors used on BeOS in active and inactive states for future
reference.
light1 color stays grayscale if grayscale, otherwise skews
non-blue. This replicates how BeOS worked.
Fill with window tab color before drawing: lose B_TRANSPARENT.
Undraw the bottom left and top right corners of bitmaps in the
unpressed state. BeOS did not do this (usually), but it should
have as it closes the ring.
Define a bunch of bitmaps and use them as stencils to write into
ServerBitmaps 1 or 2 colors at a time.
Update close and zoom button down states. When the button is
pressed rotate bitmap by 180° by reading the source bitmap in
forwards while writing destination bitmap out backwards. This
allows the dark part to be draw in the top left while the light
parts are drawn in the bottom right. (opposite of unpressed)
Don't draw the parts of the big zoom square that are obscured by
the small square.
private _CreateTemporaryBitmap() method stolen from AlphaMask.cpp
to create temporary ServerBitmaps and zero them out. Store the
pointers on the BeDecorator class and then release them in the
destructor method when the class object is deleted.
Initialize the ServerBitmaps in the ctor and set fCStatus. On
failure set to B_NO_MEMORY and fallback to drawing a linear
gradiant. This will most likely never happen but just in case
it does we want to avoid crashing.
A few 80-line char fixes
Change-Id: Ic81837aa387f05b04dda3e1ff76fdf103c93f8e8
* Moves list item selection logic back to MouseDown from MouseUp to improve
application compatibility and responsiveness
* Fixes multi-select drag and drop by not modifying the existing
selection if a MouseDown event is on a selected item.
Fixes#9190, #14264, #14289
Change-Id: I58050b403dac985f98e03faa72de1ebc5d24f95b
This reverts commit 11dee0444f.
This reverts commit 1641a0516d.
This reverts commit 484f64f315.
These changes break various edge-cases in BTextInput (e.g. typing off the end
of a long string, using the arrow keys to navigate while out-of-bounds),
and nobody has found any fixes for them in the nearly-a-year since they've
been instanted, so they are now being reverted.
Reopens#12608, #13796.
Previously, we wrapped FreeBSD's accessors using our own in*/out* assembly
macros. Now, we skip that and just use FreeBSD's macros and assembly
directly. In the process, I've added some proper abstraction,
paving the way for the use of the FreeBSD layer on non-x86 platforms
(which will be sooner rather than later, I hope!).
This introduces some new functions required by some of the drivers
I was attempting to merge (wavelanwifi...), but as it also now
mirrors FreeBSD's bus access mechanisms exactly, it's possible
that some nuances lost before are now preserved. So this has
the potentiality to help with some of the stranger timeouts/failures
on devices that work just fine on FreeBSD.
Tested on VMware (pcnet), VirtualBox (pcnet, ipro1000), and
a T61 (iprowifi4965.)
As Diver notes in #13006:
> I saw a few youtube videos with Haiku review where people were confused
> with package copyright year in HaikuDepot. They though this was when the
> package was last updated. HaikuDepot also only shows the very first line of
> copyright year, so if it's multiline (which is quite often) they see very
> old timestamps.
We should eventually display some sort of modified time as well as all
of the copyright lines, but at the very least, we can display the last line
instead of the first line, which usually is much newer than the first.
BLayoutBuilder is designed for single-shot use; i.e., a "one-liner"
of .AddLayout(), .Add(), and .End()s and no variable storage.
This is basically the only coherent way to use the class, as otherwise
it becomes unclear what state it's even in, and in the case of functions
like these with multiple branches for different options, that is doubly true.
It seems that in certain cases, the final SetInsets() after the End()
was winding up one before the "beginning" of the builder and thus attempting
to set the insets of NULL. Rather than analyze the function to determine
under what control-flow this occured (since it only happened for some
packages, and not others), I've opted here for the more systemic solution
to remove usage of BLayoutBuilder entirely, and just create straight BLayouts.
Fixes#14214.
The comment above ieee80211_ageq_cleanup specifically notes that the queue
is assumed to be empty, and in order to make it so, ieee80211_ageq_drain
must be used.
Possibly helps with #3180, as this might be a source of mbuf leakage.
Check values before setting them in SetFromScrollBarInfo
Pin arrow and knob settings to the top so they are aligned
Adjust vertical spacing on single/double to match knob style height
Only draw arrows on single/double FakeScrollBar
Change-Id: I6be89f86181a87808ba5201caf88a33c4414d4c8
Fixes#9137
Move scroll bar drawing into HaikuControlLook
Added B_SCROLLABLE flag to BControlLook
Update FakeScrollBar in Appearance to also draw using HaikuControlLook.
Focus works on scroll bars again, used by FakeScrollBar... and probably
nowhere else.
Added private _ScrollingEnabled() convenience method to BScrollBar and
use it in a few places making.
Create ScrollBarPrivate.h header to share a couple of scroll bar related
enums with HaikuControlLook that come from BeOS Scroll Bar prefs.
Stuff arrow_direction enum into BScrollBar::Private as it has been
succeeded by a similar enum already present in BControlLook and is only
around now for BScrollBar::Private::DrawScrollBarButton.
Change-Id: Idc31ee41de091ba45ded2f0315a004af00143803
* Prevents crash mentioned in Trac, but also enables keyboard navigation
to 'recent items' menus such as "Open files..." in MediaPlayer and DiskProbe
* Check selected menu and submenu exist in menu tracking thread before accessing
* Update BMenu::AttachedToWindow to pass in keydown param to _AddDynamicItems
Fixes#9251
Change-Id: I3031b8e9c1b9dd4ef1187c5a6b8ab7925e3496d2
Not really based on KapiX's patch (I looked at his Jamfile changes, but
did the rest of it myself.)
Besides the usual GCC2 (C89) fixes, this commit also changes FreeBSD's code
in removing two of the _reg_map_macro headers and adding only the relevant
portions to a post-preprocessed version of the non _macro files. This spares
us importing 7 MB (!) of headers.
KapiX confirmed his patch as working; hopefully I didn't break anything
in this import.
Before hrev46809, the "thread->priority = priority" line was below this
check, and so all was well. But that commit moved the line to its present
location, which means ever since then, the following code which updates
CPU entries, scheduler listeners, etc. has never been run.
On my VMware instance (which is probably pretty affected by the host system
and thus not the greatest performance test), "time jam -j2 HaikuDepot" decreased
from 46.0s real to 43.3s real, 52.3s user to 48.1s user, 12.1s sys to 12.2s sys.
So this seems to make some sort of impact.
Spotted by Fishpond in #10454 and confirmed by korli, but somehow neither of
them followed up on that in the 4.5 years since...
Untested, but the changes are relatively minimal (mostly adapations
to the new FreeBSD KPIs), and ttcoder recently opened a ticket (#14258)
about it, so he can test.
As Rene pointed out on the mailing list, if this is NULL after the file system
mount call occurs, then something has gone very wrong and we should treat it
as an error.
See 13778#comment:3 for information on FreeBSD behaviors.
I didn't manage to locate where the specification talks about this
(but my specification-fu is rather poor), and it didn't fix the check_sense
syslog spamming on my machine.
But it seems to continue to function as before on my hardware as well as
VirtualBox and VMware, so perhaps it might fix something else.
Signed-off-by: Alexander von Gluck IV <kallisti5@unixzen.com>
Fixes final piece of #8618
Already added support for list items to drag colors out and you can
drag and drop between the list items and preview. but, what was
missing was drag and drop between list items. Updated
ColorWhichListItem to also accept color drops through their
parent ColorWhichListView.
Also included some related style fixes, use B_RGB_COLOR_TYPE
constant in place of (type_code)'RGBC'. 80-char limit fixes.
Simplify similar code in ColorPreview class to parse out rgb_color
from message.
ColorPreview passes dropped color along to APRView
APRView no longer accepts color drops, this is handled by ListView
and ColorPreview now.
Consolidated "RGBColor" and "which" message name strings into
constants defined in defs.h.
Change-Id: I88ec2a4ffe077620ec4cc3b032196cbff0f09615
Since eventually FreeBSD drivers will be using it, this makes more sense.
Adapt the pegasus driver to it (there's all of one ID out of some multiple
dozen that isn't in the file...)
The only thing using it at present is the "pegasus" driver, so it
already doesn't make a lot of sense to keep it in src/apps/devices.
Since in the future it will be used by FreeBSD USB network drivers,
it makes sense for the FreeBSD compat layer to adopt it.
Also some related cleanup to the awk files -- they are now stored
in a "tools" subdirectory, which is more similar to where FreeBSD does it.
We are also now using FreeBSD's usbdevs2h.awk instead of NetBSD's,
as this seems to fit with the overall schema.
I got a reproducible KDL that upon close inspection seems to have been
a NULL dereference of this, thanks to GCC's mix-source-and-assembly
functionality.
Unfortunately, I deleted my mount_server settings before I fully understood
what was going on, and afterwards it no longer reproduced, so it seems to
have been related to that. I'm confident enough this is the correct fix to
commit it anyway.
when a user buffer is provided, we now pass a 128KB kernel buffer
to libntfs. The old loop in case of partial buffer read/write
was useless as ntfs_attr_pread() and ntfs_attr_pwrite() were
provided the same buffer. The new loop fills/dumps the user buffer
from/to the kernel buffer.
when a kernel buffer is provided, it is passed to libntfs, the new
loop exits after one cycle.
6ad3d25212 changed the timezoneOffset type from
time_t to int32 without adjusting the user_memcpy size. Harmless as the
function is hardly used with a non-null argument.
This time with a comment noting that they work around a GCC2 compiler bug,
so some poor soul doesn't make the same mistake I did. Fixes the GCC2 KDLs
caused by my previous commits.
Some FreeBSD developers report that this is required for HT mode, which
might explain why it's so broken on Haiku. I was also told the iwm driver
requires it for multi-frame RX, but as per the previous commit it still
KDLs even with it.
This commit also includes a refactor of the mbuf header implementation,
which now more closely mirrors FreeBSD's.
I did this correctly in the original commit, but then inverted the logic
in my C89 fixes commit by mistake ... whoops.
It seems to cause double-frees even with mbuf refcounting (though they do
occur later on), so leave it fully disabled for now.
There's a number of these "C++ wrappers for C code" wrappers in the
freebsd_network compat layer, and there don't seem to be very many
good reasons to use them. We can just as well declare these C++ functions
with C linkage so they can be used from C code directly. So, time to
start cleaning this up.
Repositories are identified with a 'url' in the
remote 'repo.info' file. There is also a
'base url' which is the URL locally with which
the system is able to access the repository
data on. There is some confusion between these
two terms in the source. This change aims to
separate the two out and consistently name them.
The settings for the repository locally also was
not storing these values and that has been fixed.
Debug info about the repositories also did not
display the two urls consistently and will now
also do so. Finally, HaikuDepot now correlates
locally configured repositories with the data in
HaikuDepotServer using the identifier URL; this
makes the use of mirrors with HaikuDepot possible.
Fixes#13888
Change-Id: I66dfe589b05c24e1ab123a6945352e0f24b60bf1
Replace strncpy() with strlcpy(), since destination size equals
maximum number of characters to copy.
Pointed by gcc8 [-Werror=stringop-truncation].
Change-Id: I3e2a98802ddb379890aefaf8c3f0efb1cd347188
The lowest model number supported by this driver is "3160", but that's just
Intel's insanity: the 7260 was released the quarter before it. So following
our naming convention strictly, "7260" is the correct name for this driver.
The firmware situation for this one is also a little different. Unlike past
instances where Intel has released mostly nonsubstantial firmware updates,
allowing us to just copy a recent-ish version from the iwlwifi archives,
the firmware is more closely tied to the driver in this series. As a result,
some of this firmware is not even used by Linux yet (they're a few versions
behind it seems), so the firmware packages included here come from FreeBSD.
One major hardware feature - RX of multiple frames at a time - is disabled
in this commit, as it depends on mbuf reference-counting, according to the
FreeBSD developers I asked, which we do not implement yet. I'll hopefully
get to looking at that in the next few weeks.
And with that, I finally have WiFi on my primary laptop, my original reason
for setting out on this quest last year. This commit was pushed through it,
even :)
FreeBSD does not have these checks, but drivers seem to expect that they
can call these functions with NULL and not crash.
Fixes a number of boot-failure tickets (and makes it possible for me at least
to test drivers without rebooting from KDL every failure), though of course the
drivers themselves will still not work.
We alwasys draw text at the bottom of the calculated TextWidget
rect, that's why it needed to be centered to get the desired
placement. However, there is two places
... in list mode. Fixes#12997
This bug was introduced in hrev50528 along with new 32x32 icon size
in list mode. I'm not sure what I was thinking on this particular
line but reverting it seems to fix the problem and logically the
original code makes sense.
Changes the trace logging so that JSON-RPC payloads
are included in the log stream. Also fixes a
memory-leak in the JSON-RPC client.
Change-Id: Ic19c64869acc525232a60ac2fd814a71bfdafdc8
Fixes#8641
To fix this bug first I had to fix a long-standing todo:
TODO: SetOrientation never gets called, fix that when in vertical mode,
we want to limit the width so that it can't overlap the bevels in the
parent view.
I made TBarView a friend class of TReplicantTray and called
fReplicantTray->fTime->SetOrientation() when switching between
horizontal and vertical mode. I could have added a setter method
instead but I didn't feel like it was worth it.
SetOrientation calls ResizedToPreferred which calls GetPreferredSize,
which resizes the text width, then it calls CalculateTextPlacement
which places the time string correctly.
Removed GetCurrentTime invocation from GetPreferredSize since that
happens in Update already. Was added in
573f748c5f originally.
Also need to call SetOrientation in TReplicantTray::AttachedToWindow
just after creating the TTime object in order for it to resize the
time view correctly on startup in horizontal mode. It needs to know
that it is horizontal so that it will expand to fit longer than
default time string.
* "timeout" is in usecs, so / 1000 and say "msecs" not "secs"
* Debug-log messages that are not for us received while waiting for
a message that is for us. Hopefully this will not flood the syslog
(DHCP renegotiation is, after all, rare), and it might help diagnose
some of the DHCP failures.
This was accomplished by adding some pretty nasty hacks to the FFmpeg recipe
so that we can compile it for the GCC2 ABI using GCC7. This works because
GCC's C ABI has not changed between GCC2 and GCC7.
As a consequence of this, pretty much all the longstanding issues of the
ancient-and-still-miscompiled FFmpeg 0.10 are now completely gone.
Fixes#5080, #8461, #12696, #12436, #13981#13410, #13337.
Closes (possibly fixed earlier) #8605, #8511, #6984.
Probably fixes (couldn't test) #13989, #11974.
I didn't figure out exactly when, but the docs from FreeBSD 8 reference it
as being not just deprecated, but already removed; and indeed no drivers
we have from either FreeBSD 9 or 11 use it. The intr_wrapper system is
used in its place.
Untested, but the changes are minimal, and the FreeBSD 9 driver worked on
an old tower that I wasn't bothered to boot up just to test this. The new
driver uses an interrupt filter to boot, so we don't even need that glue
anymore.
Also make the build system logic closer to the other FreeBSD drivers.
It is technically "used", but only in blocks that evaluate to false via
preprocessor macros, and so it was usually optimized out completely.
This is not the case for the debug build however, so the lack of it
broke that.
instead of user_memcpy().
* fix#14204: the NTFS filesystem kernel addon uses the fcntl system call to
lock the underlying device. The user_memcpy replacement in the x86 compat
branch adds range checks for the user pointer, which exposes such problems.
This goes with the "IWN_DID_6035_2" (0x088F) device ID. We had added the device
ID in the FreeBSD 9 version of the driver, which didn't properly handle the
device but somehow still managed to use it.
Thanks to miqlas for reporting and then confirming this fix.
The first change (universally disable ICT mode on Haiku) was my fault for
not properly carrying forward from the FreeBSD 9 driver, but the second change
(remove flag from _base_params) is indeed a bug in FreeBSD 11.
This device ID was not present in the FreeBSD 9 driver; we added it ourselves,
and somehow it "just worked." FreeBSD 11 tries to properly configure this device,
which nearly works, but somehow they also wound up with this flag in the base
parameters, which even the comment suspected was wrong.
Thanks to Humdinger for diligently trying all the strange code changes
I suggested to him over IRC. :)
They were already enabled for the net80211 code (and thus all the Wi-Fi drivers)
unconditionally; now we enable them conditionally based on KDEBUG_LEVEL_2
for the freebsd11_network core code also.
Includes fixes to the build, since there were some issues with INVARIANTS otherwise.
If numBytes was greater than MCLBYTES (presently 1 << 11 = 2048), then the data beyond
MCLBYTES would be silently discarded instead of being written. Now, we store the
result of the min_c in numBytes, so the caller knows how much was written.
I turn on the printf that's commented out here and found that in practice this
seems to never happen (it's larger than the ethernet limit), so it seems unlikely
to fix any "transmission mysteriously failed" bugs.
Also backported this to the FreeBSD 9 layer.
Changes mostly ported from the FreeBSD 9 code, but some of it is new.
Hopefully in the future, this diff can be reused almost wholesale,
instead of having to re-create it as was done in past upgrades.
Mostly just additions of new primitives and hook functions that are
relatively straightforward and mostly copied from FreeBSD. The one
notable set of changes is the ones relating to gDevices, as the hacks
we used previously to hide the base device are now no longer needed
(as the previous commit noted.)
Previous versions of FreeBSD created a base ifp of type IFT_IEEE80211
in addition to the ifp created for each VAP. We ignored these, so that
the devices we displayed (/dev/.../0, etc.) were numbered properly.
FreeBSD 11 no longer does this and instead uses an ieee80211com as its base
type, so this logic is not needed.
* Don't translate internally used names in BMenuBars.
* Use presentable strings for the title of BAlerts.
* Make the wording a bit less technical.
Should the HaikuServer URL be part of the update/remove rating alert?
Change-Id: I0a984082eadbc5834ac6b8b2b1955e66098d1c8a
* netcat is now provided via a package and is not required by the
'haiku' package
* Display the full name of ACPICA and update copyright year
* Update copyrights for libpng.
The first two have the same license and are also now covered by
intellinuxwireless.org. The second two also share a license among
themselves, and also with following (not-yet-imported) firmware,
e.g. from idualwifi3160.
Added recent folder limit as class member but
defaulted the value to 10.
Stopped using index to keep track of selected
path and folder menu item. Instead use BMessage to send
clicked folder path to the folder bg image loader.
Change-Id: I6b1809ff782db839ef43eb7169a7f6e77fb4ec70
Fixes#5026
You still cannot boot to desktop under SMAP on intel_extreme, however,
as the agp_gart bus has not been patched properly. Doing so breaks the
intel_extreme accelerant, so more investigation is needed.
+ has greater operator precendence than ?, so we need parentheses when
using both in expressions. Both of these look like actual bugs.
Spotted by Clang.
joystick_info contains BLists which initialize themselves upon new(),
and Clang warned (correctly) that using memset() overwites that, as well as
RTTI and other data that they contain. So instead, only memset the first
part of the struct, and then manually initialize the other members.
Fixes#14217.
In 02cb8503d2, I added the m_next and
m_nextpkt structures to mbuf, as per FreeBSD's mbufq system that
FreeBSD 11.1's net80211 code uses. What I didn't realize (and
korli and PulkoMandy who reviewed my code didn't notice either)
is that the data fields in mbuf are sometimes dealt with through
these LEN macros, which were now incorrect after such changes.
This caused an out-of-bounds memory write for data above a certain
size that was attempting to be written into an mbuf that under the
old sizing would have been fine, but under this new sizing was invalid,
and this manifested itself as a KDL under the guarded_heap (#14207).
It possibly also manifested itself as a stack-smash with the new net80211
code (uncommitted on a local machine, and the reason I tried using
the guarded heap in the first place.)
Now we use FreeBSD 11's macros, which use offsetof instead of raw
integer math. This means that we can't specify the struct size in mbuf
as these structs are computed from mbuf's definition, and thus have
to rely on the allocator giving mbuf the correct size (as FreeBSD
does also.)
No functional change. Ideally we would create these via ResAttr like we do
the mail-providers, but these have attributes on their directories and not
just the files, so that will be slightly trickier, so for now just keep them
in their zip format.
There is a (probably non-viable) case where it might not get initialized
by the function and then potentially used, so set it to NULL to silence
Clang.
* When Download window is initially shown, it is correctly
fully onscreen; however, adding a download resizes the
window such that it becomes partially offscreen. Now,
when the frame is resized, reposition the window onscreen
again.
Fixes#12704
The user iframe and associated data that the syscall entry pushes to the
stack directly were causing the stack to be mis-aligned by 8 bytes. Since
we re-aligned %rsp afterwards, for most usecases this wasn't a problem.
However, since we stored the pre-realinged %rsp in %rbp (as we need it to
access the iframe data), this also meant that anything which depended on
%rbp being 16-byte-aligned would run into serious problems.
As it turned out, GCC 7 assumed that %rbp was indeed 16-byte-aligned, and
so optimized certain accesses to use SSE instructions that depended on this
alignment. Since inside any callstack begining with a syscall this was not
the case, a "General Protection Exception" resulted (see #14160 for an example)
at the first usage of such an instruction. I wasn't really sure what was going
on when it first came up, and so "fixed" it by disabling the GCC optimization
that used such instructions. Replacing the -fdisable... with -mstackrealign thus
also "fixes" the problem, as I discovered earlier today, as it forces GCC to
realign the stack in function prologues.
So instead of rounding %rsp down to the nearest aligned address after the
pushes are complete, we offset %rsp by the amount the pushes are not,
thus fixing both %rsp and %rbp in syscall handling routines. This of course
depends on syscall_rsp being already aligned, which it is.
Thanks to PulkoMandy and js for the advice and guidance (and PulkoMandy
for the ASCII art), as this is essentially my first time working with
kernel assembly.
* Using attribute visibility hidden doesn't get applied if a
function returns a non-class pointer type, so the functions
weren't being hidden for gcc4+ builds, resulting in stack
overflows. Using addr_t, which should be the same size as
void* works around this restriction.
This reverts commit c558f9c8fe.
This reverts commit 44f24718b1.
This reverts commit a69cb33030.
This reverts commit 951182620e.
There have been multiple reports that these changes break mounting NTFS partitions
(on all systems, see #14204), and shutting down (on certain systems, see #12405.)
Until they can be fixed, they are being backed out.
- When in non-interactive mode, i.e. saving a crash report, don't
allow the image debug info loader to automatically grab missing but
available info packages. Otherwise we potentially download very large
packages with the user being entirely unaware, i.e. the 200MB debug
information package now present by default for gcc7's libgcc. This
should eventually be made a configurable preference though.
* define compat_thread_info, compat_rlim_t, compat_rlimit and
compat_thread_creation_attributes to be used when applicable in compatibility
mode.
* handle 32-bit types in _user_spawn_thread(), _user_get_thread_info(),
_user_get_next_thread_info(), _user_getrlimit(), _user_setrlimit(),
other syscalls are compatible as is.
* init TLS for compatibility mode threads.
Change-Id: I483ba95e6198ddac9d240671bcb56fcd2ad831d2
* in load_image_internal(), elf32_load_user_image checks whether the binary
format requires the compatibility mode.
* we then set up the flag THREAD_FLAGS_COMPAT_MODE and the address space size.
* the compatibility mode runtime_loader is hardcoded with x86/runtime_loader.
* if needed, the 64-bit flat_args structure is converted in-place to its 32-bit
layout.
* a 32-bit flat_args isn't handled yet (a 32-bit team execs a 64-bit binary).
Change-Id: Ia6a066bde8d1774d85de29b48dc500e27ae9668f
* define compat_area_info to be used when applicable in
compatibility mode.
* handle 32-bit types in _user_reserve_address_range(), _user_get_area_info(),
_user_get_next_area_info(), _user_transfer_area(), _user_clone_area(),
_user_create_area(), _user_map_file(), other syscalls are compatible as is.
* _get_next_area_info() doesn't work well with a 32-bit address cookie (address
could be in 64-bit range). Instead use _compat_get_next_area_info() which uses
the area id as cookie, though the areas are not ordered by address any more.
Change-Id: Ic7519ca8824aa2d534b0f03ea75a1bf6ae321535
* handle 32-bit types in _user_send_signal(), _user_sigaction(), _user_sigwait(),
_user_set_signal_stack(), _user_restore_signal_frame(), other syscalls are
compatible as is.
Change-Id: I4c8dc47bfa80f36e363d444d2a5a7be6c621606d
* define compat_image_info, compat_extended_image_info
to be used for respective 32-bit types of syscalls in compatibility mode.
* handle 32-bit types in _user_register_image, _user_get_image_info,
_user_get_next_image_info, other syscalls are compatible as is.
Change-Id: Ibbd33e6796208dfa70d869e36bf745bc3e18d330
* define compat_flock, compat_timespec, compat_stat, compat_attr_info,
compat_fs_info, compat_fd_info to be used for respective 32-bit types
of syscalls in compatibility mode.
* handle 32-bit types in common_fcntl(), _user_read_stat(), _user_stat_attr(),
_user_read_index_stat, _user_read_fs_info, _user_write_fs_info,
_user_get_next_fd_info, other syscalls are compatible as is.
Change-Id: I5b372169fe142f67b81fd6c27e0627d5119ba687