Commit Graph

50295 Commits

Author SHA1 Message Date
Alexander von Gluck IV
7e4621737c mime_db: Add several missing text extensions
* Dog-fooding and keep having to manually open files
  in Pe since the types weren't detected.
2019-01-23 01:37:38 +00:00
lazybullfrog
dace9ead09 Terminal: added argv for initial working directory
Change-Id: I82ea0e358d037d79f2a7ffb59f83cf6e3d72d4a6
Reviewed-on: https://review.haiku-os.org/c/780
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-22 17:53:03 +00:00
Augustin Cavalier
3f77fdd1d2 kernel/vfs: Fix -Werror=maybe-uninitialized. 2019-01-22 12:47:07 -05:00
Leorize
cb0d3bd341 kernel/fs/vfs: add truncation check for user_strlcpy calls
**Lots** of syscalls here don't check if strlcpy truncated the user
supplied argument. This commit adds them where appropriate.

Closes #2642

Change-Id: Iff89055aeb3a1870c8baf327b60873ce85815cd7
Reviewed-on: https://review.haiku-os.org/c/890
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-22 17:00:05 +00:00
Augustin Cavalier
a4f5124fcc Media Kit: Rewrite DefaultMediaTheme to use layouts.
The old fixed-rect method was very error-prone in corner-cases,
resulting in half-visible (cut off) parameters, incorrectly
sized controls, etc. on various devices, which often made it
impossible to use.

While there are still a few rough edges (scrollbar behavior could
be further improved, though it's already much better than it was before),
this method is much better than the previous one.

Fixes #11592 and related tickets.

Change-Id: I65175f760bda98e42d1fc68ba8e526470bf17c25
Reviewed-on: https://review.haiku-os.org/c/889
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-22 14:25:09 +00:00
Augustin Cavalier
658362336e Media: Don't delete the BLayoutItem when clearing the parameter view.
It is owned by the BView which we delete on the next line; and doing this
triggers an assert if there are still child views, which the BView destructor
cleans up before deleting the layout item.

Change-Id: I2f6f913b963e15c9808328aa2e0581cd1755e8ce
Reviewed-on: https://review.haiku-os.org/c/888
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-22 14:25:09 +00:00
Murai Takashi
ef916ff3b5 bin/multiuser: Fix PVS 1809 and 1896
Replace memset() with explicit_bzero(), since compiler could delete
memset() funnction call.

Change-Id: I6d6ad991951f516cf94b6fdf1772715ef4a42822
Reviewed-on: https://review.haiku-os.org/c/880
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-21 15:52:19 +00:00
Rob Gill
2876fb7c18 apps/DriveSetup Warn before formatting Intel extended Partition
* Provide a specific warning should a user select formatting the
  intel extended partition. Formatting this partition results in
  the loss of any subpartitions, and results in no usable partition.
  (as described in bug #9856).

Change-Id: I6fb71f3329596217364f3be56b7ca225a1f26441
Reviewed-on: https://review.haiku-os.org/c/886
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-21 10:29:50 +00:00
Rob Gill
db578bfa3a apps/AboutSystem NetBSD licences and xfree86 url
* Adds licence information for the NetBSD contributions
	* ftp - 4 clause BSD (retained in ftp.c)
	* tput - Berkeley
	(http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/tput/tput.c?rev=1.26)

* Berkeley licence text added to licences

* xfree86.org url added

  These were previously marked TODOs

Change-Id: I01bf0bb6055b3b45ca80c6cddabdb093cb043408
Reviewed-on: https://review.haiku-os.org/c/887
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-20 11:08:30 +00:00
Rob Gill
ff4410ea9d add-ons/kernel/file_systems: additional gpt filesystem types
* Updates list of gpt filesystems which can be recognized
	(no change to operation)

* sources for updated information:
	systemd https://systemd.io/BOOT_LOADER_SPECIFICATION
	microsoft https://docs.microsoft.com/en-us/windows/desktop/api/winioctl/ns-winioctl-_partition_information_gpt
	freedesktop https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
	freebsd & vmware https://www.unix.com/man-page/FreeBSD/8/GPART

Change-Id: I5387a8e00f999290632231530dccfaf73831bc9c
Reviewed-on: https://review.haiku-os.org/c/885
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-19 18:38:24 +00:00
Leorize
b9c25b0d0e unistd: introduce nice()
This commit implements nice() as specified in POSIX.1-2008.

Fixes #4932.

Change-Id: Ibd8d4636d9e3a8adf0f26a081d5b1180f0cbb839
Reviewed-on: https://review.haiku-os.org/c/863
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-19 18:31:58 +00:00
Timothy Gu
8ae2e95643 libroot: add [gs]etpriority implementation
Implemented against POSIX-1.2013.

The implementation POSIX requirement thats setpriority() shall affect the
priority of all system scope threads only extends to POSIX threads. This
is implemented by modifying the default attributes for newly spawned
pthreads.

It is not possible to modify the default pthread attributes for different
processes with the current implementation, as default pthread attributes
are implemented in user-space. As a result, PRIO_PROCESS for which and 0
for who is the only supported combination for setpriority().

While it is possible to move the default attributes to the kernel, it
is chosen not to so as to keep the pthread implementation user-space only.

POSIX requires that lowering the nice value (increasing priority) can be
done only by processes with appropriate privileges. However, as Haiku
currently doesn't harbor any restrictions in setting the thread priority,
this is not implemented.

It is possible to have small precision errors when converting from Unix-
style thread priority to Be-style. For example, the following program
outputs "17" instead of the expected "18":

	#include <stdio.h>
	#include <sys/resource.h>

	int
	main()
	{
		setpriority(PRIO_PROCESS, 0, 18);
		printf("%d\n", getpriority(PRIO_PROCESS, 0));
		return 0;
	}

The underlying reason is because when you setpriority() both 18 and 19
are converted to the Be-style "2". This problem should not happen with
priority levels lower than or equal to 20, when the Be notation is more
precise than the Unix-style.

Done as a part of GCI 2014. Fixes #2817.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Co-authored-by: Leorize <leorize+oss@disroot.org>
Change-Id: Ie14f105b00fe8563d16b3562748e1c2e56c873a6
Reviewed-on: https://review.haiku-os.org/c/78
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-19 18:31:58 +00:00
Augustin Cavalier
a526bddb8d bootloader: Add missing NULL check. 2019-01-16 20:37:07 -05:00
Augustin Cavalier
1fef0f0fa8 bootloader: Use the already-detected filesystem module...
...rather than enumerating again. Solves a TODO (all filesystems
save tarfs and packagefs, which require special parameters and
of course will not be on standard "partitions", have implemented
the required function.)
2019-01-16 20:33:12 -05:00
Augustin Cavalier
450dd5db3a ACPI: Fix -Wunused-but-set-variable. 2019-01-16 19:32:45 -05:00
Augustin Cavalier
20f6556bff kernel/x86: Backslash-escape trigraphs.
Fixes an instance of -Wtrigraphs.
2019-01-16 19:32:16 -05:00
Augustin Cavalier
8fa626d09d XHCI: Refactor register area access and handling.
* Don't bother aligning the PCI memory addresses; they will already
   be aligned, and even if by some mystery they aren't, map_physical_memory
   should be able to handle that. This greatly simplifies the code.
 * Use one pointer and then four different offset fields instead of four
   different pointers. This is what DragonFlyBSD and FreeBSD do; it's
   a negligible loss in performance (or none at all, depending on arch
   and compiler) as it requires only one more add, and greatly clarifies
   the code as to what's going on.
 * Remove (both previously and now) unused fields from the header.
 * Compute runtime and doorbell register offsets correctly (there
   was a missing bitmask.) This is how it's done on FreeBSD and
   DragonFlyBSD.
 * Actually write the high bits of the DMA addresses. Checked against
   FreeBSD and DragonFlyBSD.
 * Tweak error message.

Possibly fixes the "invalid bus space memory access" crash, but
I don't have any hardware that occurs on so I couldn't check.

Tested in VMware, VirtualBox, and on a ThinkPad E550 (Broadwell).
2019-01-16 19:27:41 -05:00
Fredrik Holmqvist
abdd597add Add CACHE_LINE_SIZE for ARM in FreeBSD header
The Haiku headers are C++ and include other C++ ones
2019-01-16 22:35:35 +01:00
Fredrik Holmqvist
ffbedf6088 Revert "Fix for bug 6991, replace registrars timer tick"
Unintentional commit, still not used to gerrit things

This reverts commit a02e4534f5.
2019-01-16 21:17:48 +01:00
Fredrik Holmqvist
ea0dc313dc First try at libunwind arch for ARM
ICU fails on linking unwind exceptions on ARM
2019-01-16 21:14:19 +01:00
Fredrik Holmqvist
a02e4534f5 Fix for bug 6991, replace registrars timer tick
Registrar schedules an event every second to do
fRoster-CheckSanity(). This uses 2.5% cpu on my machine
when idle. Changing it to five seconds lowers it to 0.1%

waddlesplash then pointed me to this bug which changes it
to watch for team deletion and call fRoster->CheckSanity()

As I know little in this area, it's mostly based on what
LaunchDaemon does in MessageRecieved.
2019-01-16 21:13:04 +01:00
Augustin Cavalier
40cdf7d607 accelerants/vesa: Indicate when we are a dumb framebuffer device. 2019-01-16 11:49:56 -05:00
Augustin Cavalier
9f8ad6a31a idualwifi7260: Merge fix to firmware loading from FreeBSD.
Fixes #14298.
2019-01-16 11:12:02 -05:00
Augustin Cavalier
969aecd624 kernel: Disable -Werror for zstd. 2019-01-15 17:18:58 -05:00
Augustin Cavalier
96bc0f463f kernel/x86: Fix some warnings. 2019-01-15 17:08:18 -05:00
Augustin Cavalier
f8ea9ed5b4 kernel/sem: Fix -Wformat. 2019-01-15 14:11:20 -05:00
Rob Gill
de24087ae8 installer: Fix Bug #14594 / avoid UI reset
* Adds check for completed installation when exiting BootManager
  or DriveSetup.

* If installation has completed, quit or restart buttons are maintained,
  along with appropriate guidance, rather than the UI reset described in bug

Change-Id: I064ccecb77b1a0e4347e1e36564614383b1409d5
Reviewed-on: https://review.haiku-os.org/c/881
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-15 11:22:29 +00:00
Augustin Cavalier
a9f4ce4515 bootloader: Obey "load_symbols" kernel setting. 2019-01-14 20:45:56 -05:00
Augustin Cavalier
c3361cad95 bootloader: Load driver settings before the kernel.
This way, parts of the bootloader (e.g. the ELF loader) that would
like to access driver settings can do so.
2019-01-14 20:44:25 -05:00
Augustin Cavalier
36f72031b1 kernel: Obey "load_symbols" kernel setting.
Somehow this was never implemented...
2019-01-14 20:31:48 -05:00
Augustin Cavalier
56583ffb3a kernel/legacy_drivers: Make asterisk style consistent.
Most of the file used space after asterisk, but some of it used spaces
before the asterisk. Now it's consistently after.
2019-01-14 16:06:34 -05:00
Augustin Cavalier
fb95946e44 kernel: Don't watch the "dev" legacy driver directory.
We don't watch its children, and most drivers within it are within
subdirectories. Further, all drivers in it are really symlinks to "bin",
which we also watch. So there is really not much purpose in watching
"dev" directly.

Should fix #4638.
2019-01-14 16:00:20 -05:00
Augustin Cavalier
8e9c7a36eb kernel: B_BEOS_* -> B_SYSTEM_* for directory constants.
Also clean up legacy_drivers' usage of them a bit.
2019-01-14 15:51:42 -05:00
JackBurton79
b3470a55cf ServerPicture:SyncState(): sync with Canvas instead of View
When the canvas api was introduced, ServerPicture was changed to work with Canvas,but this was not updated.

Change-Id: I37c68111f4a60408768656260bfc73a27f1f65f4
Reviewed-on: https://review.haiku-os.org/c/501
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-14 16:25:57 +00:00
Rob Gill
74726e7014 networking: Hostname viewing & setting
addon/network settings/hostname

	allowing the hostname for the system to be set by the user using
	the preferences gui

Change-Id: I676c368070ef89a20435f97ee39e3caa25abf8f9
Reviewed-on: https://review.haiku-os.org/c/870
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-14 16:24:46 +00:00
Leorize
b6ec8338f9 libnetwork: getifaddrs() now returns ipv6 and physical addresses
If available, getifaddrs() will now return additional entries for
different addresses of an interface. This is similiar to how NetBSD does
it.

This allows software such as libuv to construct detailed information
about network interfaces within the system.

Adrien have some concerns about getaddrinfo() wouldn't correctly exclude
IPv6 addresses after this change so a test was added to cover that.

Change-Id: I8c5d3a02b9294d746ca928a285f40344dfd6e3cb
Reviewed-on: https://review.haiku-os.org/c/874
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-14 16:00:36 +00:00
Adrien Destugues
5f603da01a Better shape for submenu arrow
Just use BControLook where appropriate. It already provides a nice arrow
drawing function (also used in DeskBar expander and in scrollbar
buttons).

Fix second part of #8900

Changes by John Scipione:

Update menu mark and submenu arrow color with menu text color

Use text color for checkmark and submenu arrow colors, tint less black.
This means that colored bg/white text menu item will also draw a white
checkmark and submenu arrow.

Break out BMenuItem::Draw functionality into private methods _IsActive,
_LowColor() and _HighColor() methods and use them to set the mark colors.

Scale submenu arrow and checkmark with item height (which scales with
font size.)

does not align shortcuts with submenu arrows... but if you were to do
that you'd add item->Bounds().Height() / 2.

Signed-off-by: John Scipione <jscipione@gmail.com>

Change-Id: I8299094ef88bf227510b116eb1b84c261dc94723
Reviewed-on: https://review.haiku-os.org/c/341
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-14 15:59:57 +00:00
Rob Gill
ee3106db4a Fix for Bug #14822 Apps/Devices ACPI button handling
* Patch checks for pathless results, and in cases where acpi/hid is returned uses the hid element.
  In case of any non-hid nodes returning no path, a separate "unknown" entry is also added.

* Also disables one "not implemented" message in line with https://review.haiku-os.org/c/haiku/+/696

Change-Id: I7ac92c7f3c5cb03401b9502aa345a86f117a5a20
Reviewed-on: https://review.haiku-os.org/c/879
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2019-01-14 14:24:56 +00:00
Stephan Aßmus
57e2488804 Get rid of special B_OP_COPY implementation for rendering text
Since BeOS had no anti-aliased drawing except for text, it didn't
matter whether drawing diagonal lines (for example) in B_OP_COPY
or B_OP_OVER. Applying the meaning of B_OP_COPY strictly to everything
else would have broken pretty much every existing BeOS, resulting
in broken drawing for anything but straight lines and rectangles.
The solution was to treat B_OP_COPY just like B_OP_OVER *except*
for text rendering, where we could be compatible with the BeOS
behavior. Nevertheless, one can sometimes observe apps using B_OP_COPY
where they /should/ be using B_OP_OVER for rendering text, resulting
in white edges around the glyphs where the actual LowColor() does not
match the current background on which the text is rendered.
There is however a problem when glyphs in a string overlap. Some
fonts have overlapping glyphs by default (handwriting, etc). With
the LCD sub-pixel filtering, this problem is visible even in fonts
where glyphs don't overlap normally, for example 'lt'. The leftmost
pixel of the 't' is smeared due to the filtering and produces an
almost transparent pixel which is rendered (using the low color as
the background) on top of the 'l'. To fix this, one would have to
render the string into an alpha mask buffer first, and then blend it
all at once using B_OP_COPY. This however defeats the point of
B_OP_COPY, which is to be a performance optimization. So instead, I
opted for the solution that is already in place for everything else,
which is to make B_OP_COPY behave like B_OP_OVER. For the case that
this would have produced a difference, i.e. rendering with the solid
high color, one needs to clear the background using the low color,
before rendering text, or it would have looked broken. So in practice,
there cannot be a difference.

Change-Id: I4348902ae754507f1429e0a9575f03d8ecbce333
Reviewed-on: https://review.haiku-os.org/c/877
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-14 08:33:46 +00:00
Rob Gill
0991a51b01 Apps:Drivesetup Fix for bug #14471
* Additional newline in tooltip text to prevent clipping on low
  resolution displays

Change-Id: I8262256d2eb1cc72fb5ffe502c3112285b4f46e5
Reviewed-on: https://review.haiku-os.org/c/878
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-13 11:49:26 +00:00
Augustin Cavalier
7c374c6ab4 test_app_server: Fix linking when --no-undefined is in default LINKFLAGS.
We now remove it manually for one library to break the dependency loop.

Change-Id: I24061705b4656d444bbe7b4a6af836303f44c020
Reviewed-on: https://review.haiku-os.org/c/873
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-13 09:58:48 +00:00
Murai Takashi
ddd56c013d Haikudepot: Fix PVS 856
Fix 'true' value becomes a class object.

Change-Id: I7d36c024a9fec7c9649765370f529de2df44d7cb
Reviewed-on: https://review.haiku-os.org/c/868
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2019-01-12 10:56:10 +00:00
Augustin Cavalier
7c7d9013db usb.ids: Update. 2019-01-11 16:44:44 -05:00
Augustin Cavalier
3cb53df4e6 pci.ids: Update.
It seems the cronjob that usually updates these was never migrated to
the new server. We should fix that, but in the meantime, these files are
now a year old, so let's update them.
2019-01-11 16:44:09 -05:00
Augustin Cavalier
16172596e2 freebsd_network: Update usbdevs. 2019-01-11 16:41:32 -05:00
Augustin Cavalier
6b899f5ab4 Appearance: Don't disable the "glyph hinting" menu field.
I missed this snippet of code in earlier changes, it seems.
2019-01-11 16:01:50 -05:00
Augustin Cavalier
c5cb2cbd86 Delete usb_printer driver.
It has been unused since 2010, when the usb_port printer transport
was rewritten to use the USBKit.

Change-Id: I224e07fb35cd9696c07b8f22dd51d3c67d92e0a9
Reviewed-on: https://review.haiku-os.org/c/869
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-11 17:02:21 +00:00
Stephan Aßmus
315ab3328e Small test-app playing ground for text rendering
The test app currently shows a number of problems in text rendering

 * Above a certain font-size, there is no glyph caching, which
   also means there is no sub-pixel filtering. It is actually
   the same problem right now for all vector-drawing. It uses the
   sub-pixel rendering pipeline, but without any filtering.
 * This test feels very sluggish. Something is going on which seems
   to be very unoptimized. To be observed when resizing the window
   and causing redraws.
 * Overlapping glyphs are handled wrongly in B_OP_COPY mode. The
   problem is that glyphs are drawn one at a time, but B_OP_COPY
   also draws the background color. In case some pixels already
   drawn with the text color by one glyph are drawn again by the
   next glyph, but with the background color, then it looks like
   gaps in the text. This problem has always existed. With the
   double filtering that was recently fixed, it was just especially
   visible, since, due to the smearing, it was much more likely that
   there were extra background pixels at the left side of glyphs.
   (Right side, too, but without visual effect.) Of course not
   completely transparent pixels, those are not drawn, but almost
   transparent pixels.

Change-Id: If590a4c93983c5a3ff0772c19074c408be8e1e74
Reviewed-on: https://review.haiku-os.org/c/871
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-11 16:51:27 +00:00
Augustin Cavalier
1245324d9f marvell88w8363: GCC2 fixes. 2019-01-10 22:08:08 -05:00
Augustin Cavalier
0eb01c720a drivers/wlan: All drivers have been upgraded to FreeBSD 12. 2019-01-10 22:05:44 -05:00
Augustin Cavalier
1528ce925d realtekwifi: Update and add new firmware sets. 2019-01-10 21:43:52 -05:00
Augustin Cavalier
a8bfcf3228 realtekwifi: Sync with FreeBSD trunk.
This includes changes to support the 8188EE device, as well as a
number of critical bugfixes to 8192EE devices, which should make
the driver much more stable and reliable overall.
2019-01-10 21:08:26 -05:00
Augustin Cavalier
478b2a6ab0 realtekwifi: Upgrade to FreeBSD 12.
This driver was completely rewritten and merged with its USB counterpart
in FreeBSD 12. I've imported the USB code, even though it's not compiled
in at all, because it's more than likely I'll get around to USB WiFi support
before FreeBSD 13 comes...

Untested, because I don't have one of these PCI devices.
2019-01-10 20:43:15 -05:00
Augustin Cavalier
860d86851e freebsd_network: Tweaks for the new realtekwifi.
One dummy header, and bump __FreeBSD_version to its actual value
from 12.0-RELEASE.
2019-01-10 20:42:24 -05:00
Augustin Cavalier
baf68028bf wavelanwifi: Upgrade to FreeBSD 12. 2019-01-10 20:10:37 -05:00
Augustin Cavalier
db7b74600c ralinkwifi: Upgrade to FreeBSD 12. 2019-01-10 17:40:08 -05:00
Augustin Cavalier
c8ba6df4ed marvell88w8335: Upgrade to FreeBSD 12. 2019-01-10 17:39:17 -05:00
Augustin Cavalier
a3cc4e1a5e marvell88w8363: Upgrade to FreeBSD 12. 2019-01-10 17:39:03 -05:00
Augustin Cavalier
0fc3af214b iprowifi3945: Upgrade to FreeBSD 12. 2019-01-10 17:29:25 -05:00
Augustin Cavalier
f7dac49055 iprowifi2200: Upgrade to FreeBSD 12. 2019-01-10 17:28:41 -05:00
Augustin Cavalier
a2045452ff iprowifi2100: Upgrade to FreeBSD 12. 2019-01-10 17:28:29 -05:00
Augustin Cavalier
3aaffc2769 broadcom43xx: Upgrade to FreeBSD 12. 2019-01-10 17:27:42 -05:00
Augustin Cavalier
4cba08df51 Printers: Allow adding IPP printers even if none are detected.
Yes, this is kind of hacky to put the printer driver as a special case
in here, but we already do this for the Preview driver, and IPP's
printer detection is pretty broken, whereas adding a printer URL manually
seems to still work.

Works around #12702.
2019-01-10 16:32:31 -05:00
Augustin Cavalier
daa6582acb XHCI: Don't reject devices with "invalid" IRQs immediately.
It seems some controllers are assigned "invalid" interrupt lines under
the expectation they will be allocated an MSI. So, don't reject
these devices for having an invalid interrupt line until after
we have tried to allocate an MSI for them.

Should fix #14792.
2019-01-10 14:17:55 -05:00
Augustin Cavalier
696138675a freebsd_wlan: Copy out only the size of the request length.
Fixes more problems with wpa_supplicant, this time on x64.
2019-01-10 13:55:21 -05:00
kerwizzy
cc15132ccc Mandelbrot: Clean up thread handling code.
* Style fixes
 * Delete semaphores in destructor

Change-Id: Ia293d3f4096e2ef1305398356f3e263a8a263d78
Reviewed-on: https://review.haiku-os.org/c/866
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-10 05:27:42 +00:00
Augustin Cavalier
88f01a973f Appearance: Remove FontMenu and MenuView.
Not used and largely untouched since 2005. FontSelectionView
supersedes FontMenu, and MenuView's options were merged elsewhere
(e.g. Alt/Ctrl swapping now lives in Keymap.)
2019-01-09 20:56:07 -05:00
Augustin Cavalier
177db1e47f app_server: Switch default UI font to Noto Sans Display.
Fixes #14779.
2019-01-09 20:35:41 -05:00
Augustin Cavalier
5464abed7e Enable sub-pixel font anti-aliasing by default.
Now that stippi has fixed the FreeType bitmap filter in app_server,
this rendering mode looks much nicer than Grayscale does.

Fixes #13290.
2019-01-09 20:29:47 -05:00
Augustin Cavalier
166dc2bfec Appearance: Remove "sub-pixel anti-aliasing is not enabled" message.
FreeType 2.8+ uses a non-patent-encumbered algorithm for this by default,
and as we have used it for quite a while now, this message is obsolete.
2019-01-09 19:51:24 -05:00
Augustin Cavalier
ec12d1fd3e freebsd_wlan: Add another struct-size hack. 2019-01-09 19:22:51 -05:00
Augustin Cavalier
1d91b37193 build: Fixes to support building in paths with spaces in them.
Now that HAIKU_TOP is a relative path, nearly all paths Jam actually
has to deal with will never contain spaces, so this is now feasible.
Only one issue remains after this commit (namely, setting
HOST_BUILD_COMPATIBILITY_LIB_DIR.)
2019-01-09 19:18:28 -05:00
Augustin Cavalier
4293d6b7da freebsd_wlan: Tweak ioctl-size hacks.
This doesn't seem to fix the wpa_supplicant crashes, though.
2019-01-09 16:30:16 -05:00
Augustin Cavalier
568bb7eeab kernel/thread: Use a rw_spinlock for the sThreadHashLock.
On a dual-core system with no other applications but the standard ones
running, my standard "compile HaikuDepot with hot disk cache" benchmark
shows a consistent ~5% improvement after this patch (~33.7s -> ~31.9s sys).
On systems with higher core and thread counts, these numbers are probably
very much larger (I'd imagine it could be up to even 10 or 15%.)

Change-Id: I5df2a075bae7c71b84c6fcd33ead60df8e844757
Reviewed-on: https://review.haiku-os.org/c/861
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-09 17:55:43 +00:00
Augustin Cavalier
e6bb34532a kernel/thread: Properly implement has_data for non-current threads.
This was left unimplemented since the dawn of Haiku; but it's so rarely
used nobody seems to have noticed. I've taken care to leave it optimized
for the current thread case.

Change-Id: Ib028a37963b2da6d0ca9b4dbd5a5f4a74ecf25b4
Reviewed-on: https://review.haiku-os.org/c/860
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-01-09 17:55:43 +00:00
Murai Takashi
5bfdd10fb6 bus_managers/ps2: Fix PVS 519, 520
Fix 'xDelta' and 'yDelta' are assigned to itself.

Change-Id: I2e1d5fbcf3137086875db2e9590780fc1034f0bc
Reviewed-on: https://review.haiku-os.org/c/864
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
2019-01-09 17:43:14 +00:00
Augustin Cavalier
3af2e73e0b iprowifi4965: GCC2 fix. 2019-01-08 21:19:42 -05:00
Augustin Cavalier
4e5a521c2a iprowifi4965: Upgrade to FreeBSD 12.
Tested on a ThinkPad T61.
2019-01-08 20:54:21 -05:00
Augustin Cavalier
27632129b2 freebsd_network: Implement taskqueue_drain_all.
Required by FreeBSD 12's iprowifi4965.
2019-01-08 20:52:06 -05:00
Augustin Cavalier
0a973154a8 BMenu: Look for ASCII characters < 128, not < 255.
Otherwise we will include ISO 8859-15 (é, à, etc.)
Thanks to PulkoMandy for pointing this out!
2019-01-08 19:50:52 -05:00
Augustin Cavalier
ab3e2cf4bc atheroswifi: Upgrade to FreeBSD 12.
Thanks return0e for testing!
2019-01-08 17:21:31 -05:00
Augustin Cavalier
3001575d60 freebsd_network: Add child drivers directly rather than finding symbols.
This method is much less error-prone than the prior one, as that required
the driver structure to have an exported symbol identical to its "name"
field, a fact that is usually true but not always (we've had an ifdef
in the atheroswifi driver for a while now due to this.)

So when we have it, we now just use the driver_t* directly, which
should push any of these problems from the run-time stage to the
compile-time stage. It's also a significant performance
improvement.
2019-01-08 17:20:50 -05:00
Augustin Cavalier
4947d1a8c7 freebsd_iflib: Return the correct filter result in more interrupt handlers.
Confirmed by tqh to fix #14803.
2019-01-08 15:12:01 -05:00
Augustin Cavalier
7ea987c1b8 kernel: Improvements to "resume" KDL command.
* Print a message when not resuming a thread because it is running.
   When I was using this command while working on ipro1000, I assumed
   that "no news was good news." But it seems that wasn't the case.
   Hopefully future developers will be less confused after this.
 * Allow resuming threads that are in "asleep" or "waiting" states,
   not just in "suspended" state. Presumably a developer poking around
   in KDL knows what they are doing, so allowing them to do this
   seems to make sense.
2019-01-07 23:14:41 -05:00
Augustin Cavalier
2e33d79d38 kernel: Panic on attempting to release a semaphore with interrupts disabled...
... and B_DO_NOT_RESCHEDULE unset. We already have equivalent panics
for mutexes and condition variables, so it seems to make sense to
check for this too.

There have been some bug reports recently about hard deadlocks with
symptoms (i.e. kernel debugger can't even be summoned) that match
"interrupt handler thread was context-switched while holding interrupt
lock," and this is the only major remaining path to that without
such a check.

This would have also helped me with recent FreeBSD driver porting;
I forgot to pass the flag once and deadlocked my system in precisely
this manner.
2019-01-07 22:15:58 -05:00
Augustin Cavalier
a84bb93b44 freebsd_iflib: Return the correct filter result in the interrupt handler.
Should fix #14803.
2019-01-07 21:58:50 -05:00
Augustin Cavalier
cf55254350 freebsd_wlan: Implement ieee80211_{add|get}_toa_params.
Required by the FreeBSD 12 atheroswifi driver.
2019-01-07 21:39:08 -05:00
Augustin Cavalier
2e07eed8ae aironetwifi: Upgrade to FreeBSD 12. 2019-01-07 21:06:36 -05:00
Augustin Cavalier
908c8ced92 idualwifi7260: GCC2 fixes. 2019-01-07 21:05:13 -05:00
Augustin Cavalier
53e3d3f593 freebsd_wlan: GCC2 fixes. 2019-01-07 21:04:59 -05:00
Augustin Cavalier
8842f2a01e freebsd_network: GCC2 fixes. 2019-01-07 21:04:48 -05:00
Augustin Cavalier
ac19c8509b freebsd_network: Fix redefinition warning. 2019-01-07 20:17:53 -05:00
Augustin Cavalier
86734cc40e idualwifi7260: Upgrade to FreeBSD 12.
Tested on a 7265D.
2019-01-07 20:17:53 -05:00
Augustin Cavalier
bf3654699e drivers/wlan: Merge the ratectl change commit from FreeBSD.
This is a relatively minor change that mostly just shuffles structs
around, so presumably it will not break any of these drivers.
2019-01-07 20:17:53 -05:00
Augustin Cavalier
6d0f2b487a freebsd_wlan: Update Haiku-specific code.
Now that we use SYSINIT for the "module" code instead of manually
maintaining lists, we have to make the static library slightly differently.
See inline comment.
2019-01-07 20:17:52 -05:00
Augustin Cavalier
8244a9baad freebsd_wlan: Merge the new net80211 code from FreeBSD 12.
Changes to the Haiku module will come in the next commit.
There are a few Haiku-specific changes in here; most notably some
hacks to prevent struct size changes from breaking wpa_supplicant,
and a removal of the full ieee80211_channel structure from some ioctls
where we previously returned it.
2019-01-07 20:17:52 -05:00
Augustin Cavalier
8e67fd0be0 freebsd_network: Unreserve the PCI device on error or driver removal. 2019-01-07 20:17:52 -05:00
Augustin Cavalier
f733714a6a freebsd_network: Changes for FreeBSD 12 net80211. 2019-01-07 20:17:52 -05:00
Augustin Cavalier
3d4f7f0f60 freebsd_network: Fix MTX_SYSINIT.
net80211 from FreeBSD 12 will use it.
2019-01-07 20:17:51 -05:00
Augustin Cavalier
1f7634a08c freebsd_network: Cleanup and some fixes to SYSINIT implementation.
Fixes a kernel panic on uninit_sysinit. Whoops.
2019-01-07 20:17:51 -05:00
Augustin Cavalier
67c3dfef8e freebsd_network: Fix license header in linker_set.h.
This file is a near-direct copy from FreeBSD; dunno how it wound up with
a Haiku license header.
2019-01-07 20:17:51 -05:00
Augustin Cavalier
753c7e0805 freebsd11_wlan -> freebsd_wlan.
FreeBSD 12's net80211 layer contains only 2 small KPI breaks from FreeBSD 11,
so we can upgrade it, apply those 2 changes to the drivers which are affected
(as the changes are in some lesser-used functions), and then upgrade all drivers
one at a time.
2019-01-07 20:17:51 -05:00
Murai Takashi
808cc3cd50 mail: Fix PVS 962
* Remove cast to void* in AddItem() at line 775, so that
avoid that the object which was created using 'new' operator
is immediately cast to another type.

Change-Id: I0722661611d0393896c1aac161a702a4c2f1d5d8
Reviewed-on: https://review.haiku-os.org/c/857
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2019-01-07 12:24:24 +00:00
Murai Takashi
27a59a2fa4 cortex: Fix PVS 1206
* Remove cast to void* in AddItem() at line 363, so that
avoid that the object which was created using 'new' operator
is immediately cast to another type.
* Also remove other casts in AddItem().

Change-Id: Ia20ab39ef50dce12b9d06ca5b1736a8a8e3e9cdd
Reviewed-on: https://review.haiku-os.org/c/856
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2019-01-07 12:23:48 +00:00
JackBurton79
ae09eb30c5 FlattenPictureTest: aestethic changes.
Add a header with the columns description. Style fixes

Change-Id: I14b66dd1c9cfff13ad8ba3ff1907dcb0696593f8
2019-01-06 22:26:04 +01:00
Stephan Aßmus
54333f5172 Don't do LCD subpixel filtering twice
The currently included version of libfreetype already has the LCD
subpixel filter turned on by default. With the switch from my
"averaging filter" back to Adrej Spielmann's filtering, there was now
another filtering being done on top of what Freetype already does.
There also seemed to be a problem with the left edge of cached
glyph bitmaps, which I didn't bother to look into. The visual result
of this change is that text looks much crisper, and the display
bugs at touching glyphs is gone.

On the other hand, LCD sub-pixel rendering is still turned on
globally, i.e. for all vector drawing, and for uncached rotated
text. The Freetype filtering is not applied there. This problem did
not exist in my "average filter", since it happened at the scanline
rendering level, not only for cached glyph bitmaps. It is however
not a regression introduced by this commit. It needs to be fixed
separately.

Change-Id: If93c2b85ed479670e6679227984fd8d9f77c11f6
Reviewed-on: https://review.haiku-os.org/c/855
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-06 18:43:49 +00:00
Stephan Aßmus
954a0a0c33 Fix some cases of updating draw state while recording a BPicture
* Also implemented recording DrawString(string, length,
   BPoint[] locations), which was previously not recorded at all.
 * Also implemented playing back recently added drawing commands
   in PicturePlayer.cpp. I don't quite understand what this is
   actually used for, but it seemed it was forgotten. I just followed
   the pattern already established in the code.
 * The other important bit in this change is to update the pen
   location when it is needed while recording a BPicture. Often
   the BView will use PenLocation() in order to transmit drawing
   commands to the app_server which use absolute coordinates only.
   This isn't actually so nice, since it means the client has to
   wait for the server to transmit the current pen location. If there
   were dedicated link-commands for pen-relative drawing commands,
   the client could just keep sending without waiting for the server.
   In any case, the app_server needs to update the pen location in
   the current DrawState and even the DrawingEngine even while
   recording a picture, because some next command may need up-2-date
   state information, such as the font state and the pen location.
 * I have not yet tried to find /all/ instances where the DrawState
   needs to be updated while recording. This change should repair
   /all/ font state changes, all versions of drawing a string, and
   all versions of StrokeLine().

Change-Id: Ia0f23e7b1cd058f70f76a5849acb2d02e0f0da09
Reviewed-on: https://review.haiku-os.org/c/817
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-06 00:06:56 +00:00
François Revol
b98f12a601 freebsd_network: use proper BAR size in bus_alloc_mem_resource
This time we use the pci_info directly, it avoids a possible race with
PCI config regs, and we already have the value there anyway.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
One crucial fix by me: check if size == 0. This avoids the deadlock
seen in #14795.
2019-01-05 14:45:54 -05:00
Augustin Cavalier
a29a8f98ed drivers/network: Mark all FreeBSD ethernet drivers as upgraded to 12. 2019-01-04 21:16:00 -05:00
Augustin Cavalier
eababbb4cf drivers/network: Upgrade sis900, syskonnect, via_rhine, vt612x to FreeBSD 12.
No real functional change.
2019-01-04 21:15:15 -05:00
Augustin Cavalier
6d2ae71f16 drivers/network: Upgrade rtl8139, rtl81xx to FreeBSD 12.
Includes some logic fixes to Haiku-specific code in the MII drivers,
and one new chipset supported by the rtl81xx MII driver. Otherwise,
no major functional change.
2019-01-04 21:13:33 -05:00
Augustin Cavalier
2b5a056e03 drivers/network: Upgrade jmicron2x0, marvell_yukon, nforce, pcnet, rdc to FreeBSD 12.
No real functional change in these.
2019-01-04 21:12:24 -05:00
Augustin Cavalier
2afe8644cf freebsd_network: Restore the hard-coded 128KB physical map size.
mmu_man changed this to be dynamically computed based on the BAR size.
It seems his computation was somehow incorrect, as it tries to allocate
a very large region here which deadlocks in the physical memory mapper.
Restoring this to 128KB un-breaks the new ipro1000 driver on more
recent hardware.

"Fixes" #14795.
2019-01-04 18:07:11 -05:00
Augustin Cavalier
a381a48f86 ipro1000: Always use DELAY() for microsecond pauses (on Haiku.)
pause() has granularity of "hz", which on FreeBSD and in our compat layer
is defined to be 1000 (so, 1ms.) As "safe_pause_us" is used copoiously
throughout startup code, this meant that (1) startup takes 100-1000x longer
than it needed to (this driver seems to most commonly delay for 10us),
and (2) this could in theory block the boot for multiple minutes if one
got particularly unlucky with the scheduler.

Probably helps with or even outright fixes #14795.
2019-01-04 17:06:22 -05:00
Augustin Cavalier
046ae71e48 EFI: Handle "Escape" scancode properly.
This should fix the Escape key being non-functional in the EFI loader
menus, which is pretty annoying when one is drilling through lots of
menus to blacklist files...
2019-01-04 16:52:42 -05:00
Rob Gill
6086986d30 kernel/x86: additional msr and cpuid items
Adds SSBD and L1TF related items

Change-Id: Iccea2bb9e057e0d011a18609212f175f9b5e678d
Reviewed-on: https://review.haiku-os.org/825
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2019-01-04 19:06:05 +00:00
Rob Gill
3987287dc6 bin/sysinfo: bugfix & update
Fixed bug where incorrect value of ECX passed when determining L2 cache

Updated cache/TLB identification
Updated CPU flags

Change-Id: I086f8bf7f86cba0d65e45450c74ec6e11e6bec2e
Reviewed-on: https://review.haiku-os.org/824
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2019-01-04 19:05:49 +00:00
Augustin Cavalier
189ed5d806 freebsd_iflib: Get the thread_id from the thread* indirectly.
This is needed on 64-bit.
2019-01-03 23:43:20 -05:00
Augustin Cavalier
3a031789fe freebsd_network: Add a missed method ID.
Some less-used drivers (e.g. marvell_yukon) need this.
2019-01-03 21:20:37 -05:00
Augustin Cavalier
8084e7c566 freebsd_network: Add cast so mbuf.h can be included as C++.
It is, as ieee80211_haiku is a C++ file.
2019-01-03 21:20:36 -05:00
Augustin Cavalier
67a0cb89e6 ipro1000: Upgrade to FreeBSD 12.
Thanks to AGMS for helping test on real hardware!
2019-01-03 21:20:36 -05:00
Augustin Cavalier
db4f8332f0 freebsd_network: Reinstate _fbsd_init_hardware and refactor probing.
Previously we just probed and then immediately attached if any devices
were found, after all initialization was done. Now we cannot do that,
as after calling SYSINIT() on certain drivers (e.g. the new ipro1000
driver), certain threads will be created that there is no good way
of tearing down.

Fortunately, it is valid to call probe() on a device before SYSINIT()
(and most other things) have been initialized, and so now we do that
in init_hardware, and then init_driver is called only if we've found
devices we support.

While we're at it, also call pci->reserve_device, which will mark us as
the driver handling said device and prevent other drivers from
using it.
2019-01-03 21:20:36 -05:00
Augustin Cavalier
83c8026372 freebsd_iflib: Import.
This is the iflib from FreeBSD 12.0 with a few select patches from
FreeBSD trunk applied (and a lot of #ifdef __HAIKU__s, as you can see.)

There are certain things it adds to SYSINIT that can't be un-initialized
(like the grouptaskqueues), and so rather than adding this to every
driver unnecessarily, a separate .a for it makes the most sense.
2019-01-03 21:20:36 -05:00
Augustin Cavalier
fd41233b07 freebsd_iflib: Import compatibility files.
These are the portions of "freebsd_iflib.a" that I've written and
do not come from FreeBSD. As the import of iflib itself will be
quite large, having a separate commit for these made sense.
2019-01-03 21:20:35 -05:00
Augustin Cavalier
81acff62c6 freebsd_network: Handle published conditions with timeout 0.
Previously, since we passed B_RELATIVE_TIMEOUT unconditionally,
a timeout of 0 would mean that it would return as soon as there was
CPU time available (so, usually, instantly.) This usually was not
a "problem" in that it caused broken behavior, but it would result
in exceptionally high CPU usage.

At first I implemented this correctly (i.e. a timeout of 0 will block
until explicitly woken up) but then discovered that our implementation
of these functions creates subtle race conditions compared to their
FreeBSD counterparts, and so to avoid deadlocks, a timeout of 1 second
is imposed. For situations where there are deadlocks due to race
conditions, this will make them painfully obvious (e.g. all network
transfers stalling for a second every 2-3 seconds or so.)
2019-01-03 21:20:35 -05:00
Augustin Cavalier
a029a69c55 freebsd_network: Properly align mbuf members. 2019-01-03 21:20:35 -05:00
Augustin Cavalier
6ef670c379 freebsd_network: Consolidate and unify SMP-related definitions.
Previously I implemented "curcpu" as ipro1000 used it, independent
of all the other SMP functions, as an optimization. Now, iflib
wants to use these functions all together, so they have to produce
consistent results.
2019-01-03 21:20:35 -05:00
Augustin Cavalier
8582775421 freebsd_network: Implement m_cljget without mbuf.
This returns an ext_buf that can be attached to an mbuf later,
which is something iflib does.
2019-01-03 21:20:34 -05:00
Augustin Cavalier
a9116ea8db freebsd_network: Add an "id" field to struct device_method.
"const char* name" is alright for the compat layer's needs to
identify functions, as we only scan the method table once and
copy the function pointers to a struct of function pointers.

iflib doesn't use a function pointer struct, though, and expects
to have the KOBJ system for function lookups, and that depends
on integer-based method IDs for fast lookups. So now every
method gets an integer ID as well as a name (and iflib's method
IDs are in the list of method IDs already.)
2019-01-03 21:20:34 -05:00
Augustin Cavalier
c25e20c5f9 freebsd_network: Add device_register hook as a recognized hook.
iflib-based drivers use it.
2019-01-03 21:20:34 -05:00
Augustin Cavalier
da60a673b6 freebsd_network: Implement SYSINIT.
Based on the already-existing linkersets framework, which seems to
work pretty well for the atheroswifi driver, so it should work for
this case also.
2019-01-03 21:20:34 -05:00
Augustin Cavalier
8267c19341 freebsd_network: Lots of additions and modifications for iflib. 2019-01-03 21:20:34 -05:00
Augustin Cavalier
88c3c4fa49 freebsd11_wlan: Disable sysinits.
These are currently no-ops; but soon enough they won't be...
2019-01-03 21:20:33 -05:00
Augustin Cavalier
92d70a24ca freebsd_network: Fix and implement some mbuf functions.
Spotted while reviewing the code during iflib porting.
2019-01-03 21:20:33 -05:00
JackBurton79
fe55edcaf4 Terminal: Font width can be a fractional value, so we need to use a float.
Adapt other code accordingly. Minimum changes to fix ticket #11478
In theory also font height could be fractional, so we might need to
review other parts of the code.

Change-Id: Idbdbe38193ca5a32b3d09c7cf9accfc917760cae
Reviewed-on: https://review.haiku-os.org/821
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-01-03 21:27:27 +00:00
Stephan Aßmus
f8550e541b Added two DrawStringDry() versions for obtaining pen location only
When recording into a BPicture (ServerPicture, actually), one cannot
simply record the commands only, when the drawing itself would modify
state. This affects all drawing commands that change the pen location.
Therefore it is necessary to have a way to "dry-run" drawing a string
in order to know the pen location that would result. This is what
these two new methods help achieve.

Change-Id: Ic399a5513f18c12c16c0ab10a55e768c1b30e4e0
Reviewed-on: https://review.haiku-os.org/816
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-01-03 18:19:02 +00:00
Michael Lotz
6990ae7b84 Installer: Fix use-after-free of target directory name.
When CopyEngine::_CopyFolder() would recursively call itself, the
fCurrentTargetFolder would be set to the entry name of that directory.
When this returned, this was never reset to the parent directory name
and would eventually use a freed string when the BEntry was reused
for the next entry.
2019-01-03 14:08:59 +01:00
Stephan Aßmus
f10faf61ac Change DrawString() and add StrokeLine() to reveal wrong pen-position
Change-Id: Iec584657741f2bb682bff557dcd3b733a9166c7c
Reviewed-on: https://review.haiku-os.org/815
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-02 21:21:52 +00:00
Stephan Aßmus
1876ba00cd DrawState: Return mask from ReadFontFromLink()
When changing the font state, a uin16 mask at the beginning of the
commands encodes which font parameters are transmitted in the link
data. Return this mask, so that one can know what parameters have
changed in the DrawState's ServerFont.

Change-Id: I52a9a665aac8eb0e6505193eba32c4b137846c78
Reviewed-on: https://review.haiku-os.org/814
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-02 21:21:52 +00:00
Michael Lotz
ddb1ff5587 kernel/x86_64: Fix overwriting the GDT/IDT by each CPU.
The constructor calls for GlobalDescriptorTable and
InterruptDescriptorTable were run on each CPU, each time clearing out
any changes already done on other CPUs.

For the IDT this didn't matter as the result would always be the same.
In case of the GDT the result would surprisingly be mostly hidden. The
used GDT entries are for the double fault stacks (which is rarely hit),
the user TLS (which will only be used in compat mode) and the TSS which
is immediately cached in the task register.

The clearing of the GDT allowed for a tiny window of time between
setting up the entry for the TSS and it actually being loaded (and
cached) in the task register. When this happened, the load of the TR
caused a not present fault, which at this point leads to a tripple
fault and reset due to no fault handlers being installed yet.

Fixes #14659.

Change-Id: I6e5c00d412ab17c3ef05740ba71228e6ca266c1e
Reviewed-on: https://review.haiku-os.org/810
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-01-02 16:27:53 +00:00
Michael Lotz
22ca923f71 kernel/x86_64: Fix descriptor index off-by-one in assert.
This was apparently copied from GlobalDescriptorTable::SetTSS() which
needs two table entries and therefore checks for index + 1. For the
SetUserTLS case this isn't needed and would cause aborts when reaching
the maximum CPU count (64 currently).

Change-Id: I27bd777fedadbd3740ac8c791199ec9300b06327
Reviewed-on: https://review.haiku-os.org/809
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-02 00:22:14 +00:00
Michael Lotz
44a1cfb8d8 kernel/x86: Reimplement locking for early boot message output.
The normal locking uses spinlocks that require getting at the current
CPU, which in turn needs a current thread set. This has not been set up
at this point and would simply cause tripple faults.

Use manual locking using atomic ops instead.

Change-Id: Ica894389330ef481eec84b667234139746ac4a46
Reviewed-on: https://review.haiku-os.org/808
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-02 00:22:14 +00:00
Adrien Destugues
d52d36aa5d open: don't print "invalid argument" when opening an URL.
Reset the error code.

Change-Id: I5b58c3082f5758d4cbca8c9706048e3414f939c9
Reviewed-on: https://review.haiku-os.org/807
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-01-01 17:48:29 +00:00
Humdinger
b02e6250e9 Mail: fix layout when resending
When resending a mail, don't put the To-field in the second column
after the From-field as it's done for incoming mail. To- and From-field
are the same layout as for creating a new mail.

Use the member fResending instead of the parameter "resending" the
THeaderView was called with.

Initialize fCcControl in ctor.
2018-12-30 10:39:33 +01:00
Michael Lotz
02f41b1a74 app_server: Cleanup argument checks to use boolean expressions. 2018-12-29 00:52:05 +01:00
Michael Lotz
3752309050 app_server: Cleanup error check logic to be more consistent.
Some of these only returned generic errors.
2018-12-29 00:52:05 +01:00
Michael Lotz
8071db3259 app_server: Add char limit to GlyphLayoutEngine::LayoutGlyphs().
Many of the consumers fill in data into preallocated arrays. Some of
them already ignored values past the array size manually, some didn't.

Add a maxChar argument and set it from the incoming array sizes for
the various consumer cases.
2018-12-29 00:52:05 +01:00
Michael Lotz
64a11edb02 app_server: Make more use of BStackOrHeapArray.
Variable length arrays on the stack are always risky when the length
is indeterminate as they can easily overflow the stack. Replace their
use by BStackOrHeapArray, fixes #6354.

Also replace most other dynamic allocations by BStackOrHeapArray as
it is more convenient and may avoid unnecessary dynamic allocations.

Add allocation checks and early returns to all places while at it.
2018-12-29 00:52:05 +01:00
Michael Lotz
22ce55254f app_server: Fix invalid cast of int32 to size_t array.
Make ServerFont::GetBoundingBoxesForStrings() use size_t.
2018-12-29 00:52:05 +01:00
Michael Lotz
9dad3fb4b0 app_server: Style and comment cleanup, no functional change. 2018-12-29 00:52:05 +01:00
Barrett17
e7933432e9 BCodecRoster: Remove MakeFormatFor
* I want to introduce a new way for plugins to
register for a format. Supporting the old FormatManager is
too painful at this point and not worth the effort.
2018-12-28 23:01:02 +01:00
Barrett17
fa911df6e6 Move FormatManager back to the media_kit
* We don't aim to replicate this functionality. I don't
think this will be useful at all in future iterations.
Originally I planned to rewrite it on top of the new
BMediaFormat, but now I am of the hopinion this is
greatly unneeded.
2018-12-28 22:55:25 +01:00
Barrett17
49a4b18141 media_server: Clean unused gFormatManager object 2018-12-28 22:24:07 +01:00
Barrett17
f3e317617f Move GetNextEncoder implementations to BCodecRoster 2018-12-28 22:24:07 +01:00
Augustin Cavalier
0c3e5b9745 ipro100: Upgrade to FreeBSD 12. 2018-12-27 16:55:48 -05:00
Augustin Cavalier
522d143920 emulex_oce: Upgrade to FreeBSD 12. 2018-12-27 16:55:35 -05:00
Augustin Cavalier
2aaa3af64d dec21xxx: Upgrade to FreeBSD 12. 2018-12-27 16:55:23 -05:00
Augustin Cavalier
25531c5613 broadcom570x: Upgrade to FreeBSD 12; fix logic inversion in Haiku code.
See inline comment in brgphy.c.
2018-12-27 16:54:24 -05:00
Augustin Cavalier
65124582dc broadcom440x: Upgrade to FreeBSD 12. 2018-12-27 16:54:15 -05:00
Augustin Cavalier
3bfc859a38 attansic: Upgrade to FreeBSD 12. 2018-12-27 16:53:47 -05:00
Augustin Cavalier
ca813faa3c atheros813x: Upgrade to FreeBSD 12. 2018-12-27 16:53:24 -05:00
Augustin Cavalier
b240ae40df ar81xx: Upgrade to FreeBSD 12. 2018-12-27 16:53:15 -05:00
Augustin Cavalier
71f1250df5 3com: Upgrade to FreeBSD 12. 2018-12-27 16:52:27 -05:00
Augustin Cavalier
d5b99ecde7 freebsd_network: Some small additions for FreeBSD 12 drivers. 2018-12-27 16:51:48 -05:00
Augustin Cavalier
125df15288 drivers/vlance: Remove.
Never included in the build, and entirely superseded by the "pcnet"
driver from FreeBSD.
2018-12-27 14:15:30 -05:00
Augustin Cavalier
3592a2eba4 vt612x: Clean up Jamfiles. 2018-12-27 14:14:45 -05:00
Augustin Cavalier
9b7ef99599 syskonnect: Clean up Jamfiles. 2018-12-27 14:14:45 -05:00
Augustin Cavalier
34b46b4548 rtl8139: Clean up Jamfiles. 2018-12-27 14:14:45 -05:00
Augustin Cavalier
72d64e3cb1 rtl81xx: Clean up Jamfiles. 2018-12-27 14:14:44 -05:00
Augustin Cavalier
df1dd1f8a8 rdc: Clean up Jamfiles. 2018-12-27 14:14:44 -05:00
Augustin Cavalier
cb5334b37b pcnet: Clean up Jamfiles. 2018-12-27 14:14:44 -05:00
Augustin Cavalier
148d1b2c69 nforce: Clean up Jamfiles. 2018-12-27 14:14:44 -05:00
Augustin Cavalier
3fcac9ac04 marvell_yukon: Clean up Jamfiles. 2018-12-27 14:14:43 -05:00
Barrett17
e0a0f13051 ffmpeg: Use unsigned integers for chapter data 2018-12-27 12:26:45 +01:00
Barrett17
e98351d3bc MetaData: Revert types to uint32 and define framerate as float
* Adds some missing methods signatures.
* integer vs float framerate is a longstanging debate. In theory,
in digital a/v there should not be need for floating point framerates.
This is because unless the software is run on exoteric hardware, there
is not need for it. Unfortunately, some legacy from the past like the
29.7 hz debate (NTSC) still may need to work under floating point framerates.
Even if in pratice it'd be run at 30 hz anyway.
* In theory, to handle all those correctly we should use a rational framerate,
however most code should be rewritten to support that correctly, and
it'd add some excessive complexities.
* All integer types are reverted back to unsigned ones. There's really
no reason to use signed integers there, and more importantly the danger
for integer underflows and the attached security concerns is very big.
2018-12-27 12:26:45 +01:00
Barrett17
ec75b9fc8e MetaData: Add missing keys 2018-12-27 12:26:44 +01:00
Michael Lotz
13beda00d3 kernel: Fix race condition when waiting for load of new team.
There was no synchronization of the check of the done flag and the
waiting thread suspending to wait for it. It was therefore possible that
the new team both set the flag and triggered the wakeup of the waiting
thread in that time window, causing it to miss both the set flag and the
thread resumption.

Use a condition variable instead.

Fixes #13081.

Change-Id: I93c45db8dd773fe42b45c4b67153bcd39e200d3b
Reviewed-on: https://review.haiku-os.org/803
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-26 23:48:41 +00:00
Augustin Cavalier
b5ccfd350d ntfs: Actually return errors from fs_mount.
This should fix the "mount succeeded but ops is NULL!" panic that
occurs on auto-mounting read-only NTFS disks on boot.
2018-12-26 17:30:28 -05:00
Augustin Cavalier
3b5e6232de libroot: Fix GCC2 build. 2018-12-25 18:34:18 -05:00
Michael Lotz
e4103b1b92 libroot: Introduce thread specific heap init/exit hooks.
This allows heap implementations to initialize and clean up any thread
specific structures. The current default hoard heap does not use these.

Note that the thread exit hook will not be called for the main thread as
the heap may be needed during process termination (__cxa_finalize for
example).

Change-Id: I703fbd34dec0d9029d619a2125c5b19d8c1933aa
Reviewed-on: https://review.haiku-os.org/799
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-25 23:00:20 +00:00
Rajagopalan-Gangadharan
20e0f7607c WebPositive: Add default download folder location option.
Change-Id: I76e90646c5e7d9a4082cd1c237047c0eda16b9e6
Reviewed-on: https://review.haiku-os.org/786
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-25 18:48:14 +00:00
Humdinger
0ca55d11eb x-mail MIME: make Subject attribute editable
Fixes #2832

For details, please check the comments to ticket #2832.
In short: while not needed normally, it'd be nice to be able to edit
the subject attribute, for example when the sender accidentally forgot
to enter a subject or made an especially awkward typo that would spoil
querying for it.

Also: sentence casing the attribute name to "Reply to".
Change-Id: I41e0ebade25d550d0cb260c0dfebd4b9c1c8b34c
Reviewed-on: https://review.haiku-os.org/793
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-25 18:47:17 +00:00
Murai Takashi
ab6bcb08bc Roster: Fix PVS 456-459
Remove unneed if condition, since 'error' is initialized to B_OK.

Change-Id: I2fd0edb99a3d055beafaf15f1140071a31140892
Reviewed-on: https://review.haiku-os.org/798
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-12-25 17:49:46 +00:00
Murai Takashi
09a5380d0c CharacterSetRoster: Fix PVS 528-530
Remove unneed if conditions, since unsigned type value is never < 0.

Change-Id: I76621f79883752cd3560c6e02f18384b1ddd9cf3
Reviewed-on: https://review.haiku-os.org/797
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-12-25 17:49:36 +00:00
Murai Takashi
12dba4e70f poorman: Fix PVS 922
Remove unneed appending a null character, since inet_ntop() adds null to 'addr'.

Change-Id: I21f5be7f737badd388f36a6dcf56a3b446b5d91c
Reviewed-on: https://review.haiku-os.org/795
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-12-25 17:49:30 +00:00
Murai Takashi
26c68df839 MediaDefs.cpp: Fix PVS 593
Remove unneed if condition, since 'size_t size' is unsigned.

Change-Id: I283afe6c1c24713b8efa21bd70747293fbc61899
Reviewed-on: https://review.haiku-os.org/796
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-12-25 12:36:42 +00:00
Barrett17
3d26587adf Media plugins are not BeOSCompatible anymore 2018-12-25 11:29:50 +01:00
Barrett17
ba5c9689e1 Remove old deprecated plugins from addons/media/plugins 2018-12-25 11:29:01 +01:00
Augustin Cavalier
179e86d1db ipro100: Clean up Jamfiles. 2018-12-24 21:10:08 -05:00
Augustin Cavalier
9c8a78130b broadcom570x: Clean up Jamfiles. 2018-12-24 21:06:41 -05:00
Augustin Cavalier
7f601aefb4 broadcom440x: Clean up Jamfiles. 2018-12-24 21:06:28 -05:00
Augustin Cavalier
c6759927e3 attansic_l2: Clean up Jamfiles. 2018-12-24 20:06:37 -05:00
Augustin Cavalier
48ce31d137 attansic_l1: Clean up Jamfiles. 2018-12-24 20:06:24 -05:00
Augustin Cavalier
e153b204d9 atheros813x: Clean up Jamfiles. 2018-12-24 20:01:34 -05:00
Augustin Cavalier
24c8f452c0 ar81xx: Clean up Jamfiles. 2018-12-24 19:57:59 -05:00
Augustin Cavalier
31888b8cd8 net_server: Do not add the FreeBSD compat headers to the include path.
This was already done for libbnetapi and ifconfig, but apparently
net_server was missed.
2018-12-24 19:52:33 -05:00
Augustin Cavalier
dba28784c2 freebsd11_network -> freebsd_network.
FreeBSD 12 has no major changes to the ifnet KPIs that constitute a
source compatibility break, save a single one related to locking
which doesn't really apply to us, and so we don't need to create
a "freebsd12_network" directory to work through the upgrades.
2018-12-24 19:49:35 -05:00
Humdinger
16e5086044 Keymap: remove item from user list, if the keymap isn't found
Fixes #4022.

When a user keymap was deleted in Tracker while the Keympas prefs
are open, the map is still visible in the list of user maps. It
just doesn't react on a click.

With this change, we just silently remove the item from the user map
list when it's clicked. Not totally nice (should I add a BAlert?),
but the suggested node monitoring for this seldomly encountered
situation is overkill, I think.

Change-Id: I5ea6dd2aa117f30a7be348a005a10f3757d52459
Reviewed-on: https://review.haiku-os.org/794
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-23 18:10:02 +00:00
Humdinger
54782f4255 Mail: fixing unicode for szlig;
The unicode for szlig ("ß") when filtering HTML tags was wrong, showing
"ö" instead. Discovered by miqlas, pin-pointed by PulkoMandy.
2018-12-23 10:57:13 +01:00
Augustin Cavalier
52a022f201 BMenu: Accept any alphanumeric ASCII character on the first trigger pass.
Since we use sentence-cased menus, there is probably only one capital
letter in the line, so looking for only capitals won't be very useful.
Instead, accept any ASCII character (< 255) which is alphanumeric,
as these are more likely to be command-able in any given keymap.

(IsAlNum returns true for accented Latin characters also, which may
be un-command-able if they require dead keys to type.)
2018-12-22 00:36:30 -05:00
Adrien Destugues
588a0c9f67 BMenu: Use BUnicodeChar for unicode char manipulation.
It is not allowed to use isspace, tolower, etc, on character outside of
the char type range (and EOF). Use BUnicodeChar instead to avoid out of
bound accesses.

Fixes the second crash in #14753.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Some changes by me to make "index" a byte instead of character index
as it needs to be.
2018-12-22 00:25:10 -05:00
Augustin Cavalier
c1917899cd drivers/network: Remove dp83815.
Never included in the build, and superseded by the sis900 driver from FreeBSD.
2018-12-21 14:26:24 -05:00
Augustin Cavalier
2dd61eb019 sis900: Import from FreeBSD 11.2.
This replaces the old Haiku-native driver that was removed in the last commit.
It should support all the same chips that one did, in addition to the SiS 7014,
and the DP83815 also.

I don't have this hardware, so for anyone who does, please test.

Fixes #1657.
2018-12-21 14:22:32 -05:00
Augustin Cavalier
57910e89b8 freebsd11_network: Update miidevs. 2018-12-21 14:09:31 -05:00
Augustin Cavalier
c09ed858e0 drivers/network: Remove the old sis900 driver.
As axeld said 8 years ago in #1657, it can be replaced with
FreeBSD's sis driver.
2018-12-21 13:47:27 -05:00
Augustin Cavalier
a380bb0236 drivers/rtl8169: Remove.
Has not been included in the image for a long time; all the devices
it supported are handled by the "rtl81xx" FreeBSD driver.
2018-12-21 13:16:13 -05:00
Augustin Cavalier
1ac98e3ab4 BWindow: Prevent CenterIn from moving the decorator bar offscreen.
The MoveTo() call is not restricted in any way; it can easily move the
window's titlebar offscreen, which is very confusing for users as if
they don't remember the window manipulation keyboard shortcuts,
dealing with such windows is often very tricky (or impossible
if the window is actually larger than the screen.)

Now we also call MoveOnScreen with DO_NOT_RESIZE and
MOVE_IF_PARTIALLY_OFFSCREEN set, which will simply get the size of
the decorator bar and then ensure it is entirely on-screen.

Fixes #11763.
2018-12-21 12:37:10 -05:00
Augustin Cavalier
5e54f6d4f9 tests/kits/net: Move libnetwork-related tests to tests/system/network. 2018-12-21 12:26:38 -05:00
Murai Takashi
8a8e01bf41 strfmon.c: Fix -Wpointer-compare
Fix comparison between pointer and zero character constant.
Pointed out by gcc7.

See also: 3d4c1b73b9

Change-Id: I917ceefce69e269fbaa12a3ae60f0702f5c5d4a7
Reviewed-on: https://review.haiku-os.org/782
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-21 17:10:24 +00:00
Murai Takashi
be27cf7649 accelerants/common: Fix PVS 1116, 1117
Fix there are two 'if' statements with identical conditional expressions.

Change-Id: I3396d4e34b70dd293957a892cd603033d6664699
Reviewed-on: https://review.haiku-os.org/789
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-21 17:09:42 +00:00
Axel Dörfler
949a1ff7cc net_server: Documented suggested interface behavior
* Also simplified updating the interface message with SetString().

Change-Id: I29635cba5ddde693f6b7b97b8bd01769b02919d5
Reviewed-on: https://review.haiku-os.org/788
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-21 08:30:25 +00:00
Axel Dörfler
a0efb75a5c net_server: Configure devices not found in settings
* Previously, the assumption was that your settings would configure
  all devices.
* Now, all devices that are not covered by the "interfaces" settings
  file will be automatically configured.
* This fixes ticket #6423.

Change-Id: Ib1e0c70314dc27cde14a00601fc8045d32937dfd
Reviewed-on: https://review.haiku-os.org/787
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-12-21 08:29:04 +00:00
Murai Takashi
cdb7e8177d media-add-ons/multi_audio: Remove unneed menset()
Remove unneed menset(), since media_format already use memset()
in its constructor.
Also fixes -Werror=class-memaccess pointed out by gcc8.

Change-Id: I3283417323550492799a34a2d29cdad03a82a2d5
Reviewed-on: https://review.haiku-os.org/783
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-20 09:00:31 +00:00
Augustin Cavalier
a62458c79c runtime_loader: Export the correct reinit_after_fork.
Forgot to add this change in my last commit. Whoops.
2018-12-19 21:43:11 -05:00
Fredrik Holmqvist
08c9948c20 Upgrade ACPICA to 20181213: a lot of bug-fixes 2018-12-19 21:19:25 +01:00
Axel Dörfler
339eef5131 Revert "net_server: Add (more) missing devices even if one has already been found."
This reverts commit def61273ed.

This isn't a fix for the issue, it will just throw away all settings.

Change-Id: I2979c02c54f9379f25dc5d41d3a6085c09e87ac3
Reviewed-on: https://review.haiku-os.org/785
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2018-12-19 12:35:15 +00:00
Augustin Cavalier
3256001041 runtime_loader: Reinit the heap lock after fork. 2018-12-18 18:01:09 -05:00
Murai Takashi
296120e005 MediaPlayer: Fix -Werror=format-truncation=
Increase size of text[], since snprintf() write to it max 66 bytes.
(sizeof(positionText)-1 + sizeof(" / ") + sizeof(durationText)-1 + 1 = 66)
Pointed out by gcc8.

Change-Id: Ic6ce221edb4ceff4b63c7b30d26c52d613cbb35e
Reviewed-on: https://review.haiku-os.org/779
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-18 18:37:14 +00:00
Humdinger
947124d152 Mail: Add queries for same subject, sender, recipient
In the "Queries" menu, add three items at the top to start a query
for the same recipient/sender/subject as the current email. Move the
separator and "Edit queries..." item to the bottom of the menu.

The temporarily created queries are put into B_USER_CACHE_DIRECTORY/Mail/.
The data in those queries might be private, therefore not in system /tmp.

The queries use the DefaultQueryTemplates for x-email, if that exists. This
is done by copying all the template's attributes. Code for that borrowed from
'copyattr'.

When creating a query for the same subject, use the MAIL:thread text for
the search, as that doesn't contain stuff like "Re: Re: Fwd: Re...". Do
the query for MAIL:subject though, because sent emails don't have a
MAIL:thread attribute.

Change-Id: I23b46f3ec07760d17b076d8b8aa8839c5f88963f
Reviewed-on: https://review.haiku-os.org/768
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-12-18 05:45:13 +00:00
Augustin Cavalier
5e621d3edd tests/posix: Add tls_concurrency_test.
From #14342. Crashed before the last commit, now works. Disabled because
it won't build under GCC2.
2018-12-17 20:09:27 -05:00
Augustin Cavalier
df3de4792e runtime_loader: Make the heap thread-safe.
Previously we didn't need to care about threading in here, as it
was used only up to the point where the application's _start was called
and then libroot's heap would take over. But with the introduction of TLS
support by pdziepak in 2014, we also handle TLS bookkeeping inside
runtime_loader, and so this heap needs to be thread-safe.

Properly fixes the JVM crashes korli was attempting to fix in hrev52658,
and fixes #13154, #14129, #14304, #14342 for real.
2018-12-17 20:03:47 -05:00
Augustin Cavalier
e7d37c7e08 Revert "runtime_loader: Add missing locking around resizing the TLS DTV."
This reverts commit d0111efead.

Initially, I, too thought this was the correct solution. In
investigating the related #14342, I found that adding a lock of
the mutex in the function that crashed most often in (DestroyAll())
increased the time it took to cause a crash from 1-2 seconds
to 10-15 seconds, but it still inevitably crashed.

Further, crash addresses were often very low (e.g. 0x1, 0x18); on
inspection I determined these were coming from the fPointer fields
of TLSBlocks. But accesses to TLSBlocks were now well protected
by the TLS mutex, and they were memset'd after allocation, so that
didn't make any sense.

At that point, I went back and read over the code until I understood
it, and it became clear this solution was incorrect: TLSBlocks and
their underlying data are always associated with a specific thread,
meaning _Resize() and DestroyAll() would never be called on the same
data from different threads, despite appearances to the contrary.

Thus despite a dearth of comments in this file, it seems pdziepak
knew what he was doing when he wrote this; no locking is needed.
That left only one place to cause this kind of memory corruption...
2018-12-17 19:52:49 -05:00
Danc2
def61273ed net_server: Add (more) missing devices even if one has already been found.
Fixes #6423 and helps with #14626.

In BringUpInterfaces, line 772 creates an error which only adds a missing
interface if one does not already exist (i.e., !_testInterface()). This can lead to
a missing WiFi interface if an Ethernet connection has been configured and set in
the /boot/system/settings/network/interfaces before the WiFi has had a chance to
be added to /dev/net. To properly configure a missing device, such as a WiFi
connection, and allow the user to choose amongst configured interfaces (i.e.,
add it to the list of devices in /dev/net and e.g., see WiFi as an option),
removing the 'if' statement on line 772 is necessary.

Two edge cases may arise:
1. A user may disable an interface -- don't add device
Solution: The code currently handles this. _ConfigureInterfacesFromSettings, called
at line 746, checks for interfaces in fSettings to see if they are disabled (706-711).
If so, they are disabled and not set as a missingDevice if the interface is disabled
(709). The next interface is checked... etc.

2. Devices must not be added twice (i.e., Checking for An Existing configured Network)
Solution: The code currently checks for this. On lines 716-720, a device that is found
in fSettings (missingDevice), is set to the interface which is later added to the
/dev/net within that (unnecessary?) if statement (772). The missingDevice will only
be set and added to /dev/net if an entry does not exist in the settings already (716)
(hence the identifier missingDevice).
Change-Id: Ifc303371b88f18c30141a651a7d97a3c860e864f
Reviewed-on: https://review.haiku-os.org/767
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-17 22:46:08 +00:00
Andrew Lindesay
3369e03d5c HaikuDepot: Process and Data-loading Improvements
This change is a reshuffle of the backend processing involved in the
aquisition of data from servers including the pull-down and load of
HPKR data as well as the pull-down and load of data from the
HaikuDepotServer (HDS) system.  The driver for this change is to
implement an initial implementation of a progress bar for the
loading of data as the application starts.

The following are notable changes;

* Removed some previously attempted 'functional style' logic in the
  model which didn't fit well with C++
* Use of the base-url in the logical mapping from HDS and HD data is no
  longer required and has been removed
* Some logging has been improved making it clearer which part of HD
  is producing the logging which in turn helps with debugging issues
* List class has been modified to more cleanly support sorted lists
  and binary searches; tests have also be updated accordingly
* Reorganise and tidy-up of the data-loading processes' structures
* The local repository update (HPKR) and data-load occur in background
  processes now in the same system as the HDS data-load - this has been
  crudely shifted from the MainWindow to new Processes and incorporated
  into the background processing system
* The 'state-machine' background process runner is now replaced with a
  'coordinator' style approach that can more easily handle the new
  processes related to HPKR loading.
* Progress for loading processes is shown in the main window in the
  WorkStatusView - this is flickering a bit, but basically works
* Added some documentation regarding how Processes work in the system
* The "Refresh Repositories" menu item now also updates data from HDS
* The "Refresh Repositories" menu item is disabled when the background
  processes are running that update the repository data

Some further refinement would be good, but this change is large enough
for one round of improvements.  There is an issue that the status bar
is used for screenshot display as well as this data-loading, but that
was the case before so it is something that can be dealt with later if
it is a problem.

Change-Id: I7668307645e3aabaf7e4a6e37e2cca80cc0f489e
Reviewed-on: https://review.haiku-os.org/770
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-17 19:31:25 +00:00
Owen
1609bb2f67 Mail: Fix infinite loop in FindURL.
Fixes #14746.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
One minor change from owenca's original patch: we can't return
immediately if urlString is NULL, as the caller probably wants
the urlLength.
2018-12-17 13:45:33 -05:00
Jérôme Duval
d0111efead runtime_loader: Add missing locking around resizing the TLS DTV.
* Fixes crashes when the DTV is concurrently resized by multiple threads.
* Fixes JVM crash or endless loop when building OpenJDK.
* Should help with #13154, #14129, #14304, #14342.

Change-Id: I132600315d76a1a86236c6c70db09a3cdf0a8743
Reviewed-on: https://review.haiku-os.org/771
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-12-17 18:20:45 +00:00
Augustin Cavalier
6109c51d55 idualwifi7260: Add another NULL check before memset. 2018-12-16 22:51:49 -05:00
Augustin Cavalier
a07f133e5b KPath: Prevent setting a KPath to itself causing use-after-free.
SetTo frees the buffer before setting it to the new one,
but if KPath sets itself to ... itself, then it will of course
try to access the buffer again.

Spotted by clang-analyzer (amidst quite a few false positives,
so this doesn't seem like an especially good rabbit hole
to go down right now.)
2018-12-16 22:29:29 -05:00
Augustin Cavalier
514bace91d keymap: Allocate BApplication on the heap.
Avoids triggering an assert at program exit.
2018-12-16 19:35:04 -05:00
Augustin Cavalier
324336d1ed libbsd: Update vis and unvis from FreeBSD.
Fixes #11061.
2018-12-16 18:32:55 -05:00
Augustin Cavalier
18016b9654 broadcom440x: Add missing NULL check.
Fixes #4293 (again.)
2018-12-16 17:14:46 -05:00
Humdinger
b3fd8cd82a TextSearch: don't hard-code Pe editor
When double-clicking a result in TextSearch, it opens the file with
the preferred application for that file type. In case you search
through e.g. a HTML file, that would be most probably WebPositive,
which is not what you want normally.

TextSearch has the setting "Open files in Pe" which forces all files
to be opened in the Pe editor.

With this change, it will force the files to be opened in the
preferred app for text/x-source-code.

Change-Id: I0920a5f2497c01b16be0ac7563fbab942b67ef24
Reviewed-on: https://review.haiku-os.org/769
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-16 17:36:19 +00:00
Augustin Cavalier
9effbd7e00 Remove some unused cruft from the early days.
These lines were added in 2002...
2018-12-15 20:26:13 -05:00
Augustin Cavalier
707c912e12 Tracker: Remove "launch broken link" cruft.
As the comment says, this was a pre-R5 (!) hack for Be's CIFS driver.
2018-12-15 18:11:20 -05:00
Augustin Cavalier
a99aa113de Installer: Check return value of system() calls.
Solves a TODO.
2018-12-15 17:52:23 -05:00
Augustin Cavalier
72fa4a2e5e Installer: Check return value of GetMountPoint.
Probably fixes #14586 (NULL dereference in the strcmp on the next line)
but I couldn't quite manage to reproduce it.
2018-12-15 17:52:08 -05:00
Augustin Cavalier
901de869a3 BDirectory: Rewrite some functions for clarity.
No functional change intended. Whoever wrote these functions before
seems to have been allergic to more than one "return" statement
in a function...
2018-12-14 18:56:53 -05:00
Augustin Cavalier
26d14a317c BDirectory: GetNextEntry() should unset entry when one is not found.
Fixes #1692.
2018-12-14 18:48:38 -05:00
Murai Takashi
e000ae2c88 bin/notify: Fix PVS 741
Fix 'bitmap' is assigned values twice successively.

Change-Id: I02d70a581a682607f6ed280b71cc33c54738b343
Reviewed-on: https://review.haiku-os.org/766
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-14 22:52:42 +00:00
Murai Takashi
e3af9ff0bf kits/tracker: Fix PVS 923
Fix 'entry' is assigned values twice successively.

Change-Id: I86456bf156eb48f3966439a854256e27ee87caaf
Reviewed-on: https://review.haiku-os.org/765
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-14 22:52:42 +00:00
Murai Takashi
3fb9ab7fb6 bus_managers/firewire: Fix PVS 396
Fix 'info' is assigned values twice successively.

Change-Id: I981d3176a41a5f7616ef5a20dae889f1f01525bd
Reviewed-on: https://review.haiku-os.org/764
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2018-12-14 22:52:42 +00:00
Adrien Destugues
16a54a87fd Merge usb_floppy back into usb_disk.
- USB pen drive seems to still work. More extensive testing welcome.
- USB floppies don't work yet, but they don't work anymore with the
  current driver, either. I'm still investigating that part.

Fixes #9276

Change-Id: I8aa5ab828ad2ad867d0c187062d6e179372fc2ad
Reviewed-on: https://review.haiku-os.org/747
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-14 22:51:44 +00:00
Peter Kosyh
6fa279737e IMAP: sync fixes
This patch should fix:

- deadlocks while manual syncing/shutdown;
- crashes while manual syncing/shutdown.

Change-Id: I0962ff5580c19cbf740d002b6f62681ed5f558ab
Reviewed-on: https://review.haiku-os.org/758
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-12-13 09:32:35 +00:00
Augustin Cavalier
e7e7a55250 kernel/fs: Account for vnode being NULL in vfs_release_posix_lock.
When the FD is put() but not freed while O_DISCONNECTED, its "ops"
and "vnode" are cleared. Thus it is entirely valid for a non-NULL
file FD to have a NULL vnode, so we should just treat such FDs
as if the locks had already been cleared (which they should have.)

Fixes #14294.
2018-12-12 19:24:59 -05:00
Augustin Cavalier
bee962a25e kernel/fs: Consumers of context->fds[] must check O_DISCONNECTED.
Since these do not go through get_fd, which would check for them,
we need to do these checks manually in the relevant locations.

Some of these changes were broken out from axeld's original commit,
and some were found by my own auditing.
2018-12-12 19:05:14 -05:00
Augustin Cavalier
64d1636fea kernel: Rework the FD disconnect feature (again).
axeld's solution from 2015 worked in that it solved the panics and
problems with leaking FDs ... but only if nobody actually tried to
use the FDs again. As you can see in the diff of the previous commit,
in allowing closed FDs (which have NULL "ops") to be returned by get_fd,
all consumers of the get_fd API (so, pretty much most functions in
vfs.cpp and fd.cpp) have to check *both* that (1) the fd is not NULL,
and (2) the fd does not have O_DISCONNECT set.

Besides missing a large majority of consumers of get_fd (which caused
ticket #14532 and also the first half of ticket #14756, probably among
others, as I haven't reviewed all NULL-dereference-in-VFS tickets yet)
this solution missed the fact that calling get_fd increments the reference
count, but then exiting the exact same way as if the FD was NULL
(without putting it) when it is disconnected *also* leaks the FD.

As it turns out, a not insignificant number of applications try
to do this, which (depending on whether you went through one of the
'lucky' functions axeld's commit touched) either (1) leaked the FD,
or (2) caused a kernel panic.

Now, we could go through and add O_DISCONNECT checks to every single
consumer of get_fd followed by put_fd to get the proper behavior ...
but that would be the same thing as just returning NULL here and not
incrementing the reference count.

So it seems the first part of axeld's solution (don't set open_count
or ref_count to -1 but leave them as-is) is the only change necessary.

A few places where there were legitimately missing O_DISCONNECT checks
(some originally added by axeld) are (re-)added in the next commit.
Otherwise this seems to be the more robust solution. (But I wonder why
nobody caught this in the code review axeld asked for in the commit
and the ticket back in 2015? Did nobody notice the unbalanced get/put?)

Fixes #14532, part of #14756, and probably any other NULL dereferences
in VFS I/O functions (XHCI is especially good at exposing these)
that are lingering around on the bugtracker.
2018-12-12 18:42:03 -05:00
Augustin Cavalier
15ec0b5cc8 Revert "VFS: Slight rework of the FD disconnect feature."
This reverts commit eb62d3337b.
2018-12-12 18:40:04 -05:00
Augustin Cavalier
675e5dfcac Mandelbrot: GCC2 fix. 2018-12-12 18:13:18 -05:00
kerwizzy
e5aeaa8d03 Mandelbrot: Implement subsampling
* Added subsampling. This makes the render look less noisy and generally nicer.

Change-Id: I1dd667c8799bd97fb84e1401976da12ecf74ea8c
Reviewed-on: https://review.haiku-os.org/732
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-12 22:17:24 +00:00
Murai Takashi
2e7e161dfb drivesetup: Fix PVS 832
Fix 'parentRow' is assigned values twice successively.

Change-Id: I57a1dec60f651c49eb05f3038b62c49c29eb2ff0
Reviewed-on: https://review.haiku-os.org/763
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-12-12 22:07:19 +00:00