Commit Graph

60413 Commits

Author SHA1 Message Date
Augustin Cavalier
c9ba44b70a nvme_disk: Properly implement partial reads.
The previous version did not account for the position not being a
multiple of the block size, among other problems.

Tested by hand with DiskProbe and then "dd skip=..." to read single
bytes from partial blocks, and validated as correct.
2019-04-14 20:14:53 -04:00
Augustin Cavalier
6ed6023d01 nvme_disk: Add more error checks in read(). 2019-04-14 19:02:30 -04:00
Augustin Cavalier
067b0d08b2 kernel: Add NVMe to the device manager. 2019-04-14 18:59:23 -04:00
Augustin Cavalier
ace6654618 nvme_disk: Get the correct PCI information struct.
We want the one of the parent object, not the parent's parent.
2019-04-14 18:50:10 -04:00
Augustin Cavalier
26657c395d nvme: Fix the build with GCC2. 2019-04-14 15:48:07 -04:00
Augustin Cavalier
2338299bcb nvme: Import the driver code.
Only one qpair is used for reading, which is rather inefficient.
We currently allocate a bounce buffer for every allocation, which is
also inefficient, due to the fact that we must read an integer multiple
of LBAs.

But it does work, and it is actually reasonably fast, even on an emulated
machine using a spinning-disk-backed NVMe device (88MB/s.)

I wasn't able to get it working in non-packaged, though; the device manager
called supports_device() on a number of PCI devices, but not the NVMe
device, so I have a different version with a hack that grabs the PCI info
manually. I didn't test inside haiku.hpkg yet; perhaps it will work in there.
2019-04-14 15:07:31 -04:00
Augustin Cavalier
4b88e72350 nvme: Import glue code to our PCI and VM APIs.
Largely simple and painless, thanks to libnvme's abstractions.
2019-04-14 15:02:47 -04:00
Augustin Cavalier
af4a03df24 libnvme: Import.
Minor modifications for Haiku included, and for the most part marked
as such.
2019-04-14 15:00:38 -04:00
Augustin Cavalier
6be5438599 busses/usb: Handle getting/putting the PCI modules properly.
Previously it was possible that we put() them twice, leading to
assert-failure panics as their ref-counts would go below 0.
Now we get() them once for every bus object that we create, as
the destructors put() them.

Should fix the panic in #15004.
2019-04-13 13:22:47 -04:00
John Scipione
75504052d6 DefaultWindowBehavior: Emulate right click and middle click
... based on mouse type setting in Mouse Preferences.

for (default) 3 button mouse, nothing changes. #important

for 1 button mouse,
	emulate right click by ctrl+click. This replicates Tracker
	behavior everwhere

for 2 button mouse,
	add todo to emulate middle click by pushing both buttons at
	the same time. Unfortunately I was unsucessful getting this
	feature to work.

Change-Id: I5377ed5b4967483096f7f185f434bced3f86cdb9
Reviewed-on: https://review.haiku-os.org/c/303
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-13 16:57:41 +00:00
Augustin Cavalier
67b05100d2 busses/usb: Don't reject devices with "invalid" IRQs immediately.
We may be able to allocate an MSI for them. This was done for XHCI
already in hrev52742.

Probably fixes #15004.
2019-04-12 16:14:26 -04:00
Augustin Cavalier
5c6d92d72f busses/usb: Move ::AddTo to be above the class constructors.
It is called before them (and is responsible for calling them),
so having it in the middle of the file does not make a lot of sense.

Already done for XHCI. Only one functional change -- removing the
set_dprintf_enabled call. Drivers probably shouldn't spuriously
re-enable that if it was specifically disabled.
2019-04-12 16:05:35 -04:00
Humdinger
5dcd02dff2 Change button label in DriveSetup' format dialog
Some time back the menu item 'Partition | Initilize' changed to 'Format'.
The format dialog's button label still says 'Initialize'.
Change to 'Format' for consistency.

Change-Id: I6f1e84187a2d4b7c55843f9cd5cf0691f40c11fc
Reviewed-on: https://review.haiku-os.org/c/1405
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-12 19:42:09 +00:00
Augustin Cavalier
f1fafe317f kernel/OS.h: Include sys/types.h instead of pthread.h.
This avoids polluting the namespace significantly. Also adjust
all files which depended on this behavior to include pthread.h
directly.
2019-04-12 15:26:25 -04:00
Adrien Destugues
53830ab75a DriveSetup: disable 'Open with diskprobe' when no partition selected
This was part of the original DriveSetup patch but I missed it when
splitting it in smaller parts.
2019-04-11 18:03:14 +02:00
Alexander von Gluck IV
5599a1a3bb freebsd_network: Make riscv64 aware
Change-Id: I7199a28738ad8411cb62a858fb7da1bcc0de134a
2019-04-10 12:45:33 -05:00
Alexander von Gluck IV
51ab221fc7 glibc: Hack and slash in riscv64
* This isn't perfect, but should be a solid start.

Change-Id: Icb3f8c57b2bc4148d2ac14a71375d3f36c15e13b
Reviewed-on: https://review.haiku-os.org/c/1403
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-04-10 17:35:13 +00:00
Alexander von Gluck IV
f481aba1a6 libroot/syscall: Add riscv64, improve error handling
* Add generic riscv64 support.
* Previously, missing architecture syscall.inc's would
  result in obsecure unrecognized opcode messages.
* The logic should be identical, but with a friendly error.

Change-Id: I8f4878e99faf0f64465d2a27c3da2dd1e43c4ba5
Reviewed-on: https://review.haiku-os.org/c/1402
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-04-10 14:54:30 +00:00
Alexander von Gluck IV
d5ee99bbd7 riscv64: Ensure kernel is medany code model
Change-Id: I1b3386a072811bd068ab44190d16697dc7aad028
2019-04-09 20:25:04 -05:00
Alexander von Gluck IV
8672576c1e system/kernel: Add kernel linker script for riscv64
Change-Id: I9a8fcd8efdf6f728ee0938d10a4b0e7dfbf2ca7e
Reviewed-on: https://review.haiku-os.org/c/1401
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-04-10 00:37:54 +00:00
Augustin Cavalier
77b171dc0d XHCI: Rename fields of xhci_trb to match their actual purposes.
FreeBSD has the names we used before this commit; OpenBSD has names
more similar to the ones used in this commit (though following their
conventions of course.)

This makes the code significantly more readable.
2019-04-09 17:10:15 -04:00
Augustin Cavalier
c05742c8d4 XHCI: Do all endianness conversion of TRBs in LinkDescriptorForPipe. 2019-04-09 17:06:13 -04:00
Dancsó Róbert
a075ce979e DriveSetup: add "open with DiskProbe" menu
Change-Id: I8ea9fe904eea2433e9c70403d554fc6160e0b059
Reviewed-on: https://review.haiku-os.org/c/1398
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-09 18:23:44 +00:00
Dancsó Róbert
510138aadf DriveSetup: automatically select single disk
When there is only one disk, automatically select it.
Otherwise, do not select anything to make sure the user does not
accidentally do things to the wrong disk.

Change-Id: I834415bda6bc43692697bdfa9030f35ffc94048f
Reviewed-on: https://review.haiku-os.org/c/1397
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-09 18:23:44 +00:00
PulkoMandy
8586b74cfc sparc: fix versions mismatches in HaikuPortsCross
Change-Id: Id733ccb211ca7eb47a104727be8045497190d551
Reviewed-on: https://review.haiku-os.org/c/1400
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-09 18:20:44 +00:00
Les De Ridder
e982a0b217 btrfs: make file system name consistent
Change-Id: I5276be636875809f78201cb6274d64499252de73
Reviewed-on: https://review.haiku-os.org/c/1394
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-04-09 12:03:12 +00:00
François Revol
80934b8395 runtime_loader: Fix handling of #!/usr/bin/* introduced in hrev53048
Code was comparing "/usr/bin/" with "/usr/bin/env" of whatever was
passed. We now only compare the substring.

Change-Id: I0d09589fa83227d88fc8ba458eaf4293e86a041b
2019-04-08 23:50:33 +02:00
Calvin Hill
4e8ff93e77 wacom: Add Product ID for Wacom Bamboo Pen/Connect.
This enables the Wacom Bamboo Pen/Connect (CTL-470 Model) to be
recognised by the wacom driver. Pen support and pressure-sensitivity
is also working fine.

Tested on hrev53021.

Change-Id: I165a03e4a60f4cad8537122fdc2992ff291b9889
Reviewed-on: https://review.haiku-os.org/c/1392
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-08 15:14:11 +00:00
François Revol
5e4336f30a GLTeapot: allow multiple instances
starsseed told me it worked fine and is actually nice for demos :-)

Another option could be to add a menu entry to open a new window, but
I'm just back from JDLL so I'm quite lazy :p

Change-Id: I91e34517812f84157db7e24f2edff587deabbbe9
2019-04-07 22:00:32 +02:00
Augustin Cavalier
eb3cdd8a25 Time: Run synchronization on network up.
Also move the settings check into launch_daemon, as that way
"Time --update" can be invoked even when the setting is disabled.

Fixes #9348.
2019-04-07 15:12:39 -04:00
Augustin Cavalier
2e95cfdadd runtime_loader: Remove the user paths from the initial/"fallback" set.
This set is only used until the SetupEnvironment script has run, i.e.
for launch_daemon and its initial tasks, which does not need the user
paths. Solves a TODO.
2019-04-07 15:08:03 -04:00
Augustin Cavalier
938d81f658 runtime_loader: Rewrite all "/usr/bin/" shebangs to "/bin/".
Previously we only rewrote ones pointing to "env" with that.

Change-Id: I775fedc4a3b8e0e590c76f50f4c3fb259c5df32c
Reviewed-on: https://review.haiku-os.org/c/1389
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-07 17:50:31 +00:00
Che Vu Gia Hy
a0710a23d2 btrfs: Fix get object id from disk in wrong order
Change-Id: I15ab04ec55dd4e9318eff9eef65a5030bf5241b3
Reviewed-on: https://review.haiku-os.org/c/1390
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-04-06 21:47:33 +00:00
Augustin Cavalier
7a15c1cbc5 kernel: Add interrupts checks for switch_lock functions. 2019-04-06 13:55:45 -04:00
PulkoMandy
0788d17ae2 Fix missing absolute dir.
The variable is used after a "cd" so it must be absolute.

Change-Id: I8d591b8642179603249ac56a1fcac082f29c870c
Reviewed-on: https://review.haiku-os.org/c/1387
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-06 17:37:25 +00:00
Alexander von Gluck IV
162279b680 kernel/arm: Fix a few build regressions around types
Change-Id: I577e64397610bc48e4b7646c533de95d0024dd63
2019-04-06 08:55:00 -05:00
Alexander von Gluck IV
40fcf16358 kernel/riscv64: Add missing kernel_arg ranges to get build going.
Change-Id: Idf549a5e4d01e6dc8949ec1252296337e5ef970c
Reviewed-on: https://review.haiku-os.org/c/1380
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-05 14:29:23 +00:00
Alexander von Gluck IV
e0ec8de753 kernel/riscv64: ATOMIC64 FUNCS are not syscalls
Change-Id: I8696939ec2fab6f3960a9a41f0b5c9fcd6949760
Reviewed-on: https://review.haiku-os.org/c/1379
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-05 14:29:23 +00:00
Alexander von Gluck IV
45ebdd4217 kernel/riscv64: Fix assembly to disable/enable interrupts
Change-Id: Id4dc7360650e78a9bcadec634be97b279da2d77c
Reviewed-on: https://review.haiku-os.org/c/1378
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-05 14:29:23 +00:00
Alexander von Gluck IV
e21b752f13 libroot/posix: Add missing riscv64 knowledge
Change-Id: I49682d79f5e4b2dd981480636e7a55d25f11c9d1
Reviewed-on: https://review.haiku-os.org/c/1377
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-05 14:29:23 +00:00
Alexander von Gluck IV
d5ee175d98 libroot/riscv64: Add missing sigjmp's.
Change-Id: Id353f86571ddf5bc106af7c77f0bd3d22b5b7cbd
Reviewed-on: https://review.haiku-os.org/c/1381
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-05 14:29:23 +00:00
Augustin Cavalier
dd0667da66 kernel/locks: Don't panic on interrupts disabled in unlock().
We don't reschedule or block in here, so checking for interrupts
is needlessly strict. Sorry for the noise, forgot to remove this
before the previous commit.
2019-04-04 21:11:29 -04:00
Augustin Cavalier
93cf12432f kernel: Add checks for interrupts in rwlocks.
recursive_locks, mutexes, and semaphores already have them.
2019-04-04 20:56:33 -04:00
SuperPrower
fe3375770e intel_extreme.accelerant: create display modes list from VBT using create_display_modes()
For cases when EDID is not available but VBT information was retrieved,
previous code generated display mode list manually, potentially
incorrectly, causing the black screen during boot. This commit
fixes this by using a dedicated function, used for the
case where EDID is available (or VBT is not available).

Fixes #14280.

Change-Id: I95cfc5313260f0b9a01a98ba78e300b4383b6e32
Reviewed-on: https://review.haiku-os.org/c/1370
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-05 00:36:04 +00:00
Augustin Cavalier
26723de267 runtime_loader: Remove mistakenly added "sparc" from loop.
Should fix the build.
2019-04-04 19:29:20 -04:00
Augustin Cavalier
936e89e19d libroot/os: Reshuffle stack_trace.cpp a little more.
* Add missing "generic" inclusion on x86; fixes the build there.
 * Name the file the same way as the other files in its directory.
2019-04-04 19:26:01 -04:00
Jakob L. Kreuze
0f856497bd mediaplayer: Implement AppendM3uToPlaylist
Change-Id: I60a5146cae85ab7abb92a28ad142e5510c0a940e
Reviewed-on: https://review.haiku-os.org/c/1337
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-04 20:39:50 +00:00
Humdinger
a9b8a220a4 Magnify: Change cursor move shortcut
As OPT + cursor keys clashes with switching between open windows
(probably since the addition of Stack & Tile), let's use ALT + cursor instead.

Fixes #14975

Change-Id: I3e039e6afaa031453fb256cf642fc29633bd12e3
Reviewed-on: https://review.haiku-os.org/c/1345
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-04 20:35:21 +00:00
Jakob L. Kreuze
354e11bf3c Add mime_db entry for application/vnd.apple.mpegurl (M3U)
Change-Id: I80657fd815450003c0ae116bc16137375ee06837
Reviewed-on: https://review.haiku-os.org/c/1351
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-04 20:34:39 +00:00
PulkoMandy
b1ec65fcfe sparc: link the runtime_loader
Change-Id: Id30476480f4e4141935d6735209ecc0872dd6696
Reviewed-on: https://review.haiku-os.org/c/1367
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-04 20:31:25 +00:00