Commit Graph

66896 Commits

Author SHA1 Message Date
Alexander von Gluck
909ef790b1 system/kernel: add missing posix_memalign, fixes guarded_heap
Change-Id: Id035aa607a5a2a8545a85416d97cdd4a1b069203
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8369
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-26 00:19:13 +00:00
Alexander von Gluck
7b1d348567
3rdparty/cloud: A few small fixes to sysprep-gcp
Change-Id: I001d824f65cf135507aac65acc586de5be7ad386
2024-09-25 16:54:00 -05:00
Augustin Cavalier
5ea41d287c kernel/vm: Check the page's cache in the "supposed to be free page" panic.
Change-Id: I8db000723f67023c845b79721385a9e1ebc6cef7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8368
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-25 21:18:51 +00:00
Augustin Cavalier
b665a3ab2a kernel/vm: Use DebugGetReverseMappingInfo() in dump_page_long.
Iterating over every single page in a 64-bit address space is far
too expensive. Instead, use DebugGetReverseMappingInfo(), which
iterates over the page translation map's page tables.

(The only thing that implements this at present, however, is
X86VMTranslationMapPAE, so it won't be too useful on 64-bit
just yet. But at least we won't hang for very long periods
of time on 64-bit at least.)
2024-09-25 11:49:53 -04:00
Augustin Cavalier
718918a70a kernel/vm: Dump page information with the "supposed to be free page" panic.
May help with diagnosing #19126.
2024-09-25 11:46:05 -04:00
Jim906
7bb3369978 FAT: allow RW access to volumes up to 2 TB
* Fix an instance of storing block number in a signed 32-bit variable,
  which could overflow on volumes > 1 TiB.
* See discussion in #11119.

Change-Id: I138b56613775c364b259e3a0e68ba8bfe9a7f904
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8362
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-25 13:58:40 +00:00
Alexander von Gluck
9a6a20d468
3rdparty/cloud: Update instructions for gcp
* Unfortunately, functionality of Haiku r1beta5 under
  gcp is blocked by #18962 (virtio_scsi not getting irqs
  with our now guarded heap)

Change-Id: Ibf70419762e9a222bcb86b7418282cc409e17986
2024-09-24 16:07:58 -05:00
Augustin Cavalier
d0ff5bacff ArchitectureRules: Reinstate the -fno-builtin-fork for 32-bit x86 only. 2024-09-24 14:47:27 -04:00
Augustin Cavalier
c289d46cf1 ArchitectureRules: Cleanups to base flags.
* Trim down comment about fno-delete-null-pointer-checks.

 * Remove -fno-builtin-fork -fno-builtin-vfork, they don't seem
   to be needed with GCC 13.

 * Remove legacy-GCC settings from kernel flags, as we don't use
   legacy-GCC there anymore. Also drop fno-builtin as ffreestanding
   implies this.
2024-09-24 13:51:22 -04:00
Augustin Cavalier
79d79dd592 ramfs: Change a usage of strncpy to strlcpy. 2024-09-24 13:42:52 -04:00
Augustin Cavalier
1daf2293d9 ipv6: Change a usage of sprint to snprintf. 2024-09-24 13:42:41 -04:00
Augustin Cavalier
90b9af1ddd kernel/x86: More fixes following integer type changes. 2024-09-24 13:42:02 -04:00
Augustin Cavalier
754742fa7f agp_gart, bfs: Don't build kernel_cpp independently.
The kernel includes it.
2024-09-24 13:15:27 -04:00
Augustin Cavalier
05c972c77f pxe_ia32: Fix another format string. 2024-09-24 13:13:55 -04:00
Augustin Cavalier
0f350f05d1 bootloader: Adjust format strings following change to type definitions. 2024-09-24 12:28:41 -04:00
Jérôme Duval
1c64d7a913 virtio_pci: poll device status after resetting the device
From the spec:
"After writing 0 to device_status, the driver MUST wait for a read
of device_status to return 0 before reinitializing the device."

Change-Id: Ib708d6ec843877b40cdb64c15beacec3dcc4c009
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8358
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-24 16:16:14 +00:00
Owen Anderson
9473fe5e6f arm64: Use the non-global bit to decide if we need to flush by ASID.
Change-Id: I1fa606632207b5c9fe704803bca1c4ceb390bd6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8361
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-24 16:12:56 +00:00
Augustin Cavalier
b28ed9e04a HaikuConfig: Don't define __HAIKU_BEOS_COMPATIBLE_TYPES in kernel mode.
This breaks kernel C++ ABI.

This mostly just changes the definition (not the size) of string types,
but in at least one case (daddr_t) it does change the size (from 32-
to 64-bit.)
2024-09-24 12:10:35 -04:00
Augustin Cavalier
b47e8b0cad build: Unify BeOS ABI compatibility ifdefs around __HAIKU_BEOS_COMPATIBLE.
_BEOS_R5_COMPATIBLE_ was defined in ArchitectureRules while
__HAIKU_BEOS_COMPATIBLE is defined in HaikuConfig.h (which is
in the include path for sys/types, SupportDefs, and other
base headers.)
2024-09-24 12:09:33 -04:00
Jim906
ed37f3a29d FAT: Fix potential dereference of NULL pointer
* Can occur if bread() returns an error code in readep().
* Fixes #19105.

Change-Id: I975c7d729c59b175c4a6249bbb4660e1294a0ef1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8363
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-09-24 14:59:36 +00:00
Owen Anderson
6b4ccaa5be arm64: Add defensive assert for block descriptor.
* We don't currently support manipulating block descriptors in
  VMSAv8TranslationMap.

Change-Id: I9dc128b4e8208f792f8c2cca72f2b2e7055d147b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8360
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-23 14:41:15 +00:00
Owen Anderson
add4a0b683 arm64: Configure maximum PA size to the maximum supported by the HW.
* If this was set too small by EFI, some MMIO addresses could end up out
  of range and trigger Address Size Faults.

Change-Id: I29280e1f536cfd64c4711b3b702418cd43699278
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8357
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-22 19:07:36 +00:00
Owen Anderson
617be7bcdc arm64: Use the correct version of TTBR0 when booting in EL2.
* When booting in EL2, TTBR0_EL1 may not be initialized if VHE
  extensions are not enabled. To handle this case, we need to use
  TTBR0_EL2 until we transition to EL1, at which time the contents
  of TTBR0_EL2 get copied to TTBR0_EL1.

Change-Id: Iadaa1f30d016397c5fd0426c891b3443dd8805e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8350
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-09-22 19:07:36 +00:00
Humdinger
eee90c8e17 Find panel: make text input column wider
In "by attribute" mode, the attribute popup and AND/OR popup menus
are needlessly wide, while the text input field could be wider.

This change increases the weight of the text column, making those
popup menus less wide.

Fixes #19116

Change-Id: I347583cdb7d8e399f83f56cc2d167084e1483ba8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8356
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-09-22 19:05:26 +00:00
Humdinger
6e67cff8a0 DriveSetup: Fixed incorrect quotes of partition names
* _DisplayPartitionError() adds quotes to the partition name variable (%s).
  So when calling it, the passed string musn't have the variable in quotes
  already (\"%s\") or we'll end up with duplicate quotes.

* Anywhere else we see a partition name variable, it should have quotes.
  This change fixes two places that didn't before.

Change-Id: I37e806c9dceea3c2a2b52a7cb139d7c32e976d5c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8353
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-22 19:05:00 +00:00
Owen Anderson
da8c631e31 arm64: Add some sanity assertions.
Change-Id: I8a5aff200e37907e06baa204bb509e4401eec21e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8349
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2024-09-22 17:57:32 +00:00
Augustin Cavalier
caaee6cc6e kernel/fs: Remove unused list_link field from advisory_lock.
The DoublyLinkedListLink is used instead.
2024-09-21 12:05:24 -04:00
Augustin Cavalier
a0658fbc88 kernel/vm: Consolidate logic in vm_cache_acquire_locked_page_cache.
The don't-wait and do-wait logic was very similar except for the
actual acquisition of the lock in the middle, so now they're combined.
This fixes another (minor) regression from 9e89f7c068
in that if a page's cache changed before we acquired its lock and
don't-wait was set, we would wind up waiting anyway.
2024-09-21 12:03:23 -04:00
Augustin Cavalier
eb26bd6c47 kernel/vm: Fix copy/paste bug in vm_cache_acquire_locked_page_cache.
This fixes a regression from 9e89f7c068.

Even if SwitchFromReadLock fails, the original read lock has been released,
and so we need to re-acquire the lock before continuing.

Should fix a KDL reported by X512.
2024-09-21 11:47:21 -04:00
Denis Ovsienko
cd333360b3 Clock: Point the hands precisely.
The clock hands do not always point exactly at the hour marks, which is
easy to see using Magnify (or a flat screen with sufficiently large
pixels): when a hand tries to points at 3 or 12 hours exactly, the
resulting line is not horizontal or vertical.

This is because the hands lines hinge on an array of coordinates, which
are calculated at run time using pi, and the calculation used to
approximate pi value as 3.1415.  This has been the case since respective
BeOS developer sample code from 1999 was imported into Haiku repository
in the initial commit in 2002.  Interestingly, BeOS R5.0.3 clock demo
does not have this bug.

Use M_PI for the pi value, point the hands precisely and fix my bug
report #19083.

Change-Id: Ie71889daed2efccd1596586f95b629f3b8e14c03
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8352
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-21 15:05:45 +00:00
Adrien Destugues
6d3408c82f Add Wonderbrush to release for all architectures
Previously wonderbrush was closed source and only available for 32bit
x86, but that is not the case anymore.

Fixes #19093

Change-Id: I05a34f7aaf82ea7cc2f65b7cbd39eeaf222d6143
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8351
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-20 17:46:07 +00:00
Owen Anderson
5ee5c0f3f5 arm64: Revert "arm64: Fix miscalculation of unmapping range."
* It turns out that `end` is inclusive.

Change-Id: I1d29e975afcfc1c6812fdf9ac8bfbbb3ac1e46bc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8348
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-09-20 17:05:15 +00:00
Augustin Cavalier
ce561013e5 ps2: Code cleanup in standard_command_timeout.
No functional change intended.
2024-09-19 13:41:59 -04:00
Augustin Cavalier
f2cb18d3f0 ps2: Lock the controller for the full duration of the command.
This way we can't race with some other command using the results
semaphore or flags fields.

May help with various PS/2 tickets.
2024-09-19 13:41:59 -04:00
Augustin Cavalier
805208b667 ps2: Use a real mutex for the controller lock rather than a semaphore. 2024-09-19 13:41:59 -04:00
Augustin Cavalier
ad4f2d20a1 ps2: Code cleanup in probe_keyboard.
* Put disabled code behind #if 0 instead of comments, as per style guide.

 * Clean up comments.

 * Errors should be ERROR not INFO (but both are printed anyway
   at the moment.)

No functional change intended.
2024-09-19 13:41:59 -04:00
Owen Anderson
0037c4432a arm64: Fix miscalculation of unmapping range.
* This could result in us inadvertently unmapping more pages than
  intended.

Change-Id: I2513028cd18436aadd29749628944a853e65e1c4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8346
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-19 17:30:15 +00:00
Augustin Cavalier
1c4821ae8b BTimeSource: Assert that drift is not < 0 as well as != 0.
May help with diagnosing #19074.
2024-09-19 12:53:08 -04:00
Augustin Cavalier
90dca2bc8e headers: Change most remaining include guards to _DEFAULT_SOURCE.
We automatically enable _DEFAULT_SOURCE if _GNU_SOURCE is defined.
Rather than having even more optional methods undefined unless
_GNU_SOURCE manually is, just change all remaining guarts to
use _DEFAULT_SOURCE instead.

Fixes #19095.

Change-Id: I5c7baf40b7fb37913e24279589fc1ae706448a45
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8330
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-09-19 16:43:31 +00:00
Augustin Cavalier
5c1f231967 Rename B_MTR_* constants to "something more meaningful".
The names chosen (e.g. "B_UNCACHED_MEMORY") follow the existing naming
conventions for memory-related constants, of putting the type at the end
of the name: B_KERNEL_BLOCK_ADDRESS, B_FULL_LOCK, B_READ_AREA, etc.

Resolves a very old TODO. No functional change intended.

Change-Id: I31491f6b3abc1e95f915aa302b9f2fb2af14774c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8316
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-19 16:43:24 +00:00
Augustin Cavalier
e323bc248c bootloader: Add a missed check for "BlockedEntries" in the package settings file.
And remove the logic to append the option with the legacy name,
now that enough time has passed.

See comments on #19081.
2024-09-19 12:24:33 -04:00
Owen Anderson
c2f3786ab0 arm64: Save all integer registers in exception handlers.
* This is needed in order to support syscalls and other exceptions
  that need to be able to inspect/modify userspace register contents.

Change-Id: I8a638c0c40dd44ed882adad0591ae3bf5493a6b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8329
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-18 19:34:15 +00:00
Jérôme Duval
0f807f4401 kernel/x86: dump hwpstate, cpb, proc_feedback features
Change-Id: I06b6da05013c7271d0a97d5aa3af2b6f416496a9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8331
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-18 16:21:44 +00:00
Jérôme Duval
017c5e70d5 Shortcuts: Mute shortcut is now from "toggle mute" instead of "mute"
Change-Id: I62ded761ac096d5ae29d7c82e0d562995a2c3811
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8347
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2024-09-18 14:01:55 +00:00
Augustin Cavalier
6c26c5b01d kernel/x86: Whitespace and comment cleanup in add_memory_type_range.
No functional change.
2024-09-17 20:09:01 -04:00
Augustin Cavalier
734556cb96 kernel/vm: Don't unset VMArea::id in delete_areas.
It's needed in delete_area for arch_vm_unset_memory_type at least.
Instead just add a parameter indicating the area is already removed
from the areas map.
2024-09-17 20:00:28 -04:00
Michael Lotz
53ff60f224 x86/vm: Don't add RAM to memory type ranges under PAT.
These are only relevant for MTRRs that describe physical memory ranges.
The change that introduced PAT removed the condition of MTRRs being
usable to always add the RAM ranges to the memory type ranges as
write-back, but this doesn't allow them to be used uncached for DMA.

Change-Id: I6cdd8f5a23a8f5cc582d25cf170c3e8d71d5e1fc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8344
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-17 23:11:34 +00:00
Augustin Cavalier
a706a92d65 hda: Fix build with DEBUG enabled.
We need the kernel debug macros defined so that hmulti_audio doesn't
try to use the userland ones.
2024-09-17 18:50:09 -04:00
Augustin Cavalier
89235ee967 DebugAnalyzer: Fix build after SinglyLinkedList API change. 2024-09-17 17:54:06 -04:00
Augustin Cavalier
99d2d975a4 BCollator: Avoid more crashes when the ICUCollator fails to initialize. 2024-09-17 17:51:53 -04:00