Commit Graph

60021 Commits

Author SHA1 Message Date
PulkoMandy
e6c9be767b sparc: interrupt management functions
Change-Id: Icc689cc0cc0075fbccdad23f77cfa53b1f32df3c
Reviewed-on: https://review.haiku-os.org/c/1107
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 20:56:20 +00:00
PulkoMandy
c1566b1555 sparc: more platform headers
Previous commit adding these was merged very quickly, so here's one
more...

Change-Id: I23c424db7631db1f0ec48e2d0ae47c8409ae6af2
Reviewed-on: https://review.haiku-os.org/c/1088
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 20:56:20 +00:00
PulkoMandy
c5769c4f6b Make -Wcast-align only a warning
On x86 and x86_64, this warning is never emitted because it is perfectly
fine to do unaligned access. On sparc, such accesses are not supported
by the hardware and will generate a SIGBUS. This must be caught by a
trap handler, and the unaligned access performed there, slowly, using
byte by byte access.

However, making this a Werror is annoying because it will trigger
everytime one casts a byte pointer to something larger, even when
alignment is actually preserved. So, removing all such warnings would be
nearly impossible (for example, just for the mergesort function, there
is a whole GSoC project for it at FreeBSD).

Keep it as a warning for now. The warning can be silenced by using
BytePointer, if desired. We should also investigate where the SIGBUS
trap is triggered a lot and consider improving the alignment of data
where possible.

Change-Id: I6b90025e8c6d69ef1ccda3c10eee270ccc1ebd29
Reviewed-on: https://review.haiku-os.org/c/1103
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 20:56:20 +00:00
PulkoMandy
5f49c55851 m68k: simplify a Jamfile.
I'm copypasting a lot from this, so I may as well clean it up while I'm
at it.

Change-Id: I9288c087abbf95475f980b5539f2fd19fad7f775
Reviewed-on: https://review.haiku-os.org/c/1136
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 20:56:20 +00:00
Niels Sascha Reedijk
d7b8d76a78 BSD headers: remove _BSD_SOURCE feature gate for sysexits.h
During the compilation of LLVM version 8, the build failed because it depends
on a constant in this file. In hrev49042 all BSD headers were feature-gated by
_BSD_SOURCE. This is not done (for this file) in glibc and (obviously) not in
BSD's libc.

Since this is not common practise, I would propose removing the feature gate
for this header file, as it would mean that we would have to upstream patches
for ports of other software that depends on the availability of these
constants.

Change-Id: I486f0c2e87eff489ce92d03589a6299ef1be6ca5
Reviewed-on: https://review.haiku-os.org/c/1144
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 20:49:19 +00:00
Andrew Lindesay
52a61976d4 pkgman: fix for syntax (help)
The tool "pkgman" was not showing it's help text
and this seems to be somehow related to the
initialization of constants such as
"kCommandCategoryPackages"; these values seems to
be coming through as empty-string for some reason.
I am changing those to be "#define" of regular
C-Strings and this seems to resolve the problem.
These values only seem to be used to group the
possible commands for production of the syntax or
help text - there do not seem to be any deeper
impacts beyond that functionality.

Change-Id: If9cd61462cd7f1f1b5ab2ece521bb3f00a1ba246
Reviewed-on: https://review.haiku-os.org/c/1139
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-03-03 20:24:54 +00:00
Greg Crain
695f50f6cc XHCI: Adjust timeouts in WaitOpBits.
Operations that succeed should not take longer; ones that fail will.

Should get rid of ControllerReset() failed CMD_HCRST.

Change-Id: I4981a319bd64a076f2f404214a96d9909f0676de
Reviewed-on: https://review.haiku-os.org/c/1135
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 17:41:49 +00:00
Jérôme Duval
2e1e3f0d75 runtime_loader: fix failures in the test suite.
* use --no-as-needed on Linux as the default changed some time ago.
* adjust LD_LIBRARY_PATH/LIBRARY_PATH to load in the current directory.
* fix some builds of program with compile_lib.

Only dlopen_lookup_next1 fails on Ubuntu 18.04.02 x86_64.

Change-Id: I6ecf70f742f67ab24d7d00fa615baa209634d02c
Reviewed-on: https://review.haiku-os.org/c/1140
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-03 17:39:45 +00:00
Andrew Lindesay
17dc34acd6 HaikuDepot: Build Configure for Python
Some operating systems only ship with Python 3 and the
binary for this is 'python3' instead of 'python' which
causes the Jam build process to fail because it expects
to find 'python'.  This change will mean that the
configure process will detect this case and configure
the build to use the correct binary name.

Fixes #14938

Change-Id: I30cd0df828792715a54d760b86dd79aee04e2b2f
Reviewed-on: https://review.haiku-os.org/c/1134
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-03-03 07:49:25 +00:00
Andrew Lindesay
c91b716e09 HaikuDepot : Generate Sources -Fix Build
In recent changes to HD's build files to generate
some sources at build-time there was a problem
with builds that were configured to run with some
element of concurrency.  In this change, the steps
that should be in sequence are done with shell
commands to avoid race conditions.

Change-Id: I5b6fb4907d8ea5f3ca90de956ecce322cd89c685
Reviewed-on: https://review.haiku-os.org/c/1130
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-03-02 16:43:33 +00:00
François Revol
2c73537c43 Add a catarea bin tool
Untouched as of 2004, can be useful sometimes.
2019-03-02 13:37:23 +01:00
PulkoMandy
d3a6abe920 sparc: freebsd_network defines
Change-Id: Ib668c69d6b506c6efaeb50d0a3e4784f836ce61a
Reviewed-on: https://review.haiku-os.org/c/1105
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-03-01 11:55:38 +00:00
PulkoMandy
167f096576 sparc: update gcc package in HaikuPortsCross
Use the latest version of the compiler for bootstrap.

Change-Id: I43639b560de2d4f3dc3fed48c3d4bd32a544cb57
Reviewed-on: https://review.haiku-os.org/c/1104
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-03-01 11:54:55 +00:00
Zach Dykstra
579b9cd9b9 Adjust the magic incantations to fix spacing
This is my first commit, so bear with me if I've violated any standards here!

I've bumped a few offsets to fix text clipping in the Get Info window. The proper
long-term fix is to recreate this window with the layout library, but that's
a substantially larger job.

Patch set 1
Before: https://i.imgur.com/S7Pl5Qv.png
After: https://i.imgur.com/bd3H1Kw.png

Patch set 3
French: https://i.imgur.com/rpmUb5T.png
German: https://i.imgur.com/ca9DecW.png
Portuguese: https://i.imgur.com/dE8sKFI.png

The font size in the Permissions drop-down is fixed. I had previously bumped it to
12, to be inline with the default font size present in a new Haiku install. However,
that produced text clipping for French and other locales. I reverted it back to 10,
and now longer strings fit as-is.

Change-Id: I7f4412b10074c76eb5b023a231bdb6b230c8f35a
Reviewed-on: https://review.haiku-os.org/c/1073
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-28 19:10:12 +00:00
Murai Takashi
1f0635d227 Game Kit: Fix -Werror=class-memaccess
Replace memset() with media_format.Clear() to fix
-Werror=class-memaccess, pointed by gcc8.

Change-Id: I87a72ac06947e90c468deda6bf6d7bb3b5fb4003
Reviewed-on: https://review.haiku-os.org/c/1113
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-28 18:58:46 +00:00
Murai Takashi
88d7c7740a media-add-ons/usb_webcam: Fix -Wclass-memaccess
Remove memset(), since WebCamAddOn()::FillDefaultFlavorInfo()
at next line sets all flavor_info members except _reserved_[].

Change-Id: I41b4297a79303b61ccea914133b268b118b0d968
Reviewed-on: https://review.haiku-os.org/c/1118
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2019-02-27 23:10:33 +00:00
Jérôme Duval
1d3959edfb exfat: checks cluster values.
also use the size of the node for Size(), instead of the valid size.
2019-02-26 23:08:53 +01:00
Alexander von Gluck IV
1b3684f86a HaikuPortsCross/riscv64: Fix packages for gcc
Change-Id: I220076059a9ee69411384a595e7b56db61c74655
2019-02-26 14:17:57 -06:00
Alexander von Gluck IV
05dda88dc1 headers/riscv64: Implement basic arch headers
Change-Id: I6bfbacb61eae84ffebc30c2565683348d684d88f
Reviewed-on: https://review.haiku-os.org/c/1063
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-26 14:50:35 +00:00
Augustin Cavalier
a30d07f80a build: Remove ATA build feature references.
The ATA build feature itself was mistakenly removed in the previous
commit, as it should have been removed along with these. Sorry
about that.
2019-02-25 19:56:07 -05:00
Augustin Cavalier
7930fb5b5e build: Print unavailable build features in one rather than multiple lines.
Reduces Jam noise and significantly improves readability.
2019-02-25 16:11:39 -05:00
Augustin Cavalier
fb1dd50ee7 kernel/fs: Make fs_mount::lock a mutex instead of a recursive_lock.
Solves a TODO.
2019-02-25 16:11:08 -05:00
Jérôme Duval
984ec35f2a exfat: fix block count for bigger disks. 2019-02-25 21:32:41 +01:00
John Scipione
65c0d507d3 MidiPlayer: Fix crash when dropping a midi file
Window must be locked or MidiRunThread crashes with a segment violation.

Change-Id: I9d5d0fa477475a9b5ba877aea3d6583690aacb2b
Reviewed-on: https://review.haiku-os.org/c/1080
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2019-02-25 11:57:46 +00:00
Murai Takashi
5b88998b2d media-add-ons/mixer: Fix -Werror=class-memaccess
Fix -Werror=class-memaccess, pointed by gcc8.
* AudioMixer.cpp: replace memset() with media_format.Clear().
* MixerAddOn.cpp: remove unneed memset(), since constractor of
  media_format already runs memset().

Change-Id: Idfb68c4d3190aeed725d905e46b0f85354962bc9
Reviewed-on: https://review.haiku-os.org/c/1112
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2019-02-25 11:56:40 +00:00
Augustin Cavalier
9cd8943940 XHCI: Rework locking in HandleTransferComplete.
We need to hold the endpoint lock while reading the TD list on
the endpoint, as otherwise we have no guarantee that the pointers
will not be modified while we are looking at them.

Since this is the only consumer of _UnlinkDescriptorForPipe, just
make that function assume a lock, and then do all locking within
HandleTransferComplete.
2019-02-24 14:49:10 -05:00
harsh jain
7495b57bcc refactor(MenuWorld): code refactor for stddlg
Change-Id: Id73404d29ea75f61663e0306eeeb559286d77281
Reviewed-on: https://review.haiku-os.org/c/1072
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-24 19:46:30 +00:00
PulkoMandy
fcffcb1576 RepositoryRules: fix typo
This went through review too fast, the wrong variable name was used so
the package name was not listed...

Change-Id: I81d4aa57fdb65297ae9f63ebf123d7a6395a99b6
Reviewed-on: https://review.haiku-os.org/c/1109
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-24 19:45:14 +00:00
Humdinger
53c1d392cb WebPositive: Fix/rearrange elements in Settings window.
The Browse button was misplaced when the "Start up" setting was
introduced recently. Moving it back into the "Download folder" row.

Move the "Download folder" row to the bottom of the group.

Have the text field of the days-of-history BSpinner not stretch
the whole window width.

Change-Id: I00260126cf7594f435899fa821e8bf79bb475ba8
Reviewed-on: https://review.haiku-os.org/c/1110
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-24 19:30:50 +00:00
François Revol
54a4352649 Coding Style Police
Change-Id: I93ebe389dbc685f4277cf32c4d0a6d529c81a354
2019-02-24 15:54:34 +01:00
François Revol
447b98e474 net_socket: Fix deferencing NULL+8 in KDL commands
Change-Id: I50d4dab27699614b0bfc977e10d6d11cbb5f79fa
2019-02-24 04:44:10 +01:00
PulkoMandy
6f7d94a13d vm: fix stack erase when printing 64bit value
Getting 64 bytes of data in a 32 bit variable is a bad idea

Change-Id: I760e1cfb996a9be053dbc50d6610b3e865cde65d
Reviewed-on: https://review.haiku-os.org/c/1096
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-23 23:50:37 +00:00
Augustin Cavalier
65ceb4c931 XHCI: Rewrite transfer-complete handling code.
* Don't set the IOC bit on the link TRB in LinkDescriptorForPipe. We don't
   want to know about this' completion, only about the other transfers
   completion and statuses. This should halve the interrupt rate.
 * Check if this is an Event Data TRB, and return an error if it is.
   (I haven't managed to trigger this code, but it is theoretically possible.)
 * Rewrite loops for clarity and consistency.
 * Use the correct offset when checking for the TRB.
   - Don't rely on the trb_count to tell us whether the TRB is in the TD,
     but just check the address based on MAX_TRBS_PER_TD.
   - Previously, as the link TRB would trigger an interrupt, we could rely
     on that to determine when the transfer finished. But that of course
     did not tell us the correct status, as the link TRB is techically in a
     different TD, as it isn't linked to the previous TRBs. Now we always use
     "count - 1", which will be the final TRB in the TD, properly speaking.
 * Print errors when we fail to find the TRB for any reason.

Reading multiple GB and abusing "stat" on a usb_disk following this commit
only managed to stall my usb_hid attached mouse once in multiple rounds of
testing, which seems a marked improvement; previously only a few hundred MB
and not that much abuse of "stat" were needed to actually trigger the stall.
So it seems this improves the stall situation considerably.
2019-02-23 17:08:10 -05:00
Augustin Cavalier
6a00da689e XHCI: Tweak comment in SubmitControlRequest.
Re-add page number, and fix verb tense while I'm at it.
2019-02-23 15:07:44 -05:00
Jérôme Duval
150ce798c2 XHCI: calls FreeDescriptor before returning.
introduced in the previous commit.
2019-02-23 21:01:00 +01:00
Jérôme Duval
342c997667 XHCI: revert part of c409803d6f
The TRB_3_DIR bit on the Status Stage was previously correctly set as per the spec:
Table 4-6: Status Stage TRB and Device-to-host and wLength > 0 means DIR OUT.

Also free descriptors when _LinkDescriptorForPipe fails.
2019-02-23 20:33:12 +01:00
PulkoMandy
e12480694e bootstrap: a little more explicit error if things are wrong
There seems to be a problem with the way we set the gcc_bootstrap
package build to depend on the bootstrap package with haiku headers.
If said package cannot be built (for example some definitions are
missing for a new architecture), we end up passing an empty string as
the package to use to haikuporter.

The error message given by Haikuporter is confusing, and not easy to
investigate. So, intercept the error earlier to save time for the next
person to hit this problem.

Change-Id: I64f326e5cb3bb0d44632864ad38ad10bb88d0c7b
Reviewed-on: https://review.haiku-os.org/c/1082
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-23 16:30:50 +00:00
Adrien Destugues
5629675a32 sparc: add defines and minimum set of required files
Gets the stage0 bootstrap to run.
Imlementation is probably nonsense at this point.

Change-Id: I10876efbb54314b864c0ad951152757cdb2fd366
Reviewed-on: https://review.haiku-os.org/c/1061
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-02-23 16:30:50 +00:00
Murai Takashi
be6c334335 STXTTranslator: Fix dead initialization
* Fix dead initialization at line 596. Pointed out
  by clang static analyzer.
* As a result, 'BMallocIO encodingIO' at line 524
  becomes unused, so delete it and header.

Change-Id: Ia62184fe0682a2eedeee42a513faccabdd3d1b59
Reviewed-on: https://review.haiku-os.org/c/1079
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-02-23 16:02:13 +00:00
Augustin Cavalier
88180e2f80 XHCI: Allow commands to time out after 1s instead of stalling forever.
This seems to occur when trying to stop endpoints in certain scenarios,
at least.
2019-02-22 17:14:23 -05:00
Augustin Cavalier
358dd70e16 XHCI: Initialize all fields during endpoint setup.
As we reuse memory on a device for endpoints, this is potentially a
functional change.
2019-02-22 17:12:03 -05:00
Augustin Cavalier
c4db8aba7b XHCI: Delete the device in FreeDevice() before tearing down internal state.
We don't properly tear down endpoints, etc. yet, but when we do, this will
be important as the device destructors are what tells us to do that.
2019-02-22 17:09:09 -05:00
Augustin Cavalier
1464b156f7 XHCI: Minor non-functional cleanups. 2019-02-22 17:08:10 -05:00
Augustin Cavalier
da8c1a9a40 USB: Don't loop endlessly waiting for a physical buffer.
This is used quite a lot in critical transfer paths, so we don't
want to lock things up if no buffers are available for whatever reason.
Wait 2 seconds, and if we didn't get anything by then, return B_NO_MEMORY.

Possibly fixes or helps with certain USB-related lockups.
2019-02-22 13:32:27 -05:00
Augustin Cavalier
7b53b3c2e4 XHCI: Don't compute the error code twice.
No functional change.
2019-02-22 13:32:27 -05:00
Augustin Cavalier
c409803d6f XHCI: Refactoring and fixes to SubmitControlRequest.
* Rearrange some basic setup to be more towards the top of the function,
   so we have less things to tear down upon failures.
 * Don't double-initialize qwtrb0 of the Setup Stage (no functional change.)
 * Rework Data Stage initialization considerably:
   - TD_SIZE refers to the number of remaining TRBs in this TD. As we only
     use 1 TRB for the Data Stage TD at present, this should be 0, not 1.
   - Actually copy data for outbound transfers. (This code does get hit,
     so I'm not sure how it wasn't a problem previously.)
 * Initialize the first quadbit of the Status Stage. (Potentially a
   functional change.)
 * Set the TRB_3_DIR bit on the Status Stage correctly as per the spec.
   (See inline comment.)

Device initialization seems to behave much more smoothly now; at least on
my hardware, the "error Parameter" doesn't happen anymore, and of course
anything depending on outbound Control transfers will now work correctly.
I now get much better speeds from usb_disk, but I still see usb_hid stalls
after this patch.
2019-02-22 13:32:26 -05:00
Jérôme Duval
14263044aa exfat: avoid overflow in Volume::ClusterToBlock(). 2019-02-22 18:38:52 +01:00
Augustin Cavalier
a54fc27a11 XHCI: Check the device object initialized successfully before adding it.
Fixes various NULL dereferences in other parts of the USB stack
when the XHCI controller is not behaving quite as expected.

Possibly related to #13403.
2019-02-22 01:23:08 -05:00
Augustin Cavalier
c7f186b23f XHCI: Make some errors more descriptive.
Also contains some minor coding style cleanup.
2019-02-22 00:39:36 -05:00
Augustin Cavalier
aa5cb68bc6 kernel/fs: NULL is a valid buffer to pass to ioctl().
Another bug exposed by hrev52905. Discovered because Expander was
not displaying archive contents anymore.
2019-02-21 22:12:32 -05:00