Commit Graph

49940 Commits

Author SHA1 Message Date
Fredrik Holmqvist
aacc409159 intel_extreme: use int cast to please the grumpy oldtimer gcc2 2018-09-30 21:38:06 +02:00
Fredrik Holmqvist
39a3fe56de intel_extreme: check that vbt_header is in area 2018-09-30 12:18:00 +02:00
Fredrik Holmqvist
597837c788 Remove unused variable in intel_extreme 2018-09-30 12:17:39 +02:00
Jérôme Duval
e4ae6cb42f Media: add offset to inactive sound card.
fixes #14522.

Change-Id: Ib1c43b63cc43d0b66e5415fbbc42cbc821a25087
Reviewed-on: https://review.haiku-os.org/593
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-29 17:25:34 +00:00
Kacper Kasper
42b6e5279f Revert "HaikuDepot: don't scale bitmaps"
This reverts commit 2ba2d60351.

...and properly fix the scaling issue.

Change-Id: I2c7ef833c1ff592dd95ea7d83d3f7beced42f209
Reviewed-on: https://review.haiku-os.org/589
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-29 17:24:49 +00:00
CodeforEvolution
106ae4ec35 Remove Curl, Switch to NetApi in Package Kit
Change-Id: I92213ab60dc987175c323d1d9ed11ac8b3517f2f
Reviewed-on: https://review.haiku-os.org/475
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-29 17:23:52 +00:00
Andrew Lindesay
66f8dcb1f1 HaikuDepot : Improvement for Buffer Management
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>
2018-09-28 19:18:40 +00:00
Andrew Lindesay
88575af1d2 HaikuDepot : Fixes for User-Ratings Related API Calls
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>
2018-09-27 18:08:21 +00:00
Leorize
c29a7780db net_socket: getsockname() now works with unnamed sockets
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>
2018-09-26 19:05:56 +00:00
Augustin Cavalier
fdb2588484 userlandfs: Make the "request data" area user-cloneable.
Fixes #14497. Thanks to leorize for helping debug!
2018-09-26 00:03:48 -04:00
Augustin Cavalier
7027cb8494 package_infos: x86_gcc2/* depend on FFmpeg.
Previously, secondary arch FFmpeg was not installed at all. This commit
fixes that.

Also pare down the dependencies a little to what we actually use.
2018-09-25 23:04:25 -04:00
François Revol
cbd7818322 radeon: make the framebuffer user-cloneable
This avoids an annoying panic...
2018-09-24 03:07:56 +02:00
Augustin Cavalier
6c73846a03 MediaPlayer: Quit the VideoProducer when we reach the last buffer.
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."
2018-09-23 17:03:02 -04:00
Augustin Cavalier
1fb7ddbb1e add-ons/media/ffmpeg: Use SWS for color-space conversion universally.
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.
2018-09-23 16:05:45 -04:00
Augustin Cavalier
e5bb653b78 add-ons/media/ffmpeg: Rework usage of AVPicture in AVCodecDecoder.
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.
2018-09-23 16:00:31 -04:00
Augustin Cavalier
17c276df21 add-ons/media/ffmpeg: Remove global initializer system.
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.
2018-09-23 15:58:28 -04:00
Augustin Cavalier
19ec897266 add-ons/media/ffmpeg: Enable deprecation warnings.
There sure are a lot of them...
2018-09-23 15:57:40 -04:00
Augustin Cavalier
3e4c34234e demangle/gcc2: Skip count > length should skip to the end.
This is the behavior the code expects.
2018-09-23 14:47:26 -04:00
Augustin Cavalier
80be7d09c5 kernel: Handle the user buffers properly in _user_xsi_semctl.
Should fix #14512.
2018-09-23 14:45:01 -04:00
Augustin Cavalier
c609f04f86 kernel: Print interrupt line when assuming no interrupt use on PCI device. 2018-09-23 14:19:25 -04:00
Augustin Cavalier
7d8b7501ba kernel: Treat 255 as an invalid interrupt line on x86.
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>
2018-09-22 20:50:34 +00:00
Kacper Kasper
2ba2d60351 HaikuDepot: don't scale bitmaps
* 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>
2018-09-18 20:29:40 +00:00
Augustin Cavalier
753e006611 kernel: Include the area name and ID in the "attempting to clone" panic message.
Change-Id: Iecc842047929531f8feb7304fbcd1a8f2b28ab2f
Reviewed-on: https://review.haiku-os.org/584
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-18 20:03:00 +00:00
Augustin Cavalier
055a35e632 tests: Add some more things to DemangleTest.
Change-Id: I6999aad2cc64650bddb7ba575536efc8878abcf2
Reviewed-on: https://review.haiku-os.org/583
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-18 20:02:55 +00:00
Augustin Cavalier
de777b79eb demangle/gcc2: Do not trust inputs.
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>
2018-09-18 02:19:18 +00:00
Augustin Cavalier
adad95fa46 tests: Add a simple version of "c++filt" that uses the homegrown demanglers.
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.
2018-09-16 23:13:04 -04:00
Augustin Cavalier
8339f2eb89 tests: Add test boilerplate for our homegrown demanglers.
There's only one test each, for now, but adding tests is now of course
a one-line addition per test.
2018-09-16 23:06:32 -04:00
Augustin Cavalier
48a6df083d Tracker: Eliminate the double border in the OpenWithWindow.
Change-Id: I43e9b15c4cd7f4986fa7c1231cc8ca89676866bf
Reviewed-on: https://review.haiku-os.org/575
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 23:21:36 +00:00
Augustin Cavalier
497f099f5a Tracker: Clean up AddPoses threads properly.
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>
2018-09-16 23:21:36 +00:00
Augustin Cavalier
f436972c14 BString: Treat NULL passed as replaceWith as an empty string.
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>
2018-09-16 17:57:02 +00:00
Augustin Cavalier
38a133eb8a StringReplaceTest: Add (failing) invocations of Replace*() with NULL "to".
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>
2018-09-16 17:57:02 +00:00
Augustin Cavalier
79187c3c42 iprowifi4965: Add -100 firmware.
Should fix #14492.

Change-Id: I887995d45d2e357f0181f54396bc3c19a2158e26
Reviewed-on: https://review.haiku-os.org/567
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 00:09:14 +00:00
Augustin Cavalier
6d7838a16b src/tests: Fix some incorrect filemodes.
Change-Id: I779cec1905c52eae6955bae979e32ba587e23560
Reviewed-on: https://review.haiku-os.org/565
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 00:09:14 +00:00
Michael Lotz
99888f6b69 kernel: Apply user iframe determination logic to SMAP/SMEP.
Change-Id: I394492a289f01303ac28e6d6670fbfdb326fa4db
Reviewed-on: https://review.haiku-os.org/561
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2018-09-14 10:09:10 +00:00
Michael Lotz
8c005190c4 kernel: Determine kernel vs. user page fault depending on iframe.
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>
2018-09-14 10:08:03 +00:00
Michael Lotz
0de5a83940 Cleanup: Use symbolic names, compare != 0 and whitespace.
Change-Id: I34c60b3ab8387fe57dbcd91f9b5d278468455cf6
Reviewed-on: https://review.haiku-os.org/559
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-14 10:04:54 +00:00
Humdinger
8aea77d00f HDA driver: use optional settings file
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>
2018-09-14 06:23:48 +00:00
Augustin Cavalier
62a788f323 ethernet: Fix some more incorrect return value handlings of ioctl(). 2018-09-13 16:14:36 -04:00
Augustin Cavalier
4d5c5a7e66 libroot: More RETURN_AND_SET_ERRNO cleanup.
No functional change intended.
2018-09-13 16:05:22 -04:00
Augustin Cavalier
110ba6da3a tests: Remove the "R5" userlandfs.
Essentially untouched since 2009, and not referenced at all from the
"Haiku" userlandfs.
2018-09-13 15:56:52 -04:00
Augustin Cavalier
043b00fb2c BNetworkDevice: Fix memory leaks and address comments.
Thanks Axel and Jerome for the reviews!

Change-Id: I4f116c540cf59ba74b79d9d2f95ed40edc9c4174
Reviewed-on: https://review.haiku-os.org/557
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-13 19:53:33 +00:00
Augustin Cavalier
45bc01d2f7 ifconfig & Network preferences: Actually trigger scans using BNetworkDevice.
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>
2018-09-13 04:13:19 +00:00
Augustin Cavalier
4e5aaaa700 BNetworkDevice: Implement Scan().
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>
2018-09-13 04:13:19 +00:00
Augustin Cavalier
e9073260a7 network/ethernet: ioctl returns -1 and stores the error in errno.
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>
2018-09-13 04:13:19 +00:00
Augustin Cavalier
77d2c1df0e libroot: Use RETURN_AND_SET_ERRNO from the utils header in ioctl.
No functional change intended.

Change-Id: I5e6a060fe8e036bc4d4b8b8cc95a4e8d0ea00f81
Reviewed-on: https://review.haiku-os.org/549
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-13 04:13:19 +00:00
Janus
aa39f874dc BColumnListView: hscrollbar matches visible columns
* _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>
2018-09-12 11:53:09 +00:00
JackBurton79
b070314f50 FlattenPictureTest: Fix DrawStringsWithOffset test
fixes #14481

Change-Id: I7aee0f9e1ed088d2b5253f22a55228b0fc8f16ec
Reviewed-on: https://review.haiku-os.org/546
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
2018-09-12 10:44:55 +00:00
Augustin Cavalier
c3ac0a72a6 BMenuItem: Remove ourselves from the super menu on destruct.
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>
2018-09-12 01:15:48 +00:00
Augustin Cavalier
4628b6de8e tests/interface: Add a (currently crashing) BMenu "concurrency" test.
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>
2018-09-12 01:15:48 +00:00
David Murphy
81d0a0e0a7 BColumnListView: Always update the reference rect in ::FindVisibleRect...
...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.
2018-09-11 18:59:32 -04:00
Augustin Cavalier
74e882b39b kernel/fs: Flush the underlying device's write cache as part of sync().
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>
2018-09-11 20:06:58 +00:00
Kacper Kasper
709c79a3f7 MediaPlayer: don't fill background for mute button
* 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>
2018-09-11 20:03:13 +00:00
Andrew Lindesay
a609673ce8 Support : Fixes for Relative URL Handling
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>
2018-09-11 18:39:53 +00:00
JackBurton79
66f19f7201 Fix ClipToPicture() inside a BPicture
Mimic what is't done in clip_to_shape: call SetCanvasGeometry() and ResyncDrawState().

Change-Id: Ibbd77ec8cf90952d94ee35871736e145102a763e
2018-09-11 14:30:59 +02:00
Augustin Cavalier
21e99b4766 pkgman: Suppress the erroneous "aborted: No Error" messages on no internet.
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.
2018-09-11 01:32:59 -04:00
Augustin Cavalier
4c7002a3d1 mime_db: Add type for HEVC elementary streams.
"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.
2018-09-10 22:26:32 -04:00
Augustin Cavalier
14162168f5 mime_db: Add entries with sniff rules for DjVu and XPS.
These formats are supported by DocumentViewer.
2018-09-10 21:56:34 -04:00
Augustin Cavalier
503d889314 Remove the "Haiku" screensaver from the tree.
As discussed in #14447.
2018-09-10 19:51:02 -04:00
JackBurton79
5706737797 PictureDataWriter: Fix invert rect.
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
2018-09-10 16:14:49 +02:00
JackBurton79
da51ebe0e5 BPicture: uncomment (and fix build) of the clip_to_picture method.
Does not seem to work, though.

Change-Id: I309d8de79a71ab8e08f4ac2f2566080b67b84800
2018-09-10 14:19:10 +02:00
JackBurton79
cb0d7a1ecd app_server: make a copy of the passed BPicture
Like the AS_DRAW_PICTURE case, make a copy of the passed BPicture also for AS_CLIP_TO_PICTURE

Change-Id: Id9a0adc48d73e5ec9c0d37e2ed85e30aa48369ab
2018-09-10 12:48:30 +02:00
JackBurton79
d1311300dc app_server: local variable was shadowing the outer variable
In the AS_CLIP_TO_PICTURE case, the "picture" variable was shadowing the outer "picture" variable.

Change-Id: I3b9de2432f93a683aaccdb899051a14ebf9b7e6e
2018-09-10 12:45:21 +02:00
Alexander von Gluck IV
7f644d106d xhci: gcc2 buildfix from hrev52319
Change-Id: I5d82059bd002c26ba372d55f5a5538ce7d19ffb2
2018-09-09 13:50:55 -05:00
Jérôme Duval
21c87a5d83 drivers: remove some non-haiku support code.
Change-Id: Ic55bb4832adabeb807f763c87ad938e74fb3a97d
Reviewed-on: https://review.haiku-os.org/520
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-09 17:32:01 +00:00
Augustin Cavalier
24ed1a79a3 AboutSystem Credits: Some updates.
* Move nielx back into Contributors
 * Move hamishm into Past Contributors
 * Add some new translation contributors
2018-09-08 20:14:26 -04:00
Augustin Cavalier
a3e22cdaa7 Installer: Rework status message view sizing logic.
* 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.
2018-09-08 19:49:03 -04:00
Augustin Cavalier
47ba82bf03 Deskbar: Add missing NULL check in SwitchWindow().
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.
2018-09-08 19:03:06 -04:00
Augustin Cavalier
f960901a70 EFI: Use proper mnemnoic for retf (lret) to appease Clang. 2018-09-08 18:56:33 -04:00
Alexander von Gluck IV
bd234de11c xhci: Turn OpsReg waits into common function
Change-Id: I52ada3447b638db07622fa51746e75ce6cce7a46
Reviewed-on: https://review.haiku-os.org/518
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
2018-09-08 14:38:16 +00:00
Alexander von Gluck IV
4fead684b8 repo: Adjust repos to be more sane [master]
* 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
2018-09-07 20:08:20 -05:00
Jérôme Duval
9928fbf629 radeon: fix copy/paste typo.
Change-Id: I669c73a990b0fff84cf5d37b5a4cc57ad97905ff
Reviewed-on: https://review.haiku-os.org/514
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
2018-09-06 13:26:58 +00:00
Jérôme Duval
a3a41a5b14 Make areas cloned by accelerants effectively cloneable.
Change-Id: I78046af6548e36571813ce516491c7fb64581967
Reviewed-on: https://review.haiku-os.org/513
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-06 13:23:55 +00:00
Nikolas Zimmermann
0e9dc76e5f Fix build with DEBUG_PAGE_QUEUE enabled
Change-Id: Id9ffcd50835a0ba9e4276a3bb5939cc1d4afa128
Reviewed-on: https://review.haiku-os.org/516
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-09-06 07:46:25 +00:00
Murai Takashi
09095817eb Mediaplayer: Suppress -Werror=class-memaccess
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>
2018-09-05 09:29:01 +00:00
Andrew Lindesay
3cc5e76f2d Support : Fixes for Verbatim Regeneration of URL String Form
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>
2018-09-05 09:05:10 +00:00
Jérôme Duval
0ff73852d1 s3: fixes for SMAP.
untested.

Change-Id: Icbb3ddf8c0f840fae0e2107ca211728036ba8aa7
Reviewed-on: https://review.haiku-os.org/510
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
2018-09-04 14:02:18 +00:00
Jérôme Duval
89780a095e ZstdCompressionAlgorithm: handle ZSTD_error_dstSize_tooSmall.
Change-Id: Ib6dca7ac8457afae845fad24514945b4ecd521cc
Reviewed-on: https://review.haiku-os.org/509
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-09-04 12:33:14 +00:00
Humdinger
dc1991b5d5 Installer: update 'EULA' window
* 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
2018-09-03 01:39:45 +00:00
Augustin Cavalier
0df493a13a libroot: Fix handling of debugger() call in abort().
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()...
2018-09-02 00:13:40 -04:00
Augustin Cavalier
e54f86aa6a libshared: Change string_for_rate to use KiB/s instead of Kbps.
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.
2018-09-02 00:10:30 -04:00
Augustin Cavalier
f45e4bd1b6 drivers/poke: Fix for GCC7 & C++11. 2018-09-01 16:15:01 -04:00
Augustin Cavalier
1e3f0626ab drivers/poke: Only allow root() to open.
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.
2018-09-01 15:43:57 -04:00
Augustin Cavalier
8d13e72523 drivers/poke: Access the user buffers correctly.
Untested (as it seems /bin/poke was never added?) but unless I messed
up some of the memcpy arguments, this should work.

Fixes #14429.
2018-09-01 15:40:50 -04:00
Augustin Cavalier
5ae6f34b81 drivers/poke: Compile as C++; some formatting cleanup. 2018-09-01 14:52:54 -04:00
Fredrik Holmqvist
6172ccc455 Embedded Controller, sync with FreeBSD
* Tries to handle all pending events at once
 * Wait is now polling every mS while waiting
2018-09-01 19:41:25 +02:00
JackBurton79
59a26ab62f FlattenPictureTest: add tests for ClipToRect,ClipToInverseRect,ClipToShape,ClipToInverseShape
Change-Id: Ia68b6989c2973f37f0772621190ab8f57fbeb381
2018-08-31 10:44:34 +02:00
JackBurton79
3211dccc22 FlattenPictureTest: add test for #6761
Change-Id: I848ccec2ea102dc4fc5c0e4f718053ecad196f8d
2018-08-30 11:25:55 +02:00
Augustin Cavalier
7985831a65 bin/multiuser: Do not exit with an error if stdin is not open.
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>
2018-08-28 23:34:27 +00:00
Augustin Cavalier
5e7b3530c8 freebsd11_network: Tolerate a NULL mutex being passed to msleep.
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>
2018-08-28 19:50:19 +00:00
Augustin Cavalier
6aed80b4f7 freebsd11_network: Implement pause() using snooze() instead of cvars.
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>
2018-08-28 19:50:19 +00:00
Augustin Cavalier
372195500d Versioning: Add BETA_1 and PRE_BETA_2 version constants.
* 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.
2018-08-28 00:21:13 -04:00
Murai Takashi
e998f2e4ac Terminal: Fix -Werror=class-memaccess
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>
2018-08-28 03:26:01 +00:00
JackBurton79
fee62e6a6e ffmpeg media decoder: revert latest changes to the AVCodecDecoder destructor.
Let's see if it fixes #14394.

Change-Id: Iba3a77197703b43f7c5e29292940b3a9018b4585
2018-08-27 10:08:31 +02:00
Augustin Cavalier
e55dd14050 freebsd11_network: Rework uninitialization order.
It is now in the exact reverse order of initialization. Untested,
but may help with some strange KDLs.
2018-08-26 14:15:09 -04:00
Augustin Cavalier
8636e31a55 BNotification: Fix copy-n-paste bug in OnClickRefAt.
Fixes #14405.
2018-08-26 13:48:51 -04:00
Augustin Cavalier
427edfcf0d Makefile Engine template: Whitespace cleanup and synchronization.
Also update comment as FULL is O3 not O2, fixing #14396.
2018-08-25 21:28:29 -04:00
Augustin Cavalier
7426861a93 radeon_hd: Add another working device ID.
Fixes #14379. Thanks cb88 for testing!
2018-08-25 21:08:35 -04:00
kerwizzy
1c2518b407 Mandelbrot: Implement incremental rendering and other improvements.
* 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>
2018-08-25 19:51:33 -04:00
Adrien Destugues
c2d37953f3 Rework PLL calculations for Iron Lake
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>
2018-08-25 18:52:33 +00:00
Humdinger
c0bbce07c8 Terminal: Make blinking cursor settings live
Change-Id: I51b2f4753c4c331c075293a7d531b26a2fbdc457
Reviewed-on: https://review.haiku-os.org/479
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-08-25 18:51:29 +00:00
Andrew Lindesay
8f30879b98 Support : Validation for Host Portion of URL
Partly Fixes #14377

Change-Id: Ia611d3653d2c16c6dcdc48ce57bd61bb6e6db366
Reviewed-on: https://review.haiku-os.org/476
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-08-25 18:50:36 +00:00
Kacper Kasper
df8b692ac0 Revive unit tests
* 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>
2018-08-25 18:50:26 +00:00
Murai Takashi
6d99295f41 bus_managers/pci: Fix -Wmismatched-tags
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>
2018-08-25 18:50:12 +00:00
Fredrik Holmqvist
b2e0398cd4 ps2_dev encapsulate TRACING code
Avoid doing system_time() calls in a loop.
Is this even needed anymore?
2018-08-24 13:51:48 +02:00
JackBurton79
5aff790ae1 ffmpeg media reader: remove useless avformat_free_context():
avformat_close_input() already calls it.

Change-Id: I45433527459bda430b8f0d15850fdcc019042db3
2018-08-24 09:34:41 +02:00
JackBurton79
de9e43cd6a ffmpeg media decoder: Fix double free() (and possibly #14394.
Don't call avcodec_close() and then avcodec_free_context().
The latter replaces the former.

http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ef6dab0a79a9852a92ed80b07f9e32a37530d9e

Change-Id: I346dc8da20a274bcfd901b4a67e612f0f38323b0
2018-08-24 09:34:01 +02:00
Adrien Destugues
d15e61541e I did not mean to commit this.
Sorry!
2018-08-23 20:21:55 +02:00
Adrien Destugues
9a152c9cb0 Change the prompt again.
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)
2018-08-23 17:51:21 +02:00
JackBurton79
6ec69f4426 Small style fixes
Change-Id: I1db785122efe70e416b4073c06148c856c5a5e8d
2018-08-23 13:55:09 +02:00
JackBurton79
9923dd5ce5 network stack: move put_device_interface() at the end of the Interface destructor.
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>
2018-08-23 06:36:11 +00:00
Adrien Destugues
1147b9a49d Haiku does provide strchrnul.
Fixes #14386.
2018-08-23 08:15:28 +02:00
Augustin Cavalier
a41d815c67 ramfs: Lots of fixes to the build.
* 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.
2018-08-22 19:19:56 -04:00
Augustin Cavalier
c7919fc71a packagefs: Move DebugSupport up into the file_systems shared folder.
ramfs will find it useful also.
2018-08-22 19:19:56 -04:00
Augustin Cavalier
e0d28cdccf reiserfs: Fix the build and enable on x86_64. 2018-08-22 19:19:54 -04:00
Augustin Cavalier
0217e08a63 vfs: panic() if volume->ops is NULL but status == B_OK.
This panic, unlike the NULL dereference that would otherwise occur, is
at least continuable.
2018-08-21 21:22:52 -04:00
Augustin Cavalier
416efa19c6 freebsd11_network: Do not define ffs() for Clang.
cpufunc.h uses the __builtin version here.
2018-08-20 21:06:55 -04:00
Augustin Cavalier
4c00d515f1 freebsd11_network: Add NULL check to if_getdrvflags.
This is the proper fix for #14182, as discussed on the mailing list.
2018-08-20 21:06:24 -04:00
Augustin Cavalier
ac3431d6e1 Undo addition of NULL check to ipro1000.
This reverts commit 4e44b1a472.
2018-08-20 21:02:35 -04:00
Augustin Cavalier
c20e7a6862 build: Add a haiku_source package.
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.
2018-08-20 21:00:25 -04:00
Rene Gollent
fc48ae3f80 Debugger: Fix #14375, #12343.
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).
2018-08-20 16:44:20 -04:00
Rene Gollent
9ebb7ab422 Debugger: Fix #14374.
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.
2018-08-20 16:41:58 -04:00
Augustin Cavalier
b2cb85f4d5 libroot: New memcpy for ARM.
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.
2018-08-20 11:53:47 -04:00
Augustin Cavalier
fbc02f9437 pacakge_infos: Update copyrights. 2018-08-20 11:32:57 -04:00
Humdinger
07a70c6feb Expander: remove hard newlines from alerts 2018-08-20 17:12:46 +02:00
Adrien Destugues
44cff45d3d HttpRequest: chunk length are in hex
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).
2018-08-20 08:02:34 +02:00
Augustin Cavalier
4e44b1a472 ipro1000: Add missing NULL check.
Should fix #14182.
2018-08-20 00:42:52 -04:00
Augustin Cavalier
4356fc7636 radeon_hd: Disable another non-working chipset. 2018-08-20 00:42:04 -04:00
Murai Takashi
d9863ca8dc Replace strncpy with strlcpy
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>
2018-08-19 20:36:01 +00:00
Murai Takashi
3a50df1bd0 Network kit: Fix -Wformat-overflow
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>
2018-08-19 20:35:53 +00:00
Augustin Cavalier
dd54d46895 realtekwifi: Move LOCK call out into the generic path.
Should fix a "mutex not locked" KDL reported by Begasus.
2018-08-17 12:12:36 -04:00
John Scipione
466b81b6c2 Window: Max-Zoom windows with Shift+Ctrl+Alt+Z
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>
2018-08-16 20:30:48 +00:00
François Revol
4fced27d37 acpi: fix format warnings with DEBUG_OSHAIKU set 2018-08-16 18:29:19 +02:00
JackBurton79
8d721650ce Check for NULL before dereferencing fStream pointer.
Change-Id: Ic1c21b24a3a1c02b478d1e8b2e395cc8a4e7adab
2018-08-16 16:31:00 +02:00
JackBurton79
1da12a78de Reintroduced keeping the state of failed initialization.
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
2018-08-16 10:09:22 +02:00
JackBurton79
53086e436e AVCodecEncoder: avcodec_close() is deprecated.
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()
2018-08-16 08:07:21 +02:00
Augustin Cavalier
6bbfad51b7 keymaps: Add Russian/Yawert (Phonetic).
From roiredxsoto. Fixes #14343. Thanks!
2018-08-15 16:38:08 -04:00
Jérôme Duval
ee692b38b2 x86_64: R_X86_64_PC32 and R_X86_64_DTPOFF32 are 32-bit wide relocations.
Change-Id: I9c4e6c5ae77f4c17c2b6901f2b133db4b9dc48e3
Reviewed-on: https://review.haiku-os.org/445
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-08-15 16:16:20 +00:00
Kacper Kasper
fe8b46fb0d kernel: vm: add unit tests for get_mount_point
Change-Id: I1eb7540ffadb26acf05b695af2e7508c71ac7274
Reviewed-on: https://review.haiku-os.org/460
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-08-15 16:14:18 +00:00
Kacper Kasper
78058cf6d5 tests: Add support for 64-bit ELFs in SymbolPatcher
Change-Id: I1f323e0d6d5c47d7d0de980fc6cc7ccbe799ae0e
Reviewed-on: https://review.haiku-os.org/466
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-08-15 16:14:01 +00:00
Adrien Destugues
04ba34b0a8 usb_hid: blacklist Silicon Labs EC3.
Definitely not an HID device. Programming tools use libusb.
2018-08-15 10:00:40 +02:00
Augustin Cavalier
552fabf1ad libroot: Merge some changes to longlong.h for ARM from upstream.
Gets the ARM/Clang build all the way to the libroot linking stage.
2018-08-15 00:11:30 -04:00
Augustin Cavalier
581da829b5 libroot: ARM does not have regparm.
Also fix the test for USE_REGPARMS in the same file. Gets the Clang
build somewhat further.
2018-08-15 00:10:33 -04:00
Alexander von Gluck IV
9ae04563d6 framebuffer/bcm2835: Check for available mailbox
Change-Id: I6f158335c4bdda108c13c26f62bfd8d814ea1b3f
2018-08-14 16:58:17 -05:00
Alexander von Gluck IV
b795602253 boot/mmu: Fix hrev52228. No returns from mmu_identity_map.
* Pretty sure Jam didn't compile the changes to this file.

Change-Id: I9dccd24e523d5bd575565f1768314a9d8f2be1ab
2018-08-14 16:26:58 -05:00
Alexander von Gluck IV
a6cb002e99 boot/mmu: Consolidate some fdt mapping functions
* 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
2018-08-14 16:16:01 -05:00
Augustin Cavalier
ab39ceb10c system/glue: Add a crtbegin and crtend implementation.
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__.)
2018-08-14 16:07:03 -04:00
Humdinger
deeaee6fc9 Boot options: add help text to state selection
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
2018-08-14 21:11:16 +02:00
Augustin Cavalier
1742c769aa translation: Disable localization for command-line tools. 2018-08-14 14:29:23 -04:00
Augustin Cavalier
06b10d86af Appearance: Reinstate changes to allow full-and-half-fixed fonts as fixed.
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.
2018-08-14 13:54:37 -04:00
Augustin Cavalier
fd25b902be BControlLook: Add FBC padding.
Fixes #14295.
2018-08-14 13:54:37 -04:00
Augustin Cavalier
0e44a703e5 BTabView: Don't assume BControlLook is in BPrivate.
Eventually it won't be, and we have a "using" directive so it is
accessible from the global namespace, so we can make this change
already.
2018-08-14 13:54:36 -04:00
Adrien Destugues
b24d095e90 usb: support for retrieving full configuration descriptors
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>
2018-08-14 15:22:56 +00:00
JackBurton79
1d404e45f1 ffmpeg plugin: use avformat/codec_free_context() where applicable 2018-08-14 14:43:30 +02:00
JackBurton79
a4e89ff894 AVFormatWriter: free the context with the correct function 2018-08-14 13:49:48 +02:00
JackBurton79
ee3e1cbe0b Use the constant instead of the numeric value 2018-08-14 13:49:48 +02:00
Augustin Cavalier
7457ccb4b2 BMessageFormat: Rename to BStringFormat.
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.
2018-08-13 20:49:00 -04:00
Augustin Cavalier
8906767241 tools/translation: B_TRANSLATE_CONTEXT -> B_TRANSLATION_CONTEXT. 2018-08-13 17:09:06 -04:00
Augustin Cavalier
d284f7cc43 keyboard_layouts & keymaps: Define translation contexts properly. 2018-08-13 16:44:22 -04:00
Murai Takashi
30ee7c9dba Pulse: Fix -Wformat-overflow
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>
2018-08-13 15:16:48 +00:00
JackBurton79
7c423844de Spacing style 2018-08-13 10:03:45 +02:00
Augustin Cavalier
0f36120d8d "R5" fs_shell: Remove (mostly.)
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.
2018-08-12 23:38:10 -04:00
Augustin Cavalier
38c59f2971 tests/device_manager: Remove dependence on fs_shell.
Doesn't build currently due to KPath API changes, but this seems unneeded
at least.
2018-08-12 23:37:18 -04:00
Augustin Cavalier
e3db3bf84e btrfs_shell: Move from src/tools to src/tests/...
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.
2018-08-12 23:21:14 -04:00
Augustin Cavalier
52de96da04 udf_shell: Rework to use the fs_shell in tools/.
The build appears to have been broken for quite a long time, but this
gets it slightly closer at least.
2018-08-12 23:16:04 -04:00
Augustin Cavalier
38fa917c59 iso9660_shell: Use the fs_shell from src/tools; fix the build. 2018-08-12 23:05:11 -04:00
Augustin Cavalier
87b501a119 tests/udf: Remove the "R5" version.
Largely untouched since 2006.
2018-08-12 22:47:27 -04:00
Augustin Cavalier
e24a254f55 tests/dosfs: Remove the "R5" version.
Untouched since 2006.
2018-08-12 22:46:28 -04:00
Adrien Destugues
af8f2a39a0 ffmpeg: do not compute duration for "mutable size" streams.
Fixes #14326 without breaking other things.
2018-08-12 09:49:36 +02:00
Augustin Cavalier
f2015c2f81 boot/platform/cfe: Remove, unused.
All platforms it was theoretically useful for also have U-Boot.
OK'd by mmu_man.
2018-08-11 20:21:12 -04:00
Adrien Destugues
58a62dd65f Add unit test for BOutlineListView.
Change-Id: Icad7e7c659141fae1bb6e52571f001c9f561a446
Reviewed-on: https://review.haiku-os.org/451
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-08-11 23:15:10 +00:00
Sean Healy
2f3e1117f9 BOutlineListView::EachItemUnder gets too many items
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>
2018-08-11 23:15:10 +00:00
Jérôme Duval
81375d4fbb Package Kit: add Zstd compression.
Change-Id: Idbdb7cf1bde659046a88ea69a76e3b5fc4cd7013
Reviewed-on: https://review.haiku-os.org/323
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2018-08-11 23:10:00 +00:00
Augustin Cavalier
376472a816 libroot: Some fixes for Clang ARM builds. 2018-08-11 15:26:08 -04:00
Augustin Cavalier
eef7e3f1f8 freebsd11_wlan: Turn debugging level down a bit.
Should fix the first part of #1431.
2018-08-11 12:27:53 -04:00
Adrien Destugues
3bd0b6ec81 ffmpeg: do not compute a duration for streaming streams.
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.
2018-08-11 11:59:09 +02:00
François Revol
c476e73be7 freebsd11_network: allocate a new root device for each attach
else the pci_info struct is reused and overwritten.

This made the broadcom43xx driver write to the PCI config regs of other
devices...
2018-08-10 07:21:30 +02:00
François Revol
4cd13e2a54 freebsd11_network: calculate the size of memory resources from the BAR
128kB ought to be enough for everyone, but that's not a reason.
2018-08-10 07:18:49 +02:00
François Revol
ba88131cfd broadcom43xx: fix dereferencing uninitialized pointer in bwi_getradiocaps
bwi_attach wasn't setting ic->ic_softc early enough.
2018-08-10 07:16:32 +02:00
Murai Takashi
00cbe4ccca Replace strncpy with strlcpy
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>
2018-08-10 00:17:07 +00:00
Augustin Cavalier
b8761dc31c radeon_hd: Re-enable HD2400.
Vidrep says this works on most configurations, except for full HD
through the first port.
2018-08-09 20:07:32 -04:00
JackBurton79
373832ae60 Commented calling _EncodeVideoFrame() with NULL.
As Adrian suggested, it's not only inefficient to do that there, but also wrong.
Modified the TODO comment
Added a new TODO comment
2018-08-09 10:44:22 +02:00
JackBurton79
f049e59f50 Try to use the ffmpeg api more correctly:
call avcodec_receive_packet() in a loop, drain and flush the internal buffers.
Introduced private method to improve code readability (hopefully).
2018-08-09 09:12:19 +02:00
Augustin Cavalier
53a5dca9d7 packagefs: Fixup previous commit. 2018-08-08 23:57:11 -04:00
Augustin Cavalier
779d9140a4 radeon_hd: The MMIO area should be user-cloneable. 2018-08-08 23:51:36 -04:00
Augustin Cavalier
d8ad2d6f33 packagefs: Rename operator< to HasPrecendenceOver().
As suggested by weinhold on the mailing list.
2018-08-08 23:48:37 -04:00
Augustin Cavalier
ce0ef8c870 USB: Remove BeOSCompatibility.h and associated cruft. 2018-08-08 23:48:37 -04:00
Adrien Destugues
1a3a613584 DiskProbe: allow full and half fixed fonts. 2018-08-08 20:01:21 +02:00
Adrien Destugues
ac2ed5cc13 Terminal: use BFont::IsFullAndHalfFixed. 2018-08-08 19:57:17 +02:00
Augustin Cavalier
cd7bd43778 Fix missing B_USER_CLONABLE_AREA in intel_extreme
Fixes #14333
2018-08-08 19:49:02 +02:00
Philippe Houdoin
739e2ceffc text_search: avoid flooding messages while searching.
* 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.
2018-08-08 19:42:37 +02:00
Alexander von Gluck IV
3718fb861d efi: Drop x86_64 assumptions.
Change-Id: I3d806f43ef951013369fd0bf906eca5977e8d34c
2018-08-08 10:18:06 -05:00
Alexander von Gluck IV
572030aca6 kernel/efi: Add efi platform
Change-Id: Ie3cc4b4652d56983147221db9fbee6b72f177b1b
2018-08-08 09:48:34 -05:00
stefano
740114b89c Allocate the packet via ffmpeg.
Seems we aren't allowed anymore to handle it ourselves.
2018-08-08 12:11:53 +02:00
Rene Gollent
57893202f1 Debugger: Fix #14321.
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.
2018-08-07 22:28:04 -04:00
Adrien Destugues
8d1f13817f libsolv: #define _GNU_SOURCE from command line
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.
2018-08-07 20:50:56 +02:00
Adrien Destugues
d9949ac911 Initial work on Apple Stylewriter printer driver. 2018-08-07 19:30:16 +02:00
JackBurton79
c85dd27c9e AVCodecEncoder: Use new API
Change-Id: I5b985cebf241e67f901e93a5a4bb61a67a659cdf
2018-08-07 18:40:15 +02:00
Augustin Cavalier
247f2fb691 packagefs: Rename isNewest to overridesHead.
As pointed out by Adrien. Thanks for the review!

Also fixed missing dereference operators.
2018-08-06 23:46:24 -04:00
Augustin Cavalier
023a547dc6 vm: Enable B_USER_CLONEABLE_AREA protection.
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.
2018-08-06 23:27:50 -04:00
Alexander von Gluck IV
91bc3a279a kernel/ppc: Fix PowerPC build after fdt changes
Change-Id: Ieccec192c9d257368f8a9b5c52d01ed3c1c66d23
2018-08-06 19:55:48 -05:00
David Murphy
bbf16bc67a HaikuDepot: Fix featured package icon drawing transparency
Change-Id: I4ed26754ef5c0bfb0638de1703ece7d84fadf12a
Reviewed-on: https://review.haiku-os.org/443
Reviewed-by: Andrew Lindesay <apl@lindesay.co.nz>
2018-08-06 23:41:06 +00:00
Kacper Kasper
f26398d462 kernel: vm: remove panic
* That's embarrassing.
2018-08-06 23:09:05 +02:00
Kacper Kasper
7cea6679a8 kernel: vm: fix off-by-one errors in get_mount_point
* Fix for 03df8bfcf2.
* Fix misleading indentation.
* Fixes #14225.
2018-08-06 23:07:27 +02:00
Adrien Destugues
3f45e1e6ef Do not play/pause files nedlessly.
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
2018-08-06 20:15:23 +02:00
Jérôme Duval
c90a0ee947 posix_spawn(): dup2() again this time on file_action_dup2.
* fixes #14322.
2018-08-06 19:13:32 +02:00
Alexander von Gluck IV
5d0fd0e422 fdt: Major over-haul of fdt
* 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>
2018-08-06 15:46:49 +00:00
Alexander von Gluck IV
c3f9610748 arm/mmu: First iteration at mapping peripherals from FDT
* 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
2018-08-06 08:57:15 -05:00
Augustin Cavalier
daad9a3c1c kernel: Revert MMC bus changes to device_manager.
This broke booting on most (all?) systems.
2018-08-05 21:56:54 -04:00
Murai Takashi
8d86b84d18 Accelerants: Fix -Wformat-overflow
* 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>
2018-08-06 00:13:12 +00:00
Augustin Cavalier
5301f108ef packagefs: Directories with more attributes take precedence over ones with less.
This still preserves the behavior that system packages take precedence over
non-system packages.

Fixes #10071 (at last.)
2018-08-05 18:26:42 -04:00
Augustin Cavalier
abf0c2878a packagefs: system_packages take precedence over non-system packages.
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.
2018-08-05 18:26:41 -04:00
Augustin Cavalier
0779294800 Package Kit: Fix logic reversal in PackageInfoStringBuilder.
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.
2018-08-05 18:26:41 -04:00
Augustin Cavalier
5753ed5544 packagefs: Move PackageNode comparison into an operator<.
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.
2018-08-05 18:26:41 -04:00
krish_iyer
25b6a6f19b SDHCI MMC Driver
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>
2018-08-05 20:56:54 +00:00
Barrett17
42cc463169 ffmpeg: Fix typo and copyright notice 2018-08-05 14:29:16 +02:00
Barrett17
201707aee8 AVCodecEncoder: Skip frames
* 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.
2018-08-05 13:26:33 +02:00
Barrett17
5e2290b083 AVFormatWriter: Set packet stream index to current 2018-08-05 13:23:45 +02:00
Barrett17
bbe2746941 AVFormatWriter: Fix debug build 2018-08-05 11:53:43 +02:00
Barrett17
e93fce62f2 AVFormatWriter: Correctly set DTS
* Fixes timestamp warning from ffmpeg.
* Fixes #13407 AFAICT. But please test.
2018-08-05 11:50:03 +02:00
Barrett17
a72bbd5bd2 AVFormatWriter: Cleanup GET_CONTEXT_DEFAULTS macro
* 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.
2018-08-05 11:31:40 +02:00
Barrett17
b5d0ce85f4 AVCodecEncoder/AVFormatReader: Remove kNoPTSValue hack 2018-08-05 11:04:59 +02:00
Barrett17
9467826d31 AVFormatWriter: Remove OPEN_CODEC_CONTEXT hack 2018-08-05 11:04:59 +02:00
Augustin Cavalier
fc35866e55 iprowifi4965: Rework interrupts glue code.
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.
2018-08-04 12:21:08 -04:00
Barrett17
03437cd7b8 AVCodecEncoder: Rename fContext to fCodecContext 2018-08-04 12:11:09 +02:00
Barrett17
e302fe32cf AVCodecDecoder: Rename fContext to fCodecContext 2018-08-04 12:11:09 +02:00
Barrett17
ee9d0e0238 AVFormatWriter: Rename fContext to fFormatContext
* Seriously, this naming is bad.
2018-08-04 12:11:09 +02:00
Barrett17
428d87c581 AVFormatWriter: Move codec to codecpar
* Little cleanup included.
2018-08-04 12:11:09 +02:00
Barrett17
6283eeb2ff AVFormatReader: Move codec to codecpar 2018-08-04 12:11:08 +02:00
Barrett17
334b8f3f9c ffmpeg: Remove obsolete code 2018-08-04 12:11:08 +02:00
Fredrik Holmqvist
1368eabbff Fix gcc2 comparison, and only align if not aligned (8 - 0) 2018-08-03 15:31:03 +02:00
Fredrik Holmqvist
04cbc2588e Use fast clearing of visible screen for splash
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.
2018-08-03 13:40:04 +02:00
Jaroslaw Pelczar
5effe7f3ec bootloader: Align boot volume structure to 8 bytes instead of 4.
This alignment is preferred e.g. on ARM when using 64-bit values.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2018-08-02 19:51:53 -04:00
Augustin Cavalier
fb4cc98472 build: Add initial ARM64 target.
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.
2018-08-02 19:48:29 -04:00
Jérôme Duval
9a90ee3a38 Revert "Switch default fixed font from NotoMono to NotoSansMono"
This reverts commit b2acee1cb9.

Reason: NotoSansMono is not per se a fixed font.
2018-08-02 14:19:33 +02:00
Jérôme Duval
033f3450e3 Revert "Appearance: fix "Fixed font" menu after the change to "Noto Sans Mono"."
This reverts commit aa3c64e46d.

Reason: the previous change is to be reverted.
2018-08-02 14:17:46 +02:00
Jérôme Duval
aa3c64e46d Appearance: fix "Fixed font" menu after the change to "Noto Sans Mono". 2018-08-02 14:07:26 +02:00
Humdinger
b2acee1cb9 Switch default fixed font from NotoMono to NotoSansMono
Change-Id: Ib9eab5a2e266393b234cf7f4a6934fd58e31c943
Reviewed-on: https://review.haiku-os.org/48
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-08-02 10:43:57 +00:00
Stefano Ceccherini
d9eeaa720a Server side support for BFont::IsFullAndHalfFixed().
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>
2018-08-02 10:43:57 +00:00
Jérôme Duval
20694a0458 posix_spawn(): dup2() returns a fd on success, -1 on error.
* duplicate the just opened file descriptor, instead of the target file descriptor.
* fixes #14308.
2018-08-02 11:21:04 +02:00
Augustin Cavalier
edb6d3b17b kernel_cpp: Move the C++14 operator delete out of the header.
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.
2018-08-01 23:42:24 -04:00
Augustin Cavalier
cf36277e17 freebsd11_network: Add definition of ALIGNED_POINTER for PowerPC.
It seems this is needed anyway, as netresolv uses these headers.
2018-08-01 23:23:21 -04:00
Augustin Cavalier
a31d07a2a9 libnetapi: Fix style issues in previous commit. 2018-08-01 22:50:08 -04:00
Augustin Cavalier
0dc3ab4f37 libnetapi: Do not use the freebsd11_network headers globally.
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.
2018-08-01 22:35:47 -04:00
Augustin Cavalier
ca57e33abb libroot/glibc: Use .double instead of .tfloat on Clang.
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.
2018-08-01 19:04:25 -04:00
Augustin Cavalier
834100c94f libroot/glibc: Merge newer e_expl* files.
These versions (from ~2015 glibc) do not use some GCC-specific extensions
that Clang's integrated assembler does not like.
2018-08-01 19:02:04 -04:00
Augustin Cavalier
b3b69f8178 netresolv: Merge a patch to getaddrinfo from NetBSD.
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.
2018-08-01 18:23:15 -04:00
Augustin Cavalier
c9431a6752 netresolv: Mark code changes with __HAIKU__.
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.
2018-08-01 18:23:15 -04:00
Augustin Cavalier
4cc9ce9ddd netresolv: Merge patches from 2017 to current HEAD.
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.
2018-08-01 18:23:15 -04:00
Jérôme Duval
0771d6b296 runtime_loader: differentiate between secondary runtime loaders. 2018-08-01 21:18:01 +02:00
Fredrik Holmqvist
15db6949b6 Don't clear video mem on UEFI, efi video mode refactor
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
2018-08-01 21:12:08 +02:00
Jérôme Duval
0594302a65 runtime_loader: <x86>runtime_loader can handle x86_gcc2 binaries.
* <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.
2018-08-01 20:59:11 +02:00
Fredrik Holmqvist
e2ab1a8ef9 Unused and should be removed, fixes last commit 2018-08-01 18:32:52 +02:00
Fredrik Holmqvist
61e207f6e1 Unused
Approved by DeadYak to remove
2018-08-01 18:29:49 +02:00
Fredrik Holmqvist
9832d1f89a Use strict typing 2018-08-01 18:28:06 +02:00
Fredrik Holmqvist
004094b574 Bug found by unused-but-set-variable, entry should be updated
Verfied by DeadYak
2018-08-01 18:22:49 +02:00
Alexander von Gluck IV
605e7eaed3 arch: Cleanup a few typos. Sorry for spam.
Change-Id: Ic2fce841acdee8572005cf2a9710188d03d7cecd
2018-07-31 19:37:01 -05:00
Alexander von Gluck IV
9642f7705b arch: Cleanup of __ARM__ checks
* 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
2018-07-31 19:12:20 -05:00
Augustin Cavalier
26ae216d0e realtekwifi: Import from FreeBSD 11.1.
Untested, but requested by Anarchos.
2018-07-31 19:50:46 -04:00
Barrett17
2d93cf97c7 AdapterIO: Fix -Wtautological compare.
* 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.
2018-07-31 23:41:12 +02:00
Augustin Cavalier
5ad9670f39 intel_extreme, radeon_hd: Use bufferLength instead of B_FILE_NAME_LENGTH.
Thanks korli for the review!
2018-07-30 22:50:30 -04:00
JackBurton79
55557aa162 CURLOPT_XFERINFOFUNCTION is available since libcurl 7.32.0 only.
Since it's just cosmetic, allow compiling with older libcurl, too.
fixes build on RedHat/CentOS 7

Change-Id: I169ad84d15e61012d1d38a9b41af7eef81683bf7
2018-07-27 17:21:14 +00:00
Matej Horvat
08021a3beb fat: correctly read lowercase 8.3 filenames
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
2018-07-26 16:28:31 +00:00
David Murphy
e5c4ce4f67 HaikuDepot: Fix package list icon size for regular and featured views
Fixes #13399
Change-Id: I9a372d467e2056c6985fdc43b4629aa8fecd7535
2018-07-26 16:28:13 +00:00
John Scipione
fb7812fab0 BWindow: default Zoom() maximizes window when shift held down
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
2018-07-25 02:33:30 +00:00
Augustin Cavalier
0fe68ab92c scsi_disk: Fix -Wdefined-but-not-used. 2018-07-23 21:46:20 -04:00
Augustin Cavalier
ca11520f4a radeon_hd: Fixes for SMAP.
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.
2018-07-23 21:00:16 -04:00
Augustin Cavalier
f2dac2f1f1 scsi_disk: Disable FSTRIM.
It is known to destroy data on such devices (see #10336). But it seems to
work on ramdisk devices, so only disable it here, not for everything.
2018-07-23 20:59:05 -04:00
Murai Takashi
9f9afda5ce Mediaconverter: Suppress warnings
Use media_format.Clear() to suppress -Werror=class-memaccess
pointed out by gcc8.

Change-Id: I810cfac2db78914059bdd4ddb29d2eb0bccd9650
2018-07-23 23:58:43 +00:00
Jérôme Duval
34a10069f4 freebsd11_wlan: fix ieee80211_realign signature and the debug build. 2018-07-23 22:23:58 +02:00
Jérôme Duval
a27099f559 x86_64/x86_gcc2: don't depend on libgcc_s, libstdc++, libsupc++. 2018-07-23 20:57:59 +02:00
Hrishi Hiraskar
46bf100be4 Tracker: Fixed wrong error message in ContainerWindow.cpp 2018-07-22 18:28:39 +00:00
waddlesplash
fe66a314c8 Revert "BScrollBar: Add lines and dots knob styles to scroll bar"
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
2018-07-22 18:26:06 +00:00
waddlesplash
49c29fa933 Revert "Appearance Prefs: Add scroll bar knob setting"
This reverts commit 0988f80fed.

Change-Id: I60ec2b05a7c66e3c3c8f18dc821d6213934b0cfb
2018-07-22 18:26:06 +00:00
Jérôme Duval
7848bf798e hda: fix 64-bit warnings. 2018-07-22 10:05:37 +02:00
Jérôme Duval
4a062f23c6 glut: fix a warning on x86_64. 2018-07-21 12:22:01 +02:00
Jessica Hamilton
2ff22d6734 vesa: fix missing display_mode for UEFI.
* Broke use of non-standard modes in hrev51207. Code changed
  when merging framebuffer driver back into vesa driver...

Change-Id: I688ae627de23f37ffc8614d8f189593f8833ae3e
2018-07-20 17:08:38 +12:00
Adrien Destugues
83aa7d63a5 Add a test to show that #2509 is not reproductible. 2018-07-19 19:39:23 +02:00
Adrien Destugues
56a7cb3137 Fix build. 2018-07-19 19:28:19 +02:00
John Scipione
3123432674 BeDecorator: update close and zoom button gradients
... 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
2018-07-19 14:01:51 +00:00
David Murphy
d8d6c65576 BListView: Restore selection to MouseDown and fix multi-select drag'n'drop
* 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
2018-07-19 14:01:35 +00:00
Hrishi Hiraskar
bc8427c522 Tracker: Allow add-ons to dynamically extend popup menu.
An add-on may now add custom entries to the popup menu, in order
to provide more than one action.

Change-Id: Ib4726c0c1e70c59e3ba4d752df24b76cfee1c4a4
2018-07-19 14:00:48 +00:00
Augustin Cavalier
d632c685a0 Fix the build following previous changes. 2018-07-18 21:22:06 -04:00
Augustin Cavalier
53a371041c Remove the FreeBSD 9 compatibility layer.
Long live the FreeBSD 11 compatibility layer!
2018-07-18 20:11:35 -04:00
Augustin Cavalier
1e29bfd7d8 Update all remaining consumers of the FreeBSD compat headers. 2018-07-18 20:10:04 -04:00
Augustin Cavalier
fd893db8b1 broadcom43xx: Sync with FreeBSD 11.1.
And with that, the driver upgrades to FreeBSD 11.1 are complete!
2018-07-18 19:47:06 -04:00
Augustin Cavalier
3c42c902d9 Revert changes to BTextInput's text-rect calculation.
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.
2018-07-18 19:31:02 -04:00
Andrew Lindesay
b3a7d91b2e HaikuDepot : Fix for List Algorithm
Fix a mistake in the binary search and insert
algorithms that was causing stability issues.

Fixes #14284
2018-07-18 23:05:58 +02:00
Augustin Cavalier
4aff6a8a2b wavelanwifi: Sync with FreeBSD 11.1.
Untested. Requires the previous commit.
2018-07-17 23:38:24 -04:00
Augustin Cavalier
d97a05f774 freebsd11_network: Completely rework the bus space access system.
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.)
2018-07-17 23:25:34 -04:00
Augustin Cavalier
f329739cdc marvell88w8363: Sync with FreeBSD 11.1.
Untested, but the changes are mostly adapations to the new KPIs.
2018-07-17 20:05:35 -04:00
Augustin Cavalier
5f64721b30 marvell88w8335: Sync with FreeBSD 11.1.
Untested, but the changes are mostly adaptations to the new KPIs.
2018-07-17 19:54:31 -04:00
Augustin Cavalier
28ca187801 ralinkwifi: Sync with FreeBSD 11.1.
Untested, but the changes are mostly adapations to the new KPIs.
2018-07-17 19:46:44 -04:00
Augustin Cavalier
7edcb06f62 tests/file_systems/bfs: Update tests Jamfiles to refer to the kernel BFS sources. 2018-07-17 19:17:41 -04:00
Augustin Cavalier
3664c8fa36 tests: Remove the "R5" BFS add-on, bfs_shell, and mkbfs.
Virtually untouched since 2007.
2018-07-17 18:27:43 -04:00
David Murphy
9ece492008 BMenu: BMenuBar submenus at screen edge moved onscreen instead of scrolling
Fixes #9093
Change-Id: I1322c0cd8ba4bbfddace037ed8a8ef666ebe7fe3
2018-07-17 21:21:40 +00:00
Alexander von Gluck IV
b19fc3b65d radeon_hd: Add RX Vega PCIID's per #13846. Testers wanted!
Change-Id: I6ab97c96a5e86725d92a973d3edca63508e388d5
2018-07-17 09:00:30 -05:00
David Murphy
e3f7fe948d BMenu: Submenu opening direction follows parent opening direction
Fixes #4859
Change-Id: I8e89afc3ad982d899428e3038fed354a78d04981
2018-07-17 04:12:21 +00:00
Augustin Cavalier
0da0829bbc HaikuDepot: Display the last copyright line instead of the first.
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.
2018-07-16 23:00:23 -04:00
Augustin Cavalier
146a80c1cf HaikuDepot: Refactor & fix layout initialization in RatingItemView.
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.
2018-07-16 22:50:18 -04:00
Augustin Cavalier
4a88aa503a atheroswifi: Turn some apparently-harmless spam into debug-prints.
Both korli and KapiX report seeing this, but the driver works for them.

Fixes #14273.
2018-07-16 20:20:00 -04:00
Augustin Cavalier
c2dbeb9d31 Revert the cargo-culted changes to sata_request.
This reverts commit ffd36865cf.

They didn't fix anything, and on some systems it's reported that they
cause boot failures.

Fixes #14272.
2018-07-16 20:11:59 -04:00
Augustin Cavalier
dffc3e2353 freebsd11_wlan: Drain ageq before cleaning it up.
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.
2018-07-16 20:00:17 -04:00
Augustin Cavalier
8959d55643 freebsd11_wlan: Sync previous ifdetach patch with FreeBSD.
It was upstreamed, albeit in a slightly different location and with
a different comment than I originally had.
2018-07-16 19:43:55 -04:00
John Scipione
0988f80fed Appearance Prefs: Add scroll bar knob setting
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
2018-07-16 16:11:46 +00:00
John Scipione
ec1b18c58a BScrollBar: Add lines and dots knob styles to scroll bar
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
2018-07-16 16:11:46 +00:00
Janus
70f1070b6f BColumnListView: BSizeColumn sort with big files works as expected
- Use off_t to compute the difference
- Fixes #14279

Change-Id: I253f16bb75501904ff59ac603a4680c66cfec33f
2018-07-16 16:09:36 +00:00
Augustin Cavalier
562ec5674f freebsd11_network: Sync queue.h with FreeBSD 11.1.
Includes some actual bugfixes, from reading the FreeBSD commit logs.
2018-07-15 22:07:09 -04:00
Janus
a5167229e1 Shortcuts: save columns information
- Clean up useless code
- Remove horizontal scrollbar
- Fixes #14278

Change-Id: I7edcb998bfca4b90d02f949b6e7979bcdbcc3cbb
2018-07-15 00:27:48 +02:00
Janus
8d6561d6fc Shortcuts: Use ALT-R for "Revert to saved"
- Fixes #14275

Change-Id: I2ca692e277c130fcee5edd202976ab748d811d7b
2018-07-14 21:53:16 +00:00
Augustin Cavalier
40cab5860d radeon_hd: Disable non-working chipsets.
Fixes #12026.
2018-07-14 17:36:25 -04:00
Augustin Cavalier
a16e3a0b37 freebsd11_wlan: Disable another spammy information print.
Hopefully helps with #14270.
2018-07-14 14:08:25 -04:00
Augustin Cavalier
1a9f01e8ed iprowifi2100: Sync with FreeBSD 11.1.
Untested, but mostly just changes to adapt to the new net80211 stack.
2018-07-14 14:08:25 -04:00
Augustin Cavalier
71bcccaeee ipw2100: Remove.
Long since superseded by the iprowifi2100 driver.
2018-07-14 14:08:25 -04:00
Augustin Cavalier
cb4ca78fbf freebsd11_wlan: Disable a spammy information print.
On some atheroswifi systems, it apparently prints every 100ms.
Hopefully helps with #14270.
2018-07-13 18:31:41 -04:00
John Scipione
71c7f40521 app_server: change the default scrollbar knob to none
Change-Id: Iea13ebe6918f5583c3a4ce10414a54f06c51efe6
2018-07-13 00:21:52 +00:00
David Murphy
e4433ad0fa BMenu: Fix crash and keyboard navigation on 'recent items' menus
* 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
2018-07-13 00:16:58 +00:00
Augustin Cavalier
e042d58907 atheroswifi: Add AR9300 HAL.
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.
2018-07-12 20:07:33 -04:00
Augustin Cavalier
3142fb6996 scheduler: Fix setting priorities following the penalty cancellation changes.
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...
2018-07-11 21:53:44 -04:00
Augustin Cavalier
a052f4807f atheroswifi: Sync with FreeBSD 11.1.
Thanks to khaled and return0e for testing!
2018-07-11 19:32:38 -04:00
Augustin Cavalier
09ddf9b9f3 freebsd11_network: Properly implement CALLOUT_RETURNUNLOCKED.
Fixes a double-lock situation in the Atheros driver. We really should
implement FreeBSD's MTX_SPIN instead of relying on cpu_status here...
2018-07-11 19:03:27 -04:00
Julien Lepiller
3248de3de4 Mediaplayer: remember position and volume
Change-Id: I43fa7cbcedd39c39e4b136e9e1f9bb34bf3eb570
2018-07-11 17:37:56 +02:00
Augustin Cavalier
dd9cb9cdc9 freebsd11_network: Check for NULL in bus_teardown_intr.
Should help with #14235.
2018-07-10 23:22:37 -04:00
Augustin Cavalier
ecdc1bc8e7 freebsd11_wlan: Add missing mtx_destroy of the ic_list_mtx. 2018-07-10 18:41:05 -04:00
Augustin Cavalier
1a35344427 freebsd11_network: Only start_wlan if FBSD_WLAN_FEATURE is required.
Fixes #8634.
2018-07-10 18:40:21 -04:00
Augustin Cavalier
77cf476567 iprowifi3945: Disable hardware AES.
Recommended by the FreeBSD developers as "possibly broken." Hopefully
helps with #14260.
2018-07-10 18:33:19 -04:00
Augustin Cavalier
e131a159c3 iprowifi2200: Sync with FreeBSD 11.1.
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.
2018-07-10 18:28:02 -04:00
Augustin Cavalier
e6f6c1b463 freebsd11_wlan: Don't try to ifdetach if we never ifattached.
The FreeBSD developers say that there are "lots of bugs around driver attach
failures," and this looks like one of them.

Hopefully helps with #12035.
2018-07-10 17:57:01 -04:00
Augustin Cavalier
de6ea5f43f vfs: Move volume->ops NULL check to just after call to mount().
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.
2018-07-10 17:46:59 -04:00
Augustin Cavalier
ffd36865cf sata_request: Cargo-cult some behaviors from FreeBSD.
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>
2018-07-10 17:43:14 -04:00
John Scipione
e88a89e676 Appearance Prefs: drag and drop between ColorWhichItems
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
2018-07-10 21:20:09 +00:00
Murai Takashi
5d898e77d2 Media addon server: Suppress warnings
Use media_format.Clear() to suppress -Werror=class-memaccess
pointed out by gcc8.

Change-Id: Ib75ee4cb7aa8018af25dd6bdcf79b4dd7c14d240
2018-07-10 21:19:35 +00:00
Augustin Cavalier
12552deffc freebsd11_network: Use FreeBSD's usbdevs file.
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...)
2018-07-09 23:11:00 -04:00
Augustin Cavalier
9fcd8dadfe freebsd11_network: Adopt the generation of usbdevs.h.
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.
2018-07-09 23:09:21 -04:00
Augustin Cavalier
131c64ad4a vfs: Add missing NULL check of volume->ops.
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.
2018-07-09 21:08:57 -04:00
Augustin Cavalier
4c43ed243f freebsd11_network: Don't panic on bus_describe_intr. 2018-07-08 15:46:01 -04:00
Jérôme Duval
de2ba86e5e ntfs: gcc2 build fixes. 2018-07-08 19:29:31 +02:00
Jérôme Duval
65e832b71a exfat: fix warning. 2018-07-08 19:19:18 +02:00
Jérôme Duval
d04d6d36d1 bindfs: fix warnings on x86_64. 2018-07-08 19:18:57 +02:00
Jérôme Duval
30be8412d9 ntfs: add comments for NULL interface functions. 2018-07-08 19:04:22 +02:00
Jérôme Duval
a2a8608d32 ntfs: fix signature of fs_mount(). 2018-07-08 19:04:22 +02:00
Jérôme Duval
6ad86087a6 ntfs: convert attributes.* to unix endlines. 2018-07-08 19:04:21 +02:00
Jérôme Duval
c6ee40d2a1 ntfs: attributes read() and write() now pass a kernel buffer to libntfs.
same as f8d3a9ee49 for attributes.
2018-07-08 19:04:06 +02:00
Jérôme Duval
f8d3a9ee49 ntfs: read() and write() now pass a kernel buffer to libntfs.
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.
2018-07-08 19:02:37 +02:00
Augustin Cavalier
b0e0298370 bluetooth: Remove non-Haiku target platforms logic. 2018-07-07 17:04:19 -04:00
Augustin Cavalier
cf5cc3958d freebsd11_network: Additions for atheroswifi. 2018-07-07 14:24:06 -04:00
Augustin Cavalier
6c9b5f2292 aironetwifi: Sync with FreeBSD 11.1.
Untested; but the changes are relatively minimal.
2018-07-07 14:24:05 -04:00
Augustin Cavalier
76218ef1ca freebsd11_network: Add bus_alloc_resource_anywhere. 2018-07-07 14:24:04 -04:00
Jérôme Duval
208c323649 real_time_clock: fix _user_get_timezone() after 6ad3d25212
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.
2018-07-07 16:07:39 +02:00
Augustin Cavalier
1b98805383 freebsd11_network: Restore the old mbuf member access mechanism.
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.
2018-07-06 18:28:18 -04:00
Augustin Cavalier
8101468dbf jmicron2x0: Sync with FreeBSD 11.1.
Same Jamfile cleanups as previous commits.

This completes the upgrade of wired ethernet drivers to 11.1! :D
2018-07-06 18:28:17 -04:00
Augustin Cavalier
081fecc2f1 dec21xxx: Sync with FreeBSD 11.1.
Same Jamfile cleanups as in previous commits.
2018-07-06 18:28:17 -04:00
Jérôme Duval
defd975ae2 Update libroot stubs. 2018-07-06 18:59:36 +02:00
Augustin Cavalier
ac555254d4 idualwifi7260: GCC2 fixes (again.) 2018-07-06 11:38:18 -04:00
Augustin Cavalier
4cc829dc65 freebsd11_network: Synchronize fbsd_uipc_mbuf with FreeBSD 11.
Includes changes to the mbuf struct to more closely mirror FreeBSD 11.
Tested with the idualwifi7260 driver.
2018-07-06 10:58:45 -04:00
Augustin Cavalier
5af0299e37 freebsd11_network: Implement m_ext reference-counting and M_NOFREE.
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.
2018-07-06 10:32:45 -04:00
Augustin Cavalier
1431b61885 idualwifi7260: Properly enable the SINGLE_FRAME flag.
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.
2018-07-06 10:30:52 -04:00
Augustin Cavalier
ac06bf48c4 freebsd11_network: Combine Unit.cpp and unit.c into unit.cpp.
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.
2018-07-05 22:22:38 -04:00
Augustin Cavalier
49da1d2e3b crypt: Use int8 instead of int. 2018-07-05 22:04:35 -04:00
Augustin Cavalier
61e7a6b1f9 3com: Sync with FreeBSD 11.1.
No functional changes to the actual driver, it seems.
2018-07-05 17:13:11 -04:00
Andrew Lindesay
3b17d8dd7f HaikuDepot / PackageKit: Repositories 'Identifier' URL
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
2018-07-05 20:06:54 +00:00
Augustin Cavalier
a00c8c4491 freebsd11_network: Add another missing NULL check to taskqueue_free.
Also add missing \ns to the new printfs.
2018-07-05 15:46:02 -04:00
Murai Takashi
c7eabc40dc JPEGTranslator: Replace strncpy() with strlcpy()
Replace strncpy() with strlcpy(), since destination size equals
maximum number of characters to copy.
Pointed by gcc8 [-Werror=stringop-truncation].

Change-Id: I3e2a98802ddb379890aefaf8c3f0efb1cd347188
2018-07-05 13:12:56 +00:00
John Scipione
e2d19ae5b7 BListView: do not modify selection on MouseUp if drag & drop
bug seems to have been introduced only recently in hrev52062
2018-07-04 21:55:35 -07:00
Augustin Cavalier
4e5f9d9753 idualwifi7260: C89 fixes to appease GCC2. 2018-07-04 21:50:14 -04:00
Augustin Cavalier
e89c61736e drivers/network/wlan: Import idualwifi7260 from FreeBSD 11.2.
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 :)
2018-07-04 20:46:32 -04:00
Augustin Cavalier
999fe6b3ea freebsd11_network: Additions for idualwifi7260. 2018-07-04 20:46:31 -04:00
Augustin Cavalier
02463a2c73 freebsd11_network: Handle NULL gracefully instead of faulting.
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.
2018-07-04 20:46:31 -04:00
John Scipione
6fdf2dd2b3 Tracker: center text horizontally again
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
2018-07-04 16:35:06 -07:00
John Scipione
6b9353b4a3 Tracker: Revert to previous CalcRectCommon bottom calc
... 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.
2018-07-04 14:08:38 -07:00
Andrew Lindesay
cd417b96c9 HaikuDepot: Trace Logging of RPC Payloads
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
2018-07-04 13:27:42 +00:00
John Scipione
1dd1976fba Deskbar: update time width based on Deskbar orientation.
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.
2018-07-04 12:31:23 +00:00
David Murphy
f5face4114 BListView: Fix drag n' drop in multi-select mode
Move list selection logic into MouseUp instead of MouseDown
Change-Id: I4e7c7f6636dabce130578777b5e1203d6695499a
Fixes #9190
2018-07-04 00:47:01 +00:00
Augustin Cavalier
382d022473 libroot: Use 'int' not 'char' in crypt code.
It seems 'char' is unsigned on ARM, so GCC errors on the -1s in here.
2018-07-03 19:08:33 -04:00
Augustin Cavalier
42080aceac DHCPClient: Tweaks to logging.
* "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.
2018-07-03 16:14:22 -04:00
Augustin Cavalier
a7abbdae77 iprowifi4965: Add some more firmwares to the image.
Not sure why these were left out. Probably helps with #12407.
2018-07-03 15:40:54 -04:00
waddlesplash
980d7f22f9 package_infos: Update lib versions. 2018-07-03 00:12:51 -04:00
Augustin Cavalier
d1c51097eb Upgrade FFmpeg to 4.0.1 across the board (including GCC2.)
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.
2018-07-02 22:21:27 -04:00
Augustin Cavalier
c6992970cd freebsd11_network: Fix alignment check and print more information on failure.
We don't care what the virtual address is aligned to, only what the physical
one is. This now matches what FreeBSD does here.
2018-07-02 22:16:11 -04:00
Augustin Cavalier
c9af3dafd5 freebsd11_network: INTR_FAST is no more.
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.
2018-07-02 18:26:07 -04:00
Augustin Cavalier
1cbcf3e06b via_rhine: Sync with FreeBSD 11.1.
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.
2018-07-02 18:26:07 -04:00
Murai Takashi
12ed45b60f Media kit: Suppress -Werror=class-memaccess
* Add media_format::Clear(), media_format::Unflatten().
* Replace memset() with media_format::Clear()
* Replace memcpy() with media_format::Unflatten()

Fix #14156

Change-Id: I38ebc2de4915b954a15b6f4f6b40d016506910e5
2018-07-02 21:14:30 +00:00
Jérôme Duval
9e9fc9f1a3 ntfs: only prints a trace in case fs_mount failed. 2018-07-01 15:10:50 +02:00
Jérôme Duval
5bd8cf13c5 intel_extreme: use user_memcpy to write to user mapped memory.
* now boot successfully to desktop with SMAP enabled on intel_extreme.
* enforced 80 chars/line on two occasions.
2018-07-01 14:23:48 +02:00
Augustin Cavalier
aa033e3412 MediaConverter: Fix some "Looper must be locked" assert failure crashes.
Not sure how these cases were never hit before, but I ran into them
when testing MediaConverter...
2018-06-30 22:34:11 -04:00
Augustin Cavalier
9396b53f89 freebsd11_wlan: Add ieee80211_realign.
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.
2018-06-30 22:20:32 -04:00
Augustin Cavalier
9269dd58fa freebsd11_network: Use B_PAGE_SIZE not PAGE_SIZE in param.h.
freebsd11_network has PAGE_SIZE defined, but not all of its users do;
so for their sake we should use B_PAGE_SIZE.
2018-06-30 22:19:31 -04:00
Augustin Cavalier
bd60686144 tracker_new_templates: It's not 2015 anymore. 2018-06-30 20:08:14 -04:00
Augustin Cavalier
6a138e1704 freebsd11_network: Enable previously-disabled uses of counter(9).
Tested and verified this doesn't break anything.
2018-06-30 12:39:19 -04:00
Augustin Cavalier
7a41fb9137 freebsd11_network: Implement counter(9) using atomics.
See inline comment.
2018-06-30 12:38:44 -04:00
Augustin Cavalier
dc26a66554 drivers/wlan: Remove ralink2860; unused since 2013.
korli patched the "ralinkwifi" driver to support 2860 in
af5a895fa4, and removed this one
from the image at the same time.
2018-06-30 11:42:34 -04:00
Augustin Cavalier
e4bc0a9658 AboutSystem: ACPICA is "Component Architecture" not "Common Architecture".
That's what I get for committing with my brain off...
2018-06-30 11:41:51 -04:00
Jérôme Duval
4f5ed463b5 kernel: vfs: common_fcntl() now uses memcpy() for kernel calls.
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.
2018-06-30 15:46:52 +02:00
Augustin Cavalier
65df4b51f5 freebsd11_network: Discard __FBSDID() macros instead of declaring them.
Nothing uses them, and they just generate a ton of "unused global" warnings.
2018-06-29 23:15:51 -04:00
Augustin Cavalier
595605d86f freebsd11_network: Properly handle M_NOWAIT in _kernel_malloc.
I'm not sure what the comment was about; HEAP_DONT_WAIT_FOR_MALLOC
predates the FreeBSD compatibility layer.

Potentially fixes some timing issues.
2018-06-29 23:11:14 -04:00
Augustin Cavalier
da166fc646 iprowifi4965: Add the missing IWN_SDID_6035_5 subdevice.
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.
2018-06-29 22:09:06 -04:00
waddlesplash
6baca0c4f4 iprowifi3945: Fix GCC4+ build. 2018-06-28 18:42:58 -04:00
Augustin Cavalier
3cc8e19a4e freebsd11_network: Fix the build at KDEBUG_LEVEL < 1.
Thanks to Humdinger for reporting!
2018-06-28 17:32:54 -04:00
Augustin Cavalier
83a6125d7e iprowifi4965: Fix for the Intel Centrino 6235.
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. :)
2018-06-28 17:32:53 -04:00
Augustin Cavalier
9552ec8248 iprowifi3945: Sync with FreeBSD 11.1.
Tested and verified as working by cocobean. (The previous driver KDLed
on their hardware.)
2018-06-28 17:32:53 -04:00
Augustin Cavalier
dcf58b2783 freebsd11_network: Add mtx_sleep.
It is identical to msleep(), which is now "deprecated" in favor of it,
according to the FreeBSD manpages.
2018-06-28 17:32:53 -04:00
Jérôme Duval
d20630d0bc hda: remove a few ids from the quirks snoop list for intel.
should fix #14231. misread from the alsa quirk list.
2018-06-28 16:49:29 +02:00
waddlesplash
b93a8f398b Backgrounds: Fix GCC 4+ build. 2018-06-28 09:28:24 -04:00
Augustin Cavalier
97f9cb046c freebsd11 / iprowifi4965: GCC2 fixes. 2018-06-27 20:26:53 -04:00
Augustin Cavalier
8b4aff3eac freebsd11_network: Enable INVARIANTS at KDEBUG_LEVEL_2.
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.
2018-06-27 20:14:36 -04:00
Augustin Cavalier
a549026d25 freebsd11_network: Actually set numBytes instead of silently truncating it.
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.
2018-06-27 20:14:36 -04:00
Augustin Cavalier
688153aaec iprowifi4965: Sync with FreeBSD 11.1.
Tested and verified as working on my Lenovo ThinkPad T61.
2018-06-27 20:14:36 -04:00
Augustin Cavalier
af8988cdb6 freebsd11_wlan: Adapt net80211 code for Haiku's usage.
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.
2018-06-27 20:14:36 -04:00
Augustin Cavalier
ace07f7051 freebsd11_wlan: Adapt _haiku module for FreeBSD 11.
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.)
2018-06-27 20:14:35 -04:00
Augustin Cavalier
2ed3d6d1b5 freebsd11_network: Remove IFT_IEEE80211 logic.
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.
2018-06-27 20:14:35 -04:00
Augustin Cavalier
83fee6c8b6 freebsd11_network: Even more changes for freebsd11_wlan.
The net80211 code now fully compiles with -Werror=implicit-function-declaration,
however, it is not yet fully patched for Haiku usage.
2018-06-27 20:14:35 -04:00
Humdinger
cbadcae1d0 Small string changes in HaikuDepot GUI
* 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
2018-06-27 22:54:40 +00:00
Augustin Cavalier
69d3ef8233 AboutSystem: kPublicDomain is not presently used, #if 0 it out.
Fixes the build (sure, GCC, a static unused global constant is worth
throwing a warning over.)
2018-06-26 18:34:39 -04:00
Augustin Cavalier
5807f2981b AboutSystem: Copyright cleanups.
* 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.
2018-06-26 18:20:14 -04:00
Augustin Cavalier
5ec8aa426a AboutSystem: Combine Intel Wi-Fi firmware credits.
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.
2018-06-26 17:50:56 -04:00
Augustin Cavalier
a7999984fc Remove last references to tcpdump.
It hasn't been in the Haiku repository or provided by the Haiku package
for over a year.
2018-06-26 17:39:06 -04:00
Niels Sascha Reedijk
f98e331cf5 Small spelling fixes. Reported by mazbrili through Pootle. Thanks! 2018-06-26 21:26:45 +02:00
David Murphy
3d86db178e Backgrounds preflet limited to 10 recent folders
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
2018-06-26 00:56:51 +00:00
Augustin Cavalier
abb59d7351 intel_extreme: Fix instances of user memory creation and access.
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.
2018-06-24 23:52:09 -04:00
Augustin Cavalier
14ec6c8b23 intel_extreme: Remove some non-Haiku cases from device_ioctl. 2018-06-24 23:52:09 -04:00
Augustin Cavalier
79dba05004 HaikuDepot: Fix a -Wuninitialized in server client code.
If result is not a success, then we use hasData without initializing it.
2018-06-21 22:06:27 -04:00
Augustin Cavalier
4215eb6003 Debugger: Fix some broken comparisons.
* Missing parentheses in integer comparison inversion
 * !=, not ! at the beginning of expression

Spotted by Clang.
2018-06-21 22:05:27 -04:00
Augustin Cavalier
582afd9a7f interface & app_server: Fix missing parentheses near ternary operators.
+ has greater operator precendence than ?, so we need parentheses when
using both in expressions. Both of these look like actual bugs.

Spotted by Clang.
2018-06-21 22:04:31 -04:00
Augustin Cavalier
b9491db99c ACPI: Remove useless if-test. 2018-06-21 22:02:46 -04:00
Augustin Cavalier
f4b42b518a drivers: Deduplify joystick_driver.h.
Now there is only the one copy in headers/private/device.
2018-06-21 18:46:30 -04:00
Augustin Cavalier
9b83a2a043 BJoystick: Fix fJoystickInfo initialization.
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.
2018-06-21 17:52:39 -04:00
Augustin Cavalier
09c7b1526f freebsd11_network: Fix MLEN/MHLEN macros after mbufq changes.
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.)
2018-06-20 21:26:21 -04:00
Augustin Cavalier
2a3a847f82 HPGSTranslator: Remove from the tree.
Not included in the build and not referenced anywhere else. Now lives at
HaikuArchives.
2018-06-19 23:43:53 -04:00
Augustin Cavalier
571def7114 WebPositive: Store default bookmarks in git instead of downloading them.
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.
2018-06-19 23:11:58 -04:00
Augustin Cavalier
9b326aa287 mail: Store mode flags by-value, not by-reference.
They are passed into the constructor by-value, and Clang warns that
we are taking the reference of a temporary.
2018-06-18 23:20:18 -04:00
Augustin Cavalier
a309b7c3a1 bin: Clang warning fixes.
* Functions that call exit() should return void
 * char* -> const char*
 * main returns int, not bool.
2018-06-18 23:18:34 -04:00
Augustin Cavalier
9b29611fb8 ACPI: Set handle to NULL.
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.
2018-06-18 23:17:38 -04:00
Augustin Cavalier
9216fc0178 More class/struct mixup fixes.
Spotted by Clang.
2018-06-18 23:16:50 -04:00
Augustin Cavalier
9ac3062734 kernel: Small fixes for Clang. 2018-06-18 19:32:13 -04:00
Jessica Hamilton
7f7f3618dd webpositive: force download window on screen.
* 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
2018-06-17 17:00:47 +00:00
Augustin Cavalier
4a459f066d :kernel: Fix stack alignment in syscall entry on x86_64.
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.
2018-06-16 17:24:33 -04:00
Jessica Hamilton
77c8afb47f libroot_build: don't define system_time() on Haiku host.
* On x86_64, this was causing an infinite loop between
  libroot & libroot_build in the host unzip tool.
2018-06-16 10:08:56 +00:00
Jessica Hamilton
d284524815 libroot_build: replace void* with addr_t for hidden functions.
* 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.
2018-06-16 10:08:56 +00:00
Alexander von Gluck IV
64d4515abf kernel: Only apply rtl-stv1 hack to x86 & x86_64
Change-Id: I971f7bf3bb95ee466a59ab777c2f6fc56fbcbd43
2018-06-15 13:43:13 +00:00
Augustin Cavalier
4f7b9506fd Revert the rest of the COMPAT_MODE changes (back to hrev52003.)
This reverts commit 458e758f37.
This reverts commit ce5eb94a82.
This reverts commit aac8d4c317.
This reverts commit c70cba914a.
This reverts commit 2ffbe7aaca
This reverts commit c6e120e2d2.
2018-06-15 00:20:56 -04:00
Augustin Cavalier
513403d420 Revert team and thread changes for COMPAT_MODE (hrev52010 & hrev52011).
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.
2018-06-14 22:25:06 -04:00
Rene Gollent
211cb77acf Debugger: don't auto-download packages non-interactively.
- 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.
2018-06-14 16:51:32 -04:00
Jérôme Duval
c558f9c8fe kernel/x86_64: stacktrace for threads in compatibility mode.
* add compat_stack_frame struct.
* user symbols are't yet looked up in compatibility mode.

Change-Id: I94b45f25564c246bb174f9491f4abc4aa8676549
2018-06-12 17:56:55 +02:00
Jérôme Duval
44f24718b1 kernel/x86_64: add compatibility source files to the build.
* add x86 versions of fnsave frstor.
* add missing declaration for elf32_resolve_symbol().

How-to build a x86_64/x86 bootstrap build:
mkdir generated_bootstrap; cd generated_bootstrap
../configure --bootstrap /dir/to/haikuporter/haikuporter /dir/to/haikuports.cross \
  /dir/to/haikuports --build-cross-tools x86_64 /dir/to/buildtools --build-cross-tools x86 -j8 --use-gcc-pipe
jam -q -sHAIKU_PORTER_EXTRA_OPTIONS="-j8 --sourceforge-mirror=freefr --no-source-packages" @bootstrap-raw

Change-Id: I6eae3653c42a53683ae307107fae595c4b8ebcfb
2018-06-12 17:56:55 +02:00
Jérôme Duval
a69cb33030 kernel/x86_64: setup a new thread in compatibility mode.
* 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
2018-06-12 17:56:55 +02:00
Jérôme Duval
951182620e kernel/x86_64: setup a new team in compatibility mode.
* 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
2018-06-12 17:56:55 +02:00
Jérôme Duval
458e758f37 kernel/x86_64: compatibility syscalls for vm.cpp.
* 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
2018-06-12 17:56:55 +02:00
Jérôme Duval
ce5eb94a82 kernel/x86_64: compatibility syscall for system_info.cpp.
* define compat_system_info to be used in _user_get_system_info() in
compatibility mode.

Change-Id: Ib917d41a3a87155aee9cb536fd09e7231b232bc8
2018-06-12 17:56:55 +02:00
Jérôme Duval
aac8d4c317 kernel/x86_64: compatibility syscalls for signal.cpp.
* 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
2018-06-12 17:56:55 +02:00
Jérôme Duval
c70cba914a kernel/x86_64: compatibility syscalls for image.cpp.
* 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
2018-06-12 15:55:55 +00:00
Jérôme Duval
2ffbe7aaca kernel/x86_64: compatibility syscalls for vfs.cpp.
* 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
2018-06-12 15:55:43 +00:00