Commit Graph

62494 Commits

Author SHA1 Message Date
Adrien Destugues
dd3b46ac1e Package Kit: smarter download resume
Pick the most advanced partial download to resume from if there are
multiple ones.

Fixes the remaining part of #16744.

Change-Id: I0ed7daf42e0346632918552e97d660b4946405cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3672
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2021-01-26 20:25:52 +00:00
Adrien Destugues
f1d4377609 Build fix. 2021-01-26 20:05:05 +01:00
Lt-Henry
52a54e1b51 usb_hid: Enable digitizers to produce button events from tip and barrel switches
Change-Id: Ifcf542e6b04f2f210c80528279e70e0fdd1bb4e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2685
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-26 18:56:32 +00:00
Adrien Destugues
20719db962 sdhci_pci: ignore invalid PCI bars.
Should fix #16778

Change-Id: I8c8ffa1a7ca5bc4613801563c42d5c5d2b3eb539
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3682
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-26 18:55:47 +00:00
Jérôme Duval
ce534c52be hda: disable 64bits dma addressing for some devices
* creative, not supported
* amd/ati/nvidia, supports 40/48bits, disabled for simplicity
* should help with #16491

Change-Id: I736d17b7dc5d4798688f9bd2741705362837b082
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3680
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-01-26 07:27:48 +00:00
Jérôme Duval
9a7acbdbcf posix: protect EOF being parsed as operator and 1
see 7d095c7453/dev-libs/jsoncpp/patches/jsoncpp-1.9.4.patchset

Change-Id: Iaedb67eb51e86cbc5b73a21a86b6b0b6b70209b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3679
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-25 18:53:43 +00:00
Alexander von Gluck IV
170aff0a14 kernel/arch/riscv64: Fix elf image loading / add basic relocations
Change-Id: I0f24ef2585ae9f83a8cff8c145276d54298d1c6b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3677
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-25 17:10:24 +00:00
X512
08e58a41e5 TextView: Select dropped text if focused
This is convenient and used in most text editors.

Change-Id: Ia39b9e6f16cc381a62e10b248033729179a0996c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2110
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2021-01-25 08:13:41 +00:00
Alexander von Gluck IV
3cd3b7029b boot/efi/devices: Use aligned readBuffer for blockio access
* Media->IoAlign dictates a memory alignment for block device
  read buffers. If this alignment fails, sanity checks within
  EFI bioses can prevent us from properly parsing filesystems
  via failed BlockIO ReadBlocks calls.
* Use a static alignment of a sane 2048 which should meet most
  alignment requirements
* Resolves RISCV64 not finding boot partitions. (and likely
  fixes a similar issue on ARM)

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Change-Id: I718511e8630a109414d90d0bae1470cc861a614f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3676
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2021-01-24 14:05:50 +00:00
Murai Takashi
672f7a7d8c Network preference: Fix icon initialization and destruction
- Add more check for icon initialization in _PopulateBitmaps().
- Delete icons in destructor.

Change-Id: Id49861af3df66dcd670524466920a37e5b5d8c22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3658
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-23 19:54:12 +00:00
Adrien Destugues
4cf4daf212 Locale Kit: move catalog add-ons loading to early initialization
The catalog loading has been done lazily since forever (this code was
imported from OpenTracker). It results in a race condition as explained
in #16670.

Moving the catalog loading earlier in the locale loading process avoids
this problem, since load_add_on is called before the locale roster lock
is used.

This should fix #16670.

Change-Id: If07054077f7dde41cb342a43af2abe8422239b05
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3661
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-01-23 12:21:15 +00:00
Adrien Destugues
2028d6386c mmc_disk: implement B_TRIM_DEVICE
Change-Id: Ib08a1e196441f35550fe221b912332b4803a04b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3641
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-01-23 12:20:59 +00:00
Adrien Destugues
cef80a1fb7 devfs: translate partition offsets in B_TRIM_DEVICE
Fixes bfs part of #10336. Untested on SATA (don't have a testing drive
to sacrifice) but working fine on SD/MMC.

This requires moving the copy from kernel to userland into the devfs. As
a result the code in the disk drivers becomes a bit simpler.

Also add some documentation for the common ioctls to implement for a
disk device.

Change-Id: Ie84b6a1d293828d33902a64b3c9d4b19aa6eacb1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3640
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-01-23 12:20:59 +00:00
Autocomitter
a43b8d4634 Update translations from Pootle 2021-01-23 08:40:14 +00:00
Alexander von Gluck IV
f96e84d85f system/efi/riscv64: Move _edata to include rela sections
Change-Id: Ibb97e7b36fce507c129eff15c04b765a5870a9d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3663
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2021-01-22 22:52:52 +00:00
Alexander von Gluck IV
6cd49df637 system/efi: ensure we include all rela and rel sections
Change-Id: I44d8ee7a4c0a6b0cd5ed0fbc2201a1d63fd8dde6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3662
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-22 22:41:50 +00:00
X512
b4d3d516c7 usb_disk: use MutexLocker in usb_disk_ioctl()
Change-Id: Ic3994f6267ea24cf776cb067e0d94226132f4c7e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3638
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-01-21 08:07:05 +00:00
Alexander von Gluck IV
a78cc92a16 build/riscv64: Bump build-packages from unbootstrap
Change-Id: Iba1d9193479d1d39acf705456b58b732764faa4e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3659
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-20 19:38:14 +00:00
Alexander von Gluck IV
d123849688 build/cross-tools: explicitly set ISA for riscv64
* Enable TLS for riscv64. For now select a dummy
  implementation.
* RISC-V has a register (tp) dedicated to TLS
* All the "desktop-like" RV64 chipsets implement GC
* Same ISA we currently build for... but calls it out
  in-case defaults change.

Change-Id: I623b6e5c309b6a6e80ec378e456b2335c561269d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3632
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-20 19:38:01 +00:00
Adrien Destugues
5ec64c5cdd sd/mmc: Cleanup and improve reliability
Store the bus cookie in the mmc_disk driver and pass it to the bus
manager when executing commands. This avoids calling into the device
manager at each read and write operation. The code to get the cookie
from mmc_disk isn't so nice since it needs to access the grandparent
device (the mmc bus root), it would be simpler if this cookie would be
available directly from mmc bus devices.

We can get card removal and card insertion interrupt at the same time
due to insufficient hardware debouncing (the SDHCI spec says we
shouldn't, but it happens on Ricoh controllers. Can't blame them, they
don't advertise themselves as compliant with the spec). So, check the
card status from the interrupt handler and ignore the incorrect
interrupts.

Fix unreliable card initialization: power must be turned on before
starting up the SD clock. Remove a now unneeded delay that was added in
an attempt to avoid initial instability.

Change-Id: Ibd8d051da1a1d859f3924ee535f4a05d9b6398d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3639
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-01-20 19:02:38 +00:00
Adrien Destugues
34552f8e66 sd/mmc: enable 4-bit data transfers
It works, but performance is still unexpectedly low (getting about
50kB/s write speed) with almost no CPU load.

Change-Id: I7da3ee70c8b379c4e6c2250d67f880c78635874f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3630
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-01-20 19:02:38 +00:00
Adrien Destugues
d57b8f90e2 ProcessController: fix layout when running in a window. 2021-01-20 18:29:18 +01:00
Máximo Castañeda
67eeb4db48 MediaExtractor: go back to 3MB min cache size
Should allow us to at least play the same files we could play before.

Fixes #16738, though not its cause

Change-Id: I2d23011696b730a891c802e8c2bfc23afe0041cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3628
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-19 20:29:39 +00:00
Stephan Aßmus
bc1e082b56 BHttpRequest: Treat incomplete downloads as error
When BSocket::Read() returns 0, it was treated as
a finished transfer. This is OK when we don't know
the content length, but when we do, there is no reason
not to bubble up the error. Return B_IO_ERROR in this
case.

Change-Id: I68801dbbb85bcfd2e7aa68fd6a9ded6304e82b19
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3621
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-19 17:05:40 +00:00
Jérôme Duval
bddb122eb4 kernel/xsi_msg: if MessageQueueID() is -1, the message queue doesn't exist
fix #16757

Change-Id: I7c381e18c468b8c209fb275ef5e899c49aa26ffd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3643
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-19 08:07:55 +00:00
Stephan Aßmus
7e677f6465 Package Kit: Delete downloads failing the checksum check
Change-Id: I3a7a914ea88e7b7b5bcc79160f46a9b4fcbba01b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3619
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-18 20:27:12 +00:00
Jérôme Duval
29536a2334 kernel/thread: restore signal mask just before returning to userland
* otherwise the signal to be handled might be blocked. fixes #15193
* also remove automatic syscall restart on _kern_select, to match Linux and
BSDs behavior: this fixes parallel build with newer gnu make, which happens
to use pselect.
* also remove automatic syscall restart on _kern_poll.

from https://man7.org/linux/man-pages/man7/signal.7.html
"The following interfaces are never restarted after being
       interrupted by a signal handler, regardless of the use of
       SA_RESTART; they always fail with the error EINTR when
       interrupted by a signal handler: ...
	select(2), and pselect(2)."
from https://notes.shichao.io/unp/ch6/
"Berkeley-derived kernels never automatically restart select."

Change-Id: I3e9488f60c966b38d427f992f06e6e2217d4adc5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3636
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2021-01-16 18:56:03 +00:00
Jérôme Duval
6ff344d7c6 Revert "kernel/thread: restore signal mask just before returning to userland"
This reverts commit 837f4f48db.

Reason for revert: breaks DNS resolution

Change-Id: If6f2a0f60dbfb24121616a9f3879ce226ea4a09a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3519
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-01-16 16:50:43 +00:00
Stephan Aßmus
60c165a53c BSecureSocket: Treat SSL-zero-return as B_IO_ERROR
Somehow B_CANCELED doesn't seem to convey the correct
meaning. Using B_IO_ERROR will also fit to the recent
changes in the Package Kit and will trigger a re-try of
package downloads.

Change-Id: I58c4d4faa705e6519e0ff9ec7c4654a6151e5486
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3635
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-16 16:32:32 +00:00
Autocomitter
648fdf2310 Update translations from Pootle 2021-01-16 08:51:22 +00:00
Jérôme Duval
837f4f48db kernel/thread: restore signal mask just before returning to userland
* otherwise the signal to be handled might be blocked. fixes #15193
* also remove automatic syscall restart on _kern_select, to match Linux and
BSDs behavior: this fixes parallel build with newer gnu make, which happens
to use pselect.
* also remove automatic syscall restart on _kern_poll.

from https://man7.org/linux/man-pages/man7/signal.7.html
"The following interfaces are never restarted after being
       interrupted by a signal handler, regardless of the use of
       SA_RESTART; they always fail with the error EINTR when
       interrupted by a signal handler: ...
	select(2), and pselect(2)."
from https://notes.shichao.io/unp/ch6/
"Berkeley-derived kernels never automatically restart select."

Change-Id: I7f86d221eae1ad93d8a308a75581d2c30a369c9e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3627
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-15 17:41:33 +00:00
Alexander von Gluck IV
4d0b11bd22 efi/riscv64: Fix missing PE32+ sections, fix characteristics
Change-Id: I13726e7b0ca7500edbb6f182d2c2e7caaddfb72e
2021-01-14 18:19:04 -06:00
Murai Takashi
d271659f96 audio/ac97: Fix DEBUG build
- Fix VERSION macro in auich.h / auvia.h, used for log_create()
  in debug.c.
- Add string.h to debug.c for strlen().

Change-Id: Iff4878763f49fe5b7e317c47e96ebd79f90725c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3629
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-14 20:47:49 +00:00
X512
111df1707b Tracker: add more string types to attributes view
Used in MIME database.

Change-Id: Ieaff506ea8be0fe7d57bfe76fd63439ef4952116
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3625
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-14 18:31:10 +00:00
Adrien Destugues
c2e78713f8 ProcessController: reintroduce the static scaling mode.
There is a very good reason to have this: for low number of cores, the
default computation makes stupidly large bars.

I had tested my changes with various number of cores (1, 2, 3, 4, 8, 16)
in QEMU to make sure it looked correct in all cases. I don't understand
why kallisti5 reintroduced broken code.

This reverts commit b18298348a.
This reverts commit b1b6769b6f.
2021-01-13 13:06:01 +01:00
Adrien Destugues
0e061f0903 FindDirectory docs: clarify where the functions are located
Only the C++ interface is in libbe. The C functions as well as the new
find_path functions are all in libroot.

Fixes #16749
2021-01-13 12:57:00 +01:00
Adrien Destugues
2aa5a0353d mmc_disk: disable currently non working code
Switching to 4 bit mode requires some more coordination as the host
controller must also be switched, right after sending this command.

I will revisit this, but the previous commit was accidentally pushed to
master.

At least we get the 25MHz clock instead of 400kHz, that should already
be quite a performance improvement.
2021-01-12 22:50:00 +01:00
Alexander von Gluck IV
f8650bc2db jam/ArchitectureRules: Bump SDIMAGE_BEGIN to 2KiB
* If we start at 0 we overwrite the partition table
  with the EFI boot filesystem

Change-Id: I7d1d5d65cdaf78f3bd3b87672e1e8e161f78ce75
2021-01-12 15:03:40 -06:00
Adrien Destugues
522c141d53 [WIP] sd/mmc: enable high speed transfers
- Switch to 25MHz clock
- Switch to 4bit transfers mode (the default is 1bit)

Reading and writing SD cards do not seem to work anymore with these
changes. I get invalid data on read, and on write, an interrupt is never
called in some cases.
2021-01-12 22:01:43 +01:00
Adrien Destugues
cf15598562 sdhci_pci: style fix. 2021-01-12 22:01:39 +01:00
Murai Takashi
68ff03664f mail_utils/mail: Fix -Wwrite-strings
Change-Id: I57f231cca2137daee8f1f2f3caa6cd9f282be0ed
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3626
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-12 16:27:24 +00:00
Murai Takashi
acada5ef55 spamdbm: Fix -Wmisleading-indentation
Change-Id: I0f7d5a10e2068f2359f93afff35f44db81b66a53
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3624
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-12 07:44:40 +00:00
Adrien Destugues
2413679304 sdhci_pci: support for inserting cards after boot.
Change-Id: Ic67ea38bb80b35528ebb1a150d1a916a56184e69
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3617
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-01-11 08:11:37 +00:00
Alexander von Gluck IV
b18298348a ProcessController: Just toss static scaling mode all together
* It was making things confusing and honestly the dynamic
  calculation code does a pretty good job.
* Just make sure we scale the scale the CPU bars with a
  multipler that makes sense for a minimum width.
* This should give us a good baseline. Tested 1 to 32 cpus

Change-Id: If41c73e68b2de2b39196013af13e6c0ffdbe6489
2021-01-10 19:06:36 -06:00
Alexander von Gluck IV
b1b6769b6f ProcessController: Fix static scaling mode after hrev54874
* We saw a "big" cpu bar on 1 core.
* This was because adding 8 to the static "15" width
  resulted in the static CPU sizing code getting disabled
* Converting this to 4 just completely disabled the static
  scaling code and made dynamic always enabled

Change-Id: Ida8c718c0d0a2fcf72aedbf525daad040d5b3678
2021-01-10 18:12:53 -06:00
Adrien Destugues
b181ea960c xsi_semget: fix possible way to crash the kernel
I don't know if the behavior makes sense, but anything is better than a
kernel crash. The ticket is an example calling the syscall directly,
so there is no user-oriented guarantee on how we behave here.

Fixes #16741.

Change-Id: I803596004d005c8c0e058c5422c4b0f7c78cfad8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3623
Reviewed-by: Rene Gollent <rene@gollent.com>
2021-01-10 22:08:33 +00:00
Máximo Castañeda
7f9c675629 MediaExtractor: access chunk cache only when we have it
Change-Id: I533bb2e25b0756acaaa227cdd06c4067d4120066
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3622
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-10 22:07:16 +00:00
Jérôme Duval
f9b26e4c30 xhci: SubmitNormalRequest: divide exception on zero trbSize
workaround for #16586

Change-Id: Id9d538f46b62585f4a12c3796781ae1207ed2454
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3611
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-01-10 21:58:02 +00:00
Adrien Destugues
b8d6e720ba DriveSetup: allow formatting a mounted partition
It is automatically unmounted, if possible.

Part of #16304.
2021-01-10 21:32:30 +01:00
Adrien Destugues
7de9578142 ProcessController: fix huge bar for low CPU systems 2021-01-10 20:46:59 +01:00