Commit Graph

49251 Commits

Author SHA1 Message Date
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