Commit Graph
100 Commits
Author SHA1 Message Date
Augustin Cavalier 77d551c2f1 Jamfile: gutenprint -> gutenprint8. 2019-05-14 19:32:29 -04:00
Augustin Cavalier f95a6bc18a HaikuPorts: Synchronize packages; add libpsl and gutenprint8. 2019-05-14 19:03:02 -04:00
Augustin Cavalier e661fdd17d repositories: Move the README into the appropriate docs/develop directory. 2019-05-14 19:00:18 -04:00
Augustin Cavalier 32cbf55317 freebsd_network: Fix logic inversion introduced in the last change.
Thanks to Stephan for noticing!
2019-05-14 12:03:00 -04:00
Augustin Cavalier 45c3eb3a3c pkgman: Split "interactive" and "show progress" logic.
Previously we didn't show progress in non-interactive mode. Now
we do, so long as stdout is a TTY.

Fixes #14603.
2019-05-13 19:32:30 -04:00
Augustin Cavalier 7115cef989 Jamrules: Include the UserBuildConfig before processing repositories.
Repository processing triggers HAIKU_REVISION computation, and it
is intended that the UserBuildConfig can override or set HAIKU_REVISION.

Fixes #14834.
2019-05-13 19:21:48 -04:00
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 <[email protected]>
2019-05-13 22:11:33 +00: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
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 <[email protected]>
Reviewed-by: Michael Lotz <[email protected]>
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 <[email protected]>
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
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
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
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
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
Augustin Cavalier b5d2337330 kernel/x86: Move the add_memory_type_range tracing to level "2".
We usually set level "1" by default, so this will hide it.
It's not really that useful when debugging problems in general
at this point.

OK'ed by tqh.
2019-04-15 12:26:30 -04:00
Augustin Cavalier 351575e0e4 kernel/vm: Do not invoke the low_resource monitor in map_backing_store.
As the comment implies, we don't want to wait here, but low_resource()
waits forever when timeout=0. It doesn't seem to do anything with the
"size" argument at all, so not calling it is just as effective, and so
replace the comment there altogether.

The case where this was most often hit, causing a full system deadlock
in anything relating to memory management, was when the passed "size"
was 0. So now we check for this case explicity at the beginning and
panic() on KDEBUG kernels for it.
2019-04-15 11:14:59 -04:00
Augustin Cavalier 716ccf0492 XHCI: If the capability parameters are invalid, bail.
This is the cause of #14557. It seems that OpenBSD does the same thing.
I didn't read the spec yet to determine precisely what this means,
so for now, just do what OpenBSD does and bail.

This only seems to happen with a secondary XHCI controller on that
device, so hopefully most USB ports will still work.
2019-04-14 22:05:47 -04:00
Augustin Cavalier fa84c61a81 nvme_disk: Round the length to the proper offset for partial reads.
Following this commit, Haiku boots successfully in VMware from a
NVMe device!
2019-04-14 21:21:26 -04:00
Augustin Cavalier 0c26c6f155 build: Add the NVMe driver to the image. 2019-04-14 20:16:36 -04:00
Augustin Cavalier a3dc2dfa70 nvme_disk: Disable tracing. 2019-04-14 20:16:14 -04:00
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
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
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
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
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 <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2019-04-07 17:50:31 +00:00
Augustin Cavalier 7a15c1cbc5 kernel: Add interrupts checks for switch_lock functions. 2019-04-06 13:55:45 -04: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
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
waddlesplash 834a613e53 AboutSystem: Move Dario from the Current to the Past maintainers list. 2019-04-04 14:16:17 -04:00
Augustin Cavalier b934184a12 packagefs: Remove some more HPKGv1-related classes.
These were now unreferenced following the removal of GlobalFactory
and the other v1-related code, so this commit should not be any
functional change.
2019-04-04 14:07:02 -04:00
Augustin Cavalier 95587710d1 Debugger: Call the GCC2 get_next_argument directly.
This codepath is only hit when we are using the GCC2 demangler,
so we should not use get_next_argument which tries to autodetect
what kind of symbol this is.
2019-04-03 10:42:35 -04:00
Augustin Cavalier 9061e43c7d packagefs: Remove another reference to GlobalFactory.h.
Missed in previous push.
2019-04-01 19:23:31 -04:00
Augustin Cavalier 11e3c6dd26 packagefs: Open HPKG files as O_NOCACHE.
We have not one but two internal caches in packagefs for *uncompressed* data;
we do not need the underlying filesystem to cache the *compressed* data
needlessly.

This seems to be a negligible memory and boot speed improvement at best,
although it will likely help in low-memory situations in reducing
the pressure on the file cache (... actually it doesn't look like
the file cache responds to low resource notifications at all, which
may be relevant here.)
2019-04-01 19:02:00 -04:00
Augustin Cavalier d1a0bc4fb5 packagefs: Remove support for HPKGv1.
The current version is "v2", and it has been since the final PM branch
was merged back in 2013, so it's unclear if anyone actually uses this
file format. The "package" command can still of course read these
files, it's just that packagefs will now not be able to.

It's very unlikely anyone is impacted by this change.
2019-04-01 13:58:30 -04:00
Augustin Cavalier ad38b80fd5 BMessage: Fix R5 checksum calculation on 64-bit.
Change-Id: I0d418883bb66c6ad9e351c955e213f5cbc975e56
Reviewed-on: https://review.haiku-os.org/c/1336
Reviewed-by: waddlesplash <[email protected]>
2019-03-31 17:39:11 +00:00
Augustin Cavalier 18a8edbf0e docs/develop: More reorganization.
* There is now a 'busses' folder, and the extant USB/SDHCI/Bluetooth/etc.
   docs now live in it, instead of various other places.
 * kernel/ports is now kernel/arch, like it is in src/system.
   SPARC documentation is now in there, too.
 * VM files (these are rather outdated) are now in kernel/vm.
 * SCSI ASC info removed, this is easily available online and
   it doesn't seem to be very relevant.
2019-03-30 18:00:46 -04:00
Augustin Cavalier 454b04ca27 HaikuConfig: Change _BEOS_COMPATIBLE_TYPES to only be defined on i386.
Hopefully soon we will have our first 32-bit non-x86 architectures.
No functional change for x86 32- and 64-bit intended.
2019-03-30 16:57:05 -04:00
Augustin Cavalier 5c93058ad7 BuildSetup: Stop defining __INTEL__ for the host tools.
Nothing in the tree uses __INTEL__ anymore, so this is no longer
needed.
2019-03-30 16:55:27 -04:00
Augustin Cavalier 5ffbe7d778 Change all references to "__INTEL__" to "__i386__".
They are functionally identical, but the former is a BeOS/Haiku-specfic
macro that we include in the compiler specs, and the latter is defined
by GCC.
2019-03-30 16:54:01 -04:00
Augustin Cavalier 1e60bdeab6 Remove all invocations of SetSubDirSupportedPlatformsBeOSCompatible. 2019-03-30 15:19:38 -04:00
Augustin Cavalier b357daa5c5 build: Deprecate SetSubDirSupportedPlatformsBeOSCompatible.
By default, all targets support the "haiku" platform, and we no longer
support building for BeOS, Dan0, Zeta, or other BeOS-compatible targets,
so this is no longer needed.

Also remove all references to the non-Haiku compatible platforms, and
change all BEOS_COMPATIBLE checks to HAIKU_COMPATIBLE. Removal of
all SetSubDirSupportedPlatformsBeOSCompatible invocations
will be in the next commit.
2019-03-30 14:54:14 -04:00
Augustin Cavalier a1c2d3d653 uptime: Remove, in favor of the coreutils one.
This one had an uncertain "freeware" license, and the code quality
is not so great. BeOS didn't have an 'uptime' command, so we can
replace this with the coreutils one without worry.
2019-03-30 13:47:14 -04:00
Augustin Cavalier 3200e3bc42 pci & usb ids: Update.
Also remove the ReadMe as it's not accurate anymore. Fixes #14980.
2019-03-30 13:06:14 -04:00
Augustin Cavalier 041f46f392 u-boot: Use Haiku-style endian conversion functions.
Fixes #14987.
2019-03-30 13:01:33 -04:00
Augustin Cavalier ebc14c9921 libroot: Restore the old __swap functions for x86_64.
They are needed in order to not break applications compiled against
them. Fixes the boot on x86_64 after PulkoMandy's commit.
2019-03-27 15:11:30 -04:00
Augustin Cavalier 569791be52 headers/posix: Define the byteswap macros unconditionally.
It helps if one tests GCC4+ fixes on GCC4+...
2019-03-27 10:19:50 -04:00
Augustin Cavalier 8e309168b9 headers/posix: Use separate naming for the byte-swap macros.
This avoids a compile error on GCC4 when ByteOrder.h is included
after it.
2019-03-27 00:25:34 -04:00
Augustin Cavalier 86ec5e3bf4 Convert some more endian conversions to Haiku-style. 2019-03-26 22:44:20 -04:00
Augustin Cavalier 6d5e91f0c9 headers/posix: Make casts in netinet byteswap functions uniform. 2019-03-26 22:31:33 -04:00
Augustin Cavalier fcf0b31fb9 bootloader: Add the network endianness macros to NetDefs.h.
This file contains all the protocol- and interface-related
definitions, so this seems to be where they belong.

Required following previous commits.
2019-03-26 21:51:42 -04:00
Augustin Cavalier fb52ab82d2 Minor tweaks to fix the build after the last commit.
* firewire and freebsd_network expect the macros come from
   sys/param.h, as this is one of the places FreeBSD defines them
 * All others are Haiku-native and can use Be-style macros.
2019-03-26 20:06:09 -04:00
Augustin Cavalier 9cb15d72bd netinet/in: Use the GCC4 builtin byteswap functions for htonl.
Fixes the build breakage caused by PulkoMandy's recent commit.
Remove these from ByteOrder.h now also, as per POSIX they should
come from netinet/in.h.

This is a small source compatibility breakage, but it will only
affect a small portion of non-POSIX, partially-Be applications.
2019-03-26 19:33:43 -04:00
Augustin Cavalier 204ec4dec6 build: Use the main ByteOrder.h.
The only differences between the two were whitespace and then the
GCC4 builtin byteswap functions.
2019-03-26 19:13:01 -04:00
Augustin Cavalier d15fda2c7e build/BeBuild.h: Throw an error if the compatibility headers are not included.
If this triggers, it means something is using the "build" errors while
the build system thinks it is not, which is always an error. Nothing
triggers this at present, but some subtle bugs in the build system
a while back would have been caught by this.
2019-03-26 18:59:42 -04:00
Augustin Cavalier 660dea3f6a net_server: Clean up authentication handling code.
Even if we find an authentication string, make sure it's not empty before
trying to use it; and use the other one if possible.
2019-03-17 15:34:04 -04:00
Augustin Cavalier fef60ce6cc XHCI: Reworking locking behavior and check for lock failures.
Should fix #14959.
2019-03-17 15:33:17 -04:00
Augustin Cavalier b322554630 kernel: Check for uninitialized locks in mutex_trylock().
We already do this in mutex_lock() and variants.
2019-03-15 10:59:48 -04:00
Augustin Cavalier d3f27239b1 bus: Remove IDE.h and change ATA bus manager paths. 2019-03-13 11:34:13 -04:00
Augustin Cavalier 19151d0134 usb_audio: Clean up and fix device management code.
* Actually use the global mutex instead of creating useless MutexLockers.
 * Don't delete the device object on _free(), then it can't be opened again,
   which we want to be possible. Matches the behavior of other audio drivers.
 * Clean up device detection code to better match other drivers.

At least under XHCI, multi_audio_test throws a variety of errors and then
crashes while attempting to use this driver. But following implementing
CancelQueuedTransfers, the system no longer KDLs after that. Progress!
2019-03-13 00:34:58 -04:00
Augustin Cavalier d592cab849 usb_webcam: We won't be building for Zeta. 2019-03-13 00:33:47 -04:00
Augustin Cavalier 4d03f44874 multi_audio_test: Fix the build. 2019-03-13 00:33:27 -04:00
Augustin Cavalier dda9c02789 XHCI: Use MutexLocker in HandleTransferComplete. 2019-03-13 00:32:25 -04:00
Augustin Cavalier 1d79fe616f XHCI: Implement CancelQueuedTransfers and RemoveEndpointForPipe.
Seems to work OK on my hardware now. Possibly helps with device unplug/replug
issues; though that worked on my hardware before this change, too. This is
now more correct at least.
2019-03-13 00:09:39 -04:00
Augustin Cavalier 7356f1de4b XHCI: Properly handle partially-failed transfers. 2019-03-09 17:53:31 -05:00
Augustin Cavalier c5c392585c usb_audio: Fixes for SMAP. 2019-03-09 17:50:25 -05:00
Augustin Cavalier 965d4047bb usb_audio: Trim trailing spaces; change device basename to "hmulti/usb". 2019-03-09 16:10:07 -05:00
Augustin Cavalier e6a55c69fe XHCI: Miscellaneous tweaks and cleanups.
* Check "endpoint == NULL" instead of the ID for this pipe; as
   _InsertEndpointForPipe will have already done the check for us.
 * Store the endpoint's ID (our internal ID) in the structure, and
   then move the doorbell-ring into _LinkDescriptorForPipe. Now all
   variables named "id" are actually that, and not the endpoint number
   (which is "id + 1".)
 * Return actual statuses in NotifyPipeChange, among other tweaks.
 * All things which set the usb_request_data structure also set data,
   so we can just use ReadDescriptor to do copies like normal, simplifying
   the finish-transfers code.

No (major) functional change intended.
2019-03-09 15:21:04 -05:00
Augustin Cavalier e4487e3e45 screen_savers/Shelf: Fix build in DEBUG mode. 2019-03-09 14:08:27 -05:00
Augustin Cavalier 6aae8d5abb XHCI: Improve tracing in CreateDescriptor. 2019-03-09 13:27:00 -05:00
Augustin Cavalier c32137f3fd kernel: Tweak some mutex functions.
* Remove code duplication.
 * Make _mutex_trylock work in non-KDEBUG kernels. This should fix
   spurious failures to lock in drivers compiled for KDEBUG kernels
   running under non-KDEBUG kernels.
2019-03-09 12:02:00 -05:00
Augustin Cavalier 3131c13005 XHCI: Implement the debug transfer hooks.
This requires a bit of massaging around the locking code. Probably
we shouldn't be able to do this, and there should be a "mutex_unlock_etc"
for use in interrupt contexts, but at present there is not.

This makes it possible to use XHCI-attached keyboards from within KDL!
2019-03-08 22:06:34 -05:00
Augustin Cavalier 9bdd88ebe3 XHCI: Granularize locking.
This is not so important now (though it is a mild performance improvement
when running transfers during commands), but it will be when the debug
transfer hooks are implemented, as we will need to use these to determine
if it is safe to queue and poll for transfers or not.
2019-03-08 20:40:12 -05:00
Augustin Cavalier 187a2c6ce7 XHCI: Completely overhaul endpoint configuration logic.
The code as it was before was very hard to follow and incorrect in
a number of corner cases, as well as not being very clear about what
the TODOs were.

It now follows the spec much more closely (especially in interval
computation) and contains more details on where it is still lacking.

This probably does not fix much (if anything) as is, but it paves the
way for future isochronous support.
2019-03-08 20:40:12 -05:00
Augustin Cavalier 57608a81c5 XHCI: Fix a race condition in request submission.
See inline comments. At least in brief testing I couldn't cause the
USB-HID stalls anymore, but they were very intermittent for me anyway.
But it was doubtless the case that the logic as it was before was
very much incorrect.
2019-03-05 13:08:03 -05:00
Augustin Cavalier 2df3446676 XHCI: Allocate one physical chunk for all buffers if possible.
Besides calling the allocator fewer times, this also helps break up
the size classes we are allocating chunks from, reducing memory pressure.

As most transfers are smaller than 128KB, this is a major performance
optimization for them.
2019-03-05 12:24:37 -05:00