Commit Graph

65513 Commits

Author SHA1 Message Date
Máximo Castañeda
26a211b054 Remove trigraphs
Fixes arm64 build

Change-Id: I8e266871df8f124539a4b5d6fb267931e6506dd5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6769
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-08-02 11:43:59 +00:00
Niels Sascha Reedijk
e10dd8e99a Dev docs: update instructions on generating build-packages repo
This is now updated for the modern k8s infrastructure.

Change-Id: Ib468eb0bdf4b0746c3f5d8692d9353d0cd9e923a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6768
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-08-02 07:09:03 +00:00
Zardshard
39f337c812 Debugger: Refactor CliContext::WaitForThreadOrUser
Change-Id: Ic232432f253900a44ad9929cafa46971833cfb5b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6367
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Rene Gollent <rene@gollent.com>
2023-08-01 15:04:02 +00:00
X512
f8bd82e198 xhci: report link status for USB 3 ports
The values come from XHCI table 5-27.

PS_PLS_MASK is the same as PORT_STATUS_SS_LINK_STATE.

Change-Id: Ie54abcda0c33738fe7dc5caa4e4f3abae3b40adc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6488
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-31 21:44:21 +00:00
Augustin Cavalier
13b7ddec87 NTFS: Fix potential memory leak. 2023-07-31 17:38:47 -04:00
Humdinger
3961af9fe9 Use UTF8 multiplication sign "×" instead of "x"
It was suggested for translations in Pootle, and I agree it looks
subtly nicer: a bit smaller and vertically centered.

Also made all strings that include the "x" translatable, in case
there are different local usages.

For icon sizes in Tracker, move menu creation into a loop with an
kIconSizes array holding the pixel dimensions.

Change-Id: I805279d7186d90a13a40b4d4495670cdfac18913
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6765
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-07-31 21:19:35 +00:00
Adrien Destugues
453f4d01a3 Screen preferences: remove leftover debug printf 2023-07-31 10:26:27 +02:00
Adrien Destugues
4fbc89c3f2 Remove -Wno-error=trigraphs
All (accidental) trigraphs have been removed in the source.
2023-07-31 10:25:22 +02:00
PulkoMandy
4c28b3f19f Screen preferences: use a matrix menu for the resolution list
When there are a lot of display resolutions available, the menu can
become very high. Switch to a "matrix" menu with 3 columns in this case
to keep it a reasonable size.

Change-Id: I826be06a91bd1bcae600cc333e34d4a9dd7b3df5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5320
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-31 07:02:23 +00:00
Adrien Destugues
24a34a5ee5 fts: fix unused-but-set variable
This warning happens on Haiku because we don't have DT_DIR and the
dt_type field in dirent. The FreeBSD code has a partial ifdef for that,
but it is missing in some places, leading to an unused but set variable.

Completely disable the variable when DT_DIR is missing.

Change-Id: I274799b0d25e2df27758fcf4452567879aed8e10
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6764
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-29 16:26:09 +00:00
Augustin Cavalier
4c47466fea fts: Roll up changes from FreeBSD.
Notable changes include:

 * fts: Stat things relative to the directory fd, if possible.
 * fts: Fix double-free with conflicting concurrent modifications.
 * fts: Don't abort if an empty pathname is given.
 * fts: Don't return FTS_SLNONE if it's not a symlink (if race).
 * fts_children: preserve errno after running close/fchdir
 * Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.
 * fts: Fix a potential memory leak in error case
 * libc: Check for readdir(2) errors in fts(3)
2023-07-29 12:25:37 -04:00
Adrien Destugues
26710c49ff PSD translator: whitespace cleanup.
No functional change intended.

Change-Id: I00175e96b83d5345720508555163644a089aaf0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6748
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-29 15:56:19 +00:00
PulkoMandy
699bc5363f Launch daemon: fix some unused variables
Used for tracing only, so mark them as unused when tracing is disabled.

Change-Id: I76acb0f18ccab12512eaa4b2644e9d57c591b9ef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6740
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-07-29 15:56:19 +00:00
PulkoMandy
2a7d6a9850 Cortex: fix some unused-but-set warnings
Declare the variables as unused because they are used only in ASSERT
calls which are disabled by default.

Change-Id: I4786fad54463b532b00afa5be00ed52fb118776f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6737
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-29 15:56:19 +00:00
PulkoMandy
21b533d448 Bootloader FAT: remove unused variables
The "longNameValid" variable already indicates if a long name is present and
valid, and it is correctly handled, with the short name used as a fallback
if the long name is either not present, or not encoded correctly.
The "hasLongName" variable is useless since long names are already handled.

The "partial" variable indeed indicates a partial read was done. There is
nothing to do with that info, the read is already complete at this point and
the correct data is read and returned to the caller. So I don't see why we
should keep this variable.

The "count" variable seems to serve no purpose and is easy to re-add if
someone ever has a need for it.

Change-Id: Ic7eb7f34a49243ecdb5dd3c6b29c3b90f3bece10
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6739
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-07-29 15:56:19 +00:00
PulkoMandy
30e762a797 bluetooth: fix unused but set variable
Change-Id: Ie63b0a28c352bc9997a2a70b3e335af2b3cc1bc3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6714
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-29 15:56:19 +00:00
Augustin Cavalier
3386b8b785 libbsd: Add a basic kqueue implementation.
It only supports file descriptors and processes (threads),
and a few flags (not all) to go with them.

This has been tested extensively against libuv.

Change-Id: I6fc5930fa7273698172c9c695965842b5df44f03
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6746
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-07-29 15:53:15 +00:00
Augustin Cavalier
f66d2b46a8 kernel: Add event queue implementation to wait for objects efficiently.
Based on hamishm's original patch from 2015, but heavily modified,
refactored, and reworked.

From the original commit message:

> When an object is deleted, a B_EVENT_INVALID event is delivered,
> and the object is unregistered from the queue.
>
> The special event flag B_EVENT_ONE_SHOT can be passed in when adding
> an object so that the object is automatically unregistered when an
> event is delivered.

Modifications to the original change include:

 * Removed the public interface (syscalls remain private for the moment)

 * Event list queueing/dequeueing almost entirely rewritten, including:
  - Clear events field when dequeueing.

  - Have B_EVENT_QUEUED actually indicate whether the event has been
    appended to the linked list (or not), based around lock state.
    The previous logic was prone to races and double-insertions.

  - "Modify" is now just "Deselect + Select" performed at once;
    previously it could cause use-after-frees.

  - Unlock for deselect only once at the end of dequeue.

  - Handle INVALID events still in the queue upon destruction,
    fixing memory leaks.

 * Deduplified code with wait_for_objects.

 * Use of C++ virtual dispatch instead of C-style enum + function calls,
   and BReferenceable plus destructors for teardown.

 * Removed select/modify/delete flags. Select/Modify are now the same
   operation on the syscall interface, and "Delete" is done when 0
   is passed for "events". Additionally, the events selected can be fetched
   by passing -1 for "events".

 * Implemented level-triggered mode.

 * Use of BStackOrHeapArray and other convenience routines in syscalls.

Change-Id: I1d2f094fd981c95215a59adbc087523c7bbbe40b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6745
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-07-29 15:53:15 +00:00
Autocomitter
a3f83f646c Update translations from Pootle 2023-07-29 08:25:08 +00:00
PulkoMandy
c75dc6af6b pci and usb header scripts: avoid generating trigraphs
Change-Id: Ifd10f039cebdd3995397ad380b7a2c6ddd437775
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6738
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-07-28 09:11:43 +00:00
PulkoMandy
7e80a0ba59 PSD translator: fix mismatched types compiler warnings
Change-Id: I12f0cc2b7f4fea43726425af558641d8e6789a14
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6736
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-07-28 09:11:43 +00:00
PulkoMandy
16a112ae7b ext2: fix unused-but-set variable
This variable was introduced in hrev38573 which is the conclusion of
a GSoC project by jvff to add write support to the ext2 driver.
It has been unused for 13 years, I think it is safe to remove.

Change-Id: I8ae4635dbc39f108b769d90b92e5545f8183a10d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6715
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-07-28 09:11:43 +00:00
Augustin Cavalier
8b018d9a9f NTFS: Fetch the mount point path during initialization.
Fixes #18490.

Change-Id: I06d4b268f2088ac49ef3bc5d895ab94f219e2177
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6741
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-26 19:06:13 +00:00
Augustin Cavalier
387fe2d9a7 userlandfs: Adjust following ConditionVariable changes. 2023-07-25 17:12:10 -04:00
Augustin Cavalier
f64c46e636 kernel & libroot: Implement per-team unnamed semaphores.
This requires breaking syscall ABI to add the "flags" parameter
to _kern_mutex_sem_release.

Resolves a TODO.
2023-07-25 16:26:22 -04:00
Augustin Cavalier
b3b7b89334 kernel/user_mutex: Check that a thread was actually unblocked during handoff.
Otherwise, we will deadlock.

I don't know that this has ever actually occurred; it is very unlikely
due to the write-lock acquisition before unblocking. It could only
occur if a SIGINT was delivered or timeout+wakeup occurred at just
the right moment.
2023-07-25 15:33:07 -04:00
Augustin Cavalier
aca21731ff kernel/condition_variable: Return the count of unblocked threads from Notify.
No reason not to, and it's needed in user_mutex to avoid a very rare
potential race, anyway.
2023-07-25 15:27:40 -04:00
Augustin Cavalier
2cc89328fa kernel/user_mutex: Fix race in user_mutex_sem_release.
We need to be sure nothing will start waiting before marking the
semaphore as uncontended.

Fixes a deadlock observed in libuv.
2023-07-25 15:21:00 -04:00
X512
ae65daec10 kernel/riscv64: remove unused code
Change-Id: Ia140c962b3ae70faac3c9ae19125b0e245326586
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6743
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-24 21:18:04 +00:00
Augustin Cavalier
528d532174 userlandfs: Adjust path to Notifications.cpp. 2023-07-24 17:11:45 -04:00
X512
eb4b22adca virtio_mmio: fix logic
- Use separate descriptor count. Queue length and descriptor count do not need to be the same.

- Assotiate cookies with descriptors, not used queue index.

- Use mask instead of modulo operator for better efficiency (queue length is always power of 2).

Change-Id: I5f053287e2a0cfad8da25053c63c42aa06fb238d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6710
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-24 21:00:56 +00:00
X512
0235c04759 util/Bitmap: add more utility methods
Change-Id: I021c2fafa01266e8a38c1cb2fd748fd89a4b75bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6742
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-24 21:00:56 +00:00
Augustin Cavalier
ddde98b06d kernel: Move some source files around.
* stack_protector.cpp now lives with other files in "lib".

 * Notifications.cpp, wait_for_objects.cpp go to a new "events" directory,
   which will soon contain more files related to the event_queue.

No functional change.
2023-07-24 16:23:41 -04:00
Augustin Cavalier
c6cd9b51a2 DoublyLinkedList: Add a RemoveAllBefore convenience function.
Extracted from hamishm's event queue patches.
2023-07-24 16:09:42 -04:00
Augustin Cavalier
a2efc7ec03 AVLTree: Unify removal implementations.
Extracted from hamishm's eventqueue patches.
2023-07-24 16:09:21 -04:00
PulkoMandy
a2b91af97b highpoint_ide: fix unused-but-set variable
Change-Id: I2b6769779682978b5e61166bc4032291bb02bea2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6713
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-07-24 18:42:51 +00:00
PulkoMandy
70d3b1028a ps2: mark unused-but-set variable unused to avoid warning
Change-Id: If0073d878cfe4c37ea61bc10459e698ebbb47897
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6712
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-07-24 18:42:51 +00:00
PulkoMandy
69657d9d4f ACPI: remove unused-but-set variable
Change-Id: I8095cb13c51c3891cc36dca1b7667041cb6c9df0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6711
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-07-24 18:13:52 +00:00
PulkoMandy
45311bd6f9 usb_rndis: synchronize writes
The write function can be called concurrently by multiple threads. The
way it is implemented now means this desn't work, since there is no
guarantee the correct thread will be released from the semaphore by the
USB completion callback.

I tried to allow mutiple requests to run "in parallel" (really letting
the USB stack schedule them) by having he callback track which thread to
wake up (using send_message/receive_message as a synchronization tool)
but that still resulted in lockups.

The simplest solution is to ensure there is only a single thread doing a
write transaction at a time, which is achieved here with an extra mutex.

Fixes #18521.

Change-Id: I0b737acab6f5665cbe5b0e40a20ce99c16bdf21c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6707
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-07-24 14:47:23 +00:00
Niels Sascha Reedijk
fef51dedd8 mail_daemon: warn about unused return value
GCC 13 warns that using the `begin()` method on a container is marked as
`[[nodiscard]]`. This makes sure that this warning is not treated as an error.

The code actually looks like it does not do much if anything of use. As a
follow-up ticket #18478 is raised.

Change-Id: Ie149f7e02cacda2bcd0be59617583605d5905747
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6655
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-23 16:48:21 +00:00
Autocomitter
26bda37ca5 Update translations from Pootle 2023-07-22 08:20:18 +00:00
Humdinger
a4e4beafe5 IOM: Localization/String improvements
* Switching mis-used B_TRANSLATE_CONTEXT to B_TRANSLATE_COMMENT
* Use B_TRANSLATE_SYSTEM_NAME for "Icon-O-Matic"
* Remove remnants of old localization system
* Rename "Control Points" to vertex/vertices
* Add a ":" after Undo/Redo
* Sentence casing
* Avoid Yes/No buttons in BAlert

Change-Id: Ibb299925bce1f6ca1cf03216a36df7c44f10bdc6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6704
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-21 20:07:46 +00:00
Jérôme Duval
18d6122240 Terminal: support for underline color and styles
the text is now printed above the underline.

Change-Id: I1a3a7713bf514830106532e1534793e0fe158bc2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6706
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-21 18:12:41 +00:00
Zardshard
c5abd6a796 libicon: Notify Shape on transformer addition/removal
hrev57144 accidentally made Shape be notified only if the library was
compiled for Icon-O-Matic.
Also includes some miscellanious improvements.

Fixes #18510

Change-Id: Ie4ae7f9b8b1a5b39f87db2dbf79064fa875b644c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6705
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-19 18:04:23 +00:00
Trung Nguyen
b7b57869e8 unix: Implement datagram sockets
Implement `SOCK_DGRAM` sockets for `AF_UNIX` family.

Change-Id: If3d6f408a7d881635ccf04b080391905fdc94b13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6617
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-19 17:16:16 +00:00
PulkoMandy
5a86b40e33 xres: fix extracting resources
Regression introduced in hrev51641 which added braces to fix a
misleading indentation warning. The code was behaving correctly and the
indentation was wrong.

Change-Id: I378ff3ed6209917b44387fc29459b6e492c5eb9c
2023-07-18 21:26:03 +02:00
Trung Nguyen
8e8250e9dd headers: Explicitly hide BAlert functions
Explicitly hide some BAlert functions that ought to have been
deleted. This prevents binding generators from thinking that these
functions are available, causing undefined symbol errors during
link time.

Change-Id: I56f53808851b82a10f31015d2351d4e2c29b6f33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6718
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-07-18 16:43:33 +00:00
Pascal Abresch
f11b304632 Document Launch flags and Preference directory for findpath
Change-Id: I150c0ca1e0deb5749689bb1019a48efdcdc99def
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6701
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
2023-07-18 16:43:20 +00:00
Alexander von Gluck IV
425ac1b60a refactor: Swap %Ld for %lld in all format usages
* %Ld is an undocumented alias for %lld in glibc.
* muslc doesn't implement it for this reason.
* While we will likely never drop %Ld support,
  lets clean house and set a better example.

Change-Id: Id46dad3104abae483e80cc5c05d1464d3ecd8030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6636
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-17 11:26:21 +00:00
Joachim Mairböck
d110ee8cc1 Icon-O-Matic: properly pluralize command names using BStringFormat
There are languages which have different plural forms than singular for one
and plural for everything else, and even if the number is not shown, having
the correct form looks nicer.

For NudgePointsCommand a helper function was introduced because there the name
is given as a constructor parameter.

Change-Id: I19a4984cf83af6612f2eafbf0920c9ad947d52ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6703
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-07-17 11:21:10 +00:00