Commit Graph

65438 Commits

Author SHA1 Message Date
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
Augustin Cavalier
71bba69f8a Interface Kit: Add casts to int32 following previous commit. 2023-07-15 09:29:08 -04:00
X512
da70563f7f interface/Size: fix -Wdeprecated-enum-float-conversion warning
Change-Id: I8ca131f57495f974a79292a42ba5ce42a47d2437
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6702
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-15 13:10:33 +00:00
Autocomitter
5c868338ec Update translations from Pootle 2023-07-15 08:19:41 +00:00
Augustin Cavalier
1efb33617f Move DeviceList class to hid_shared.
It was shared among 3 different HID drivers, now
there is just one common copy.
2023-07-14 17:07:40 -04:00
Vladimir Serbinenko
e16045db2c i2c_elan: Support I2C Elan devices
They are not HID devices as they need special polling and interpreting. As
a result only descriptor is shared with other i2c HID devices. So it's easier
to have it as a separate driver.

Partially based on FreeBSD ietp driver

Change-Id: Iddc64d216eefeda235a1b15521cba9189dd2ffd8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6660
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-14 20:58:01 +00:00
Zardshard
6427935280 Icon-O-Matic: Generalize some classes
* Turns PathContainer, ShapeContainer, StyleContainer into Container.
* Makes Shape use Container for storing Tansformers instead of
  reinventing the wheel yet again.
* Moves common logic from AddPathsCommand, AddStylesCommand,
  AddShapesCommand, and AddTransformersCommand to AddCommand.
* Factors out common logic from two more commands similar to above.
  This adds the MoveCommand and RemoveCommand classes.
* Cleans up some code style.

Change-Id: I59eca94a1c45eac608514f269f6e5f8628f93fab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6640
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-07-14 20:56:49 +00:00
Zardshard
a75a222b35 Icon-O-Matic: Remove dead homebrew translation system
Icon-O-Matic uses Locale.h now.

Change-Id: I9722ee76fda47821bf27e6195f8f6ec3d3e1b43e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6700
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-11 18:27:10 +00:00
X512
1d9ad3fad7 mmu/riscv64: implement global page mapping support
ASID allocation is not supported yet, so always use ASID 0 for user pages for now.

Change-Id: I021e77dae692c22984bc625dd0588362bece45b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6698
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-07-11 17:34:31 +00:00
Augustin Cavalier
ed3d3b1023 drivers/pty: Destroy TTYs when usage is complete.
Otherwise, they will be "reused" and persist settings
and buffers, which we don't want.

Fixes the remaining part of #18488.
2023-07-11 11:33:00 -04:00
Augustin Cavalier
4b02e067a6 generic/tty: Add an assertion and a comment about references.
No functional change.
2023-07-11 11:32:59 -04:00
Augustin Cavalier
5193c8cd2f drivers/pty: Close "slave" TTYs when the "master" is closed.
The old TTY driver did this, but it was not properly carried
over into this new driver.

Fixes the first part of #18488: the child bash process from the
first session is properly closed, but the TTY state isn't reset
and there can still be stale things left in its buffer, it appears.
2023-07-11 11:32:59 -04:00
Trung Nguyen
3cb845283e headers/os: Make headers generator-friendly
Make Haiku headers a bit more friendly to binding generators by:
- Giving some `enum`s names (especially those that appear in
default arguments).
- Converting an internal `inline` function into a macro so that
the result could be evaluated in compile time.

Change-Id: I770674ad8fa7b24ac30b6b447d52a4b4c2530b8a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6716
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-11 14:40:02 +00:00
jiceland
14a0c87fd9 Tracker: Set and clear background image when switching directories.
Fixes #15784 and #16436.

Change-Id: Ia9baff083b3a8d4f4e8c5314f12fafeef6d01f7a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6717
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-11 14:35:15 +00:00
Humdinger
623fc35a33 Mail: Slightly improved attachment handling, layout, strings
* In case the dropped file is a symlink, attach the actual file instead.
* Don't add a file, if it's already in the list of attachments.
* Add file size in brackets after the filename in the list of attacments.
* Add some spacing before the "Attachments" label.
* Consistently use "attachment" instead of the mixed in "enclosure".
  "Attachment" also seems a more common term for this.

Change-Id: Id36d900216ce25c96ac1815889b8c7b6ec0e5f2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6699
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-11 02:53:26 +00:00
Humdinger
a8030ecec6 Mail: Accept dropped files on window
Currently only files dropped on the mail contents view are added as
attachments. Since dropped text files get inserted into the contents,
it only worked for non-text files.

With this change, the header area and the empty space of the tool bar
react to file drops as well.

* Accept dropped files on the whole window area
* Forward dropped files on the address text controls to the
  main window (if they aren't people files)

Change-Id: Ia92f1e34aaf98a3089b318947668f3df41af00ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6697
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-11 02:53:03 +00:00
PulkoMandy
899e0ef82b userlandfs: use std::bitset for FSCapabilities
gcc 13 is confused by the custom bitset implementation, so use the C++
standard one instead.

However, this results in including the C++ <string> header in kernel
code. This doesn't work for gcc2, because of two problems:

- That header includes a declaration of atomic_add that doesn't match
the one in SupportsDefs.h (which can in some cases replace the function
with a #define for an inline version). Adjust the header to use the
be a problem because it creates a risk of circular inclusions.
Standard C++ headers shouldn't depend on BeAPI ones.
- It also leads to the inclusion of iostream which defined lock and
unlock functions in the global namespace. We don't want these, and they
are not part of the C++ standard, so just remove them.

Ideally we could use std::hash for the GetHashCode implementation, but
that doesn't work because it depends on an helper function that's in
libstdc++, and we can't link that from kernel add-ons.

Change-Id: Iee07280beb4dddf7a9b6160e37f3b816e4de89ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6663
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-10 06:27:18 +00:00
Autocomitter
9aa43979f8 Update translations from Pootle 2023-07-08 08:24:47 +00:00
PulkoMandy
a6957d9ff4 fifo_poll_test: add handling of EINTR signal
This is the test for #7859, the problem now is just that the SIGCHLD
signal is delivered before the file descriptor close event wakes up the
poll().

Change-Id: Iddf96e2830d5c7496ec3c6bd27cc235c5ce9d7d4
2023-07-04 20:19:02 +02:00
Stian Skjelstad
243ac0b9a6 USB ACM serial driver did not take maxPacketSize provided by the device into account
Change-Id: Ic93d420012d757088b20936e6c8d942ccbc0e5bf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6668
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-07-04 18:02:19 +00:00
Humdinger
a5afae7f96 mail_daemon filter: Fix "Move target" setting
Fix copy&paste error to use correct setting keyword "move target".

Change-Id: If1d555f56529b11ab87a5be330af88c1f346e6ee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6667
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-07-04 16:38:07 +00:00
Trung Nguyen
4313795d2e network/stack: socketpair for non-stream sockets
`socketpair` should skip the `listen` and `accept` step for
non-stream sockets. This allows the implementation to work for
UNIX domain datagram sockets.

Change-Id: I81ba826d605b77be5a4ec9046ea4c6bd556a35a0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6618
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-07-04 15:09:20 +00:00
Humdinger
419466254d Mail prefs: fix window title
Since the menu item says "Settings..." the window title should
use the same.

Change-Id: Iec3ff51f2b78eb0f3ffe63814b99a053c898d37b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6666
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-03 12:27:42 +00:00
PulkoMandy
311dc3ca7d tty: notify read in addition to write when the other tty is closed
Reading a tty that's closed by the other side will return an end of file
error, but will not block.

Fixes #18486.

Change-Id: I8441becdcc8c83c08611684fa0a29216e9d04ec8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6665
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-07-03 09:38:33 +00:00
PulkoMandy
037c2257f9 Export liblinprog symbols in libalm
Appls using libalm (mainly the Aukland Layout Editor) expect to find
these symbols in libalm.

Change-Id: I9ed72ce9fb63510351ab8b50643c3eace2c2953b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6664
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2023-07-02 16:51:56 +00:00
Autocomitter
c568ba76b1 Update translations from Pootle 2023-07-01 08:15:08 +00:00