Commit Graph

64817 Commits

Author SHA1 Message Date
Niels Sascha Reedijk
b70a0efa9e NetServices: Notify any async listeners when a request completes early.
The API allows a user to end parsing responses earlier if the response has a
client (4xx) or server (5xx) error code. The end user should still be notified
of this result, so that they can act.

Change-Id: I11f2ab296658f767b5b34e10badb54de27aab494
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5910
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-14 16:53:40 +00:00
Jérôme Duval
76ddb69a3a usb_raw: abort transfers cleanly on kill, fix use-after-free
* aborted transfers will release the notify semaphore when the cancel is notified.
* the allocated buffer would be freed on return, while the usb stack eventually copied
data in the buffer in our back, leading to KDL crashes, because the freed buffer would
be right reallocated for some kernel team structures.
* regression introduced by hrev55806, the transfers didn't need to be cancelled before.

Change-Id: Ifb6e941f71d05c37c36f878059c33883bb72a67c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5905
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-14 04:53:09 +00:00
X512
215b685f7f kernel: Drop non-standard GNU inline assignment syntax
* We needed this previously due to our gcc2 compiled kernel.
* Now that our kernel is always latest gcc, we can move to the
  c++20 syntax for inline assignment.
* Improves compatibility with clang, less GNU-specific stuff

Change-Id: Ib7272a0a52554a31e9a0e788fd3f031db9049795
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5898
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-13 20:49:53 +00:00
Alexander von Gluck IV
67d20a5856 ahci: drop failure to obtain pci x86 module error
* Contributes a lot of spam to syslog on non-x86

Change-Id: Ia22a1f6d167b9a9576cca6694dca99d853dad2d0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5902
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-13 20:28:13 +00:00
X512
54fb2560ae bus_managers/fdt: register multiple fdt/compatible attrs
Change-Id: I71efa8051d104d4b6a627071cd231c887271eb2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5901
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-13 01:55:44 +00:00
Adrien Destugues
b358c4c49f hoard2: make block header size a multiple of 16 bytes
On 32bit x86 gcc11, allocations should be aligned to 16 bytes, but the
block header (which is stored before the allocations) contains two
pointers, which on a 32bit system results in 8 bytes. Add some padding
to make this header 16 bytes, guaranteeing that the data area is
actually aligned.

Fixes #18111.

Change-Id: Id23f8c0272d75090710f872b728852cd0fcb19ac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5885
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-13 01:55:04 +00:00
Oscar Lesta
3af8011358 env vars: move XDG Base Dirs variable exports to SetupEnvironment
This makes sure that apps get access to these variables regardless if
they are started from a shell or from GUI (double-click from Tracker,
desklink, etc).

Fixes #18130.

Change-Id: I82e2884e460fad7d6ec16e7b624c5cd2fcf807df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5897
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-13 01:49:55 +00:00
X512
36fa4b7e7d debug_server: improve stack trace
Change-Id: I94fc9e9e547f0191484cad8e7dc6e8b233b981db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4299
Reviewed-by: David Karoly <karolyd577@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-12 15:49:12 +00:00
PulkoMandy
6e8c897e21 Tracker: Always use thumb attr when there is one
... even when the "Generate image thumbnails" setting is off.

This allows applications to generate thumbnails for 'non-media' files.
For example I use this in the ACE Amstrad CPC Emulator, to add a
thumbnail to emulator savestates (snapshots) with a screen capture of
the machine.

Change-Id: I95b0e4c64f5b1ffa779512755f70cfd9c1881661
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5768
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: nephele <nep@packageloss.eu>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-12 10:26:58 +00:00
X512
fa557843f2 riscv: use atomic CSR bit set/clear operations, refactor
Fix race conditions that cause broken timer interrupts.

Change-Id: I78e13a18d394b1566977e894a1def16a66c9ca5f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5883
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-11 18:43:15 +00:00
Murai Takashi
09b2fc9e11 libnetservices2: Fix Use-after-move
Pointed out by Clang Static Analyzer.

Change-Id: Ifbf5bd5e02825e60f7b70b7f99093b6b9740f81d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5896
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2022-12-11 12:50:05 +00:00
Humdinger
d3811d0036 Thumbnail: fix off-by-one of Height/Width attribute
Fixes #18128

Change-Id: I3abe72552657517acece101a1653b2f013b4f23f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5881
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-08 20:38:57 +00:00
Augustin Cavalier
140013f27a libroot: Fix open flags in shm_open.
We need O_CLOEXEC here, not FD_CLOEXEC (which is equal to 0x1, which
in openflags is O_WRONLY and thus leads to the conflicts caught by
the previous commit.)

Fixes haikuports/haikuports#7524.
(cherry picked from commit 59e09f7beb)

Change-Id: I5751822ac48ae7a865755494da241e4bfd34c45f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5853
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-07 22:59:58 +00:00
Augustin Cavalier
7cc1c1af2e kernel/vfs: Validate that only one of O_RDWR or O_WRONLY is used, if any.
Otherwise we will have open modes that could have both and lead to
confusion in code that presumes only one will be set.

This catches the cause of some ported software (e.g. Wayland layer)
misbehaving with ramfs mounted in /var/shared_memory: the ramfs does not
properly handle both flags set, and due to another bug, they are for
shm_open'ed files.
(cherry picked from commit 9bc250e28d)

Change-Id: I9e98be89b6d4a2da90f74c048b4f762ca9cf8738
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5852
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-07 22:59:58 +00:00
xoblite
6dd06f66d0 Updated the PCI and USB ID lists to the latest versions.
From their respective GitHub repositories:
https://raw.githubusercontent.com/usbids/usbids/master/usb.ids (version 2022.05.20)
https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids (version 2022.12.04)
Change-Id: I9348da6c4dca920e85ea607e8e6c4cf5c2cc41b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5874
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-07 22:47:29 +00:00
X512
bf2786efae kernel: enable ramfs build and automount to shared_memory directory
This will allow proper operation of POSIX SHM API (shm_open etc.).
Now memory files are stored fully in memory and do not affect disk
storage (except swap if enabled).

Change-Id: Iae3ce1afa968df72e82198e598a273cbf7cb0269
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5802
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-01 02:09:21 +00:00
Augustin Cavalier
05b654c67c ramfs: Fix SMAP violations in DataContainer. 2022-11-30 21:07:23 -05:00
Augustin Cavalier
396e3dfb9c ramfs: Switch from an embedded to a separately allocated small buffer.
This saves 16 bytes in the class vs. the old size, but more importantly
allows us to avoid allocating VMCaches and wasting an entire page for
any attribute larger than 32 bytes; instead, attributes can be up to
1024 bytes before we allocate a full page for them.

Unfortunately small files cannot take advantage of this optimization
right now as the cache is always used for them. I added a TODO about
this.
2022-11-30 20:27:17 -05:00
X512
f0e187c3fd kernel: follow-up to hrev56619: use new(std::nothrow)
to handle allocation failures.

Change-Id: I15d84b24dcea17741382b1d5285acf6219a39811
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5868
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-30 23:48:17 +00:00
Zelenoviy
07ca9bce14 termios: fix raw mode initialization
Change-Id: Ibdf0b84fd3ef47c091a670b1cdd00edf2cde196d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5869
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-30 23:47:12 +00:00
Jérôme Duval
fb69e06195 kernel: load cpu amd microcode update if loaded by the bootloader
we detect basically the cpu info before loading the microcode,
to be able to detect the vendor, and avoid any update on hypervisor.

I couldn't test because my cpu doesn't have any update available.

Change-Id: I6aea830158423b3ee13b640be8a788fc9041e23c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5859
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-30 08:50:59 +00:00
Jérôme Duval
616edea7fb boot_loader: load amd microcode update data file
switched to non-packaged paths

Change-Id: I331d4d6ed1af1ce6fa68109c9c6baf4a92bdc7b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5858
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-30 08:50:59 +00:00
Augustin Cavalier
4e742d81ab ramfs: Volume->WriteLock but do not unlock in unmount.
As, of course, we are deleting it. This problem was obscured by the
one fixed by the previous commit.
2022-11-30 00:24:36 -05:00
Augustin Cavalier
605ecac1ee ramfs: Correct "reference" (link) counting of Node objects.
* RemoveReference() could delete us immediately, thus we must do
   all important work before invoking it.

 * Add assertions about fRefCount and remove a spurious add.

 * Do not use Link but PublishVNode on the root, as we manually manage
   when this object is published/deleted.

Fixes #18032.
2022-11-30 00:24:24 -05:00
Augustin Cavalier
6a8bb0562e ramfs: Correct usage of Nodes in Entry.
* We do not want to set fNode in the constructor but let the invocation
   of Link() take care of doing so instead.

 * Link/Unlink manipulate linked-lists. Thus it is dangerous to use them
   in tandem on the same Node object. Add a check for this.

 * Minor cleanup.
2022-11-30 00:17:58 -05:00
X512
8426404f97 pch_i2c: move to its own directory
Prepare for more i2c host controller drivers.

Change-Id: I85a4faf8376ffb501994a2bd89e0903bd89ed8cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5856
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-30 05:11:51 +00:00
Augustin Cavalier
80ae26e14b kernel/legacy_drivers: Use new/delete instead of malloc/free. 2022-11-29 22:36:08 -05:00
Augustin Cavalier
8f75eaafd0 VMAnonymousCache: Use new/delete instead of malloc/free. 2022-11-29 22:34:43 -05:00
Augustin Cavalier
549abba75f kernel/low_resource_manager: Use new/delete instead of malloc/free.
No functional change as-is, but this is necessary with some experimental
patches I am testing which add a lot more assertions to DoublyLinkedList,
which thus require it to have constructors/destructors for the Link class.
2022-11-29 22:34:26 -05:00
Augustin Cavalier
f6166140a1 build: Define _BOOT_MODE once and for all in ArchitectureRules+BootRules.
Previously it was spread all around the tree, and was not defined
consistently for all boot objects (there were a number of boot modules
which did not define it, but did include headers which checked for it.)

Now, as it is handled in SetupBoot which is invoked for all boot objects,
it will be applied consistently throughout. We can thus drop the manual
additions of it from all Jamfiles.
2022-11-29 20:18:12 -05:00
Augustin Cavalier
d48f4fd05f ramfs: Prevent creating files or directories named "." and "..".
Fixes #18031.
2022-11-29 19:08:16 -05:00
Augustin Cavalier
05fdda96b7 ramfs: Acquire write lock before unmounting.
Might help with #18032.
2022-11-29 19:06:56 -05:00
Augustin Cavalier
d5c130a3f9 ramfs: Whitespace fixes, no functional change. 2022-11-29 19:05:23 -05:00
Augustin Cavalier
9d679d7f5a debug_server: Restore <algorithm> include to appease GCC2. 2022-11-29 18:04:46 -05:00
Augustin Cavalier
f2dd9acf72 nvme_disk: Use a recursive lock instead of a mutex.
It appears on some controllers we can wind up in cases that are
a double-lock, otherwise.

Should fix #18093.
2022-11-29 17:51:31 -05:00
Augustin Cavalier
b85db63d2b debug_server: Make use of BControlLook::ComposeIconSize.
Change-Id: Ic5298f9fff3c0d9c4b3733fa99c43781edfabad7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5842
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-29 21:27:52 +00:00
Augustin Cavalier
5f40b96c35 libroot: Adjust malloc_hoard2 to use max_align_t when available.
Spotted while investigating #18111, but likely does not fix it.
This matches the existing behavior of the runtime_loader heap.
2022-11-29 16:14:13 -05:00
Augustin Cavalier
7255d28854 Tracker: Do not try to change to an invalid or unset icon size.
This can happen if we are already at the largest or smallest size.

Fixes #18066.

Change-Id: Icf68627ea51a054dac806ec0c9258bc80c869483
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5840
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-28 22:28:59 +00:00
Máximo Castañeda
753349fb2e WebPositive: save the cookie jar in the user settings directory also for the curl backend
The files and formats are different for libnetservices and curl
backends, but now they are under the same directory whatever the
installed haikuwebkit version uses.

Change-Id: Iab87d5fd27ebea1fa0a8967a9802dfa2fb11240a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5835
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-28 19:49:07 +00:00
Jérôme Duval
652d5f6347 ccp: driver for the RNG part of CCP on AMD
the entropy source is read every second and pushed to the PRNG.
the PCI device is tested, not the ACPI.

Change-Id: I9bb6b21c7189b28a1d8a624d83b33ff6682152dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5825
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-28 13:33:01 +00:00
Jérôme Duval
bce7dc883a silicon_image_3112: use kernel read/write protection for map_physical_memory
Change-Id: I04655afb3f552e5919923ab96f96f32d0f8db6b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5834
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-27 17:06:27 +00:00
Jérôme Duval
685e124c99 tty: let processes open a slave tty again, ignoring O_NOCTTY.
they just won't control the tty.
fixes https://github.com/haikuports/haikuports/issues/7457

Change-Id: I8968b620a39c3050f6498faaa95c25aaed86e5c1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5832
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-27 11:32:47 +00:00
Jérôme Duval
17ec9b7f4e libroot/glibc: apply upstream fix for _itoa: "Make sure at least a zero is emitted."
6cae39579b
fix #18098
Change-Id: I1b29f8cf723bf0731ed0be3a2ab3d2b152af449c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5833
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-27 11:31:16 +00:00
Jérôme Duval
3a42882e0f intel_extreme: check another register when finding out hw_cdclk on Haswell/Broadwell
doesn't help with #18084

Change-Id: I6f3cc8b50fc5742fab3021f01b90dfebe484b336
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5830
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-26 12:56:08 +00:00
David Karoly
756f03a03d ldscripts: remove mipsel
Change-Id: I94c554553a751ce83166c43ed55cee9df7ef0f81
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5828
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-11-25 17:44:16 +00:00
Jérôme Duval
e8deaebd62 kernel/x86: dump the CPPC feature
Change-Id: Ic4d286108520147defd6251a15943a14ab96e264
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5829
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-25 17:24:47 +00:00
Jérôme Duval
739d4da07b amd_pstates: introduce a AMD P-states driver for Ryzen with the CPPC feature
tested on Zen2 (Ryzen 3 5300U)
This support was submitted in October for inclusion in Linux.
Haiku supports only two profiles. We could probably add some more, and let the driver says which it supports.

Change-Id: Id7754b445bc32a691d58a1e4af630351562abc22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5826
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-24 06:26:13 +00:00
Jérôme Duval
34e9243872 random: always use the PRNG, and use entropy sources to feed it
remove the yarrow module. the hardware modules can push entropy with queue_randomness().
virtio_rng will now push entropy every 300 seconds.
helps with #14937

Change-Id: If76c5deabf61dc616a0e051332f44b89deb6b8a1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5824
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-21 18:28:41 +00:00
Augustin Cavalier
0843085384 FAT: Limit volume names to 11 characters, not 10.
The rest of the code does a memcpy(..., ..., min(11, strlen(...))
so clearly no NULL terminator is needed and 11 is the real limit.

Should fix #18074.

Change-Id: I6aea166899eab2bab9511ca52981ccc9172b6c17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5823
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-19 01:58:42 +00:00
Máximo Castañeda
5728bdf606 BAlert: invalidate icon view on icon change
Invalidating the layout may not be enough for an update.

Fixes: #18069
Change-Id: I93f6b0feb043c7f317a9ff1e7af11b2047fc7cd5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5821
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-17 21:39:13 +00:00