Commit Graph

59977 Commits

Author SHA1 Message Date
Augustin Cavalier
da452ce2bc strace: Print syscall names without the "_kern_".
This makes the output much easier to read (e.g. "write(...)" vs.
"_kern_write(...)") and similar to strace/dtrace/etc. output
on other platforms.

Change-Id: Iac8e32aae0dcf3731a348c6192203f8d5b54da7a
Reviewed-on: https://review.haiku-os.org/c/1451
Reviewed-by: Bruno Albuquerque <bga@bug-br.org.br>
2019-05-13 22:11:33 +00:00
Bruno Albuquerque
9888752db1 freebsd_network: Style fixes pointed out by Korli.
- Did not see his comments before pushing my previous change.
- clear owning flag when passed value is NULL.

Change-Id: I493973aff2b107785c3734847c85a52f0f9da360
Reviewed-on: https://review.haiku-os.org/c/1443
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-05-13 18:58:04 +00:00
Jérôme Duval
858e5775ab vfs: fail only truncate on file descriptors opened read-only.
chmod is allowed.

Change-Id: Idcac38bdd7f0d614538421a41dfd30066a0c316f
Reviewed-on: https://review.haiku-os.org/c/1444
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2019-05-12 07:23:16 +00:00
PulkoMandy
00b283c042 Fix long double support for ARM.
Fixes #15056.

Change-Id: I48c00b955346971aa88b731ccad1953a4044983d
Reviewed-on: https://review.haiku-os.org/c/1442
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-05-08 20:14:25 +00:00
Bruno Albuquerque
7f6254d1e9 Prevent a double softc free.
- Keep track if the softc was allocated externally or not.
- Only try to deallocate it if it was allocated internally.

Do not try to free the softc if we were not the ones allocating it.

- Avoid a double free on consecutive calls to device_set_softc.

Change-Id: Ibb38e54e9dfd2a80dbb53920970bead626da8ba1
Reviewed-on: https://review.haiku-os.org/c/1441
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-05-08 15:31:31 +00:00
Les De Ridder
1712a3c957 btrfs: add initial disk system add-on
Change-Id: I8f26a78770e679527a99b49a04557c1aa4334b53
Reviewed-on: https://review.haiku-os.org/c/1396
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-05-08 10:20:53 +00:00
François Revol
25de7c1b12 loader: VESA: make nvidia scaling fixup a driver setting
Since not everyone likes the default, make it an option in the vesa
settings file. Note setting a mode with the Screen prefs overwrites
the file so it will discard the option.

Also move the code to get_mode_from_settings() since we can't load driver
settings as early as vesa_init().

Change-Id: I93080bd1fbc064dab053624ad37935268b1ed17d
2019-05-08 04:42:33 +02:00
François Revol
0bed4dedc9 haiku utils rdef: bump Copyright year and fix indentation
Change-Id: Ib33df34029d0ab0189754024dd07beef3a2864bc
2019-05-08 02:00:04 +02:00
Murai Takashi
0ecfc6f3e3 Added some support for GCC 9.
Change-Id: I6b6cd53e00601592b44e1f2aa2804c8c9c9593d9
Reviewed-on: https://review.haiku-os.org/c/1438
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-05-07 23:07:17 +00:00
François Revol
547b5497e3 googlefs: fix warnings
Someone should rewrite this.

Change-Id: I08ddd10ac39c025f2ea1c28213a744bc2ada8516
2019-05-03 19:37:46 +02:00
François Revol
7409049765 Fix warning
Change-Id: I83250cc76a709404c52b91c992abb64f162e259b
2019-05-03 19:22:38 +02:00
François Revol
1b48852e84 Fix doxygen + whitespace
Change-Id: Ief0b2646e95841604a0396f15a054ff2086db198
2019-05-03 19:22:38 +02:00
Augustin Cavalier
02079c66f3 debug_server: Remove the "Write core file" button.
It is very, very rarely used, and is extremely wide on some locales
(i.e. almost 2x the width of the other buttons combined), making it
appear out of place. Now that it can be done from Debugger, having
it here does not seem to make a lot of sense.

As requested and discussed in #14777.
2019-05-02 16:59:39 -04:00
Augustin Cavalier
5ef0649658 Debugger: Add a "Write core file" menu item alongside "Save debug report". 2019-05-02 16:35:25 -04:00
Augustin Cavalier
c2cbf95810 kernel: Add and fix ownership checks in mutex_destroy and mutex_transfer.
* mutex_destroy() only checked wether or not there were waiters,
   not if the lock itself was presently held by another thread.
   Now we do, which should make #15015 panic much earlier instead
   of trying to use freed memory.
 * mutex_transfer_lock() and recursive_lock_transfer_lock() did
   not check that the calling thread actually owned the lock.
   Now it does, which should trigger asserts if anyone tries
   to do this.
2019-05-02 16:07:39 -04:00
Augustin Cavalier
c190864083 bus_managers/pci: Properly handle 64-bit BAR addresses.
We need to call pci_ram_address() on the whole address, not just the
lower 32 bits, and then store both components inside the PCI info
(previously we were leaving the high bits unset.)

Very few drivers bother to check if the address is 64-bit or not,
and for the most part they don't need to care, since the PCI bus
is at 0x0 physically and will pretty much never get anywhere near
4GB in size. But the XHCI driver read these, and so would get
bogus values for the high 32 bits, as we were never setting those.

Probably fixes #15040.
2019-05-01 15:43:27 -04:00
Adrien Destugues
a92e224f9a listusb: add some standard subclass codes
From https://www.usb.org/defined-class-codes

Change-Id: Icd029ff2078650fad3c2fa90f1d82cf80b0662b0
Reviewed-on: https://review.haiku-os.org/c/1423
Reviewed-by: Rene Gollent <rene@gollent.com>
2019-04-30 17:20:13 +00:00
Jérôme Duval
62740a49ce tty: add posix open_pt test.
Change-Id: I9a4d927ee693198b8c978f1cb51cf4cc50ca6557
Reviewed-on: https://review.haiku-os.org/c/1417
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-29 20:26:27 +00:00
Jérôme Duval
e892b55b25 tty: fix TRACE build on x86_64.
Change-Id: Idcfa9bca4a5b450f7a7d2a060809999ee3e3ceaa
Reviewed-on: https://review.haiku-os.org/c/1416
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-29 20:26:27 +00:00
Augustin Cavalier
097bbc7fd2 file_systems: Remove now-redundant bounds checks before file_cache_read().
Change-Id: Iafb7d188c7e7cb4406d924eb3354a7ede40c6641
Reviewed-on: https://review.haiku-os.org/c/1421
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Michael Lotz <mmlr@mlotz.ch>
2019-04-29 20:21:05 +00:00
Augustin Cavalier
728b515e1c kernel: Bounds-check the parameters passed to file_cache_read().
cache_io() did some bounds checking, but for uncached reads it was
entirely on the filesystem. Now we are more consistent: do all the
bounds checking for reads in the file cache, and do all bounds
checking for writes in the filesystems.

This makes sense as nearly all file systems were doing the exact
same logic for read() but of course all have different logic
for write(), due to block allocation, etc.

This potentially fixes #14993.

Change-Id: Iaf3e549001344cf375c7b8de549fc169d77bdbb2
Reviewed-on: https://review.haiku-os.org/c/1420
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-29 20:21:05 +00:00
Augustin Cavalier
1e4109cdb4 h2generic: Use a bounce buffer only when necessary.
This fixes two ioctls that were broken when adding the bounce
buffer.
2019-04-28 15:17:35 -04:00
Adrien Destugues
088cebb96f BFileGameSound: remove annoying printf.
Change-Id: If12c4031e7ec245a79cca51fe1304f6cc21f28e4
Reviewed-on: https://review.haiku-os.org/c/1415
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
2019-04-28 07:32:42 +00:00
Jérôme Duval
35fa85dba5 runtime_loader: load "LD_PRELOAD" libraries after the executable.
This makes the behavior more standard, is still to be used with libroot_debug.so
for instance.

The old behavior is obtained with "LD_PRELOAD_ADDONS"; in fact a runtime_loader add-on
needs to be entirely loaded before the executable to be effective. To be used with
libltrace_stub.so for instance.

Change-Id: I8536c5b8873f975405bea9eb4e2b92febabfc78a
Reviewed-on: https://review.haiku-os.org/c/1409
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-04-27 08:59:08 +00:00
Jérôme Duval
888652929c runtime_loader: treat weak symbols as strong symbols definitions.
http://www.sourceware.org/ml/libc-hacker/2000-06/msg00029.html
Change-Id: I15bf1f48dda32942e2a93610d62dabe0cabdc9a1
Reviewed-on: https://review.haiku-os.org/c/1191
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-04-27 08:58:11 +00:00
Jérôme Duval
471e44c962 <driver>mem: use user_memcpy instead of memcpy.
Change-Id: Id37e0e48a936de2e9fcfc5b9e16aad22b6dd0901
Reviewed-on: https://review.haiku-os.org/c/1414
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-26 15:48:40 +00:00
Jessica Hamilton
785877e9c0 loader: remove unused function.
No longer required due to bab060e.

Change-Id: I5d931ecfa615d2982a22256ba7d1f8aa1679a576
2019-04-26 04:27:11 +00:00
Jessica Hamilton
bab060e9dd loader: load all available file/partitioning system modules.
* This fixes booting on virtualbox with UEFI, where it
  fails to identify CDs as BOOT_METHOD_CD, such that the
  write_overlay driver doesn't get loaded, causing a
  panic in the kernel trying to mount the boot device.

Change-Id: I1f23b4c4195668752357735368f4668b73f75980
2019-04-25 05:08:22 +00:00
Jessica Hamilton
0f00993773 Revert "loader: load all available file/partitioning system modules."
This reverts commit ce624c696f.
2019-04-25 05:05:19 +00:00
Jérôme Duval
0e4b529df5 pthread: pthread_getattr_np must call pthread_attr_init().
Fix #15025

Change-Id: Ie0b91714d375d75170b54e81cb31cf18b106ecc1
Reviewed-on: https://review.haiku-os.org/c/1413
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-24 18:43:37 +00:00
Zoltán Mizsei
c9ac7e4a9e Add audio/x-mptm to the mime db
Change-Id: Ib529b18eeedd9b1d0de0f254fb96e97d9d04df44
Reviewed-on: https://review.haiku-os.org/c/1412
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-23 02:44:24 +00:00
Zoltán Mizsei
66e077c644 Add MPTM to the MediaPlayer known mediatype list
Change-Id: I44140272a6cc8515f5583680cd4d182064192ca8
Reviewed-on: https://review.haiku-os.org/c/1411
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-23 02:44:24 +00:00
Augustin Cavalier
1cb376132e bootloader packagefs: Implement PrintErrorVarArgs.
The package kit calls this function to print errors it hits
when reading packages. We should never hit this in "normal
operation", but it should help with debugging #14993.
2019-04-22 19:41:04 -04:00
Augustin Cavalier
5c1e072463 bootloader packagefs: Remove unused classes from the build. 2019-04-22 19:31:47 -04:00
Augustin Cavalier
f62a92ae05 network/stack: Fix a race condition in device interface teardown.
Inside the device_consumer thread, the sequence of operations was this:
  1. Call fifo_dequeue_buffer()
  2. If it returned B_INTERRUPTED, exit the thread. Otherwise, process
     the buffer it returned as normal.
  3. Loop.

Thus, if the FIFO was destroyed not during a call to
fifo_dequeue_buffer, the next loop, fifo_dequeue_buffer would
be called on a destroyed FIFO. It would then try to lock the mutex
in the FIFO which had been destroyed, causing an assertion failure
and thus a panic.

Now, we check the ref_count on every loop, and set it to 0 before
calling uninit_fifo(). Thus, even if we are in the middle of a loop
inside the FIFO thread, the loop iteration condition will fail
and thus the thread will exit, avoiding the race.

Probably this was not an issue before because the timing required
to hit this is incredibly unlikely. With the new ipro1000 driver
(or kallisti5's WIP TUN/TAP driver), the timing makes this much
more likely.

Should fix #15024.
2019-04-22 18:41:25 -04:00
Alexander von Gluck IV
d117379205 posix/if_types.h: Remove IFT_IEEE1394, breaks build
* Sneaky ifdef in libnetwork/netresolv/irs
* Sorry for spam.

Change-Id: I241d65b63d0bb8b281e3db0adcad2814b1476c7e
2019-04-22 13:21:50 -05:00
Alexander von Gluck IV
db3b4a3caf posix/if_types.h: Fix tun id, add a few more
* Oops, there's a standard for these. Stick to the standard.
* Add a few that could be useful someday.
* Mention iana spec.

Change-Id: I4cf75e8c1e4b25f65d10921c7075fbd53f44e14e
2019-04-22 13:06:04 -05:00
Les De Ridder
aa08671d9c btrfs: partially implement filesystem initialization
Change-Id: I7fb3340dc39b3331d30e5113b5860d936efab253
Reviewed-on: https://review.haiku-os.org/c/1395
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-21 13:39:46 +00:00
Augustin Cavalier
9d6d044fdd ipro1000: Merge changes from FreeBSD's master branch.
Includes some crucial fixes for interrupt routing on certain hardware.
2019-04-20 12:30:34 -04:00
Augustin Cavalier
e86136cf87 freebsd_iflib: Merge changes from FreeBSD's master branch. 2019-04-20 12:28:11 -04:00
Preetpal Kaur
5012906434 Disable Touchpad preferences.
Show warning in the touchpad preference dialog box when user is not connected and also disable touchpad preferences except touchpad view.

Change-Id: I52b80e834ee3bb37d568aa065942eae405001343
Reviewed-on: https://review.haiku-os.org/c/1344
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-19 08:26:40 +00:00
Augustin Cavalier
9f7fb0e5c9 EHCI: Destroy the cleanup semaphore on teardown.
Otherwise, the wait_for_thread() of the fCleanupThread will block
forever, stalling the boot process.

Fixes another part of #15004.
2019-04-18 14:06:46 -04:00
Augustin Cavalier
e8b2085d87 busses/usb: Print the PCI ID of the device with an invalid IRQ. 2019-04-18 14:01:13 -04:00
Jessica Hamilton
ce624c696f loader: load all available file/partitioning system modules.
* This fixes booting on virtualbox with UEFI, where it
  fails to identify CDs as BOOT_METHOD_CD, such that the
  write_overlay driver doesn't get loaded, causing a
  panic in the kernel trying to mount the boot device.

Change-Id: I63046d976661500227604bf01cc1631f1ae2b608
Reviewed-on: https://review.haiku-os.org/c/1406
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-18 16:40:01 +00:00
Jérôme Duval
3a75ef9ad1 runtime_loader: call preinit_array before initializing dependencies.
Change-Id: Ieed1af8ede83692d583d8e84bae92b1be29ddd1e
Reviewed-on: https://review.haiku-os.org/c/1187
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-18 04:54:01 +00:00
Augustin Cavalier
96e7ae6c4c nvme_disk: Fix build under GCC7. 2019-04-18 00:00:03 -04:00
Augustin Cavalier
2bd1323ab8 nvme_disk: Respect the maximum transfer size by segmenting I/O.
On VirtualBox, the reported maximum transfer size is 2MB; but all
I/O >= 753KB fails in an identical way to the "maximum size" failures.
In other news, there are multiple open tickets in the VirtualBox
tracker about Linux systems failing to boot off NVMe...

I tested with a hacked-in maximum segment size of 752KB and everything
seemed to work just fine. Writing a HPKG to a FAT partition on NVMe,
rebooting, and then reading back the HPKG showed it had the same
sha256sum as the one stored in /system did. So this is working!
2019-04-17 23:15:06 -04:00
Augustin Cavalier
a3fa1e70f6 nvme_disk: Implement write support.
Tested only lightly. Please use caution when trying it!
2019-04-17 22:06:59 -04:00
Augustin Cavalier
872c8209b0 nvme_disk: Allocate up to 8 qpairs and round-robin them for I/O.
Before this commit, only one qpair was allocated and it was
locked for the duration of the transfer. Now we allocate more
qpairs if the device supports it and lock only when actually
calling read(), enabling multiple reads to both be queued
and execute simultaneously.

This is probably a significant performance improvement,
even more so than it is/would be for SCSI, as SSDs
can actually read from as many sectors as bandwidth
allows at once.
2019-04-17 19:44:23 -04:00
Alexander von Gluck IV
16525505c6 network/tun: install-tun target for rapid tun testing 2019-04-17 21:18:18 +00:00