Commit Graph

63344 Commits

Author SHA1 Message Date
Augustin Cavalier
6ae7f1f12d XHCI: Consolidate xhci_device cleanup routine and use it in AllocateDevice.
This also fixes a leak of slots when initializing devices failed.
Fixes #16323, although there is some other underlying problem
which led to that error in the first place.
2021-12-08 12:59:45 -05:00
Augustin Cavalier
2b4a870a7f packagefs: Prevent signed integer overflow in Query::IndexGetWeightedScore.
As the comment already noted, the maximum input score is 2048,
and 2048*1024*1024 overflows int32. Subtract 1 from maxFactor
to prevent this.
2021-12-08 12:26:30 -05:00
Augustin Cavalier
fb25e7349d scsi_cd: Remove unused code. 2021-12-08 12:25:09 -05:00
Augustin Cavalier
ca89fd65a6 HaikuPorts: Mesa on x86_gcc2h needs llvm9. 2021-12-07 22:43:06 -05:00
Augustin Cavalier
f207629e04 MACLib: Only define min & max if we are on GCC2.
Otherwise they will be pulled in from <algorithm>.
2021-12-07 22:19:31 -05:00
Augustin Cavalier
36a1e12f21 kernel/vm: Cast temporary to uint32.
It is defined as a uint32:1, which apparently becomes an "int" on
newer GCC versions, which thus triggers a -Werror=format. So,
convert it explicitly in order to prevent the error.
2021-12-07 21:24:00 -05:00
Augustin Cavalier
a81d165008 Update build-packages for GCC 11 upgrade. 2021-12-07 14:26:24 -05:00
Augustin Cavalier
c52bbf73b5 ArchitectureRules: Adjustments to Werror flags for GCC 11. 2021-12-07 14:24:15 -05:00
Augustin Cavalier
dbaef85011 configure: Use IS_LEGACY_GCC instead of manually comparing GCC versions. 2021-12-07 14:22:54 -05:00
Augustin Cavalier
f0213b4407 EXTranslator: Disambiguate clamp(). 2021-12-07 14:22:24 -05:00
Augustin Cavalier
365c228de7 RTFTranslator: Remove some dynamic exception specifications. 2021-12-07 14:22:12 -05:00
Augustin Cavalier
db911197a0 libroot: Force __cxa_pure_virtual to be linked in.
In GCC 8 builds it is by default, in GCC 11 builds it is weakly
defined, which runtime_loader does not yet support properly,
so we force it to be included.
2021-12-07 14:21:52 -05:00
Augustin Cavalier
7ce3c9283e kernel/condition_variable: Unblock earlier and simplify the code more.
Unblocking after unsetting fVariable just causes too many headaches
and corner cases to deal with; the code as-is did not actually handle
all of them, as it missed the case where the entry thread had called
thread_prepare_to_block but had not yet actually blocked.

Hopefully the last fix for #17444.
2021-12-07 14:15:54 -05:00
Augustin Cavalier
acdd232ad5 kernel/condition_variable: Check thread->state before unblock.
See inline comments. Should help with #17444.
2021-12-07 13:30:36 -05:00
David Karoly
b3780b5658 kernel/arch/arm/int: enable OMAP3 and PXA intc drivers
Change-Id: I83ab8cd4c474bd374f66a39d9a60c778dd7033e8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4757
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-07 10:58:24 +00:00
David Karoly
36d65a7890 kernel/arch/arm/int: add initialization code for GICv2
Change-Id: I4f98a4e0277ce37e758cabbb04806cf13f351f1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4674
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-07 10:58:24 +00:00
David Karoly
354655e136 boot/efi/dtb: implement interrupt controller detection
Change-Id: I045a94c5bcb7c16297bc6fdd1fa2981e5b3f3a62
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4756
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-07 10:58:24 +00:00
Jérôme Duval
09a8f74d70 intel_extreme: add PCH definitions for some platforms
Change-Id: Id91f8fb526825cc62cd4288bee4a6d08dfd6654a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4764
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-12-07 08:32:49 +00:00
Rudolf Cornelissen
a4493afb60 intel_extreme: fixed small error, forgot to (re)set default refclk for DP. 2021-12-07 00:48:58 +00:00
Rudolf Cornelissen
9ef22aa9d7 intel_extreme:DP links on sky- upto/incl coffeelake are now done (refclk detection added) 2021-12-07 00:42:42 +00:00
Lt-Henry
6c88202d33 hid_shared: factorize more code between USB and HID
* Removed i2c keyboard handler, as it was just a hid shared handler duplicate with kdl stuff removed
* I've created a new macro def for the kdl code, splitting generic kdl code from specific usb one
* I2C custom KDL code can be added in the future (I don't know if it is already possible)

I am not very happy with this solution, but imho it is better than having two keyboard handlers. In fact, they were already out of sync from last patch series

Change-Id: I36513e57a2ce4f004fc7e05ccff5a6b2517fc139
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4758
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-12-06 19:49:02 +00:00
Augustin Cavalier
858210daf4 kernel/condition_variable: Acquire thread->scheduler_lock before unsetting fVariable.
This fixes a race condition as described in the inline comment.

Hopefully fixes #17444.
2021-12-06 13:11:28 -05:00
Jérôme Duval
949005a59b strace: handle parallel syscalls on different threads
If a thread executes a system call and meanwhile a different thread calls another one, then
the ongoing call is marked as unfinished. When the call returns it will be marked as resumed.

* remove PreSyscall, now unused.

Change-Id: Iea45b866be2c40568d766c2ed3cc73e34b9d1293
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4765
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-12-06 17:22:50 +00:00
David Karoly
f18aba2ca8 BootRules: use non-legacy ld
Change-Id: I0dc6a1c8731e710a9c43b6dfa5ea08c84fa5d3a6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4759
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-12-06 03:08:27 +00:00
David Karoly
8032682c23 OverriddenJamRules: sort out build flags for .S files
Change-Id: I1ad67e1aab3911e7b66dc801923e8ba5cc1e087d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4755
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-12-06 03:08:27 +00:00
Jérôme Duval
39782e55fa strace: support trace for poll() and select()
in the case of poll(), the events should be printed before the actual syscall,
and the revents after, while taking in account the return value.
thus B_DEBUGGER_MESSAGE_PRE_SYSCALL needs to be enabled and handled.
the attribute "preSyscall" is added to identify such syscalls, and the parameters
are identified with the attribute "inOut".

Change-Id: I390643ea176c720738c5ec4fc75a3a4c7125a3cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4763
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-12-06 03:07:41 +00:00
Jérôme Duval
c53f760dfe strace: add some constants ioctl from sys/ioctl.h
Change-Id: I100f715f899435c6a9bce775d95da6f755ba55c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4762
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-12-06 03:07:41 +00:00
Rudolf Cornelissen
c80ea54975 intel_extreme: PLLs post skylake work differently again. Refclk update. 2021-12-05 16:56:15 +00:00
Rudolf Cornelissen
d60c7e010c intel_extreme: for gen9.5 added new portF to DDI scan. add ID dump in kerneldriver. 2021-12-05 12:47:05 +00:00
Rudolf Cornelissen
77b2dd17df intel_extreme: added DDI link colordepth detection, may fix ticket #17439 2021-12-04 23:24:50 +00:00
Rudolf Cornelissen
a33640cc6b intel_extreme: fix 3 and 4 lanes DP connections (ticket #17439) 2021-12-04 00:46:36 +00:00
Augustin Cavalier
3c2597393c kernel/int: Allow arch_int_assign_to_cpu to make its own decisions.
For now this is used on RISCV64 to indicate that interrupts will always
be on CPU 0. However, in the future, some architectures may want
or require interrupts to be "steered" in various ways, and this
also paves the way for that.

Change-Id: Iec79870cf5c4898d102d0e624de19602271ae772
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4721
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-12-03 22:36:47 +00:00
Rudolf Cornelissen
3316cfc9af :intel_extreme: only offer backlight control in screenpres on laptops. 2021-12-04 00:25:49 +00:00
David Karoly
563ac51229 boot/efi: fix compile issue with format strings
Change-Id: I144afe78f73fed211ea1c72584fa5f12e4452454
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4751
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-12-02 12:50:54 +00:00
David Karoly
e82b457883 boot/efi/devices: fix warning for comparison signedness
Change-Id: I2a329c91d229a8672536ccdaa2c94db109390308
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4752
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-12-02 12:50:37 +00:00
David Karoly
c5d81c2739 build: prepare for x86 EFI loader
Change-Id: Ic9e4181042bf634cd590d8c95935a987a4871b0d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4753
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-12-02 12:50:25 +00:00
David Karoly
f5f10a9ec9 boot/efi/arm: remap UART to kernel address space
Change-Id: Iff145a45e8efe28b710d5a948f6f69a944027885
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4744
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-02 08:16:31 +00:00
David Karoly
1f46427d16 kernel/arch/arm: introduce virtual_ranges_to_keep
Change-Id: I36b8b871a103f2be87c600fc0b0a12f7ceff0ae4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4743
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-02 08:16:31 +00:00
David Karoly
19960ba6f9 boot/efi/dtb: implement interrupt-cells handling
Change-Id: Ia95c2cfecde27cdd6d5a8f0556da7e387eecb07c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4742
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-02 08:16:31 +00:00
David Karoly
a722fbfc45 kernel/arch/arm: enable 8250 generic and OMAP UART drivers
Change-Id: I45396eada2e9088b27df7fb9522d07e8ac223fd5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4741
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-02 08:16:31 +00:00
David Karoly
15951db938 kernel/arch/arm: initialize debug console based on FDT
Change-Id: I759d38185c2f7e75d8ba7120c8d06740720171ec
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4735
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-02 08:16:31 +00:00
David Karoly
326b5263de boot/efi/dtb: implement clock frequency resolution for PL011
Factor out the code for clock frequency lookup to a separate function.

PL011 does not have clock-frequency property, it has a clocks property
instead, containing a phandle of the apb clock.

Change-Id: I5cbe2b4b2421afe1924c2804002ceef83ce37ef9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4734
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-02 08:16:31 +00:00
David Karoly
ff9497b539 boot/efi/dtb: require exact match for PL011 in device tree
Don't match PL011 for arm,primecell compatibility string
as it can indicate other peripherals.

Primecell peripherals have the generic "arm,primcecell"
name as well as a specific name in the format of "arm,pl???"

see:
https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/primecell.txt

Change-Id: Ida6450e9e71dac834770d558e4ab95c5574970cb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4733
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-02 08:16:31 +00:00
David Karoly
8a18d81d7a boot/arch/arm: disable FPU initialization on bootloader start
Change-Id: Idd71940d22a9004e93f613899725d299a7932d8c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4702
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-02 08:07:42 +00:00
dsizzle
d1f10fcef9 Added missing --cross-tools-source argument name for bootstrap build and missing \ at the end of line 136
Change-Id: Ie4a6d47d78a1f2eb707c15a53335adee7e370376
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4745
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-02 08:05:50 +00:00
Augustin Cavalier
62cdbd253e libbe_build: Add header needed on some systems. 2021-12-01 17:15:23 -05:00
Augustin Cavalier
711e2dc05b Adjust all struct dirent creations (again), this time to use offsetof().
The dirent struct is not packed, so offsetof(dirent, d_name) != sizeof(dirent).
Thus in order not to waste the alignment bytes (which are significant,
on x86_64 at least, sizeof(dirent)==32, but offsetof(...)=26.)

This is also the most portable way to handle things, and should
work just fine in cross-platform code that has a non-zero-sized d_name.
2021-12-01 17:05:40 -05:00
Augustin Cavalier
ba0e4a83e5 FAT: Unlock before calling the file cache.
Otherwise if the file cache calls us again from a different thread,
as it sometimes does when doing concurrent I/O to multiple files,
we will deadlock.

Fixes #14104.
2021-12-01 16:39:24 -05:00
Augustin Cavalier
e385e3a009 FAT: Remove some unneeded locks.
Noticed by PulkoMandy in review on 4725.
2021-12-01 16:29:47 -05:00
Augustin Cavalier
690671b0c7 FAT: More miscellaneous cleanup.
* Remove __RO__ hack inherited from BeOS sample code.
 * Remove and excise unneeded macros.
 * Remove readlink, VFS will return EINVAL in its absence anyway.
2021-12-01 16:28:21 -05:00