Commit Graph

65002 Commits

Author SHA1 Message Date
Jessica Hamilton
e673ca9491 cdboot: add missing PCI x86 module.
Fixes #18391; introduced in hrev56936.

Change-Id: I7c2166f9f0198bbbfbd296a19679345cfb82302d
2023-04-28 23:55:39 +00:00
Augustin Cavalier
be8080575a IORequest: Refactor IOOperation transferred-bytes and status accounting.
Until the introduction of the nvme_disk driver, these classes were
mostly only used directly by the IO scheduler, and then a few direct
usages of IOOperation itself in the individual disk drivers; so
API confusions were easily missed.

When writing the nvme_disk driver's IORequest support, however, it
became readily apparent that there were some pretty bad confusions
around transferred-bytes accounting in IOOperation. This commit
attempts to resolve all of those.

There are two basic changes here:

1. Move transferred-bytes accounting into IOOperation::SetStatus.

The "TransferredBytes" field of IOOperation is against the *original*
range, not the actual operation's range (which will be wider, due to
bouncing, etc.), and furthermore only applies to the actual content
of the request (and not e.g. to a read half of a bounced write.)

These two facts meant that determining what value to pass to
SetTransferredBytes was not trivial, and was easy to get wrong.
I recall messing that up when working on nvme_disk multiple times
before reading the API carefully.

2. Do not pass redundant values to IORequest::OperationFinished.

All of the values here can be derived (albeit indirectly) from the
IOOperation, and all consumers of this API basically did just that.
Rather than make them do it, make the IORequest take care of
computing all of those values itself.

Change-Id: Ic9ae29e1100319e5b7647647c4db7e5aad4d125e
2023-04-28 14:59:21 -04:00
Oscar Lesta
8561b2c894 AboutSystem: update CPU info on replicant constructor.
This is similar to changes made in hrev56526 and hrev56815,
but for CPU related info this time.

Extracted some new _Get*() methods for the code that will get
called from both the normal and the replicant constructors
of SysInfoView.

Re-arranged the code a bit so the BStringViews get created /
updated in the order they appear on the GUI.

Change-Id: I2a371ec623e0b4d7497056fae6d5346b98d07ee2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6396
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-04-28 18:37:13 +00:00
Augustin Cavalier
103c671ef0 AbstractModuleDevice: Add generic read/write hooks via "io" hook.
This substitutes for the already-existing behavior of scsi_cd, scsi_disk,
and virtio_block, so we can delete their hooks and let them use
these new generic fallbacks.

Some other drivers perform clamping, and so using these fallbacks would
constitute a behavioral change.

Change-Id: I9a2e503f2e03abc276bdfc02d1cff1565a9742e9
2023-04-27 16:24:08 -04:00
Augustin Cavalier
be67f14dcb mmc_disk: Refactor read/write/io hooks.
* Move geometry fetching to open(); it was not done
   in io() and was duplicated in multiple places.

 * Clean up clamping and bounds checking.

 * Use IORequest::TransferredBytes().

 Change-Id: I4157e516098dc0362c1478abd21a545c1f235cd7
2023-04-27 16:24:02 -04:00
Augustin Cavalier
e0f07d3ce0 IORequest: Add an assertion in SetTransferredBytes. 2023-04-27 15:20:17 -04:00
Augustin Cavalier
f64b099191 scsi & virtio: Clean up IORequest usage.
* Use TransferredBytes() instead of assuming length.
 * Consolidate checks and invoke io hook instead of scheduler directly.
2023-04-27 15:19:39 -04:00
Augustin Cavalier
8d2c997da2 nvme_disk: Add missing bounds check and adjust clamping. 2023-04-27 15:12:14 -04:00
John Scipione
fc12af740f netfs: Restore status_t result, fix build
result is being used on VisitReadQueryRequest().

It was not being used on ProcessQueryEvent() though
so leave that off still.

Change-Id: I8fbfbb3edef6ff962237f696fe315b66900b4376
2023-04-26 19:16:47 -04:00
mbrumbelow
7b3bfaf34f netfs: Removed 'result' variable
Return B_NO_MEMORY on error creating volumeIDs object
in VisitReadQueryRequest() and return nothing on error
in ProcessQueryEvent() because the method's return
value is void.

Change-Id: I23c6f12258a702b6ffff667639e01fdbac928d6d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6371
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-04-26 21:45:58 +00:00
Augustin Cavalier
8540053c8a xsi_message_queue & xsi_semaphore: Downgrade a lot of traces.
Reduces syslog spam.
2023-04-26 17:17:57 -04:00
Augustin Cavalier
d8f78afc8a xsi_message_queue: Permit incoming buffer to be NULL.
The user address space has not included NULL for a while, so this
has actually been broken for years, and nobody noticed. I guess
XSI message queues are not very well used?

Fixes the in-tree "xsi_msg_queue_test1".
2023-04-26 17:17:19 -04:00
Augustin Cavalier
6acd708e97 xsi_message_queue & xsi_semaphore: Use condition variables to wait.
This removes a lot of custom logic for managing waiting threads,
which was not even correct in all cases (and the code actually
acknowledged this with a big TODO about it, which weinhold
added all the way back in 2008!)
2023-04-26 17:16:07 -04:00
Augustin Cavalier
9747721a43 kernel/condition_variable: Add a fast-exit from Wait() for negative timeouts.
acquire_sem_etc does something very similar.
2023-04-26 17:12:24 -04:00
Augustin Cavalier
d8e4f52b78 kernel/condition_variable: Add a ConditionVariable::EntriesCount() routine.
Will be useful in changing the XSI subsystems to use condvars.
2023-04-26 17:08:15 -04:00
Augustin Cavalier
484bf053dc VMCache: Use THREAD_BLOCK_TYPE_OTHER_OBJECT.
This would have assisted in debugging #18390.
2023-04-26 15:34:24 -04:00
Augustin Cavalier
557f0446b3 kernel: Introduce THREAD_BLOCK_TYPE_OTHER_OBJECT.
THREAD_BLOCK_TYPE_OTHER implies the "object" pointer in the
wait information is a string. But sometimes we want to pass
through objects which are not strings, for inspection in KDL.
2023-04-26 15:33:53 -04:00
Augustin Cavalier
f5e531e92e kernel/thread_types: Remove Thread::condition_variable_entry.
Unused, and "struct PrivateConditionVariableEntry" no longer exists, anyway.
2023-04-26 15:32:20 -04:00
John Scipione
c7cd1bae68 BeControlLook: fix clipping rect, part of #12890
Change-Id: Ib3c29dd1ffba1f0456a5043b62d943123335e966
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6366
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-04-26 16:43:38 +00:00
Máximo Castañeda
e6a598a2f4 ControlLook: fix clipping
Remove ConstrainClippingRegion calls as they do not take into
account view transformations.
Clip drawing to the drawing rect, not the updated area.

Fixes #12890

Change-Id: Ie76cb83e0af03213008da78407de25261daea5df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4457
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-04-26 10:41:04 +00:00
Autocomitter
af3dceb279 Update translations from Pootle 2023-04-26 06:31:10 +00:00
Augustin Cavalier
3c51bd6a2b libroot: Fix initialization of LocaleNumericDataBridge.
We need to store the isGlobal value, so that the destructor
can take care of unsetting the glibc locale properly.

It seems this has been broken since d338200e2b.

Fixes #18344 and probably #18336.
2023-04-25 15:55:42 -04:00
Augustin Cavalier
419abdb265 openbsd_wlan: Add implementation of IEEE80211_IOC_SCAN_REQ.
We cannot actually initiate scans, but we can at least detect when
one is in progress.

This fixes "ifconfig ... scan" on OpenBSD devices returning errors
instead of scan results ("list" always worked.)
2023-04-25 13:37:52 -04:00
Augustin Cavalier
6fa3716c79 docs/user: Import syslog documentation from an old Haiku newsletter article. 2023-04-25 13:10:59 -04:00
Augustin Cavalier
4ba629698f pci/designware: Add another missing include. 2023-04-25 12:50:58 -04:00
Augustin Cavalier
69929490eb locale_t.h: Add missing newline at end of file.
Fixes #18369.
2023-04-25 12:38:37 -04:00
Augustin Cavalier
3ce66fb079 pci/designware: Add missing include. 2023-04-25 12:38:13 -04:00
Jérôme Duval
bd7bb43761 PCI_x86: remove
Change-Id: I54335b6390dc5e312225a3100fd88d4e49838d35
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6331
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-04-25 15:54:32 +00:00
Jérôme Duval
2982f45075 freebsd_network: drop PCI_x86
Change-Id: Ie185f63b56bc564b794e5900609fe9f0465de602
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6330
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-04-25 15:54:32 +00:00
X512
3b91d73bce bus & drivers: drop PCI_x86
Change-Id: I494deaf24a4793a5e0fe9fa46ecdce32f65e616a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6226
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-04-25 15:54:32 +00:00
X512
f33c8f9ce2 busses/pci/designware: add
Change-Id: I43dfc8a4b4fabe7b892e98aa192db95ba1b9378f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6225
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-04-25 15:54:32 +00:00
X512
912bdb2aca busses/pci/ecam: add
Change-Id: I8decef75a2d7f30bb5d45fc4774037d6a92bc161
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6223
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-04-25 15:54:32 +00:00
X512
a23ac85fa9 bus_managers/pci: split PCI controller to separate add-on
busses/pci/x86: add
Other add-ons are in following commits.

Change-Id: I7a77bfaef0e8995917b4b54c8369d7075533ec26
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6220
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-04-25 15:54:32 +00:00
X512
97b7c7719d bus_managers/pci: move MSI handling to generic code
Change-Id: I6194838b7b46222f720fc328bb4512fdb88a9c8a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6222
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-04-25 15:54:32 +00:00
X512
e942269a1f pci: generic MSI interrupts support
Change-Id: Ib4fd23f6bca867a2b428bf2651234d719ee08672
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6221
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-04-25 15:54:32 +00:00
John Scipione
26704b5974 Tracker: undo Model.h changes from previous commit
This changes more than just style, put enum values back.
In practice this makes no difference but the change was
unintentional so put it back like it was before.

Change-Id: I46c782c441d72e77a2897683f54ba7fcefbd5b63
2023-04-23 23:46:06 -04:00
John Scipione
a63a67392b Tracker: Whitespace, alphabetize style fixes
No functional change intended.

Change-Id: Ib47f6b04e372923a5d2a1774ce4e3f56d8b05792
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6370
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-04-24 02:47:43 +00:00
mbrumbelow
3f06b49ad3 fs_shell: cleaned up of a few unused variables
Change-Id: I58e91b634d8d32247c2f37a2518d4234397e8a6f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6378
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-04-22 09:03:29 +00:00
Jessica Hamilton
4d8698c300 duplocale: fix missing locale magic when creating a new locale.
Fixes #18345.

Change-Id: Ibedfa973b371b65a502dc655eae65f4ed0833144
2023-04-20 04:45:42 +00:00
Zardshard
44daad619e Debugger: improve command help text
Improve the help text of the db, dw, ds, dl, and string commands.

This is accomplished by
* Splitting CliDumpMemoryCommand into CliDumpMemoryCommand and
  CliDumpStringCommand
* Moving code shared between the two into CliContext
* Removing functions in CliContext that were replaced by this movement
* Allowing customizing the help text for CliDumpMemoryCommand for each
  command it represents
* Changing the help text for CliDumpStringCommand

Change-Id: If4f9e0c20f00f3e3d6c6769216fabb3160aea0a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6332
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-04-19 09:01:04 +00:00
Zardshard
92f36c4a61 Debugger: Remove unused function
Change-Id: I92b7260d4b5b7d187ec9ecd9f9f602c317410aa6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6362
Reviewed-by: Rene Gollent <rene@gollent.com>
2023-04-18 17:36:49 +00:00
Augustin Cavalier
c4737dcb22 freebsd_network: Be lenient, do not assert if the callout mutex is &Giant.
Same as FreeBSD. Should fix #18356.
2023-04-17 22:47:14 -04:00
Augustin Cavalier
97d55ad49d freebsd_network: Add missing LOCKGIANT to the close() hook.
Should fix #18363.
2023-04-17 21:51:29 -04:00
Freaxed
81d3bc02bf BMenuItem: use unicode character for B_SPACE shortcut
Change-Id: If3e9b1232538f50e15fb8f5b249a7584f23a46db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6360
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-04-17 18:53:34 +00:00
Jérôme Duval
7c58a5a3fb tcp: avoid overflow of the advertised window with window scaling enabled
tcp_segment_header.advertised_window is 16 bits.

Previously, instead of using the maximum window, zero would be sent, thus
the partner wouldn't send anything.

fix #18337

Change-Id: Ibff98ee58b84bdf52527a7821648a5faf20c5589
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6359
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-04-16 18:53:41 +00:00
Trung Nguyen
7bfc9c6fc7 libroot: Fix bad pointer access in __init_stack_protector
The address of the variable should be taken instead of the
variable itself being casted to `void*`.

This fixes a rare segfault bug when any Haiku binary runs in
a `chroot`ed environment without a `/dev` mount.

Change-Id: I2fdacac62fadbcce8006bbf0a5350f6ec95133ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6377
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-04-16 15:57:12 +00:00
Trung Nguyen
50a5eed083 app_server: Fix potential infinite loop
Return `B_ENTRY_NOT_FOUND` instead of -1 when `/dev/graphics`
is not found.

Otherwise, `app_server` would run into an infinite loop
while waiting `fCardFD` to equal `B_ENTRY_NOT_FOUND` in some
specific environments such as a `chroot` where `/dev` is missing.

Change-Id: Ice23a82f58811f1258c58826c2488ae5c5c29cee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6376
Reviewed-by: X512 <danger_mail@list.ru>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-04-16 13:09:36 +00:00
vaibhavg20comp
b5ff580afb btrfs: btrfs_shell build errors fixed
Change-Id: I05c4d489f9227b94c00648c7a22569b2902ef325
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6309
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-04-14 11:11:15 +00:00
John Scipione
3e37877f10 BButton: Remove button label margins
... to prevent label truncation on BeControlLook,
BDH Calc, and some other places.

Fixes #16570

Change-Id: I68d8b64a631e116d3180c96be1fb5681de86fda6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6310
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-04-12 15:17:34 +00:00
John Scipione
27b3dee8b3 Revert "Deskbar: Use hvif window icons & scale with font"
This reverts commit 2b65e2d808.
2023-04-11 14:19:11 -04:00