Commit Graph

63833 Commits

Author SHA1 Message Date
Augustin Cavalier
49fd143d15 freebsd_network: Print the taskqueue name in the timeout KASSERT.
Should help with diagnosing #17634.
2022-03-09 17:10:15 -05:00
Augustin Cavalier
45f4882a72 libroot: Allow posix_spawn to use load_image in more cases.
If a spawnattr and file_actions are specified but empty, that
can be treated the same as if they were passed as NULL.
2022-03-09 16:20:42 -05:00
Augustin Cavalier
2f26390421 libroot: Remove another unused glibc header. 2022-03-09 16:02:44 -05:00
Augustin Cavalier
3a76add7d3 libroot: Replace a64l/l64a with musl equivalents. 2022-03-09 15:50:30 -05:00
Augustin Cavalier
92ca4f66a7 libroot: Remove duplicate obstack.h and obprintf.
We never included obprintf in the build, and the real obstack.h
exists in the "extensions" folder. Unfortunately, it seems the
BeOS R5 libroot had an obstack.h in the public POSIX headers
directory and exported the functions, so we cannot remove it
completely just yet.
2022-03-09 15:29:12 -05:00
X512
b19f5c839b kernel/x86: add ability to set GS segment base from userland
Needed for Wine.

Co-authored-by: Jérôme Duval <jerome.duval@gmail.com>

Change-Id: I13f6a5802fce04fd2ebb4cc01ecd2f12c90830db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4839
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-09 18:28:00 +00:00
Alexander von Gluck IV
397102c17d boot/riscv64: Fix -znotext invocation to work under ld and lld
Change-Id: If47b0aeeda49661e466c66cabd2ac9a83f16aeef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4987
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-09 13:47:03 +00:00
Alexander von Gluck IV
e9541a68ed build/riscv64: Disable relaxation linker optimization under clang/lld
* Fixes errors compiling under clang around 'R_RISCV_ALIGN
  requires unimplemented linker relaxation'
* Same fix FreeBSD applied https://reviews.freebsd.org/D25210

Change-Id: I680cac5e3e73d3ebb84aa0741bcee61530405db0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4986
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-09 13:45:04 +00:00
Jérôme Duval
86e5dd70f6 glibc: add missing prototypes in wchar.h
fixes #17636

Change-Id: Iab9db947abf9b13d840fb94d2095f1c42f1c4051
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5077
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-09 08:56:41 +00:00
Humdinger
1e174254d6 Media replicant: fix menu label "Sounds preferences"
Change-Id: I561393f3d8663e650a27380eb45bcf4412af87a9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5076
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-03-08 07:08:22 +00:00
Jérôme Duval
62dbe4d6c9 intel_extreme: map with kernel permissions only. 2022-03-07 12:03:10 +01:00
Rudolf Cornelissen
c9e1571cc3 intel_extreme: added Intel ACPI OpRegion basic support for fetch of native panel modeline. 2022-03-06 23:47:19 +01:00
Augustin Cavalier
d497bf51a6 kernel/wait_for_objects: Fix copy/paste error in poll().
Seems none of the applications I tested yesterday actually used poll(),
because it was completely broken by this.

The previous code assigned this variable inside a malloc() call, though,
which wasn't all that obvious either.
2022-03-05 11:16:14 -05:00
Augustin Cavalier
f666c0873e kernel/wait_for_objects: Use BStackOrHeapArray for userland data.
Especially in select(), this cuts overhead significantly,
as we now only invoke malloc() once, and for small select()s
we never have to.
2022-03-04 16:56:46 -05:00
Augustin Cavalier
856721d9fe kernel/vfs: Use correct select pointer type in allocation of IO context.
All pointers are the same size of course, so this is not a functional change.
2022-03-04 16:15:40 -05:00
Augustin Cavalier
ce172b8e10 freebsd_network: Check for errors in usbd_transfer_submit.
This way, transfers that fail to queue will have their callbacks
actually invoked.

Fixes hangs when trying to disable unplugged USB WiFi devices.
2022-03-04 16:04:53 -05:00
Dale Cieslak
2398586d63 Pairs: reset IsFirstClick to true for New game
Reset the value of IsFirstClick to true whenever a new game is
started. Without this fix the board gets confused if there is
a card flipped when a game is restarted.

I can't reproduce any of the other oddities in the ticket but
this fixes the egregious repro case mentioned.

Fixes #6932

Change-Id: Ie5cedd7fc2ca411db722d3c24f68fe9aa48f7b5f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5038
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-02 22:42:05 +00:00
Adrien Destugues
015b40866c vesa: live mode patching, nvidia version.
Some improvements to allow setting 8, 15, 16 and 32bit modes, and detect
the correct mode number after patching the BIOS automatically, instead
of hardcoding it.

Also move the patching code to a separate file.

Fixes #10570.

Change-Id: I920f448b59ad7373cb8595d92ce3fa52324be67e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4629
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-02 22:39:02 +00:00
Adrien Destugues
9515cd8c6f vesa: implement live patching for ATI/AMD cards
This uses atombios headers to find where in the BIOS the video mode
tables is located. Then, we can replace entries in the table (in a RAM
copy of the BIOS, of course) and inject any video mode we need. To make
the table easy to find, the Atombios headers from the radeon_hd are
reused, but no atombios code execution takes place here.

Change-Id: If1981b1574822d4ce1e072dd6437a727192ce7cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4628
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-02 22:39:02 +00:00
Adrien Destugues
6a175a5ddc vesa: report BIOS manufacturer (visible in screen preferences)
Get the OEM string from the VESA info block (and also get the memory
size from there while we are at it). If the string is empty, use the
BIOS type (identified in other ways) to still report something.

Change-Id: I8cbd75d19f624a43db05e82d1e1b2a536cc418b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4625
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-02 22:39:02 +00:00
Adrien Destugues
1005a27603 vesa: live BIOS patching for Intel video devices
The VESA standard does not define any way for software to set a custom
video mode, which means normally we would be constrained to whichever
modes the video card manufacturer decided to provide. However, since we
run the BIOS in an emulated environment, it is possible (and even quite
easy) to patch it and inject any video mode we want, provided we know
the format to use and where to put the info in.

This approach was used in the NewOS VESA driver, as well as in
915resolution (a tool that predates the availability of native drivers
for Linux for Intel videocards). Later on it was also used in Chameleon
and Clover, bootloaders that are used for hackintoshes (running MacOS on
unsupported hardware).

This commit implements full support for Intel cards only, AMD and NVidia
will be added later (but there is preliminary code to detect them)

Change-Id: I2c528ba18b3863f486da694860a10761efcbfb3f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4624
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-02 22:39:02 +00:00
David Karoly
6804f6c764 kernel/arm: implement entering userspace
Change-Id: Icf3945db979a8f4444856fc7157649f48b297c29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5037
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-02 22:38:25 +00:00
Augustin Cavalier
6acf0b3e21 freebsd_wlan: Reduce -O0 to ieee80211_scan_sw.o.
This is the only file that seems to be affected by whatever the problem is.

Part of #17458.
2022-03-02 16:28:59 -05:00
Augustin Cavalier
84f45724fc kernel/Jamfile: Remove invalid character. 2022-03-02 15:05:31 -05:00
David Karoly
289b735673 arm: fallback to icu-57.2 for haikuportscross
Change-Id: Iad87ab9675314d52cf1748afb1bd9017ec911178
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5036
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-03-02 19:28:50 +00:00
Adrien Destugues
455468cbfd sdhci_pci: remove (incomplete) use of MSI
MSI was never implemented in this driver and only used for a log during
initialization. Remove it for now.

This makes it easier to use the driver on non-x86 systems where there is
no MSI.

Change-Id: I39ccbb82b78ea98c0d045ef07ee9bb28c775e292
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4847
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-03-02 09:13:33 +00:00
David Karoly
fdb459132e boot/efi/x86: implement SMP detection and bootup
* move common SMP initialization code to x86/arch_smp.cpp

* factor out arch-specific SMP initialization to
  arch_smp_32.cpp resp arch_smp_64.cpp

* implement smp_trampoline for x86 32-bit EFI loader

* rename SMP trampoline for x86_64 to long_smp_trampoline

* add new argument virtKernelArgs to arch_smp_boot_other_cpus
  as the kernel args are not identity mapped on 32-bit architectures

Change-Id: I30d0bb1fa9bfb08f6784a2af34eb83d6b64afa57
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4869
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-03-01 17:39:19 +00:00
Rudolf Cornelissen
456e6f33dd intel_extreme: added more pipeC support, fixes for eDP on DDI systems 2022-02-27 22:25:04 +01:00
Zakero
11dc1393cf Minor Terminal fixes
In the Terminal settings window, the pop-up help text for
"Tab title:" had two entries for "%% - The character '%'.".
Removed one of the entries.

Fixed the spelling of some constants: kTooTip* vs kToolTip*

Changing the window title and tab title directly will now
show the same tool-tips as the Terminal settings window.

Change-Id: Ic36cc1f8af0305b757105a229203115efee870c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4989
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Máximo Castañeda <antiswen@yahoo.es>
2022-02-27 19:10:39 +00:00
Humdinger
7753e163c9 Mixer: Remove option to refuse format changes from audio mixer GUI
The options "Refuse in/output format changes" were meant to prevent
format changes of connections on the fly, without tearing down and
establishing a new connection.
The mixer does not support such format changes for input.

With this patch input format changes are refused - the former
default setting.
Output format changes are at least mostly implemented, so we are
allowing format changes here.

Both options get removed from the Audio mixer setup panel of the
Media preferences. The code those settings themselves is kept.

Thanks Máximo Castañeda for the investigation, see
https://www.freelists.org/post/haiku-development/Explain-the-Audio-Mixer-Setup-options-of-Media-preferences,26

Change-Id: Idb2d0674a4701014249bc5252a7e4ccedc4f532f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4934
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-02-27 06:51:38 +00:00
David Karoly
4c6e7a4bca kernel/arm: implement prefetch abort handler
Change-Id: I39c330a44ad36ede41c7727017dd733d07288be9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4983
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-02-26 22:08:57 +00:00
David Karoly
883858e60b implement TLS for arm
Use the User Read-only Thread ID Register aka TPIDRURO to store
TLS pointer.

The User Read-only Thread ID Register is read-only in User mode,
and read/write in privileged modes.

see: ARMv7 Architecture Reference Manual,
section B3.12.46 CP15 c13 Software Thread ID registers

Change-Id: I7bff2fd66f41d7bf1a8a247151bcd02b32733c1b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4994
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-02-26 11:41:40 +00:00
Autocomitter
8a2698fe28 Update translations from Pootle 2022-02-26 08:07:32 +00:00
Augustin Cavalier
0463bae558 realtekwifi/rtwn: Synchronize with FreeBSD trunk as of today.
A few changes ommitted (e.g. NET_EPOCH) as they are not needed.
Adds support for a variety of USB devices and one PCI device.
2022-02-25 15:37:50 -05:00
Augustin Cavalier
4e02cb0d87 freebsd_network: Add stub epoch.h.
We don't have a need for these APIs, so we can leave them as dummies.
2022-02-25 15:36:56 -05:00
Augustin Cavalier
9467237d25 freebsd_network: Update usbdevs. 2022-02-25 15:36:09 -05:00
David Karoly
1b895c8371 kernel/arm: implement syscall handler
Change-Id: I75f2fb7808f55a460835276ca66cce8a26e8403d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4980
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-02-25 15:35:50 +00:00
Augustin Cavalier
a40b421ac7 freebsd_network: Restore include of sys/pcpu.h in sys/mutex.h.
Fixes some build failures in a few WiFi drivers.
2022-02-24 21:49:26 -05:00
Augustin Cavalier
711ff0cf42 freebsd_network: Fix undefined reference caused by incorrect includes. 2022-02-24 21:23:41 -05:00
Augustin Cavalier
05216554a4 realtekwifi: Compile with USB support and expose the necessary structures.
Tested with an 8821AU. It works, hurrah!
2022-02-24 21:15:44 -05:00
Augustin Cavalier
423ee7c669 freebsd_network: Adjust and rewrite attach code for USB support.
init_hardware now takes 2 devices arrays: one for PCI and one for USB
drivers, respectively.

The few drivers that have their own __haiku_handle_fbsd_drivers_list
are also adjusted at the same time.
2022-02-24 21:15:10 -05:00
Augustin Cavalier
2e9f01f60d freebsd_network: Introduce USB-handling code.
It is not yet wired in to the rest of the compatibilit layer;
that will happen in the next commits.

The bulk of the implementation is in usb.cpp; most of the
rest of the new files are copied from FreeBSD to varying degrees.
2022-02-24 21:12:28 -05:00
Augustin Cavalier
a8523a21b5 freebsd_network: PCI handling cleanup in preparation for USB support.
Should not have any functional change.
2022-02-24 21:10:24 -05:00
Augustin Cavalier
d6e2a3156a freebsd_network: Mutex handling cleanup.
* Add support for mtx_assert.
 * Move MTX_SPIN handling to dedicated functions like FreeBSD does.

Tested with ipro1000 and realtekwifi.
2022-02-24 21:07:50 -05:00
Augustin Cavalier
ba641651b4 freebsd_network: Implement cv_destroy. 2022-02-24 21:06:58 -05:00
Augustin Cavalier
eeec7ed477 USB: Change from an instant to an unlimited timeout in ControlPipe::SendRequest.
Otherwise we have a race (or worse): in the case where the transfer
has completed or is in the process of completion between CancelQueued
and here, the callback can still be invoked after we returned and
cause corruption.

Discovered while working on USB support in the FreeBSD compatibility
layer: a lock inversion problem meant these timeouts always occurred
but then the callback would be invoked later and corrupt stack.

With this change, such problems will instead cause deadlocks.
That's not an ideal situation to be in, but we should detect
such problems elsewhere and make them into asserts; deadlocks
are assuredly better than random memory corruption.
2022-02-24 21:06:08 -05:00
Augustin Cavalier
7c97a7846f XHCI: Handle fragmented transfers failing to submit the next fragment.
Previously they would just get "lost" and never signal completion.
(Considering how rare fragmented transfers are, this may not fix
any real problems.)
2022-02-24 21:05:54 -05:00
Augustin Cavalier
6711786ccc XHCI: Fix a TRACE statement.
Disabled by default anyway.
2022-02-24 21:05:35 -05:00
Alexander von Gluck IV
f1b2d3ba95 kernel/x86: Fix and modernize tracing of timer code; no functional change
* Fixes functionality of TRACE statements on 64-bit platforms.

Change-Id: Iaba8f8b2d49ec1acda3fc2d51e24a207c5bcc97a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4992
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-02-24 20:37:17 +00:00
David Karoly
0fea9fec6f Update gcc_bootstrap package for ARM
Change-Id: Ica8b714252925460c612f934cc2a7300a397ec47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4993
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-02-24 20:23:06 +00:00