Commit Graph

54572 Commits

Author SHA1 Message Date
Humdinger
c3162b5d8a MailMessage: Fix date in header of forwarded mails
As investigated by madmax in #18230; Date() returns a time_t since 2015. Thanks!

Change-Id: Ic35129ad60f6cadc09917c05e86f726de3061dcb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6010
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-21 16:51:57 +00:00
Alexander von Gluck IV
7cfd9e92cf tests/qemu-boot-test: Adjust arm64 cpu to max per David k.
* Gets us into the haiku kernel when booted with u-boot

Change-Id: I70aa6cf4c9d8894cf13771e97652778215fe0ab7
2023-01-19 13:00:57 -06:00
Alexander von Gluck IV
ce41afe7f8 tests/qemu-boot-test: Add initial arm64 boot test case
Change-Id: I108a27408873330169de3ab31eecb2fd034ee628
2023-01-19 11:41:33 -06:00
Máximo Castañeda
8e2cd40d9e FontManager: use correct constants for default styles
Reapply part of 12ae5308f2 that was lost in the long revision history of
user fonts. No big deal as the values are the same.

Change-Id: I26bbceb0380b33e35b105519a11e309500f9acf6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6006
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-01-18 17:26:43 +00:00
Murai Takashi
4cff9918f3 screen_savers/flurry: Remove duplicated code
Pointed out by Clang Static Analyzer (Dead assignment).

Change-Id: I3360c52ec42ca1695d4bc45a422fd91de1a349e1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6005
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-18 14:20:26 +00:00
Pascal Abresch
99d1318ec0 Fix userguide localization
Change-Id: Ie52a545b4e50ef3d87c7bfb26e54772fd7816377
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5974
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2023-01-18 12:46:12 +00:00
Humdinger
281ece0b8a Terminal: Menu "Theme settings..." -> "Colors..."
"Colors" is simpler, better translatable and currently more
correct. A "theme" is broader, including backgrounds, fonts,
mouse cursor, sounds etc.
For a Terminal it's mostly colours. Fonts are being handled in
the "Settings" panel.

Change-Id: Icf043fffbc64d976db7a71c28c41aeea0cdf44e6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5999
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-01-15 22:13:23 +00:00
Pascal Abresch
75070a4089 ShowImage: Fix status view font size
Change-Id: If29226e01c0ea24c367c029f87225822f0f1509d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3756
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-01-15 08:49:19 +00:00
Pascal Abresch
322be3bee0 StatusView: compute font size based on scrollbar size
Compute a font size that just fits the available space, instead of using
an arbitrary scaling. This makes the code adjust to any font and any UI
size.

Select the appropriate font using a binary search, which will need only
a few attempts (I think 6 font sizes will be tried at the default
config)

Change-Id: Ie3b8678678c0d940981f1785418aa8ab354d01c5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3893
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-15 08:45:06 +00:00
Kyle Ambroff-Kao
fb0b77979a loopback: Bump default MTU from 16KiB to 64KiB
While profiling with iperf for #18203 I noticed that the default MTU for
the loopback interface is 16KiB. Other operating systems set this quite
a bit higher. Linux sets it to 64KiB by default. Random Google searches
seem to suggest that Microsoft sets it even higher than this although I
don't have a Windows computer to verify this at the moment.

Changing the default to 64KiB in this patch makes a pretty big
difference in a kvm VM with a single CPU. The max throughput goes from
about 2Mbps/s to around 12Mbps/s, around a 6x increase.

With the same VM but 8 CPUs, the throughput goes from 1.58Gbps to
1.99Gbps, about a 26% increase in throughput. It seems the throughput
is a little more stable too and doesn't drop periodically. I suspect
that this is just because there is less CPU saturation in the loop
consumer thread.

With window size maxed out to around 1GiB as described in #15886 there
is still about a 10% increase in throughput with this change.

There are still some weird performance issues to diagnose but this seems
like a better default.

Change-Id: I8c5d088298a4a7b3e8b1aa1a2f4f85b0cc9c62c2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6000
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-01-15 05:34:08 +00:00
xoblite
07f11ccca9 data/ids: Updated PCI IDs list from upstream (+125/-19 since current)
Downloaded from https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids

Change-Id: Idbd703c5208b5ccf7f4f8789226c6ec568fa3292
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5997
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-01-14 18:27:21 +00:00
Alexander von Gluck IV
594a6fa9e5 kernel/device_manager: Fix virtio device iteration on qemu-system-riscv64
Change-Id: Id8f82bcd455234a1f3a985a89050c32f880655f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5994
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-01-13 07:33:01 +00:00
Jérôme Duval
042c401bb0 intel_extreme: add PCI ids for Haswell ULT GT1 Mobile
for bug #18215

Change-Id: If49bc262d0c5eb7082fb749222ca6534d5c55aa3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5991
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-01-13 05:48:37 +00:00
Alexander von Gluck IV
5fba2ada03 tests/qemu-boot-test: Fix keyboard and mouse on riscv64
* virtio is sketchy still due to some non-architecture
  specific bugs. This lets us control the VM until virtio
  improves

Change-Id: I2b6805b7282f8b060fae6d831c675eb2dd2f84ef
2023-01-12 19:02:35 -06:00
Alexander von Gluck IV
59f8bbddb0 virtio_block: fix tracing on 64-bit platforms
Change-Id: I65738c17fc5ec923d47ef63832590ba3f6d28b6d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5993
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-12 21:52:49 +00:00
xoblite
183b85ddf8 Tracker: NavMenu and MountMenu should not set font themselves (inherit from BMenu instead)
Change-Id: Ie04908ebb1c05bd2abe19e8574bae0fa1cf47e1a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5990
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-01-12 17:23:13 +00:00
Alexander von Gluck IV
f65d24dfd9 kernel/debug: Fix newlines on serial output
* kputs uses the string printing functions per arch
  which includes logic to detect \ n and add a \ r before it on
  serial devices.
* kputchar uses the individual character printing arch code
  which doesn't include this check.  This results in a floating
  prompt on serial kernel debugger sessions:
  kdebug>
         kdebug> help
                     Prints a command...
* Since kputchar is lower level and most would expect it to print
  "a single untampered character", just convert these newline calls
  to use kputs which includes the \ r check serial devices use.

Change-Id: I8389899e7670859597aeddbb6f58e9b7f7942230
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5992
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-01-12 17:12:48 +00:00
Jessica Hamilton
4fc16a17cf libroot: fix try functions for pthread_rwlock.
These should return EBUSY instead of EDEADLK, so move the check
for deadlock into _Wait(), where the timeout can be checked prior
to the deadlock check.

Fixes the issue introduced in hrev56698.

Change-Id: I5717dd0579a93a117c15be93ce84136a0e065829
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5989
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-01-11 08:08:41 +00:00
xoblite
b36bd5f7d5 Devices: Miscellaneous polishing (removed the old non-utilized view tabs etc)
* Removed the old non-utilized "Basic" and "Bus" view tabs to make the "Device details" view default and more prominent
* The tab title now shows the name of the currently selected device, and  the default width of the value column has been increased to show more text by default
* Removed non-referenced/skeleton code plus made various clean-up edits as suggested by reviewers

Change-Id: I32ece29aa04e357cb4a8a0672becb754e4ccdacf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5908
Reviewed-by: KHH <haiku@xoblite.net>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-10 21:48:10 +00:00
Jessica Hamilton
4924129ec2 libroot: pthread_rwlock_[rd|wr]lock detect simple deadlocks.
Whilst these are "may fail" in POSIX, they're easy to detect,
so fail early instead of deadlocking.

Return EDEADLK when trying to obtain a read/write lock if the
current thread already has a write lock.

Fixes part of #17971.

Change-Id: I15a67c8f56f746b988f79443b6966a05122aa6a9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5985
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-10 21:11:43 +00:00
Jérôme Duval
37223744b7 kernel/x86: add a hybrid type per cpu, to be dumped when the feature exists.
for AlderLake CPUs

Change-Id: I4beba04e3ac95d7564684ee86de99c894b57a15c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5988
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-10 20:40:11 +00:00
Jessica Hamilton
1b370545d7 Terminal: graphical settings for configuring themes.
Implements #16835: Make colour schemes modular.
Implements #15936: Terminal settings should allow to drop a colour.

Change-Id: I1071c9285ba887e734af47b724f9de7f6c660581
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5950
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-01-10 11:09:22 +00:00
Jessica Hamilton
7a772a5586 Terminal: support bracketed paste.
Fixes #18029: Pasting into nano etc. eats newlines and indentation

Change-Id: I935696bb97f4d82b30f73cc488f6317cf847beae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5987
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-01-09 18:36:47 +00:00
X512
7003a4cb1d i2c/ocores: add fdt compat for HiFive Unmatched
Change-Id: I325a33d224e4711c71e324ac2afeae2dffc8aaeb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5952
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-01-09 14:54:02 +00:00
Alexander von Gluck IV
81a892eddf efi/serial: Refactor EFI bios serial services
* Convert x86 direct port I/O to our standard gUART.
* sSerial is plainly EFI Serial or EFI Stdout
* gUART is plainly hardware serial now

Change-Id: I5730fbc0ce3427851e4e2d1d0aa8c55f7765e444
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5982
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-01-06 18:02:58 +00:00
Zelenoviy
762b00e999 intel22x: update driver from FreeBSD sources
Fixes #18187

Change-Id: If0c281ce2eaf8a27d97c3211f8156d6d373e9256
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5983
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-01-05 23:44:53 +00:00
Oscar Lesta
07d5ef79d2 virtualkeyboard: fix building of target "<input>virtualkeyboard".
Fixes a "-Werror=write-strings", and a linking, error.

Change-Id: Iceb768a14e7d091796523640a2e94cb848848f44
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5980
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-05 21:52:31 +00:00
Alexander von Gluck IV
2435e24cc8 efi/dtb: Search for snps,dw-apb-uart on all architectures
* This is actually a generic Synopsys DesignWare ABP UART
  which can be found on riscv boards like the StarFive as
  well as ARM.  Just make generic.

Change-Id: If3c047560d66ebb8a76410c55c22e216cbf5d4e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5978
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-04 13:31:50 +00:00
Augustin Cavalier
0fae96c5a3 package command: Enable zstd compression by default.
Note that zstd-compressed packages cannot be installed unless the
running system can already read them, even as part of a system
update transaction. This has been possible for some months now,
but if one has an older EFI bootloader, you may need to upgrade it.

Change-Id: I9e561459477723e498a871ee5c5caad560861b79
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4663
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-03 10:01:37 +00:00
Humdinger
8040281d80 setvolume: detailed usage info, print mute state
* Describe parameters in "usage".
* Change -m to explicitely mute, instead of toggling mute.
* Add -t to toggle muting, -u to unmute.
* Add long version options:
  --mute, --unmute, --togglemute --increase, --decrease
* Accept a step size as additional parameter to in/decrease,
  without it, the step size is 3 dB.
* Print muting state when toggling or un/muting.
* Update shortcut_settings to use "setvolume -t" to toggle muting.

Change-Id: Iacad5bcf4a40a6056c85161ac45379015392420c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5976
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: nephele <nep@packageloss.eu>
2023-01-03 06:46:14 +00:00
X512
f6c51a5dc4 BBitmap: add ability to specify client-defined area
Change-Id: Iae1550b3088b0f6c26b0b91d9acb7f7cbcc721d3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4369
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-01-02 18:07:53 +00:00
Oscar Lesta
59b54f3810 poke: use phys_addr_t for mem_map_args's physical_address field
This is needed to fix usage of POKE_GET_PHYSICAL_ADDRESS on
x86 32 bits (with PAE).

Change-Id: Ic00185ec7fcf9b6666ad6169a752d8b8edd2b61b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5975
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-01-02 15:02:32 +00:00
Jérôme Duval
42aa87de9e asus-wmi: always pass five arguments for WMI calls
Some laptops like G713QM-HX121 or FX705DY have an ACPI WMI DSL, which evaluates five arguments
for all method IDs similar to
98e865a522
but with 5 arguments:

        Method (WMNB, 3, Serialized)
        {
            P8XH (Zero, 0x11)
            CreateDWordField (Arg2, Zero, IIA0)
            CreateDWordField (Arg2, 0x04, IIA1)
            CreateDWordField (Arg2, 0x08, IIA2)
            CreateDWordField (Arg2, 0x0C, IIA3)
            CreateDWordField (Arg2, 0x10, IIA4)
            Local0 = (Arg1 & 0xFFFFFFFF)

Patch to fix proposed by Reijo F from russian haiku os chat on #18189

Change-Id: I4536029600e6e9608aceafa45b36af8f0ffe35b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5977
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-01-02 15:00:19 +00:00
PulkoMandy
e9154f59e6 Menu: disable triggers when SetTriggerEnabled(false) is called
Triggers are a way to trigger menu items by ressing one of the letters
in their label. Normally that letter is underlined in the menu, but in
Haiku this is disabled by default and can't be enabled due to the lack
of a Menu preference (the code is there to draw the underline, still).

The trigger for each item is either assigned manually (using SetTrigger)
or automatically by the Interface Kit (picking a reasonable letter from
the label).

Triggers can be completly disabled at the menu level, however, in Haiku
this only disables drawing the underlines, and does not actually
disable the triggers, so items can still be invoked. This does not
match what is said in the Be Book. This commit actually disables the
triggers when SetTriggerEnabled(false) is called, making the keyboard
available for other uses if needed.

Possibly affected apps from a GitHub search on "SetTriggersEnabled":
- BeCJK
- 8dock
- Some of Tracker menus with lots of items, for example X-Ray menus

Change-Id: I1efa675b018fa524953c81e2dc2d456c28d6be8e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5971
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-01-02 12:18:15 +00:00
Máximo Castañeda
7a6e72c289 listdev: include dependency on generated file
listdev depends, through usb-utils.h, on the script-generated usbhdr.h.

Additionally, there's no dependency on kdevice_manager.h since 2008.

Change-Id: I77d36d6b5dca48415fcb98121ecb6d372cfa85ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5972
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-31 14:45:40 +00:00
X512
ad59349e16 runtime_loader: dequeue disposable image before calling image finalizers
Fix #18181.

Change-Id: I2e86d72eb2b32b807364fb45126080540e62dcdf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5970
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-29 18:58:09 +00:00
Jim906
c565d98b6b Window: initialize fUpdatesEnabled to false
* Set it to true when the client's message loop is started.
* Prevents a Window from sending messages to the client BWindow when
  the BWindow's message loop is not running.
* If a Window sends an _UPDATE_ message to its client and does not
  receive the expected reply, it will later refuse to draw to the area
  that was updated.  This can happen in the case of a BView that is a
  child of an OffscreenWindow (BBitmap::fWindow).
* Fixes #9064.

Change-Id: I8ab840852f3875cb323842d927ee1e50b0aa3511
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5967
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-29 10:57:24 +00:00
Alexander von Gluck IV
1f846c9cc5 rootfs: Introduce permissions to virtual rootfs filesystem
Change-Id: I12b1e611cb88421005f34e279b02d20199b3fa52
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5964
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-27 02:28:35 +00:00
Alexander von Gluck IV
151482229c system/kernel: Fix virtual / permissions
* Solves some insecure permission errors with
  sshd subprocesses.
* More secure I guess not letting "anyone" write to /

Change-Id: I1bb31ff0142585639369f7b3d15cf9a2d5755598
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5962
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2022-12-27 02:28:35 +00:00
PulkoMandy
90e87426ac ffmpeg: enable Werror and fix all warnings
Warnings fixed include usage of various deprecated functions, structures
and fields of ffmpeg.

Change-Id: I8d6338ad282f214a805b8d746ce22e2f0895fb25
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5954
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-26 15:16:19 +00:00
PulkoMandy
81f94bfd9e mediaconverter: fix memory leak
If the file has multiple audio or video tracks, only one is converted.
But in this case there would be memory leaks of various objects for the
other (unused) tracks. Fix this for now by allowing only the first track
of each type to be used. Ideally, MediaConverter should allow converting
all tracks or selecting which ones to keep.

Change-Id: I78c0c31648c80c7760dd68b3b4f64537ad2cee88
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5744
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-26 15:15:43 +00:00
Jérôme Duval
c9e5ef8796 strace: shows values for create_pipe and socketpair.
Change-Id: I45ee381044b2e3d4ff0ed1daa61ac5bab949bcdb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5390
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-24 09:40:21 +00:00
Humdinger
58d81e5a28 DiskProbe: Fix view colors not being live
The background color under the icon in the main window and
the attribute icon editor didn't change live.

Change-Id: I5618f66c3d2f91c5d18b6ee9870a87b02bbe3a38
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5960
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-23 16:54:51 +00:00
Alexander von Gluck IV
61f5f30ce3 preflet/network: Fix window dynamics, scale right pane only
* Left list now static in width
* Right dynamic
* Fix dynamic nature of right networkinterface info pane

Change-Id: I678a3355c95ed5c4c759b5b1e3715e5e170979fd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4962
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-23 16:54:27 +00:00
Jérôme Duval
3b8430dfcf strace: add an option to filter syscalls by name or by type
the type lists are hardcoded for now.

Change-Id: Iae89046ee52d3812354de619bfd9625217479c49
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5597
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-12-23 09:57:37 +00:00
Jim906
83c65dbb04 fat: record time of file modification
* Add a function that updates the last-modified time of a fat
  vnode; call it when the driver writes, creates, deletes,
  or moves a file.
* The function optionally copies the new time from the vnode to the
  corresponding direntry (useful if the calling function is not
  going to do that anyway).
* Add a function that updates the last-modified time of the parent
  directory of a fat vnode and copies the new time to the corresponding
  direntry; call it when the driver deletes a file (not needed
  for creating or moving because the parent directory vnodes are
  directly accessible).
* Fixes #11119.

Change-Id: Ic7c0bda55190f236e9fd31d5d140d753138f7997
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5798
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-23 09:03:04 +00:00
Semion Dimov
d53856a1b6 Added missing posixoptions and sysconf constants according POSIX.1-2017 standard
Change-Id: I2721ea4f2c3dbe0ef6a11c3a61da6034b4a7fd48
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4371
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-23 01:57:05 +00:00
PulkoMandy
4562b1727c mime_db: add a sniffing rule for css
Just like the one for HTML, we have to do a bit of guessing since there
is no easy structure. We can extend it with more keyowrds or remove some
if we find some problems with other files.

Tested so far with the Be Book and Haiku user guide CSS files.

Fixes #18144.

Change-Id: If04fba18846d17ba0eb28dd0bd12787f1fe32028
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5948
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Máximo Castañeda <antiswen@yahoo.es>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: nephele <nep@packageloss.eu>
2022-12-23 01:54:47 +00:00
PulkoMandy
31111d806f googlefs: use libnetservices for HTTP requests
This allows us to do HTTPS more easily and removes a lot of the code.

A file is converted to C++ to allow use of these APIs.

Now Google replies to the query with… a page asking to accept cookies,
and no results at all. They are definitely not cool anymore.

Change-Id: I4bed3b1f8630b324b979d26fbb71c4f05165fbb5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5494
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-22 18:30:02 +00:00
PulkoMandy
d669317867 googlefs: fix tracing, build with userlandfs
It is currently not working because Google has changed its HTML since
this was written.

I plan to switch to using https://html.duckduckgo.com instead, which
would be a lot easier to parse. However, this requires switching to
HTTPS and I don't think doing TLS in the kernel is a sane idea.

So I suggest using userlandfs instead.

Change-Id: Iaf1f27680bbf1cd98806047122cea1a208b35bf0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5493
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-22 18:30:02 +00:00
Jérôme Duval
2c08dd5bc5 bus/USB.h: header for usb device items
Change-Id: Ic36733af169948f54d7d938dfab1cb5aeb34ab9a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5956
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-22 17:43:32 +00:00
Jérôme Duval
8b26b08a34 listdev: list USB devices too
Change-Id: I14c626b6a37c95196ce87ec6b1bbb76ff14cdb4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5955
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-22 17:43:32 +00:00
PulkoMandy
beff8fa729 ffmpeg: leak when re-allocating ffmpeg context
The _Setup method can be called several times if the parameters are
changed (for example when calling SetQuality). But it always allocated a
new context without freeinthe previous one, resulting in a leak.

Part of #9458, it fixes the largest leak there (10K bytes for each loop
of the provided test) but there are other leaks left as well, some of
which apparently need an update to a newer ffmpeg version removing some
deprecated fields.

Change-Id: Iad119dbda9cff1ce023b602a1978b100a1263f7d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5953
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-22 15:56:25 +00:00
Oscar Lesta
18edaef38c dstcheck & fortune: set B_BACKGROUND_APP flag
To avoid dstcheck appearing on Deskbar's Recent applications menu
right after boot.

Noticed that /bin/fortune was also missing this flag.

Change-Id: I18e166d83d85613a99903b0805565647b7d4d001
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5949
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-22 05:24:54 +00:00
Jessica Hamilton
a764093ca8 shared: add ColorItem from Gravity screensaver.
* A useful utility class that will also be used by Terminal later

Change-Id: I23020a401fbab7d4116df31f965ae61ecaf2a6cd
2022-12-22 11:07:28 +13:00
PulkoMandy
9f9688d841 media kit: avoid useless copy of entry_ref
Copying an entry_ref is not cheap since the "name" field needs to be
allocated and copied separately everytime. Here it is not needed at all,
so let's just use a reference instead.

Change-Id: I1e572b69569cbb7437db147b483779245ec5e180
2022-12-21 14:26:22 +01:00
PulkoMandy
a443628974 media plugins: replace strcpy with strlcpy
Fixes a memory corruption: the ffmpeg plugin has a LOT of file
extensions, which goes way past the 8 allowed characters and even past
the 88 reserved bytes at the end of the structure. As a result, memory
after the structure is overwritten, resulting in heap corruption and
crashes.

This is immediately detected by using the guarded heap.

As a short term measure, use strlcpy to avoid overwriting memory, but
now the ffmpeg plugin will be unable to provide any useful info. It
would make sense to make media_format_info store a pointer to a string
instead (similar to entry_ref), but this requires more changes and will
create some incompatibility with existing apps if they use the field.

Change-Id: I8d2b567a179e9f7816b72f48aedac4e8534bc044
2022-12-21 14:26:22 +01:00
X512
85d9d60045 ocores_i2c: add
Change-Id: Ib48f8dbc0bf485b469b590f1472994d250b6ed45
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5900
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-12-20 15:11:32 +00:00
Kacper Kasper
8798a36c9b HaikuDepot: pluralization for minimum age text
Change-Id: I82fdbe5741103291e55bfb3765dc62617e3638ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5947
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-19 18:58:02 +00:00
PulkoMandy
5a7756068c packagefs: do not use auto-generated attributes for root node
The root node does not come from any package, so it shouldn't have the
SYS:PACKAGE_FILE attribute. Remove it from there.

Fixes #12453

Change-Id: Icb695bb90644753d4af1c4215c4ad3c2dd9c5e68
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5951
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-19 18:46:17 +00:00
Samuel D. Crow
3e4b839bbf PowerStatus: Abort cleanly after battery not detected.
fixes #18113

Change-Id: Id346807cea95fc4814f261cc0203fa6f8e4ee132
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5873
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-19 18:42:16 +00:00
Jérôme Duval
d9f90ce7f3 Shortcuts: provide some default actions for mute, increment and decrement volume media keys
Works for HID-aware devices (USB & PS/2).

Change-Id: I45e9ededaab1699f30e55fb644ec0e3ceebeb191
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5937
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-19 13:51:02 +00:00
Jérôme Duval
c44b267fb3 ps2: switch to HID keycodes for media/acpi keys
reference: http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf
I tested volume keys successfully.

Change-Id: I2649eb7829bcc9bfdbef26ae4a36179505aec56a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5944
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-19 13:51:02 +00:00
Jérôme Duval
6e0950ff9f Shortcuts: accept consumer keys for shortcuts
for now the hexadecimal code will be displayed.

Change-Id: Id5594f2d806cbd391ece8740332947e92814e238
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5915
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-19 13:51:02 +00:00
Humdinger
b62aa2381d Expander: Fix buttons in BAlerts
* Move "Create" as default button to the right, "Cancel" to
  the left.
* Fix ESC triggering "Cancel" instead of "Create".
* Use B_INFO_ALERT when asking to create a folder.
* Use "OK" instead of "Cancel" for acknowledgement.

Change-Id: I15ab52ea9abc9c977f757efd27fa0e2232cf74f6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5946
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-12-18 11:34:16 +00:00
Jessica Hamilton
de2ada1f10 Terminal: load themes from data and settings folders.
* Uses the same format as the Terminal settings file
* Adds an additional key, "Theme name", to settings for themes,
  which needs to be present for a theme to be loaded, else it
  will be skipped
* Loads themes from Terminal/Themes in the data and settings
  directories, searching data first, then settings second,
  allowing a theme to be tweaked by putting a copy in a
  settings folder

Change-Id: I8cadf98151459c1ae6098c38481b16eb3f2cf952
2022-12-18 16:24:49 +13:00
Jérôme Duval
6333726b2e setvolume: add options to mute, increment, decrement the master volume
also set the background flag

Change-Id: Ie198476d666a0cd290520d15534afa3a73cf8a1f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5936
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-17 15:19:26 +00:00
Dale Cieslak
85b82f8524 BFont: allow loading of user fonts from disk or memory
This patch adds an API call to BFont, called LoadFont, that
takes a string path to a font file. The user fonts are managed
via a new class called AppFontManager that inherits from the base
class FontManagerBase but adds the methods to add and remove user
fonts from disk or memory. There is also a new method called UnloadFont
to remove a user font, but on exit of an app all user fonts should be
automatically cleaned up.

Global/system fonts are managed by the GlobalFontManager, which is
a new class that also inherits from the base class FontManagerBase,
replacing the old "FontManager" class.

A maximum of 128 user fonts may be loaded, and memory fonts
may not exceed 20MB.

There's also an overloaded version of LoadFont that accepts
an area_id and loads the font from memory. A size and offset may
optionally be provided to allow for an area that contains more
than just a font.

Change-Id: I6add42bdf0c0cefc0e2e2a4984fd848c3e7269e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4790
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-17 12:32:09 +00:00
Zelenoviy
65f096fd08 USB: node unregistering returning B_BUSY is not a error in this case
Change-Id: Id9a1eccd47daef490d5ab2cba46ea97386ea0a89
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5870
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-12-17 08:59:00 +00:00
Oscar Lesta
f34d1d77f9 Shortcuts: detect keypresses even when the lock keys are set
Shortcuts was a bit overzealous while filtering out modifiers on
B_KEY_DOWN message handling.

This allows to enter keys regardless of the state of caps, scroll, or
num-lock modifiers.

Change-Id: Ie204f8e7938214ca68f45404026c7959216e0fc7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5943
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2022-12-17 03:27:47 +00:00
Jérôme Duval
7fb137c2b2 efi/x86_64: skip reserved memory blocks when finding out the memory top
fix #16712

Change-Id: Ib2ae08bc47008098a6b0c231a759d5e91f88fd33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5912
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-15 04:11:35 +00:00
Oscar Lesta
1cae9edcc7 ramfs: add B_FS_IS_REMOVABLE as a workaround for #18137
This work-arounds the issue of the VirtualMemory preflet showing
RAM FS volumes as valid storage options for the swap file.

Removing B_FS_IS_PERSISTENT didn't work as I originally expected,
causing problems when attempting to write/delete entries on RAMFS
mounts after that.

Kudos to waddlesplash for the B_FS_IS_REMOVABLE alternative.

Change-Id: Id5ba1fa192b63b944cf59413a7f580ebb608e50d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5911
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-14 18:36:48 +00:00
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
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