Commit Graph

65106 Commits

Author SHA1 Message Date
Augustin Cavalier
ff6e777d28 kernel/util: Clear list links on removal under KDEBUG.
This way, if someone tries to double-remove an item or do other
invalid things to it, this will crash instead of (silently) corrupting.
2023-03-30 12:46:31 -04:00
Augustin Cavalier
2393d22cdb kernel/util: Add static assert that the two list links are the same size.
They are used interchangeably in some places, so we should assert this.
2023-03-30 12:43:23 -04:00
David Karoly
e37168ad4f kits/app: fix unaligned copy in BMessage
BMessage contents are packed so we might get alignment exception on some
architectures when fetching fields from message with Find##typeName.

As memcpy() is already used when composing message content in AddData,
here we introduce memcpy in Find##typeName functions.

Change-Id: I0213409a219acda138f8d2fe7023e5dcfcd5cff3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6195
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-03-30 14:54:15 +00:00
Panagiotis "Ivory" Vasilopoulos
71f5445c91 Installer: Remove leftover code
Just some refactoring, nothing too much. The tooltip is not necessary
because the hints have been made much more visible using popups and
the default state of the Installer window itself.

Change-Id: I25f10fe3460c4df0bdc4e4af298532f94c65ebc5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6262
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-30 13:01:39 +00:00
Zach Dykstra
29285e87a8 translators: remove explicitly setting sizes
With the change in hrev56876, translator configuration views no longer
need to hint what their sizes should be.

Change-Id: I7742b4c8d71ec98635e530b34573e6f765f12d30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6265
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-03-30 04:04:37 +00:00
Augustin Cavalier
15ff8d64b6 BNetworkDevice: Remove GetNextNetwork.
As far as I can tell, it has no consumers whatsoever outside the tree.
(wpa_supplicant did not even use it.) So, remove it altogether.

If that turns out to be mistaken, we can reinstate it temporarily
as a private class function or ABI-only symbol.
2023-03-29 20:15:32 -04:00
Augustin Cavalier
11a8223711 Migrate in-tree consumers of BNetworkDevice::GetNextNetwork to GetNetworks.
GetNextNetwork is very inefficient as it fetches all networks but only
returns one of them. GetNetworks was introduced to compensate for that,
but only the most regular consumers were initially migrated. Now,
the remaining consumers of the old API are converted to the new one.
2023-03-29 20:10:34 -04:00
Augustin Cavalier
8c58c0c5e3 BaseTranslator: Use PreferredSize() not ExplicitPreferredSize() in resize.
The former will use the explicit preferred size if one is set;
otherwise, it will use the computed preferred size; whereas
the latter will only use the explicitly set one, which if it has
not been set, will just be an empty BRect.

Fixes #15434, #18329.
2023-03-29 18:35:04 -04:00
Augustin Cavalier
d2670b490d freebsd_network: Handle an edge-case race of callout_stop.
If callout_stop() runs at the same time the callout_thread is
about to process the callout, we can wind up with a situation where
the callout is "active" but has not yet run due to waiting on the mutex.

FreeBSD's documentation confirms that callout_stop must be called
(when "safe" is 0, i.e. not callout_drain) with the callout's lock
held, if it has one, and so we can prevent the callout from being
invoked at this point, too.

Additionally, fix return values of callout_reset.

May further help with #18315.
2023-03-29 11:37:02 -04:00
Augustin Cavalier
d86a240aec kernel/thread: Refactor thread-local-storage initialization and updating.
* TLS slots are not in any way architecture-specific; we do not even
   have a mechanism by which they could be made so at present.
   Thus, the initialization of them can be moved to common code, and
   out of the per-architecture implementations.

 * When dealing with a fork()ed thread, it will already have a TLS array
   with values set in it. Therefore, do not overwrite the whole array,
   but instead only update the specific values which have changed on fork.
   This fixes at least part of #17896.
2023-03-29 11:24:17 -04:00
Alexander von Gluck IV
ed24eb5ff1 3rdparty/proposals: Add draft WIP khronos proposal
Change-Id: I48eed026db138e4f83cb7f5e0403f0fcaaa401f2
2023-03-29 08:50:35 -05:00
Zardshard
5bf437dd89 DriveSetup: Rename view name to match class name
Change-Id: I5c744f0279265525472ae899f777234eb055d171
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6261
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Automation <automation@haiku-os.org>
2023-03-29 11:15:44 +00:00
Augustin Cavalier
baf281aa61 strace: Fix names of hardcoded syscall lists.
Before this commit, specifying %memory or %network just crashed strace.
I guess this was never tested?
2023-03-28 16:44:54 -04:00
Augustin Cavalier
55f633f7ec strace: Add printing for the address-spec enum. 2023-03-28 16:21:10 -04:00
Augustin Cavalier
90b0629ee1 strace: Trivial improvements.
* Break in FlagsTypeHandler once we have cleared all flags.
 * Use sizeof(hex) instead of writing out the size again.
 * Place comment above variable name in patch_syscalls.
2023-03-28 15:38:53 -04:00
Augustin Cavalier
04acec35f9 strace: Add set_memory_protection to area syscalls. 2023-03-28 15:29:25 -04:00
Augustin Cavalier
97685bf91d strace: Set void** parameters of area syscalls as InOut. 2023-03-28 15:26:49 -04:00
Augustin Cavalier
7da3e2fcc4 strace: Treat void** the same as addr_t*.
This way, the actual value pointed to will be printed, instead of
the pointer itself.
2023-03-28 15:24:54 -04:00
Augustin Cavalier
7046e7cd8a strace: Cleanup read_string.
Our std::string is not broken; rather, the bytesRead may include the
terminating NULL byte, which was then added to the string and caused
misbehaviors. So we need to use strnlen with std::string also, and
then everything works as expected.
2023-03-28 15:09:41 -04:00
Augustin Cavalier
28d588d51e strace: Create a status_t type handler and use it for return values.
This way, we save 3 string comparisons on every non-empty return value.

Actually this code was broken before, and did not print error names
for return types other than status_t, because message.return_value
is an unsigned integer and thus "< 0" was always false. Now we cast
appropriately in the new TypeHandler, so this works properly.
2023-03-28 14:23:27 -04:00
Augustin Cavalier
8b9267565d strace: Do not print unnecessary parentheses.
Cleans up output somewhat.
2023-03-28 13:36:18 -04:00
Augustin Cavalier
0166c1efdd strace: reserve_address_range argument _address is an InOut parameter. 2023-03-28 13:33:51 -04:00
Augustin Cavalier
0f3ea49704 strace: Add area protection flags printing.
Using the new FlagsTypeHandler.
2023-03-28 13:00:58 -04:00
Augustin Cavalier
37f7aba689 strace: Clean up Jamfile.
* Organize sources a bit better.
 * Move -O0 into the loop.

No functional change intended.
2023-03-28 12:59:59 -04:00
Zardshard
b014491b88 DriveSetup: Preserve focus on rescan
Before, pressing Disk->Rescan would keep the previous item selected but
move the keyboard focus to the first element.

Change-Id: Iff99bff64bd67128834a1021dc63f1801ecb4c92
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6264
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-03-28 15:32:10 +00:00
Augustin Cavalier
502309ab5a strace: Introduce FlagsTypeHandler, and use it for O_* modes.
Change-Id: I1569084a71c32834c0ff3d8dc71ef3de9d5a817d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6263
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Automation <automation@haiku-os.org>
2023-03-28 15:27:05 +00:00
Augustin Cavalier
4cb9408437 NTFS-3G: Update to 2022.10.3.
Bug fixes only.
2023-03-27 21:56:10 -04:00
Panagiotis "Ivory" Vasilopoulos
95de7f50ea Installer: Adjust layout for new window size
- Ensure that enough space is used for text
- Adjust string in Installer to fix weird wrapping issues
- Make Installer logos smaller

Change-Id: Ibd9cc9a944928263f28a43094b695f1018c30a5f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6187
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-27 18:00:32 +00:00
Trung Nguyen
35212f7bef userlandfs: Fix GetVNodeName
- VNode names are now allowed to have a length of 1. This is
common for Windows drives mounted through a shared filesystem.
- Empty VNode names are now checked from the userland side,
preventing the kernel driver to reject and not ACK a false
B_OK from the userland server.

Change-Id: If0a6fcea1387367d1492c9b94c62c03e381ce1c1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6276
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-27 17:57:27 +00:00
Autocomitter
7beba92388 Update translations from Pootle 2023-03-25 08:07:48 +00:00
Jessica Hamilton
ebf5253621 open: fix typo from commit cleanup.
Change-Id: I3684756dcaad228d0bbd549e51adf77c757ec5ae
2023-03-25 12:52:07 +13:00
Jessica Hamilton
da78f6bf20 open: B_ALREADY_RUNNING is valid for BUrl::OpenWithPreferredApplication().
Caused `open` to display an error with non-zero exit code when the
target application was already running and is single launch. In fact,
the error check at the end explicitly tests for B_ALREADY_RUNNING
along with B_OK.

Change-Id: Ic38c961bcdd8350b97b0d75ec010d25198afd561
2023-03-25 12:47:43 +13:00
Augustin Cavalier
90d34dcaf0 freebsd_network: Rework callout_stop implementation.
From the FreeBSD manual pages:
> If the callout is	currently being	serviced and cannot be stopped,
> and at the same time a next invocation of	the same callout is also
> scheduled, then callout_stop() unschedules the next run and returns
> zero.

Previously we would return zero but not unschedule the next run.
This may fix #18315.
2023-03-24 11:34:34 -04:00
Augustin Cavalier
c650846d9e vm: Replace the VMAreas OpenHashTable with an AVLTree.
Since we used a hash table with a fixed size (1024), collisions were
obviously inevitable, meaning that while insertions would always be
fast, lookups and deletions would take linear time to search the
linked-list for the area in question. For recently-created areas,
this would be fast; for less-recently-created areas, it would get
slower and slower and slower.

A particularly pathological case was the "mmap/24-1" test from the
Open POSIX Testsuite, which creates millions of areas until it hits
ENOMEM; it then simply exits, at which point it would run for minutes
and minutes in the kernel team deletion routines; how long I don't know,
as I rebooted before it finished.

This change fixes that problem, among others, at the cost of increased
area creation time, by using an AVL tree instead of a hash. For comparison,
mmap'ing 2 million areas with the "24-1" test before this change took
around 0m2.706s of real time, while afterwards it takes about 0m3.118s,
or around a 15% increase (1.152x).

On the other hand, the total test runtime for 2 million areas went from
around 2m11.050s to 0m4.035s, or around a 97% decrease (0.031x); in other
words, with this new code, it is *32 times faster.*

Area insertion will no longer be O(1), however, so the time increase
may go up with the number of areas present on the system; but if it's
only around 3 seconds to create 2 million areas, or about 1.56 us per area,
vs. 1.35 us before, I don't think that's worth worrying about.

My nonscientific "compile HaikuDepot with 2 cores in VM" benchmark
seems to be within the realm of "noise", anyway, with most results
both before and after this change coming in around 47s real time.

Change-Id: I230e17de4f80304d082152af83db8bd5abe7b831
2023-03-24 10:53:52 -04:00
Yourself
e48af9e4ec Icon-O-Matic: cleanup workspace switching code
* Remove comment stating DesktopColor is buggy. The documentation has
  since been updated clarifying that this is the expected behavior.
* Refactor code.
* No functional changes.

Change-Id: I03711136eb613afb80ad8c03a7f18ba6d15f641c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6256
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-24 14:02:21 +00:00
Yourself
a231654f09 BWindow docs: Improve function descriptions
* Clarify what information BWindow::WorkspacesChanged provides
* Clarify when BWindow::WorkspaceActivated is called

Change-Id: Ifcb041bcf67db1ee5c1c514a2b97baa49f8c4dcc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6257
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-24 14:01:56 +00:00
Andrew Lindesay
b6356b9116 HaikuDepot: Password Requirements
Obtains HDS's password requirements and displays
those to the user when creating a new account.

Relates to #13986

Change-Id: I1b76181e17bc03e9baf915dadcd3c45f9eb89b3f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6203
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-21 21:04:16 +00:00
Emir SARI
37d99b7eaa NumberFormat: Fix incorrect fallback logic
We need to assign the fallback value to the temporary variable,
otherwise there is a broken if logic in case the percent is not
formattable.

Change-Id: I90593fdf8ec29b802dff02c2fbe5d7ac40cea2ff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6238
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-03-21 20:06:31 +00:00
Humdinger
d2283cd881 Web+ console: Show count of repeated lines
In order not to fill up the console with identical strings, show
a count of the repeated lines instead.

When the console is cleared, make sure the repeating line is inserted
by resetting the fPreviousText.

Plus a minor style fix.

Change-Id: I408a24e59a04c9e51d4ede3f272f7ca23a19b432
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6206
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-21 18:52:57 +00:00
Zach Dykstra
41bdfde7e6 tracker: write default columns to correct attr
Tracker creates folders in
~/config/settings/Tracker/DefaultQueryTemplates with customized
attributes. In particular, each folder has relevant columns already
pre-set. These were being generated and written to disk in the host's
endian, but always written to the big endian attribute name.

This meant that on LE CPUs, Tracker tried to load _trk/columns and
convert it from BE to LE. Sanity checks failed, and each 'converted'
column was deleted, leaving Tracker to install a default set of columns.

The attribute for the host's endian is now automatically used
(_trk/columns for BE, _trk/columns_le for LE).

This fix also exposed that the 'When' column for the text_x-email
template folder was incorrectly typed as a string, instead of time.

Change-Id: I44d5f99d71d949368ff1aba1f48c03332a26d331
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6213
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-20 22:14:28 +00:00
X512
a83ee8cf77 build: enable network driver build for riscv64
Change-Id: I954c78a98103abdf98ed96e1a639e9d9e2f0ddc8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6235
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Automation <automation@haiku-os.org>
2023-03-20 22:14:15 +00:00
Emir SARI
aa3f526b8d MediaConverter: Fix incorrect string break
Change-Id: I00c7b6d4154087e1fdb3cf469ffbf80c2a470ecc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6234
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-03-20 22:14:06 +00:00
David Karoly
60b19d7eac kernel/arm: implement signals, fork, restart syscall
Change-Id: I24219b83d90710ef719190183ba6f069f82dae61
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6198
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-20 17:28:20 +00:00
X512
5865e68ef2 kernel/riscv: timer freq calculation, interrupt handling fixes
Change-Id: Ibe8b260a49c1b6e51df06f82b6c3a066c44accb1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6219
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-03-20 16:52:27 +00:00
X512
604b6f7e9b fdt: implement '#address-cells', '#size-cells' support
Change-Id: Ic1c1e75b9352d676da6f07ebd05b0491bd41f7a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6218
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-03-20 16:52:27 +00:00
X512
408a7e27d9 kernel: implement clear_caches for riscv64
Change-Id: I28296725ce22b47e94481abf794b92cf4ffd98a5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6217
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-03-20 14:24:26 +00:00
X512
1e4146cbc6 RISCV64VMTranslationMap: add missing instruction cache invalidation
Change-Id: Ie4081a3642e5de84865895e81aaa28f090b2c5eb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6216
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-03-20 14:23:54 +00:00
X512
6d13693a78 kernel/int: increase max interrupt vector count
Change-Id: Ia16e66a7bdac37019e6256405b9f10024909c69a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6215
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-03-20 14:23:54 +00:00
X512
1bb04f4a43 preferences/Keymap: use transparent background, reduce stamping artifacts
Change-Id: I4109808f81659f86c8dd75f16e38b5eca6fdbc9c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6188
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-20 07:28:54 +00:00
Humdinger
33f97c1093 Boot Options: Minor GUI string changes
Under "Select Boot Volume" you can also select an older state to
boot into: Rename to "Select Boot Volume/State".

The title on the page to select an older state was "Select Haiku
version". Since every un/install of any software package creates
a "state" it's not actually the "Haiku version" but the overall
state: Rename to "Select package activation state".

Change-Id: Ife9408c52214f6ceeb9994c8b7020cec6d679f54
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5428
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-03-19 08:05:22 +00:00