Commit Graph

63419 Commits

Author SHA1 Message Date
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
Augustin Cavalier
8896f5d72f FAT: Make more use of C++ features and utility classes.
This driver was fully C until relatively recently, when it was
switched to C++ so that it could be used with fs_shell. However,
it still is mostly using C paradigms; so this commit begins the
refactor away from that.

If I did this correctly, there should not be any functional change.

Change-Id: Id87d17b2e019ccdd1c7f07156cfe2a2124496675
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4725
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-12-01 21:16:26 +00:00
Jérôme Duval
9dcb1b7ff7 intel_extreme: added IDs for ASUS laptop in ticket #15392
also for Acer Aspire F5-573G from https://bsd-hardware.info/?probe=240171b234

Change-Id: Id3c83d3039736fa749f0411889c081e447bd0444
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4750
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-12-01 13:02:42 +00:00
Jérôme Duval
befbf01515 intel_extreme: implement get_preferred_mode for vbt on mobile
this avoids searching in edid information in this case.

Change-Id: I330341f089f71cd5de657a6630b5414d02db771f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4749
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-12-01 13:02:42 +00:00
Rudolf Cornelissen
7a52a73261 intel_extreme: added IDs for ASUS laptop in ticket #16825 2021-11-30 22:25:03 +00:00
Jérôme Duval
3fedf64872 intel_extreme: enable KabyLake
Change-Id: I81d04fdf8305efcc9250cfb975dd3466ebcb4058
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4740
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-11-30 08:06:56 +00:00
Kacper Kasper
66aae93087 intel_extreme: enable CoffeeLake
Change-Id: Id73c88d0815259fa7a8027f757ac430818492b1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4739
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-11-30 08:06:56 +00:00
Augustin Cavalier
02077ffc42 kernel/condition_variable: Atomicize ConditionVariableEntry and drop the lock.
Before 2019, the entire ConditionVariable system was "giant"-locked:
that is, there was a single global lock that all ConditionVariable
and ConditionVariableEntry operations had to pass through. This of
course was not very performant on multicore systems and when
ConditionVariables see significant use, so I reworked it then to have
more granular locking.

Those patches took a number of attempts to get right, as having two
objects in separate threads that can each access the other not turn
into a deadlock or use-after-free is not easy to say the least,
and the ultimate solution I came up with erased most of the performance
gains I initially saw on the first (partially broken) patchsets.

So I have wanted to revisit this and see if there was a better way
even since then. Recently there have been a few reports of
ConditionVariable-related panics (apparently double unlocks),
notably #16894, and so that was reason enough to actually revisit
this code and see if a better solution could be found.

Well, I think I have come up with one: after this commit, Entries
no longer have their own lock, and instead accesses to Entry members
are almost always atomic; and there is now a case where we spin inside
Variable::_NotifyLocked as well as one in Entry::_RemoveFromVariable.

This leads to somewhat simpler code (no more lock/unlock dance in Notify),
though it is significantly more difficult to understand the nuances of it,
so I have left a sizable number of comments explaining the intricacies
of the new logic.

Note: I initially tried 1000 for "tries", but on a few instances I did see
the panic hit, strangely. I don't think the code that is waited on can
be reasonably reduced any further, so I have just increased the limit to
10000 (which is still well below what spinlocks use.) Hopefully this suffices.

Quick benchmark, x86, compiling HaikuDepot and the mime_db in VMware, 2 cores:
before:
real    0m23.627s
user    0m25.152s
sys     0m7.319s

after:
real    0m23.962s
user    0m25.229s
sys     0m7.330s

Though I occasionally I saw sys times as low as 7.171s, so this seems
to be at least not a regression if not a definitive improvement.

Change-Id: Id042947976885cd5c1433cc4290bdf41b01ed10e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4727
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-11-30 02:18:27 +00:00
Kacper Kasper
7a855aa5c7 intel_extreme: fix overflow in SKL PLL calculation
* RGB 4K@60Hz clock is 594MHz, that multiplied by 5 overflows int value.

Change-Id: Idda04119d582fa4e30c7729296ad5959b29dba77
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4738
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Rudolf Cornelissen <rudhaiku@gmail.com>
2021-11-29 18:14:21 +00:00
Kacper Kasper
fe9ab0f353 intel_gart: add support for Gen8+ GPUs
Change-Id: I8b84e278f33542c359fc0d783f571e06ebc89b2a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4737
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Rudolf Cornelissen <rudhaiku@gmail.com>
2021-11-29 18:14:21 +00:00
Rudolf Cornelissen
c199501e81 intel_extreme: add laptop panel detection and mode scaling for DDI systems 2021-11-29 13:30:27 +00:00
Rudolf Cornelissen
6ed123e532 intel_extreme: always assume panel on eDP on laptops. 2021-11-27 18:15:07 +00:00
Rudolf Cornelissen
03ed104900 intel_extreme: enabled all known skylake gfx cards since they are pgm'd now 2021-11-26 23:52:15 +00:00
Rudolf Cornelissen
39e05c7d01 intel_extreme: skylake PLL works, all outputs fully functional. 2021-11-25 22:41:48 +00:00
Murai Takashi
4500c381d2 drivers/graphics/framebuffer: fix include guard
Pointed out by LGTM (Duplicate include guard).

Change-Id: Idc0e0cd48f85d4635f87355f36eb03932aa36d2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4736
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-25 12:20:29 +00:00
David Karoly
493b3fc409 bus_managers/fdt: check for NULL
Change-Id: Ib33b2591c2966a266e0813e042d388dbe88ef939
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4700
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-24 13:39:23 +00:00
David Karoly
191fa37376 kernel/uart: fix GetChar for PL011
Check RX buffer status when GetChar is called in no-wait mode.
This fixes an 'infinite keypress' issue that used to occur
after 16 keypresses.

Change-Id: I47762de387b07c4fed46cc192cd3b81fdabfb270
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4732
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-24 13:38:14 +00:00
Augustin Cavalier
750ed8dd41 nvme_disk: Implement TRIM.
Only lightly tested (in QEMU with qcow2 images: it seems to work
and not to discard actual data.) Use with caution!
2021-11-23 17:57:37 -05:00
Augustin Cavalier
ab2a1b20e3 nvme_disk: Add a missing CALLED() and another assert. 2021-11-23 17:57:36 -05:00
Augustin Cavalier
3ff0d7a882 libroot: Compile x86_64's arch_string with -fno-builtin.
Otherwise, GCC and Clang create infinite recursions.
Fixes #15827.
2021-11-23 16:36:48 -05:00
Augustin Cavalier
2532a28785 Avoid using unions for LongDirEntry.
GCC still assumes that the dirent has no data past the end for some
scenarios here and still mis-optimizes things. Therefore, drop the
usages of unions altogether, and instead use a casted character array.

Additionally, use B_FILE_NAME_LENGTH for the array, not B_PATH_NAME_LENGTH,
and make sure to add 1 for the NULL terminator.
2021-11-23 16:36:18 -05:00
Augustin Cavalier
8be37ed439 kernel/smp: Avoid casting spinlocks, which are structures.
The lock entry is the first thing in the struct, so this is a no-op
change, but it is safer to do in case of changes, of course.

Spinlocks have been structures for quite a long time, so this was
probably just missed in the conversion.
2021-11-23 13:52:44 -05:00
Augustin Cavalier
ba3ee26af0 WindowInfo: Use char[0] for FLA instead of char[1].
This is a private structure, so despite being an ABI break,
it should not cause any problems.
2021-11-23 13:50:45 -05:00
Augustin Cavalier
3d34a937af Package Kit: Build FetchUtils outside HAIKU_TARGET_PLATFORM_HAIKU. 2021-11-23 13:49:14 -05:00
Augustin Cavalier
1998232e12 libpackage_build: Add FetchUtils.
Change-Id: I2394d35c520c6cdde6e7cb09039d0d8f5689f19f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4731
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-11-23 18:41:20 +00:00
Augustin Cavalier
2be10edfb9 Package Kit: Improvements to partial download handling.
* Move IsDownloadComplete call into DownloadFileRequest; this way
   we will always revalidate checksums even if the file is fully
   downloaded instead of skipping that.

 * Treat ERANGE as a "bad data" error in PackageManager (it usually means
   we have a size mismatch between the local and the server's file)

 * If we fail checksum validation or get ERANGE, and we reused a download,
   immediately try again without reusing the download. This fixes most
   problems that previously required you to delete old transaction
   directories.

Change-Id: Ia3079655691b871e0b206e366b59fca0f832c63d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4730
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-11-23 18:32:28 +00:00