Commit Graph

9496 Commits

Author SHA1 Message Date
Fredrik Modéen
6cd4da00c0 SettingsMessage: Add uint16 and uint64 support
* Thanks to kottan I notices something was of..
* Added uInt16 and uInt64, I was missing UInt16.

Change-Id: Id136dbb5a81392a7a694ac1fbbd9aefbd7f77af3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3888
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-05-01 12:58:34 +00:00
Jérôme Duval
20308ad6a7 build: follow-up for hrev54993
should help with bug #16929, untested

Change-Id: Ia7b9b6cc8e84e2377d79c0edd1c278cdf74d869b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3891
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-30 10:42:21 +00:00
Zoltán Mizsei
13e1bb0e0d Enable GCC11 as GCC4 compatible ABI
Change-Id: I55faec61f9f3162108c5ad4da11bad588663c9d1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3890
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-04-30 06:11:02 +00:00
Han Pengfei
2db2b2123b headers: Make structure padding explicit in efi_memory_descriptor
The EFI memory descriptor 64-bit aligns PhysicalStart on both 32- and
64-bit platforms. Make the padding explicit for arm efi and referring
32-bits platform.

- Same fix in FreeBSD: https://reviews.freebsd.org/rS320234
- Confirmed with NetBSD: https://github.com/NetBSD/src/blob/trunk/sys/external/bsd/gnu-efi/dist/inc/efidef.h#L191
- Confirmed with Linux: 5ee96fa9dd/include/linux/efi.h (L137)
- Confirmed with Zircon: https://github.com/vsrinivas/fuchsia/blob/master/zircon/kernel/lib/efi/include/efi/boot-services.h#L34

The Early Zircon/Fuchsia version has the same problem we have, apparently they did not
test their header on 32bit platforms either, now They have got it fixed.

Signed-off-by: Han Pengfei <pengphei@qq.com>

Change-Id: I0c685d41420c4a63773a7bb39b7d2fdd61e932c4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3875
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2021-04-21 09:28:45 +00:00
Han Pengfei
d3b7fb5a1d headers: Update efi headers from current versions in Zircon
- Add device path message macros
- Add serial terminal defines

Signed-off-by: Han Pengfei <pengphei@qq.com>
Change-Id: I9760c506eae49a7d0c474a13b2d2a97a369be3b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3878
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-21 07:16:43 +00:00
Rudolf Cornelissen
375a70e9fd Fixed I2C buses not working on C51 (some Geforce 6100/6150/Go cards). DDC/EDID should now work on all supported cards. 2021-04-18 00:51:46 +00:00
Fredrik Modéen
6375ef053d Move SettingsMessage to a central location
* Move SettingsMessage
* Remove SettingsMessage from MediaPlayer and WebPositive
* Use the central SettingsMessage in MediaPlayer and WebPositive (Later Bluetooth)
* Fix a Jam file.

Change-Id: I3bb82a40082c5ece5c2aea2468a77bcd9f15ce77
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3856
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-11 08:53:18 +00:00
Fredrik Modéen
91cbfa855e Bluetooth Pref: Inactiveate button and things that don't do anything.
* Inactiveate button and things that don't do anything.
* Those button and controlles that hade any actions in the Bluetooth Pref now saves in settings.
* Fix some windows/views.
* Fix Copyright in last Bluetooth commit.
* Last commit before we move saving settings with BMessage.
* Changed PoupMenu to BOptionPopUp

Change-Id: I32b85f1985b558d24b294a184665e08e6ce18a7d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3829
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-10 20:28:43 +00:00
Fredrik Modéen
16196fd3b7 Bluetooth Pref: Updating view of incomming connection when Paring
This is not my code but from ticket #9265
* Made a picture of how it looks, old left andnew right. https://imagebin.ca/v/5wIe6TIMzw4C
* Think we have a bug somewhere and don't store the name of the Bluetooth device (shown i the image).
* I have made som small changes but other than that it's the same code as in the ticket
* Ran the src/tools/checkstyle/checkstyle.py to get som style stuff, probably missed some anyway.

Change-Id: Ifeb75c8ad890f541e100cdcf78b394675a48ada9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3825
Reviewed-by: Fredrik Modéen <fredrik@modeen.se>
2021-03-30 17:25:13 +00:00
Murai Takashi
560961ee2a Bootloader: replace blacklist with blocklist
Various projects, both commercial and OSS, began to use inclusive
terminology. There is no reason to not do it.

In Haiku, bootloader uses Blacklist, which is recommended to replace
with Denylist or Blocklist. I think Blocklist is appropriate here,
since it's a list used to block offending driver at boot.

Some strings remain unchanged for compatibility with previous naming,
but this change prepares for later removal of these (once everyone has
updated their kernel and bootloader).

Change-Id: Id9105ff5e9fcb866000355089b5ef97bf63ee854
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3145
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-27 10:47:33 +00:00
Niels Sascha Reedijk
f97357a6ed Fix building on Haiku after hrev54993
Build tested on Linux.

Change-Id: I911ac42d99a0c1e94cab77dc29bf43d8f7f91093
2021-03-24 11:19:25 +00:00
Jérôme Duval
45872f7f9c kernel/vm: restrict permission changes on shared file-mapped areas
a protection_max attribute is added in VMArea.
a read-only opened file already can't be mapped shared read-write at the moment,
but can later be changed to read-write with mprotect() or set_area_protection().
When creating the VMArea, the actual maximum protection is stored in the area,
so that it can be checked when needed.
this fixes a VM TODO.

Change-Id: I33b144c192034eeb059f1dede5dbef5af947280d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3804
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-23 17:40:31 +00:00
Niels Sascha Reedijk
9335a062be Revert "Fix building on Haiku after hrev54993"
This breaks the build on other platforms, so it needs a bit more thought and testing.

This reverts commit d0834b34d5.
2021-03-22 22:52:50 +00:00
Niels Sascha Reedijk
d0834b34d5 Fix building on Haiku after hrev54993
Change-Id: I052aad6374ae7ab7b4bcbf47bd88cd84193a9879
2021-03-22 21:10:09 +00:00
Dancsó Róbert
2cba2d5642 Added localization support for Cortex app.
* Fixes #7530.

Change-Id: I238c4c8fe32b181a8e1a4bd688bcbe9f3a87f79f
Signed-off-by: Kacper Kasper <kacperkasper@gmail.com>
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3169
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-22 18:50:39 +00:00
Jérôme Duval
267c6a9b0d Locale: correct fix binary compatibility for BNumberFormat
fix HaikuDepot build after hrev55006

Change-Id: I3c275e1b0f23f936db448ad82639458535617d6a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3809
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-03-20 09:30:14 +00:00
Jérôme Duval
e3c3983827 Locale: fix binary compatibility for BNumberFormat
Issue: https://github.com/HaikuArchives/Album/issues/15
Change-Id: I1f8d5055f929957adb0cca20a8f6b13bcccabfab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3807
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-19 10:53:15 +00:00
Jérôme Duval
b2b83ad10f runtime_loader: dlopen() should respect RPATH of the loading module
Change-Id: Ic58edb53114dfff30cc7188957cd32508fa8bd48
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3798
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-03-18 08:19:55 +00:00
Jérôme Duval
3592432e9b utmpx.h: add ut_host for compatibility (not posix)
Change-Id: I27e8f7b6dbc29232542e3749d8e194efa2ef5209
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3799
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-16 16:55:44 +00:00
Niels Sascha Reedijk
fc03b45a71 POSIX: make readv() and writev() conform to IEEE Std 1003.1-2001
The standardized version of readv() and writev() take an int as the third
parameter. Arguably a size_t makes more sense, but the standardization bodies
decided otherwise.

The non-standard functions of readv_pos() and writev_pos() have been updated
for consistency. The corresponding _kern_readv() and _kern_writev() internal
functions continue to take the size_t parameter.

The ABI will not change, even though on 64 bit machines the size of the count
parameter will change from 8 to 4 bytes.

The actual use will be slightly different. Like with the size_t argument type,
it will not be possible to give a count lower than 0. If the value is less than
0, then the B_BAD_VALUE/EINVAL error will be set.

Change-Id: I949c8ed67dbc0b4e209768cbdee554c929fc242e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3770
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-03-16 12:03:02 +00:00
Alexander G. M. Smith
3376ed1a72 Package Kit: Proper Installation for First Boot Packages
Do the final installation operations for all the packages in the
/system/packages directory when the OS is booted for the first time.

This will run their post-install scripts, create users, groups and generate
settings files (marked with a package version attribute).  Previously we just
ran all the shell scripts found in the /system/boot/post-install directory
(don't do that as much now).

Fixes bug #14382

This patch has simpler code flow in CommitTransactionHandler::_ApplyChanges
Tested on 32 and 64 bit systems.  Once it's official, need to remove the
open_ssh redundant post-install script that creates users etc. from HaikuPorts.
Now we can notice bugs like package version attributes on settings files aren't
fully working. :-)

Didn't remove special case for add_catalog_entry_attributes.sh since it
still does stuff that the build system doesn't do.  Might be able to add
that script as part of the Haiku.hpkg.  See change 3751 for removing it,
https://review.haiku-os.org/c/haiku/+/3751

Change-Id: I3807b78042fdb70e5a79eca2e2a45816ece0236f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2342
Reviewed-by: Alexander G. M. Smith <agmsmith@ncf.ca>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-14 09:10:18 +00:00
Andrew Lindesay
564de1924a Locale: Support for Percent Formatting
Updates BNumberFormat to be able to format
percentages.  Also re-introduces some unit
tests and updates the BNumberFormat ones.

This doesn't actually fix #16312 as the
defaults for percentage formatting don't seem
to track the selected language, but goes part
way there.

Related to #16312

Change-Id: Id6ddf426ce5571f4e8513c0eb1663cf42ac53cb1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3767
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-13 00:29:32 +00:00
Leorize
78b1442051 libbnetapi: BUrlRequest now outputs to BDataIO
Previously, BUrlRequest returns data received via a callback that can't
return any value. This approach have several issues:

- It's not possible to signify failures to the request.
- Users have to implement custom listeners just to handle the common
  case of outputting to a buffer/file/etc.
- The received data has to be serialized into BMessage when
  BUrlProtocolDispatchingListener is employed. This can cause a
  noticible slowdown in real-world scenarios as evident by #10748.

With this change, BUrlRequest will output directly into a BDataIO, which
exposes a richer API for request handlers to work with (for example a
BitTorrent client can request a BPositionIO for non-linear data
delivery), as well as simplifying common cases for users.

The adaptation only requires one additional API:
BHttpRequest::SetStopOnError(). This API simply instructs the HTTP
request handler to cancel the request if an HTTP error is occurred.

Change-Id: I4160884d77bff0e7678e0a623e2587987704443a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3084
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-02-28 20:39:31 +00:00
Leorize
3e27f8d5a7 libbnetservices: BUrlResult is no longer a BArchivable
The switch to make BUrlResult serializable was debuted in
f9e1854f19 with the rationale is that
BHttpRequest auto-redirection might cause the headers to become
obsolete by the time a client process the BMessage received from
BUrlProtocolDispatchingListener.

With the change to BHttpRequest to not notify listeners when
auto-redirection is enabled, this is no longer the case and the
serialization code can go away now. This simplifies BUrlResult and its
subclasses, and gain us some performance for clients using
BUrlProtocolDispatchingListener as the result object no longer has to be
serialized.

This also change the ABI of BUrlProtocolListener::HeadersReceived to no
longer passing a BUrlResult.

Additionally, BUrlResult and BHttpResult now express the size of the content
as an off_t, thus allowing results larger than 4 GB.

Change-Id: I9dd29a8b26fdd9aa8e5bbad8d1728084f136312d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3082
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-02-28 20:39:31 +00:00
Jérôme Duval
c1e6e51a05 libroot: implement timegm calling the ICU backend
Change-Id: Ib4de4288e061670acbc2edea3671cee029305d33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3748
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2021-02-24 05:51:44 +00:00
Jérôme Duval
99bd3b947f SupportDefs.h: remove the unichar type
irssi uses the unichar typename with a different type.

Change-Id: I2ee9dcf685f4832dd1b3c7d68f4686d69de50fb7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3656
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-02-09 16:47:55 +00:00
Andrew Lindesay
d75b4d610d HaikuDepot: Remove Custom List
Further removal of the use of custom list class;
this time with the package lists.

Relates To #15534
Change-Id: I1f01ed9d5ddbd7754097ce0adbf505d6ba17fd2f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3732
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-02-06 19:45:53 +00:00
Jérôme Duval
acdafb571d Debugger: fix build after hrev54931 2021-01-29 21:38:10 +01:00
Adrien Destugues
6f3a5c9ab0 Debugger: add AVX support
- Unify storage of "FPU" registers between debugger and signal handler
  to use xsave format on both sides
- Handle YMM registers in Debugger (they are the same as XMM, but wider)

Tested:
- The system still boots with and without AVX
- The hello_avx test program can be debugged and the full value of YMM is visible

This changes the API of vregs in signal.h but not the ABI (structure are
declared differently but memory layout is the same). This changes the
API and ABI of arch_debugger.h for x86_64, but I don't think anything
outside Haiku uses it (did we ever have a 64bit compatible gdb?)

Change-Id: If93680ffa0339c19bab517876b4e029f5d66b240
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3038
Reviewed-by: Rene Gollent <rene@gollent.com>
2021-01-29 13:29:10 +00:00
Niels Sascha Reedijk
e95af9e0ef libnetservices.a: final cleanup after progress size change to off_t
Final fallout of the hrev54936 change

Change-Id: Id4836359f49dffbef76916db7fb7b51dd1e490d8
2021-01-28 11:08:10 +00:00
X512
626466daa4 Network kit: use off_t for download and upload size
This change only applies in libnetservices.a. The implementation in
libbnetapi.so will use the original definitions.

Change-Id: I0aaa5a40af5fbcafaf233c32206cb4af862f8141
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2465
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-28 09:50:23 +00:00
Niels Sascha Reedijk
2a7090df71 libnetservices.a: move BGeoLocation from libshared.a
The BGeolocation class uses the network interface in libnetservices.a, so it
is moved here for now.

This will break any out of tree projects that depend on it, but it is a source
incompatible change only.

Change-Id: I6f5b1332eb87ad37dd33fbe09fdb11b16f7f26e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3670
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-27 19:53:11 +00:00
Niels Sascha Reedijk
ce64ffdb90 libnetservices.a: Put the experimental API into BPrivate::Network namespace
In order to prevent classes between libnetapi.so with the legacy API and
applications using the libnetservices.a library, the latter will have the
classes in a distinct namespace.

In the implementation, both libbnetapi.so and libnetservices.a will use the
same header and source files. If LIBNETAPI_DEPRECATED is defined during build,
the headers and source will have binary compatible behavior. Otherwise, the
classes and other objects will be put in the HaikuExt namespace.

In order to build the libbnetapi.so and libnetservices.a with the proper
build configuration, there is a stub `src/kits/net/libnetapi_deprecated` folder
that applies the special configuration to the source files.

Currently HaikuDepot, Webpositive, libshared.a and the http_streamer add on
use the compatible API in libbnetapi.so.

Change-Id: Ic73e9f271ef75749adda46f6f72e9a0b2851b461
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3667
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-27 19:53:11 +00:00
Niels Sascha Reedijk
603e0bdf62 libnetapi.so: make headers of deprecated classes private
These classes have been moved to the public API too soon, and they need some
more time to mature before they can be declared stable.

Change-Id: I9c52a8e6cc103922abde7a6b911fe0c3e6bf5700
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3665
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-27 19:53:11 +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
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
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
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
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
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
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
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
Adrien Destugues
f15516ff92 Package Kit: re-use downloads from unfinished transactions
There are three parts to this change:
- In FetchFileJob, if the request fails with a timeout or IO error
  (probably because of unstable connection) attempt to resume the
  download with a range request. No limit on number of retries
  currently, maybe we should add one.
- In PackageManager, before downloading a file, look around in other
  transaction directories in case it's already there. Partial and
  complete downloads are differentiated by an attribute which the
  fetch file job maintains. For complete downloads, no fetch job is
  scheduled, for partial downloads, the fetch job will request the
  remainder of the file.
- In BHttpRequest, the implementation of SetRangeStart() and
  SetRangeEnd() have been added, along with some refactoring to
  handle listener notifications consistently. This also fixed a
  bug where the final notification for download progress was not
  emitted for compressed data.

Fixes #12414.

Change-Id: I3e285741ed0e5651594a7c2e1c7170644a9d297d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3404
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-01-09 15:20:09 +00:00
Adrien Destugues
437df0a3fb x86_64: fix build
This code was accidentally removed but is still needed.
2021-01-08 13:38:29 +01:00
Adrien Destugues
68d37cfb3a Fix definition of PAGESIZE and B_PAGE_SIZE
On sparc, the minimal page size we can use is 8K. Since B_PAGE_SIZE and
PAGESIZE defines were hardcoded to 4K, this resulted in a lot of
confusion in all code trying to manipulate pages.

- Remove cpu.h from headers/private/kernel/arch/*. It dates back from
  NewOS and was not used anymore since our kernel uses B_PAGE_SIZE
  (PAGE_SIZE was the only thing defined in this header).
- Add posix/arch/*/limits.h with the arch specific page size and include
  it from the main limits.h.
- Adjust bios_ia32/debug.cpp which was the only place using the
  PAGE_SIZE constant from the deleted headers.
- Change OS.h to define B_PAGE_SIZE to be the same as POSIX PAGESIZE.
- Define PAGESIZE in the build header if the host OS doesn't.

Change-Id: I8c3732cf952ea3c2f088aa16d216678fbf198b96
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3558
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-08 12:02:16 +00:00
X512
c46f51fb45 BReference: add IsSet method
Change-Id: Ibc34dbde3b81faecdc7fe66a2c07fc33d7871ce2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3487
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-01-08 09:56:38 +00:00