Commit Graph

59812 Commits

Author SHA1 Message Date
Barrett17
83a69e16c5 MediaExtractor and MediaWriter fix constness
* Fixes an ugly hack, where the codec was initialized in the
InitCheck and prevented the method to be const too.
2019-02-21 17:43:11 +01:00
Barrett17
2caa4ec708 codec_kit: Fix build 2019-02-21 17:36:55 +01:00
Barrett17
cb19342b80 dvd_streamer: API Update 2019-02-21 16:39:59 +01:00
Barrett17
486872713c http_streamer: API update 2019-02-21 16:39:58 +01:00
Barrett17
662583b300 MediaStreamer: Extend API to support DVD navigation
* This is a general review of the code and includes a rework
 of the sniffing API.
2019-02-21 16:39:58 +01:00
François Revol
d18fe1c54c loader: disable scaling on nvidia VESA BIOS
cf. https://patchwork.kernel.org/patch/7113461/

Change-Id: I3f564bd1037aeb4b539f495d57397446ae14e5ed
2019-02-21 05:28:56 +01:00
François Revol
38c4c8bfa9 kernel: fix mount arguments checks from userland
Since NULL is not considered a user address anymore, we must check for
it first.

This fixes the "mount: Bad address" error after hrev52905.

Change-Id: If60ea58bb81b6c35c6bf27ecfa9b29bd7a25d8aa
2019-02-21 03:14:23 +01:00
Augustin Cavalier
fe9e1e0c4f package_infos: Restore old compat version in x86_64.
The x86_64 buildmaster was only updated past the R1~beta1 version
a few weeks ago, so most packages still have a R1~alpha4_pm dependency.
Thus thus broke the build. Revert it for now so we don't do that.
2019-02-20 19:43:37 -05:00
Adrien Destugues
a6a6e3a842 Package kit: add likely-useful architectures
Required for bootstrapping them.

Change-Id: I179d8c73b08688946049bf18ff9151ef047e449b
Reviewed-on: https://review.haiku-os.org/c/1071
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-20 22:29:36 +00:00
Adrien Destugues
a54059b3f0 Update package_infos
- Bump year to 2019
- Adjust compat version, use alpha1 for x86 and generic packages, and
beta1 for other architectures since that's where they first appeared
(we will probably bump to beta2 for arm/sparc/ppc when we release
them for real?)

Change-Id: Ibb0968feb28731898776335eba01d34dcb758625
Reviewed-on: https://review.haiku-os.org/c/1069
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-20 22:29:36 +00:00
Augustin Cavalier
5fd8023312 XHCI: Disable Stop/SetTRD/Reset again.
They don't seem to particularly help, and there are reports
that this broke XHCI completely on some devices.

This reverts commit a21f7b525b.
2019-02-20 16:37:03 -05:00
Augustin Cavalier
01796e78f4 kernel/x86: Re-introduce the 1MB lower barrier.
It was removed in 2008 to make VM86 work, which is now gone.

Fixes #14911.
2019-02-20 15:37:06 -05:00
Augustin Cavalier
10aa58d7c3 kernel/vm: Make sure the base address is larger than fBase.
This is technically only a functional change following the previous
commit, which unconditionally made sure the address was larger than
the base except for B_EXACT_ADDRESS. Essentially this makes sure
that if an address is passed which is smaller than the base is
passed in, it won't immediately fail just by being too small.

Checked against BeOS (0x0 passed to create_area with B_BASE_ADDRESS
succeeds, and returns 0x2000 consistently.) This is also needed
to not break userland initialization following the next commit.
2019-02-20 15:33:32 -05:00
Augustin Cavalier
836a9548e0 kernel/vm: Remove VM86-related address space hacks.
VM86 was removed in 2012, so these are no longer needed.
The USER_BASE vs. USER_BASE_ANY distinction still seems like a
potentially useful one, though, so I've left all those changes in.
2019-02-20 13:28:25 -05:00
Augustin Cavalier
b08b51b417 BFS: Fix vising attribute runs in FileSystemVisitor.
See inline comment. Fixes "vnode refcount > 0" assert failures while
running checkfs after yesterday's commits.
2019-02-20 11:24:15 -05:00
Augustin Cavalier
13c4bc94ca kernel: Undo changes to pinned threads and blocking.
This reverts commit 58ed2965d0.
This reverts commit 055d49b1fd.

I was mistaken, it is perfectly legal to block a pinned thread.
It seems we'll need some other way to detect invalid context
switches.
2019-02-20 10:34:18 -05:00
Augustin Cavalier
055d49b1fd kernel/x86: Pin the current thread before calling interrupt handlers.
int_io_* functions do not touch the thread state, but we already have
it here as we will modify its contents later, so it makes more sense
to set this flag here.

This is mostly only relevant following the previous commit, i.e.
finding interrupt handlers that brokenly try to context-switch.
2019-02-19 21:38:15 -05:00
Augustin Cavalier
58ed2965d0 kernel: Panic on attempts to block a pinned thread.
Preventing "normal" context switches caused by a time interrupt
is the primary reason for pinning threads. "thread_block" and friends,
however, cause an explicit context switch and will not return until
another thread unblocks us.

Calling these while a thread is pinned is thus undefined behavior,
and so we should just panic in the case anyone attempts to do so.
2019-02-19 21:35:39 -05:00
Augustin Cavalier
a21f7b525b XHCI: Move and reorder Stop/SetTRD/Reset during endpoint creation.
Fixes a lot of "command failed: invalid context" errors on a variety
of devices following previous commits. Does not seem to affect much,
though.
2019-02-19 21:33:54 -05:00
Augustin Cavalier
a182f19364 USB: Properly assign IDs to USB Bus Managers (HCI drivers).
Previously they would just get -1, as the BusManager class
would request their ID before they had been added to the Stack.
Now we add them to the stack inside ::Start(), rather than letting
the individual drivers do that just after ::Start(), and then assign
the ID there directly.
2019-02-19 17:14:54 -05:00
Augustin Cavalier
d6f3954f39 XHCI: Tweak copyright header.
* List authors in alphabetical order.
 * Add myself.
 * Make first copyright year the actual year the file was created.
2019-02-19 16:41:47 -05:00
Andrew Lindesay
784aba8e2d HaikuDepot: Fix Code-Generation Jam Logic
The Jam build logic for HaikuDepot was potentially creating
a dummy file that was newer than the generated .cpp/.h files.
This then, in turn, caused the dependent .o files to be
considered needing to be re-built.  This change will ensure
that the dummy file is touched first so it is not newer than
the generated sources and also if the dummy does end up
being newer then the generated sources will be touched.

trac #14853

Change-Id: Ieefb0b2aa14bf43b7cbbdfee4228c215cad5b6fa
Reviewed-on: https://review.haiku-os.org/c/1070
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-19 21:34:23 +00:00
Fabiano Fidêncio
768957dca1 ImageRules: Ensure nightly builds will have a stable volume-id
Let's make the nightly builds consistent in a way that they would always
be recognized by libosinfo (and, consequently, by GNOME Boxes,
 virt-manager, virt-install, ...) by explictly using "nightly" instead
of the $(HAIKU_VERSION) when generating nightly builds.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>

Change-Id: I6fc4f15be1e8e9244abf14e75308fc825f37b2e8
Reviewed-on: https://review.haiku-os.org/c/1053
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2019-02-19 19:03:25 +00:00
ahenriksson
aa7750382a bfs: split checkfs code into FileSystemVisitor and CheckVisitor
Another FileSystemVisitor implementation will be used for resizing

Change-Id: I2d5f47dcbefb4c76834487b194a99c6f5ae7de50
Reviewed-on: https://review.haiku-os.org/c/923
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-02-19 18:44:43 +00:00
ahenriksson
8497a2cc28 vfs: functions to change a vnode busy status and ID
The kernel version is only partially tested.

Change-Id: I9a2f6c78087154ab137eadbced99062a8a2dd688
Reviewed-on: https://review.haiku-os.org/c/918
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-19 18:44:43 +00:00
Adrien Destugues
518af33f33 mmc/sd: support for SD v2.0 cards
Older cards did not implement CMD8, so handle the command stalling, and
proceed with initialization (not querying about SDHC support in that
case, as per the spec).

Change-Id: Ie842effc2f99e1adf1990b3215be79db493138b5
Reviewed-on: https://review.haiku-os.org/c/1056
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-19 18:34:03 +00:00
Adrien Destugues
ff76d2df8e sdhci and mmc implementation
sdhci:
- Add semaphore for interrupt management
- Add basic operations (setting clock, executing a command)
- Add early initialization (clocks and power up)
- Wrap the bus in a C++ class to ease usage
- Expose API to MMC bus manager
- TODO: manage card insertion and removal interrupts
- TODO: use MSI when available

mmc_bus:
- Implements SD card management independant of the way we access the bus
  (later on different drivers can provide the same API as SDHCI)
- Worker thread to do the initialization
- Implement card initialization process up until getting an RCA from the
  card. This is the generic part to assign an ID to the card, after this
  point commands can be targetted at the specific card so it can be
  handed over to the mmc_disk driver.
- TODO: initialization for non-SDHC cards which do not reply to CMD8.

Change-Id: I71950ca3ce206378a68fa7f97c19f638183d6cdd
Reviewed-on: https://review.haiku-os.org/c/1032
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-19 18:33:25 +00:00
Rob Gill
1f93ed9936 Avoid use of sprintf/snprintf on same source/destination (undefined
result)

 * Altered to avoid use of sprintf/snprintf to copy between the same
   source and destination. (This is an undefined result since c99)

 * (consequential trailing whitespace removal & line length adjustment)
Change-Id: I43976af43fe99d15b6c2677c5ab05db46fd6a8c0
Reviewed-on: https://review.haiku-os.org/c/1036
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-19 18:32:20 +00:00
Murai Takashi
a31244d098 mail: Fix potential memory leak
Fix memory leak when realloc() failed.
Pointed out by Clang Static Analyzer.

Change-Id: I13f758c4d89275651e22785652d0880a6d5b1a8e
Reviewed-on: https://review.haiku-os.org/c/1064
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-19 18:31:44 +00:00
Murai Takashi
d938c7118f userlandfs/server/fuse: Fix potential memory leak
* Fix potential leak of 'cookie' at line 2206, which is allocated
  at line 2203. Pointed out by Clang Static Analyzer.
* Add NULL check to 'cookie'.

Change-Id: Ibfdbe3a52ceb0d29adf1acca51fb7b27d2c532f3
Reviewed-on: https://review.haiku-os.org/c/1065
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-19 18:31:44 +00:00
Murai Takashi
b7223dc11f accelerants/radeon: Fix potential memory leak
* Fix potential leak of 'node' at line 147, which is allocated
  at line 123. Pointed out by Clang Static Analyzer.
* Remove trailing tabs.

Change-Id: I2289dfb5a9d0ada1fd7fc3854906d66a730b5bcb
Reviewed-on: https://review.haiku-os.org/c/1058
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-19 18:31:44 +00:00
John Scipione
4512141632 BeDecorator Draw outer left close button bevel to the edge
... just like BeOS R5 did.

In 3123432674 (hrev52122) I wrote:

"Undraw the bottom left and top right corners of bitmaps in the
unpressed state. BeOS did not do this (usually), but it should
have as it closes the ring."

This was a bad idea, draw like BeOS R5 instead.

Change-Id: I4eba7566bb31d3e208bc30439b0221b70eeb2bbe
Reviewed-on: https://review.haiku-os.org/c/1066
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-19 18:29:44 +00:00
Yatendra Singh
e680a439bf Launchbox: autostart on boot
Use launch daemon to autostart Launchbox if enabled in settings.

Change-Id: Id0aaf454cfbc0cc42db2dbb54d6788c79dae6949
Reviewed-on: https://review.haiku-os.org/c/917
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-19 18:29:17 +00:00
Augustin Cavalier
c62142a72b kernel: Add missing NULL check to _user_xsi_semget.
Private semaphores will have a key of -1, but IPC_PRIVATE is 0,
meaning it is possible to wind up here and get a NULL semaphoreSet
if someone passes us an argument of -1.

Reported on Twitter.
2019-02-18 23:24:28 -05:00
Barrett17
1efb85decc Add initial DVD support implementation
* This is an initial implementation of the DVD streamer.
It needs various development to actually work, so can be
considered as a begin.
* Navigation is not implemented, this needs some work to
add hooks in the BMediaStreamer to allow mouse tracking.
2019-02-18 23:40:09 +01:00
Barrett17
a92a085d1d BuildFeatures: Add libdvdnav and libdvdcss deps 2019-02-18 23:40:08 +01:00
Barrett17
2e53ae46b4 media_server: Use portable printf codes 2019-02-18 23:40:08 +01:00
Augustin Cavalier
d47cf79f7c XHCI: Rework endpoint-for-pipe setup and initialization.
* Stop/Reset/Set was commented out because it caused invalid context
   states. This was because we cannot run those commands until after
   we have configured the endpoint. Moving them to after that
   makes it work properly.
 * Add the endpoint to the context after configuring it, not before.
 * After configuration, we need to issue either an EvaluateContext
   or a ConfigureEndpoint, but not both, depending on whether
   this is endpoint number 1 (Control) or not.

All cross-checked against FreeBSD (the last change in particular comes
directly from a change of theirs.)

Tested with usb_disk and usb_hid on already-working hardware, no
obvious regressions. Possibly helps with #13834, among other
initialization problems.
2019-02-18 17:04:12 -05:00
Alexander von Gluck IV
371809b601 x86_64: Update build_package to include missing llvm7 for mesa_swpipe
Change-Id: Iaa381e1dcb5fa486a655a09e032cf780c5d14759
2019-02-18 13:44:56 -06:00
Augustin Cavalier
0ca15910c4 XHCI: Check return value of _LinkDescriptorForPipe. 2019-02-18 11:53:05 -05:00
Augustin Cavalier
db360a2064 XHCI: Make sure we have at least one TRB in CreateDescriptorChain.
Linux seems to do the same thing. Confirmed as correct by korli
in #12929.
2019-02-18 11:53:05 -05:00
Alexander von Gluck IV
b5ded9cc1a x86_64: Update build_packages for new libbluray,libdvdnav,libdvdread
* Purposely excluded was libdvdcss, libaacs

Change-Id: I83514e301eb3ee2c8f7d90ff6225ccd9a64314ad
2019-02-18 10:24:10 -06:00
Alexander von Gluck IV
4ec9f32bc2 HaikuPorts: Update README.md for build-package updates
Change-Id: I5845db702da506eaaa5e179d8470fdaa72470874
2019-02-18 10:19:57 -06:00
Augustin Cavalier
eae896c7ae XHCI: Print command code in "unsuccessful command" log message.
This should help with debugging #13772.
2019-02-18 10:15:55 -05:00
Augustin Cavalier
a881209f38 XHCI: Minor tweaks and other changes.
* Cap fSlotCount at the hardware level, not just at the software
   level.
 * Clear interrupts in init routine.
 * Write high DMA address of DCBAAP.

Found by cross-comparing with DragonFlyBSD and OpenBSD.
2019-02-18 10:05:04 -05:00
Augustin Cavalier
6554cc220f XHCI: Fix the build of tracing code. 2019-02-18 10:03:47 -05:00
Murai Takashi
29dcf8568b drivers/bus/usb: Fix potential memory leak
* Fix potential leak of 'controlData' at line 701, which is allocated
  at line 695. Pointed out by Clang Static Analyzer.
* Add NULL check to 'controlData'.

Change-Id: I96b0244d05d303b4c08ac8969f5ce5fc2e5012f9
Reviewed-on: https://review.haiku-os.org/c/1059
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-02-17 20:48:22 +00:00
Augustin Cavalier
c054900882 kernel: Sanity-check interrupts in snooze().
This didn't trigger any panics on my bare-metal dev install when tested,
but it might explain some easily-reproducible hardlocks (i.e. can't
even drop to KDL via emergency keys) I was seeing on other machines.
2019-02-17 14:36:16 -05:00
Augustin Cavalier
1eededf17f kernel: Only sanity-check interrupts in switch_sem_etc under KDEBUG.
"are_interrupts_enabled()" is a "relatively" expensive function, so avoiding
it makes sense. This is the same way it's done elsewhere in sem.cpp, as well
as for mutexes and condition variables also.
2019-02-17 14:34:36 -05:00
Augustin Cavalier
c61fa718f2 usb_disk: Handle user buffer-to-partial buffer copies correctly.
Discovered by an SMAP violation triggered by running "writembr" on a
USB drive.
2019-02-17 13:10:24 -05:00