Commit Graph

66234 Commits

Author SHA1 Message Date
Augustin Cavalier
88979be93f PCI: Log failed config reads.
We already log "can't read config" in this method, so let's
also log lower-level failures.

May help with investigating #18536.
2024-07-09 11:45:44 -04:00
Augustin Cavalier
1342073197 PCI: Avoid overflows in ReadResourceInfo.
The operation should be promoted to at least 32-bits anyway,
but it's better to be safe here.
2024-07-09 11:40:57 -04:00
Augustin Cavalier
599a303e23 PCI: Return more meaningful error codes from ReadConfig/WriteConfig. 2024-07-09 11:36:50 -04:00
Jim906
342a1b221b FAT: revise using code from FreeBSD
* Rewrite most hook functions, modeling many after FreeBSD hooks and
  making use of support functions ported from FreeBSD. As it stands
  now, most of the FreeBSD driver files are present with minimal
  changes, with a pseudo-BSD compatability layer added to make them
  work in Haiku. Performance is not what it could be if the BSD code
  was rewritten to interface directly with the Haiku kernel, but under
  the current approach the driver might be easier to maintain in terms
  of porting future FreeBSD bugfixes.
* Add support for FAT in userlandfs. Aside from being useful for
  debugging, the userlandfs module provides better filename support
  for characters that are not in code page 850, because it can link
  libiconv.
* Update the fat_test.sh script to use dosfstools to format the tested
  device, instead of the internal dosfs_initialize hook. The script
  is written to test specific cluster sizes, but the initialize hook
  still does not support user-specified cluster sizes.
* Coding guidelines: lightly-modified BSD files and lightly-modified
  original Haiku driver files have not been revised to adhere to the
  Haiku style guidelines. For BSD files, this is meant to make it
  easier to compare with the FreeBSD repository when merging future
  FreeBSD patches. For existing driver files, this is to highlight the
  functional changes made in this change request (I can submit a
  separate patch later to clean up style in these files). Also, some
  #include lines are not alphbetized (they are instead ordered like
  they would be in FreeBSD, because one header relies on another).

Change-Id: I92521d4b700d7aa52fe6c664cf8f83a4d9395809
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7660
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-07-09 06:40:55 +00:00
Máximo Castañeda
a5df3d5221 MediaPlayer: fix subtitles
- Setting word wrapping and resizing the BTextView to the video size
  before adding the text moves the subtitles to where they are supposed
  to be, and breaks long lines that would be cut off.
- Show last subtitle entry: _IndexFor returns the index at which to
  insert a new subtitle for some start time, so when getting an existing
  one, we always need the previous index. Before the change we would do
  that after checking the time of the subtitle at the returned index,
  which for the times of the last one would be outside the list.
- Improve charset detection by using the whole file. Just the first line
  of subtitle text may be too short to be useful, and to get there we
  should have decoded the file first. The refactor also fixes not getting
  the last entry from the file.
- While not subtitle related, fix typo in aspect ratio menu shortcuts.

Fixes: 18151
Change-Id: I83fae735d31bce4616da9128a46be15763c30591
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7833
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-07-08 20:10:10 +00:00
Augustin Cavalier
2813fd13ca profiler: Report CPU times and use them to compute "missed" ticks.
This shows that the profiler is still pretty broken, because we
are missing quite a lot of ticks on average. One run of
"profile pkgman search" here produced an output with 66 total ticks
and 423 (!) missed ticks. A brief run of WebPositive was not quite
as bad (main thread: 1078 total ticks, 157 missed ticks.)

Change-Id: Idfc34534e66eff0fe7e948fcc3576be09db879a3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7820
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-07-08 17:13:30 +00:00
Augustin Cavalier
60b260aca1 kernel/block_cache: Coalesce consecutive block writes.
This way we can take advantage of the writev() optimization
added in the preceding commit.

Should also help with #15585.

Change-Id: Ib3b8d2c72b4a36cfb75d7c17b91d442161b2dbdd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7825
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-08 15:51:13 +00:00
Augustin Cavalier
6c7ced1f01 kernel/fs: Try to use real vectored I/O in common_vector_io.
We can only do this if the underlying I/O will not be cached,
since the I/O hook bypasses any cache. But that should be fine,
as in the event that reads and writes are going through the file cache,
calling read and write multiple times isn't especially expensive.

On the other hand, when the underlying device is not a file
or something else cache-backed, making many I/O calls instead
of just one can be very expensive. The BFS journal flush seems
to routinely call writev() with over 100 iovecs on a regular basis
during high disk activity, and doing 100+ separate writes to
an external drive vs. just one makes a big difference.

Should help with #15585.

Change-Id: I433e9d9948634f8cdccf7999710c6c5e6b6c8850
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7824
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-07-08 15:51:13 +00:00
Augustin Cavalier
cf638bb14b nvme_disk: Fix a few bugs in the get_memory_map logic.
* If realloc returns NULL, we still need to free the original pointer.

 * If get_memory_map returns with B_BAD_VALUE and entries is 0,
   this is really the same as B_BUFFER_OVERFLOW.

Fixes spurious I/O failures when writing the BFS journal directly
with vectored I/O (as the next commit will enable.)

Change-Id: I56b63ea2f6b82716719570f1e35d9b425a49b64e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7823
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-08 15:51:13 +00:00
Augustin Cavalier
ff91caf6e5 kernel/fd: Merge vectored I/O implementations.
We now have just one rather than three (common_user_vector_io,
_kern_readv, kern_writev.)

No behavioral change intended, though there is some slight
functional change (syscall flags are now set/unset much earlier.)

Change-Id: I6c3c26cab1c19755ef15c8b3c9e38afe9b1d145c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7822
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-07-08 15:51:13 +00:00
Humdinger
ed33555f4c AboutSystem: fix/remove broken links
There seem to be no obvious alternatives to the URLs for:

* Bitstream Charter
* GLU
* Ralink

Those URLs were removed.

Fixes #18932

Change-Id: I20a1a9e4d4808f5f6cbaa0f34f2aaf24be8f90f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7831
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-07-08 12:49:05 +00:00
Máximo Castañeda
8773f8b854 BTextView: improve layout without word wrapping
- Don't add the insets twice for the preferred width when it is clamped
  to the minimum one.
- Set the minimum size to the preferred one.
- Line breaking depends on text content, not available width, so can be
  done without a valid text rect.

Change-Id: I511d07a8e0ed78330a232679495a1564bfcd22cb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7818
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-07-08 10:56:53 +00:00
Máximo Castañeda
1828888741 CharacterMap: gray-out characters without glyphs in the chosen font
Change-Id: I1a52757579069f7e7fa3a67a5335fe6549379bcb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7830
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-07-06 13:12:21 +00:00
Máximo Castañeda
b8a45b3a2d BFont: allow skipping fallbacks in GetHasGlyphs
Change-Id: I5a68008d25cce34596fb5ce6fb07259ae56c3a3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7829
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-07-06 13:12:21 +00:00
Máximo Castañeda
36087e77db CharacterMap: fix block filter
Some of the Unicode blocks correspond to the union of two blocks as
defined in BeOS (for example, "Arabic" includes B_BASIC_ARABIC_BLOCK and
B_ARABIC_EXTENDED_BLOCK), making the `Includes` test inadequate.

Change-Id: Ib1a358f6be8a8f517c6b8a3642536b3e75d365a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7828
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-07-06 13:12:21 +00:00
Andrew Lindesay
66ee6532aa HaikuDepot: Image loading
HaikuDepot had an image loading system that was well
suited to handling standard icon sizes on standard
unscaled resolution displays. The new mechanism
introduced in this commit will better support UI
scaling in the application.

Change-Id: I23a4c31387fa35f62d8ed18e411b89444c966a2f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7794
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-07-02 18:04:03 +00:00
Oscar Lesta
13581b3d2a proj2make: some minor improvements.
- Enable use of `find_directory()` when searching for "etc/makefile".
- Fixed a missing return statement on `_l::str()`;
- Fix "STATIC" typo on gAppTypes.
- Removed some superfluous spaces on the output makefile, added a couple
  of missing ones.
- Avoid adding library paths as include dirs.
- Replace BeOS header paths with Haiku's.
- Some minor code style changes, here and there.

Change-Id: I03f221c39e894fb6ab6ffebd95ffe5e749678540
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7786
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-07-02 15:39:43 +00:00
John Scipione
26db1794f9 libprint: whitespace cleanup only
Change-Id: I5a3da12e8f61ff404a50b24b0962f9c92511b182
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7791
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-02 10:49:48 +00:00
Timm Steinbeck
922624afa6 USB: Add nullpointer checks to USB Device destructor
It seems to be possible that in case of USB issues a Device
is destroyed before it is registered with the device manager.
In such a case fNode of the device is NULL and there is a
page fault followed by a panic.

Fixes #18922.

Change-Id: I0a363a0ff85e6a74788701738e0cb85a90e99a05
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7821
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-06-29 15:28:46 +00:00
Augustin Cavalier
722d3c01b7 kernel/fs: Increment pos in readv/writev so long as it's not -1.
This amends 20ac27def6.

I missed an important case in that commit: if pos is not -1,
then movePosition will still be false, but we nonetheless
need to increment the read/write position.

Should fix #18921.
2024-06-28 13:47:33 -04:00
Andrew Lindesay
50fc99b8a5 HaikuDepot: Ratings scroller
Fix an issue where the scrollbar on user ratings
was not adjusting to the length of the ratings.

Change-Id: I690f4cbef0cdd88dd7540b47889166e0b3bf513d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7819
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-06-28 15:27:08 +00:00
Jérôme Duval
6c9192d702 kernel: revert unneeded change, requested by waddlesplash
Change-Id: If55f93ed75dc20363de9bf0022d93800f5a9661f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7816
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-06-27 16:16:23 +00:00
Augustin Cavalier
44e9aa9f33 file_systems/QueryParser: Don't let the equation score be 0 if there's an index.
Without this, a query term that does have an index but for which
the pattern starts with a wildcard (e.g. "*term*") is treated as having
a score of 0. That means that it is then dependent on the query order
as to whether or not the equation will run at all, since if all the terms
have a score of 0 but one has an index, placing that term first
will make the query run while any other would not.

Fixes #18672.
2024-06-26 18:20:50 -04:00
Augustin Cavalier
88911fe61c file_systems/QueryParser: Only increment within the operators loop.
If we have a matching operator, we will replace the current item
with a new item, and we may need to process it again. For example,
in cases like "A||B||C", the first pass will turn this into "(A||B)||C",
and so we need to re-process the first item to get "((A||B)||C".

Fixes "Open with..." and some other things following the query parser
refactorings.
2024-06-26 17:23:11 -04:00
Augustin Cavalier
eca86a00ae Tracker: Add a try/catch around ModelMenuItem's creation in AddOneAddOn.
ModelMenuItem can throw exceptions if its Model fails to initialize,
and even though we pass a Model in directly, copying the Model
results in opening the underlying file again, which of course may
fail if something changed since our Model was created.

While at it, remove the return value, since it isn't used anywhere.

Should fix #18905.
2024-06-26 16:37:28 -04:00
Augustin Cavalier
1a3dae790e Tracker: Code cleanup around add-ons.
Mostly de-indents and some shuffling in headers.
No functional change intended.
2024-06-26 16:37:26 -04:00
Jérôme Duval
28748463d9 kernel: check for NULL core in power_saving mode choose_core()
Change-Id: I94fccef73c4254888ad71dfbc748fac72e5bc124
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7795
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-06-26 10:35:33 +00:00
Augustin Cavalier
d1c8e2fe7c strace: Don't print the starting "_kern_" in the stats view.
Same change that was made for the non-stats printing a long
time ago.
2024-06-25 22:10:49 -04:00
PulkoMandy
a85ea80f68 Fix adding Gutenprint to regular image
This was missed in the update to Gutenprint 9.

Change-Id: Ie372a38d557e8f1506b27294b3d6699bb30f7fc0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7716
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-06-26 01:54:07 +00:00
Augustin Cavalier
05404cc538 freebsd_network: Print the bounce buffer type in panic message.
May help with diagnosing #18885.
2024-06-25 21:48:28 -04:00
Augustin Cavalier
8e56b86bdd kernel: Use BStackOrHeapArray in fd & port vector I/O syscalls.
The socket syscall needs to still use the heap. Also add a comment
around get_iovecs_from_user() indicating what callers must do.
2024-06-25 21:33:20 -04:00
Augustin Cavalier
20ac27def6 kernel/fs: Fix readv/writev after the seek-disabled refactor.
This fixes a regression introduced in 34fcf3d9ea.

That commit correctly adjusted the "pos" checks at the top of these
functions, but missed that there was a place in the loop where pos
is incremented. After the first increment, we would have a non-zero
pos, and so the new checks in the actual read/write routines would
return an error, meaning that only the first iovec was ever processed.

This fixes WINE following the aforementioned change.
2024-06-25 20:46:54 -04:00
Augustin Cavalier
32c59a45e1 strace: TypeHandler for iovec*.
Useful for readv, writev, and writev_port_etc.
2024-06-25 20:20:15 -04:00
Augustin Cavalier
0caf909cec Move mounting the shared_memory ramfs to launch_daemon.
The directory is created there, so we should also perform the
mount operation there. If we don't, the first boot of a new
Haiku image will not have the ramfs shared_memory, since of
course the kernel can't mount it at a nonexistent directory.
2024-06-25 19:09:38 -04:00
Augustin Cavalier
146690fec4 aironetwifi: Amend last change.
Seems my local incremental build spuriously succeeded.
2024-06-25 18:57:35 -04:00
Augustin Cavalier
6335cebddd usb.ids: Update. 2024-06-25 18:37:30 -04:00
Augustin Cavalier
e791322263 pci.ids: Update. 2024-06-25 18:37:16 -04:00
Augustin Cavalier
4780e4d4df freebsd_network: Remove some now-unneeded methods and compatibility macros. 2024-06-25 18:35:03 -04:00
Augustin Cavalier
5a39afd352 aironetwifi: Synchronize to the last version before it was removed. 2024-06-25 18:32:53 -04:00
Augustin Cavalier
df49d6c934 drivers/network: Remove remaining declarations of "devclass".
Mainly the ported OpenBSD drivers (where this was added in Haiku-specific
code), and then the few remaining drivers that are no longer supported
on FreeBSD.
2024-06-25 17:40:09 -04:00
Augustin Cavalier
088c695b17 freebsd_network: Remove fls/ffsl from generic/cpufunc.h 2024-06-25 17:14:45 -04:00
Jérôme Duval
61607003b1 kernel: check for NULL smallTaskCore in power_saving mode rebalance()
should fix power saving issue from #18915

Change-Id: Ie0d64445599a3f3af6b2c7f654b20e26bd4e3b8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7790
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-06-25 20:53:36 +00:00
Augustin Cavalier
97a29cc796 freebsd_network: Remove definitions of ffs/fls functions from x86/cpufunc.h 2024-06-24 22:19:49 -04:00
Augustin Cavalier
054e94c69b iaxwifi200: Port a change from upstream OpenBSD. 2024-06-24 22:18:15 -04:00
Augustin Cavalier
25e0933970 openbsd_wlan: Synchronize with upstream OpenBSD. 2024-06-24 22:05:52 -04:00
Augustin Cavalier
95ce8f21aa rtl8125: Synchronize with upstream OpenBSD. 2024-06-24 21:57:29 -04:00
Augustin Cavalier
b1ae2896a0 openbsd_network: Add cast to silence a warning. 2024-06-24 21:56:59 -04:00
Augustin Cavalier
1f33dab2e6 freebsd_network: Move ffs/fls routines to libkern.h and use builtins.
FreeBSD upstream did this a while back. Should fix the 32-bit build.
2024-06-24 21:56:08 -04:00
Augustin Cavalier
86021fd407 Synchronize freebsd_net80211 and all maintained FreeBSD drivers with 14.1.
Tested with realtekwifi, still works.
2024-06-24 21:19:47 -04:00
Augustin Cavalier
f6b6453fee freebsd_network: Additions for FreeBSD 14.x net80211 and drivers. 2024-06-24 20:55:29 -04:00