Commit Graph

9681 Commits

Author SHA1 Message Date
David Karoly
38d4a2edf7 virtio: add VIRTIO_FEATURE_ANY_LAYOUT in virtio.h
Change-Id: Ib8bc3639b4330dc1fb61ddbb6a3e8237cc6814ca
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4971
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-02-18 21:27:47 +00:00
Jérôme Duval
d96e266b70 POSIX: introduce pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock
will appear in the next version: https://www.opengroup.org/austin/docs/austin_1110.pdf

Change-Id: I83ef657dce54c223e2dc0c207fce17d9238f7115
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4970
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-02-18 21:27:06 +00:00
Jérôme Duval
e41d4bd102 POSIX: introduce pthread_mutex_clocklock
will appear in the next version: https://www.opengroup.org/austin/docs/austin_1110.pdf

Change-Id: Id4553754494d6594f159356a73534c3cc9900184
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4969
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-02-18 21:27:06 +00:00
Jérôme Duval
ceb7b7612a POSIX: introduce pthread_cond_clockwait
will appear in the next version: https://www.opengroup.org/austin/docs/austin_1110.pdf

Change-Id: I964968b81533c43ae95380bff79c8ec423d0a665
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4967
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-02-18 21:27:06 +00:00
Jérôme Duval
a866e2d902 POSIX: introduce sem_clockwait
will appear in the next version: https://www.opengroup.org/austin/docs/austin_1110.pdf

Change-Id: Iee3faf23647aa5244ad316fe1c3d825592483935
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4966
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-02-18 21:27:06 +00:00
Rudolf Cornelissen
cfd3bb41aa intel_extreme: log srcclk info, Sandy/Ivy eDP detect BIOS pipe setup and use that. 2022-02-12 23:29:42 +01:00
Augustin Cavalier
9af6dc63b2 kernel: Remove malloc_referenced now that it is unused.
It was added long before we had KernelReferenceable, which should
be used instead.
2022-02-09 16:42:06 -05:00
Augustin Cavalier
e372ec1e02 kernel: Use KernelReferenceable for the supplementary_groups array.
Instead of the malloc_referenced system. Makes for some cleaner code,
and the malloc_referenced system was only used here, so it can now be
dropped altogether.
2022-02-09 16:39:43 -05:00
Augustin Cavalier
ebf0b53a7e kernel/util/atomic: Permit atomic_pointer_get to accept const* pointers. 2022-02-07 14:35:23 -05:00
Augustin Cavalier
50157a8d17 kernel/condition_variable: Make ConditionVariableEntry::Variable non-inline.
We have to use an atomic here.
2022-02-07 14:22:39 -05:00
Augustin Cavalier
c9d521ea5b kernel/condition_variable: Various cleanups.
* Adjust a comment that now goes with 3 functions and not just 1.

 * Remove spinlock switch function, this is useless as it cannot
   change interrupt states here, but we require interrupts to
   be enabled to wait on a ConditionVariable.

 * Remove WaitStatus function from ConditionVariableEntry; unused
   and would require locks anyway.

 * Implement Publish using Init.
2022-02-07 14:22:12 -05:00
Rudolf Cornelissen
4b5e0c3bcd intel_extreme: Sandy/IvyBridge fix 4 lanes DP detect, fully pgm eDP link 2022-02-04 19:56:27 +01:00
X512
d03e5994ee ConditionVariable: add classical wait interface with lockable
Change-Id: Id18264e786dba818138caf3908c7a89b18e2a1dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4921
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-02-02 19:45:27 +00:00
X512
32fd04c959 AutoLocker: get ability to get lockable
Change-Id: Id8f554494ce83725c40ccebdf0e58e54bf1bf47c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4920
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-02-02 19:45:27 +00:00
Rudolf Cornelissen
ed9bb4dc76 intel_extreme: decoupled PIPE/eDP link programming from FDI train, fixed eDP pgm error. 2022-02-01 23:48:48 +00:00
Rudolf Cornelissen
ba0c9427cd intel_extreme: for Ivy/SandyBridge added eDP programming for laptops. 2022-01-30 00:21:32 +00:00
urnenfeld
f9412d9f8a boot: ARM64 EFI port
* MMU mapping
* EL2 to EL1 transition (FreeBSD/Jaroslaw Pelczar)
* Initial implementation for cache cleaning and TLB invalidations (ARM)
* Processor Helper functions
* Additional Logging in boot process

Change-Id: Idcee93583418a3c3528c5d9586d3add487f9d5ca
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4888
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-01-28 15:33:12 +00:00
David Karoly
367beefadc boot/x86: move HPET initialization to arch folder
Change-Id: Iac3f4923f132c4c3328fde5af1dad75af5b2efbd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4864
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>
2022-01-28 10:25:29 +00:00
David Karoly
d283a8c58a kernel/arm: add range checking for early page tables
Change-Id: Ibbd367475482eb0cf839314014c8bf68612c5d6a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4891
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2022-01-27 16:29:48 +00:00
Rudolf Cornelissen
022986d510 intel_extreme: sandy/ivybridge DP links to screens are now programmed to the actual mode if possible 2022-01-26 23:42:14 +00:00
David Karoly
4ddb4993c8 kernel/x86: fix HPET ACPI table alignment
vendor_id shall come after the bitfields

Move hpet_address to separate struct definition so we can apply
the correct packed flags.

see also: https://wiki.osdev.org/HPET

Change-Id: Iced005846fedd4b895910e9b61137d5349db5b41
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4859
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-01-12 12:20:25 +00:00
Alexander von Gluck IV
901fc0c75f posix/arch/signal: Fix riscv64 arch detection
* We decided to not create our own custom define checks
  and go with the standard ones for riscv64.
* clang doesn't define __RISCV64__ either, so this moves
  the clang build of riscv64 a bit further

Change-Id: I2a6c3751168a898c1617b32f46055a9ba1609e2b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4861
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-01-12 12:17:15 +00:00
Augustin Cavalier
218604196a libroot: Fix ICU locale implementation of wcsxfrm.
* The "size" parameter is the size of "out" not "in", and the
   return size_t parameter is supposed to always have the total amount
   of wchar_ts needed, not how many are actually used.
 * In the case where "outSize == 0", we set "requiredSize" and then
   return.

Fixes crashes seen in glib2 Unicode collation routines, which
are used in GTK file dialogs.

Thanks to PulkoMandy for glancing at this.
2022-01-11 16:34:15 -05:00
Jérôme Duval
a7115745f2 POSIX/C11: add timespec_get()
Change-Id: I746e32f3a463bf2c7b03097c625901d54cf2b8eb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4853
Reviewed-by: Rene Gollent <rene@gollent.com>
2022-01-10 14:46:27 +00:00
Augustin Cavalier
4ec4055399 BBitmap: Make now-deprecated ImportBits variants private. 2022-01-07 22:05:30 -05:00
Augustin Cavalier
edd3417172 BBitmap: Introduce ImportBits variants that take BSizes.
The old versions used pixel-count dimensions, not pixel-span dimensions
as the entire rest of the API does, which was probably a mistake
in the first place. The new APIs using BSize always use pixel-span
dimensions.

The old versions will shortly be deprecated.

Discovered while working on Xlibe.

Change-Id: I604a5ac6e0588420ff0b667d9193d60ac27b92c6
2022-01-07 22:03:01 -05:00
David Karoly
023a36024d boot/efi: introduce arch_dtb
Change-Id: Iff9e4198aca706097889faf51e9559fe551126ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4782
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2022-01-05 16:22:35 +00:00
David Karoly
fbc211a255 efi: fix alignment for block device protocol
efi_block_io_media struct needs padding on x86.
uint64_t is aligned on 4 bytes in Haiku toolchain for 32-bit EFI loader.
But the EFI firmware expects it to be aligned on 8 bytes.

Same padding in u-boot:
https://github.com/u-boot/u-boot/blob/v2021.10/include/efi_api.h#L638

and in Illumos:
feff18a41e

Change-Id: I1b95cbe4cc1e7d96fde3ba52862a05f8a94aab79
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4840
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-01-04 17:56:41 +00:00
Kacper Kasper
fd876ad749 intel_extreme: vblank interrupt support for Gen8+
Change-Id: I8e7e68786cc4a626cb386929600715a6a6b1917d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4760
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-01-01 11:36:02 +00:00
David Karoly
6117e0c29c boot/loader: relocate kernel to virtual address space on 32-bit architectures
Change-Id: Ic86ca6874f358df8755a0c691cccb155d145e06c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4675
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-01-01 11:35:28 +00:00
David Karoly
235aa994d7 boot: rework 32-bit/64-bit kernel load base selection
Change-Id: I0aed05c0ef2ff1a162581e4f988bf24ed1e521e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4816
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2021-12-27 15:44:56 +00:00
Alexander von Gluck IV
65ed50c713 graphics/edid: Add support for digital display info; solves #17462
* We pack the first 8 bits into a union for the raw
  edid since alignment matters.
* Handing the raw_edid is a bit ugly, so in the edid struct
  we drop the input_type from the union since packing doesn't
  matter as much.

Change-Id: I32dbfe9484f9eb83cf491a44d30a32ca36d65b7b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4775
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>
2021-12-18 15:21:30 +00:00
David Karoly
af90bfd3bb boot/efi: introduce arch_convert_kernel_args
Change-Id: Iabb321564d6733c6cf481ec2548fa287e308ae89
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4796
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-12-17 08:58:57 +00:00
X512
8ca0f03d0c riscv64/smp: Implement multi-processor support
* Working under qemu smp 1,2+
* Working on SiFive Unmatched
* x86_64 efi not broken by smp_boot_other_cpus change

Change-Id: I32ebc17913e46ed082be9ade8f56448bbf12f16e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4705
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-12-12 15:35: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
9ef22aa9d7 intel_extreme:DP links on sky- upto/incl coffeelake are now done (refclk detection added) 2021-12-07 00:42:42 +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
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
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
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
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
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
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
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