Commit Graph

54572 Commits

Author SHA1 Message Date
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
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
Jérôme Duval
d2875e7b28 usb: fix references on the module B_PCI_X86_MODULE_NAME
the dependency is optional, only the device modules depend on it.
should fix #18075

Change-Id: Ifddb9814ff5ff59ee7d80d06b14ba9fded04cd56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5822
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-17 21:17:20 +00:00
Dominic Martinez
b06ada87fe build: clean hds schema directories correctly
Change-Id: Ie55706885cdaa5bb94f8bf419aac25c326192d64
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5814
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-15 06:03:15 +00:00
Augustin Cavalier
75fa60f74a HaikuPorts/x86_gcc2: Synchronize, and adjust TIFFTranslator to match. 2022-11-13 01:00:45 -05:00
Máximo Castañeda
241f109ccb View: provide the transform between different coordinate spaces
There's currently no way for an application to convert between view and
drawing coordinates with a drawing states stack without keeping track of
all the transformations itself, which is not very convenient for helper
or library functions.

Handle other spaces too, for good measure.

Change-Id: Ic8404a1c111e273fff1eebf2f9f59f58246b796c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5775
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-13 04:04:30 +00:00
Rudolf Cornelissen
423e3645e1 nvidia gfx: removed a syslog message as it was spamming.. 2022-11-13 00:24:05 +01:00
Rudolf Cornelissen
ea959da4df intel gfx: fixed SMAP faults, added 2 G98 IDs to kerneldriver. 2022-11-12 20:16:10 +01:00
Augustin Cavalier
62bd88a64d webpositive: Depends on haiku_datatranslators.
If nothing else for the Media codecs.
2022-11-11 15:52:50 -05:00
Augustin Cavalier
fefa5edf96 Move print add-ons to the haiku_datatranslators package.
This allows us to move the Gutenprint dependency there, too.
2022-11-11 15:48:23 -05:00
Augustin Cavalier
f156c66999 usb_ecm: Disable tracing by default. 2022-11-11 15:47:41 -05:00
John Scipione
369c7b11d2 BAlert: Reserve room for stripe and large icon
... even if no icon is present. Draw stripe w/o icon.

"After ... hrev56382 alerts ... with no icons appears without a
gray stripe, causing it to jump left and right."

Fixes #18033 for R1B4 Release Milestone.

Change-Id: I35acc07411cadd4b394d6dfa1957049280b6f4b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5810
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-11 19:34:25 +00:00
Alexander von Gluck IV
f162d76431 accelerants/radeon_hd: Style cleanup; no functional change
Change-Id: Id54ae8191f7a0b4cd0ffdf3e507df8d694f21899
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5809
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-09 03:32:26 +00:00
Alexander von Gluck IV
d1b7a784d7 accelerants/radeon_hd: Fix double +
Change-Id: If51bf45076de9871bbd9ed75a4701c31ce9615cb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5808
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-09 03:32:26 +00:00
Augustin Cavalier
c1353b749c BControlLook: Fix corner spacing calculation.
Fixes #18046. Ideally app_server would just use
this to pick the size of corners...

Change-Id: I2dc243d55321b3fc0fa90faf415d9b04abf9c376
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5780
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-08 18:09:48 +00:00
Jérôme Duval
cedd85556c kernel/x86: init the tsc frequency and clock speed from MSR when available
only for AMD newer CPUs. tested on R5300U

Change-Id: I44be2efca37b1738a759a15140e5fd8d3b5ac7b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5804
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-07 09:03:52 +00:00
Jérôme Duval
af136a21bd graphics/edid: add support for the CTA extension block
Change-Id: I2799496faf2f9383c703384a419d8d9fcffc75ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5803
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-07 09:02:42 +00:00
X512
8be7c1aa58 kernel/file_cache: fix VMCache object leak
Fixes #18039.

Change-Id: Ia3cda69f91e56efb36931a97028378ec3ceb2100
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5801
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-05 13:27:15 +00:00
PulkoMandy
4c070183d9 PNG translator: remove B_TRANSLATE on string that isn't user visible
Change-Id: I3c04838729740f86493636913ba30a072e633696
2022-11-05 12:59:04 +01:00
Augustin Cavalier
b966f172df package_infos: "haiku" does not depend on "haiku_datatranslators."
This was initially added so users on the nightlies would not wind up
with no translators installed on updates. It has been long enough
that we can probably remove this in master. (I will re-add it
in the beta4 branch for users upgrading directly from beta3 -> beta4.)
2022-11-03 20:27:18 -04:00
Augustin Cavalier
16081dd2fa libshared: Enable hidden visibility.
This breaks ABI as we forgot to do this originally and a lot of apps
implicitly use symbols from libbe or elsewhere that are imported from
libshared, but we are about to branch beta4, so now is the time to
change this.

Fixes #17256.
2022-11-03 20:24:24 -04:00
Augustin Cavalier
0c6a5835f9 ramfs: Set vnode cache in ramfs_create instead of ramfs_open.
This way it will always be set even on the first creation,
and avoids unnecessary sets. Fixes mmap() of newly created files.
2022-11-03 20:12:50 -04:00
Niels Sascha Reedijk
429cbf2220 NetServices: include libnetservices2.a in the HaikuDevel package
Change-Id: I88e888df5ac7673ab343e25b7216546cb7ca6055
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5799
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-03 05:28:09 +00:00
Niels Sascha Reedijk
1111dda699 NetServices: Add libnetservices2.a from dev/netservices into master
The overall design does not deviate much from my proof of concept [2] and that still makes a good read to
understanding the overall architecture. If you want to get a sense of how it is built up, the API comes with
full doxygen documentation for the public API [3], and I have also done a PoC change for HaikuDepot which is
useful as an illustration on what the impact for the user of the new library is. [4] There is also a test suite
that may give some insight into the day to day ergonomics of the API [5].

The current state is that I am fairly confident that many HTTP requests will actually work, but I do expect
rough edges with a protocol with this many diverse implementations. There is also a list of features yet to be
implemented on Trac [6]. Additionally, I still want/need to do performance testing.

The goal of merging the kit right now is to start making it available for more uses, and through that also give
a chance to shape its future. There are also some design decisions that need review, most notably I expect some
discussion around the uses of C++ 17 idioms (like std::optional and std::string_view) and around the use of
exceptions for error handling.

The impact of merging right now should be near zero: the netservices2 kit lives in its own header space, and
builds into its own static library (libnetservices2.a). It is not yet used in any of the apps in our
repository.

The branch does remove the deprecated services kit from the libnetapi.so library, though it leaves
libnetservices.a intact. After our previous announcement to remove it after beta 3, this should be expected.

[2] https://github.com/nielx/haiku-netservices-rfc/tree/exceptions
[3] https://git.haiku-os.org/haiku/tree/docs/user/netservices?h=dev/netservices
[4] https://review.haiku-os.org/c/haiku/+/5692
[5] https://git.haiku-os.org/haiku/tree/src/tests/kits/net/netservices2?h=dev/netservices
[6] https://dev.haiku-os.org/wiki/Development/NetServices2

Change-Id: I5d0b7e2619699f39a2506588417b57391f0f5cc2
2022-11-02 01:37:17 +00:00
Augustin Cavalier
8672fc2739 InterfaceDefs: Adjust and introduce new spacing/insets constants.
* Nothing in the tree and few things outside it used BIG_{SPACING|INSETS};
   it seems a value of 15px (at default font size) is not that useful.
   There are, however, a lot of things around the tree that use multiples
   of 20px. So, make BIG be that, with the intent to replace those
   with BIG directly.

 * Introduce CORNER_{SPACING|INSETS}. There are a lot of applications
   (e.g. Tracker, Terminal, Debugger etc.) which use scroll bar width/height
   to metrically align controls with the window frame or with some other
   control which contains scroll bars. Rather than have to invoke
   BScrollBar or BControlLook directly to get the value, we should just
   derive the size of scrollbars from a spacing constant instead
   and get rid of the custom function. (For now it is just replaced.)
   This reuses the old values for BIG, as it is equal to 14px at default.

 * Introduce BORDER_{SPACING|INSETS}. This is equal to the typical border
   size of 1px at default font size (or lower) and uses floor() instead of
   ciel() to compute what the size should be (i.e. it will remain 1px
   at 150%/18pt and only go up at 200%/24pt.) This will allow a lot of
   the hardcoded border sizes around the tree and elsewhere to use
   ComposeSpacing() instead.

Change-Id: Iaea3fa30364859888e816a9d61ac156268d70758
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5702
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: nephele <nep@packageloss.eu>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-02 02:23:32 +00:00
Zelenoviy
afe965f464 usb_hid: properly device remove handling
Small fix to device remove handling, when multiple hid-devices published on multiple interfaces.

Fixes #18008.

Change-Id: I64e1a9fb6cbac503e3d55b51ee0539bb6f1908e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5773
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-02 02:21:02 +00:00
Zelenoviy
4f18dc0496 usb_hid: Fix MaxReportSize computation
While calculating buffer size for IN reports, only "Input" report type
should been taken in account. Complex HID devices, such as "Gaming"
keyboards and mice, often have "Feature"-reports declared (with size way
bigger than "typical" kbd IN report) for vendor-specific device
configurations.

But "Feature"-reports are sent over control channel only and can't
appear on interrupt channel.

Should fix #14919, #17937, #17699

Change-Id: I4b9eb51938ca4aba2bc34247d00ae164eb2c19fc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5771
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-02 02:21:02 +00:00
Máximo Castañeda
7b3e89c094 PoorMan: some libhttpd fixes
The last thttpd update was less than perfect. A bad format string was
causing crashes on directory listings, and some of our changes were
removed, like PoorMan's setting for directory listings, leaks and thread
safety.

Fixes: #17329
Change-Id: I84d9862a0ebd5492a2542cf9776462e7fe7dbe77
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5772
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-01 01:06:07 +00:00
Oscar Lesta
62b6a4c615 mount_server: BPartition::ContentName() returns a BString now.
Change-Id: I9a236f6a28826d9394265081c3ebf6e96290fa54
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5770
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-01 01:05:35 +00:00
Oscar Lesta
dfd7e48a6c Partitioner: fixed warnings, and usage of BPartition::ContentName()
Not particularly high priority (this being a test) but... I came across
these while searching for code still needing updates after the changes
on BPartition::ContentName().

Change-Id: I05e8d6c02ba34688cee4f0b55e4e782243b0af4d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5769
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-01 01:05:35 +00:00
PulkoMandy
4fad6eb32d Tracker: fix thumbnail caching
system_time returns the number of microseconds since booting. This is
not what's needed for the thumbnail generation timestamp attribute, as a
result the attribute was always considered out of date and the stored
attribute would never be used.

Change-Id: I3728077c484f341b765700532d3f986e64f165ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5767
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
2022-10-31 17:40:50 +00:00
Niels Sascha Reedijk
2710b4f5d4 Merge remote-tracking branch 'origin/master' into dev/netservices
Change-Id: I48c8cf4f03e281a5caeb9f27bf052285961529ff
2022-10-29 22:58:24 +01:00
Niels Sascha Reedijk
71e29bbeea NetServices: format code using haiku-format
This commit formats all the netservices2 code with the `haiku-format` tool from
https://github.com/owenca/haiku-format (commit aa7408e), with the following
customizations:
 * SpaceBeforeRangeBasedForLoopColon is set to false
 * Braces before a catch block are not wrapped
 * Most headers, except for ExclusiveBorrow.h, have been manually reformatted
   to adhere to Haiku's header format (issue #19 in the repository)

Change-Id: I693c4515cf26402e48f35d1213ab6d5fcf14bd1e
2022-10-29 22:53:57 +01:00
Augustin Cavalier
1284e971e2 kernel/vfs: Fix locking behavior in acquire_vnode and add a missing ASSERT.
vnode deletion is prevent either by owning a reference to the node,
or by being at least a reader of the vnodes lock. Thus, in acquire_vnode,
we have to inc_ref_count while still holding the lock in order to prevent
a race.

This function is used so rarely and quite deep inside FS drivers that
I'm  not sure this race would ever have been a problem. Nonetheless
the old code was incorrect.
2022-10-29 13:42:19 -04:00
Augustin Cavalier
b4b1561b6a kernel/vfs: Do not wait for removed vnodes to become unbusy.
Most of the time, that is harmless and will just cause a slight delay
before the vnode is removed and we return NULL instead of finding it.
However, in rare circumstances involving renames, we can wind up in
a deadlock with the thread that is trying to remove the vnode, and
would have to wait all the way to the timeout (a full ten seconds!).

The only vnodes not about to disappear from the table that can be both
"removed" and "busy" seem to be special vnodes like pipes, which will
be in an "unpublished" state while they are initially "busy" which we
can check for, in case something wants to wait for them.

The "dirconc" test readily triggered a pathological case of this behavior.
Before this commit, it ran for over 15 minutes before I killed it (and
it was not close to done at that point, either.) After this change,
it completes successfully in around 3 minutes or so on my test VM.

Thanks to mjg@freebsd.org for pointing out this testcase and its
misbehavior on Haiku!

Change-Id: Id1accf0aaf0724e1aec927a437d3a2ac1596cd98
2022-10-29 13:42:19 -04:00
Niels Sascha Reedijk
93069fc4bc NetServices: Disable BasicAuthTest for HTTPS
Change-Id: I0b61af00b96ebe7fbcd04da50e32cb9e9be7f890
2022-10-29 14:29:34 +01:00
PulkoMandy
d9e730c808 libroot: generate a name for nameless volumes
Generate a name indicating the volume size and filesystem.

Remove code that was doing that or similar things in various
filesystems.

Change-Id: I6b993735e58cdfaf1f19af575e918614c7fe5679
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5381
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
2022-10-29 11:31:13 +00:00
Niels Sascha Reedijk
477e74d187 NetServices: fix parsing raw HTTP bodies without a known size
When parsing a raw HTTP body without a known size, whether or not a request is complete depends on the
end of the connection. Make sure that the parser updates to complete when all the bytes in the buffer have
been read and the connection closed.

Change-Id: I6f055b43ffe4a44da65da85c19b71304d804c800
2022-10-29 12:23:15 +01:00
Mashijams
62a64d0a43 xfs: make Directory Iterator class an abstract class
Directory Iterator class represents one instance which could be Short, Extent, Leaf, Node or B+Tree, a good case for making it an abstract class

Change-Id: I925255caf4c4f8bc01a975740ef2ebf0bb2e1b49
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5764
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-10-28 16:54:43 +00:00
Augustin Cavalier
6610656e8f Network preferences: Add type specification to appease GCC2. 2022-10-28 12:52:50 -04:00
Oscar Lesta
62ea448683 TextSearch: do not trigger new grep searches unnecessarily.
Opening and closing a file from the results window with Pe, for
example, was triggering unnecessary new grep searches, when only
the attributes or other metadata on the file got changed (and
not its content).

That new search was also changing the focus from the results view
to the search field (making one lose the position on that list,
specially annoying with large number of results).

Avoid that by not monitoring/reacting to B_ATTR_CHANGED, and not
reacting to B_STAT_CHANGED if the only flag is B_STAT_CHANGE_TIME.

Change-Id: I56d34c93da94acf36890abe458da45d26a334593
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5763
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-10-28 16:35:19 +00:00
Augustin Cavalier
75b68ba59d NTFS: Account for null-termination of strings when checking buffer sizes.
May fix #18021.
2022-10-28 12:26:35 -04:00
Augustin Cavalier
bfd87e4cc1 posix_spawn: Add POSIX_SPAWN_SETSID to the list of allowed flags. 2022-10-28 11:54:21 -04:00
Augustin Cavalier
b94de4c9bd BNetworkDevice: Restore old buffer size.
May help with #18020.
2022-10-27 21:49:58 -04:00
Augustin Cavalier
b2c77ad27a Network: Add a BNetworkDevice::GetNetworks() method and use it in the GUI.
The GetNextNetwork() method is really inefficient: it fetches all the
networks at once from the kernel every single time and then winds
up returning only one of them. In parts of the GUI that iterate over
all networks more than once per refresh (sometimes within a loop, even!)
this was often a noticeable lag on the GUI, especially with OpenBSD
drivers which have extra overhead to do struct translation in the
ioctl handler.

Now, we have a way to fetch all scan results at once and just iterate
over them as many times as we need, and this is what NetworkStatus
and Network preferences now do, saving lots of time and effort.
2022-10-25 23:34:42 -04:00
Augustin Cavalier
65c155bede BNetworkAddress: Make the first SetToLinkLevel() take a const pointer.
Technically breaks ABI. However to the best of my knowledge,
nothing uses this method outside of the tree.
2022-10-25 23:34:42 -04:00
Alexander von Gluck IV
9bceb7fb3c radeon_hd: Add encoder crtc source table 1.3
Change-Id: I9020f9bf270509c162987a9c1656f7e1cce33490
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5529
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-10-25 22:45:46 +00:00
Alexander von Gluck IV
8c46059114 radeon_hd: Add new connector id, guard from reading over bounds
Change-Id: Ifbabcf8217c617baffe85f24b985c18760e4da58
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5527
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-10-25 22:45:46 +00:00
Augustin Cavalier
5de85b8f98 docs: Remove the User Guide and Welcome pages.
These were not maintained here, merely mirrored from the Userguide Translator,
and rather infrequently at that. But as they were built with Haiku,
that meant new versions of these packages were built every hrev,
which meant a lot of wasted space and bandwith for updates.

Now there is a separate "userguide" repository which will collect the
files exported from the Translator, and recipes at HaikuPorts to build
the packages, instead, so we can delete these files from this repo.
2022-10-25 18:38:28 -04:00
Jérôme Duval
74622d8051 Devices: add vendor names for ACPI devices when available
files can be updated so:
curl --fail -L -o acpi_id_registry.html 'https://uefi.org/uefi-acpi-export'
curl --fail -L -o pnp_id_registry.html 'https://uefi.org/uefi-pnp-export'

Change-Id: Id0456f925729c635c5e2d43f80e9e016483b2611
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5753
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-10-25 07:09:10 +00:00
Augustin Cavalier
93e536ab5d registrar: Properly clear out icons and resize when text changes.
May help with #18006.
2022-10-24 22:43:27 -04:00
Augustin Cavalier
781db1b43f BAlert: Invalidate layout if the icon is unset. 2022-10-24 22:43:00 -04:00
PulkoMandy
70bf92576d pci: print PCI info in case of deferred init.
This is normally done just after init, but in the case of deferred init,
there will be nothing to print at that point.

Currently, there is no way to access that info after the system has
booted. listdev should be extended, or the info should be published in
PCI device nodes to view in the Devices app.

Change-Id: Id89377ccf8bb967abae96194e503fffc06477acf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5758
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-10-24 16:37:15 +00:00
Jérôme Duval
876ddc1adb mountvolume: return type of ContentName() is now BString
fixes #18011

Change-Id: Ie8dda950005c191c843535b12f7cf8f9819bdcfb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5757
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-10-24 07:31:12 +00:00
Jérôme Duval
37f29a6f7a usb_ecm: switch to the new driver API
Change-Id: I385d70b3245d6b18c3593cf2672445ccfb000f13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5754
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-10-24 06:31:55 +00:00
X512
fe084f0b03 virtio_mmio: fix config space access using 1,2,4-byte memory access
Change-Id: I596da650be81a596efcbe7e3abecf2a4da3a8459
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5747
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-10-24 06:31:15 +00:00
Augustin Cavalier
56761ebfeb app_server: Granularize whether font settings were loaded in DesktopSettings.
As per axeld's review.

Change-Id: Idd817156d53ebf535f162285bfd08f0566ac3901
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5755
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-10-23 23:53:34 +00:00
Niels Sascha Reedijk
3c9045fbbf NetServices: Refactor to make HttpParser stateful
This change refactors various parts of the HTTP parsing. The HttpParser now
tracks what part of the message needs to be received next, and throws an error
if the object is used in the wrong way (when the caller requests to parse the
wrong part of he message).

The metadata about the transmission is now also saved in te parser. There is
partial work in there to start exposing the 'bytes written', which in
compressed streams is expected to differ from the bytes read. This is not
used yet.

This also simplifies the state tracking done by BHttpSession::Request.

Change-Id: I8532c6a5c8776456ea8bbccd6df7a44bac92b60d
2022-10-23 18:43:41 +01:00
Mashijams
689f8e9060 xfs: minimised disk seeks for node xattrs
- Made GetNext() function in Node Attributes efficient by reducing disk seeks to number of Node entries

Change-Id: I4e2bf8fb1898676c30eca2c6d6f39dc1999ae2f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5612
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-10-23 07:28:51 +00:00
Augustin Cavalier
a180a40b63 app_server: Only increase default font sizes if settings were not loaded.
Thanks to axeld for the review.
2022-10-19 19:37:29 -04:00
Augustin Cavalier
e1f6b2fbe7 nvme_disk: Add a polling fallback mode.
Before implementing interrupts, all I/O was polled.
Now we only use polling as fallback if interrupts mode
does not work for some reason.

Should fix #17484.
2022-10-19 18:57:58 -04:00
Augustin Cavalier
f1c9e12aa3 NTFS: Truncated pathnames should be an error, not a warning.
May help with #17964.
2022-10-19 15:36:52 -04:00
Augustin Cavalier
5bb671cc0e MediaPlayer: Fix a hard-coded font size. 2022-10-19 14:25:29 -04:00
Augustin Cavalier
46a2beb0f8 HaikuDepot: Refactor usage conditions windows.
* Set only a minimum width and then resize to preferred on window.
 * Set a minimum height for the text view itself.
 * Use the new TextView controls instead of the old BTextView.
 * Adjust other size constraints as needed.

Fixes #17998.
2022-10-19 14:25:09 -04:00
Augustin Cavalier
6a4c3457cf HaikuDepot: Adjust some hard-coded font sizes. 2022-10-19 14:23:32 -04:00
Jérôme Duval
41c1669de1 bin/acpi_call: command to call ACPI methods
adapted from the FreeBSD tool, uses ACPICA headers in userland mode.

Change-Id: Icba77b01e6e351df31538dda21520f0cc99b26bb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5749
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-10-19 12:57:04 +00:00
David Karoly
9ae2ef5de6 boot/efi: implement ring buffer
Change-Id: I7c384eb859e28ce824bd5cc5e85039d80462eb67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5722
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-10-19 00:10:25 +00:00
Alexander von Gluck IV
4e77b1a727 radeon_hd: Drop duplicate 6700 XT PCI ID
Change-Id: I2da5a34f47e0281a35921bd104c1a3571c65638b
2022-10-18 18:51:39 -05:00
Han Pengfei
44cceee67e pthread: add pthread_{getname_np,setname_npp}
- These two functions imported for Linux/BSD compability.

Signed-off-by: Han Pengfei <pengphei@qq.com>
Change-Id: I3e9cada26f1ed043bfaed83e8185dcfff3bd71e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5746
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-10-18 16:30:54 +00:00
Jérôme Duval
8e17b43da6 kernel/device_manager: Implement B_GET_DRIVER_FOR_DEVICE
for legacy and new drivers.

This is an opcode for ioctl that can be used on almost any device entry found in /dev.
When used, ioctl will fill a buffer with the absolute path to the driver file that is
being used by the device.

This opcode was available in BeOS R5, though remained unimplemented in Haiku since
the introduction of the Device Manager almost two decades ago.

Original change by Jacob Secunda.

Change-Id: Ic49141b677b4158a63918459d4048450c825447c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5078
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-10-17 06:13:07 +00:00
Alexander von Gluck IV
d3e920ba77 tests/qemu-boot-test: provide a summary of error-generating subsystems
* Not perfect, but does give some nice data on what makes the most
  "error noise" on boot
* We should eventually make this a ruby or python script to do
  better reporting

Change-Id: I831af05520a95ffba492c068c105f93ff2c31a2d
2022-10-16 09:10:07 -05:00
PulkoMandy
48776daf36 AboutSystem: restore previous size constraints
The window was changed to be larger and completely fill he screen at
640x480, this does not look right. Restore the previous 500x300 size
constraint.

Fixes #17952.

Change-Id: I7d60253b7304ede788e064adf2bad20168393a33
2022-10-16 10:00:38 +02:00
Axel Dörfler
97739603d1 kernel: Added operator delete(ptr, nothrow_t)
* This seems to be required when building the DriveEncryption kernel
  driver with gcc 11.2 on x86-64, at least.

Change-Id: Ie1ae09435dd912021957e64d4b9a3e7b05913c33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5742
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-10-12 20:35:55 +00:00
Axel Dörfler
2c563c4c9b DiskProbe: Added 4096 byte block size
* It's a quite common block size on disks nowadays.

Change-Id: I68e1abb050e7bd0bb190cdd7e4d4f2c78e8db7ff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5741
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-10-12 20:34:48 +00:00
Jérôme Duval
caafd8470b pch_i2c: add Meteor, Alder and Raptor Lake ids. add Lakefield ids.
Change-Id: I7acc2e0dd7b84ea3dc8f10bbe186ff0008aa7c2d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5739
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-10-12 16:53:14 +00:00
Oscar Lesta
b2a47f1f5a AboutSystem: update hrev from the replicant constructor.
Extracted a _GetOSVersion() function, and used that to get the value
for version text, and to update it at replicant instantiation time.

Should fix #17957.

Change-Id: Ifc964c3646743a503fd756c902d102977e35e73d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5724
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-10-11 15:39:48 +00:00
Oscar Lesta
7c7357f07c AboutSystem: make static constants out of some member variables.
This avoids using them while uninitialized (as could happen when
using the archive constructor.

Fixes #17955.

Change-Id: If75354216b9731b3273d79aec787cd0140a6175e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5723
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-10-11 15:36:47 +00:00
David Karoly
a3fb982730 boot/efi/riscv64: use generic mmu functions
Change-Id: I671f41b9c163c522ffa7ffcb2509f279c4c9496a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5701
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-10-10 21:28:59 +00:00
Jérôme Duval
c3f23e8222 Devices: add a view for USB devices
Tried to match the USB classes to categories.

Change-Id: Id021730755060ab6a5149eea87f5e25370c67e1c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5738
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-10-10 21:28:37 +00:00
Jérôme Duval
edeaa9c0c7 listusb: generate class code table from usb.ids, and use it
Change-Id: I43b79c5abc74306aba9a69991aeb5e110b2d790b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5737
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-10-10 21:28:37 +00:00
Jérôme Duval
e6ce95c5ab usb: register device nodes for hubs and devices
the device identifier is the USBID. no actual interface to be used by drivers.

Change-Id: I9fd1fdab0d02f1b82380c619b39bc3a12a9e2333
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5736
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-10-10 21:28:37 +00:00