Commit Graph
10341 Commits
Author SHA1 Message Date
Augustin Cavalier 8e86be8509 libbe_build: Synchronize BBitmap implementation with the main one.
BView-related code removed or disabled, of course, but this now uses
the ColorConversions class, and adds some more ImportBits APIs from that.

Change-Id: I805cef159bac52173ef16030eae69e83db6f061b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9391
Reviewed-by: waddlesplash <[email protected]>
2025-06-24 22:47:45 +00:00
Augustin Cavalier 8de71284ed HaikuControlLook: De-convolute edge color computation.
Previously it used "contrast" and "brightness" values that were
computed in strange ways. Now it behaves more like the other
color computation functions and deals with the "flags" directly.

Comparing many controls, colors on button frames in all states appear
to be the same (or nearly the same, within 1-2 RGB values) before
and after this change.


Change-Id: Ia6d696c29fc76c73c88cc97af97ea45e1ff089ff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9321
Reviewed-by: waddlesplash <[email protected]>
2025-06-17 23:00:59 +00:00
Oscar Lesta e19042c642 pkgman: add an option to not refresh the repo caches on install.
Fixes #13161

Change-Id: I69b307cf8497d411d83f7065b9356159740f7d2b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9337
Reviewed-by: Adrien Destugues <[email protected]>
2025-06-16 19:44:36 +00:00
PulkoMandy 26bedc8f4e sparc: move kernel to a lower address
The openboot mmu code does not like addresses above 4GB, so load the
kernel to a lower address. It doesn't really matter anyway, because on
sparc the kernel normally lives in a separate address space and uses
special instructions to access userland memory.

See #19597 for details, further changes will be needed here.

Change-Id: Iac6901f275667efef5e64d059daf4c96032a7baf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3573
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-11 06:40:13 +00:00
Jérôme Duval 23f923bcaf libbsd: add closefrom() and close_range()
Change-Id: I9c88948d6c4d5a32e3aa06cd696e2ce24c2d298f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9334
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-09 16:26:13 +00:00
Jérôme Duval 396ebbc16f POSIX-2024: support for MSG_CMSG_CLOEXEC and MSG_CMSG_CLOFORK
Change-Id: I55551860fb7dac5d0c11a6d4201502fff9ab2d13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9332
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-09 16:26:13 +00:00
Jérôme Duval 904fd2abf0 POSIX-2024: support for O_CLOFORK, SO_CLOFORK
Change-Id: I4f3a961947eefdeafd5a249499899cc92d67c2d1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9330
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-06-09 16:26:13 +00:00
athira-selvam 1d242620b4 BUrl: rework handling of URL encoding
The content of a BUrl should always be in encoded form, to simplify
handling and validation.

Deprecate the UrlEncode member function and make it private. Instead aadd a new
way to handle URL encoding:
- All ways to set an URL (constructors, SetUrlString, and all setters)
  now take an extra boolean parameter indicating if the string is already
  encoded. The default value is to encode strings automatically.
- The static version of UrlEncode and UrlDecode, which operate on a
  string, are preserved and used by other parts of the API.

All unit tests adjusted to handle this, and still passing.

Fixes #12983

Change-Id: I06f06978d0d35e56d7c92b67f001856bb7dcafc8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1193
Reviewed-by: nephele nephele <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-05-27 10:43:12 +00:00
X512 a73ec86407 Shape: remove unused code
Change-Id: I5fc23415aa79d216f04cdf0481794b3fa4c35bdf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9304
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-05-21 20:23:53 +00:00
Alexander von Gluck 2de2e7aec3 headers/BeBuild.h: Add gcc 15 support
Change-Id: I4572dc62159ad0abb593c48d0ff0008068815fbd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9302
Reviewed-by: waddlesplash <[email protected]>
2025-05-21 17:46:52 +00:00
waddlesplash 888ea83454 Revert "BTextView: Update word-wise/line-wise shortcuts"
This reverts commit 74ef92bc55.

Change-Id: I441d9cce87670e17141051fded594ae8aa6fc1fd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9299
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-05-21 17:46:34 +00:00
Augustin Cavalier e702bf57be BQuery: Make SetFlags() behave like other Set..() methods & add documentation. 2025-05-01 12:36:43 -04:00
Augustin Cavalier d26ab46206 BQuery: Add SetFlags() method.
It can be used to set flags on the query, same as fs_open_query()'s
flags parameter.

fLive had 3 bytes of padding after it, so this doesn't break ABI.
2025-04-30 17:18:16 -04:00
Augustin Cavalier 7e740f61ac kernel & file_systems: Overhaul query attribute change notifications.
* Introduce notify_query_entry_moved to the fs_interface API.

   axeld added a hook to the query parser (then in BFS) in hrev34317
   to directly handle moves/renames, but just sent notifications for
   it as B_ENTRY_REMOVED + B_ENTRY_CREATED (which is in fact the same
   exact thing BeOS R5 did, I tested). We need to preserve that ABI/API,
   unless flags that didn't exist on BeOS R5 are set.

 * Rework notify_query_attr_changed to notify_query_attribute_changed.
   This method is Haiku-specific (it was added in hrev39131), but it
   wasn't very useful: it only sent the name of the file, not the name
   of the attribute that changed.

   It now sends the name of the attribute along with an "int32 cause",
   same as notify_attribute_changed does.

 * Rename the private flag B_ATTR_CHANGE_NOTIFICATION to B_QUERY_WATCH_ALL.
   This better describes what it does (it's analogous to the B_WATCH_ALL
   node_monitor flag). Probably we should make it public at some point...
   (although probably at a lower value.)

 * Overhaul QueryParser notifications logic to implement WATCH_ALL
   properly, make use of the new and improved notification methods,
   and to deduplify some logic.

This makes it possible to use queries with B_QUERY_WATCH_ALL
in a similar fashion to watching a directory node with B_WATCH_CHILDREN,
avoiding the need to watch every single node individually.
2025-04-30 17:12:49 -04:00
captain0xff fcdf08d1f3 radeon_hd: Added more Polaris10 GPUs and corrected the DCE value
* Updated the deviceName to include RX 570, 580 and 590
* Rectified the DCE values for Polaris and Vega according to https://docs.kernel.org/6.14/gpu/amdgpu/driver-misc.html

Change-Id: I2d7ee489279efc90bd1d4fd94db28443569285e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9062
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-04-22 12:51:42 +00:00
Joachim Mairböck fd9622c608 fenv.h: change guard symbol for extension functions to _DEFAULT_SOURCE
This way, they are available by default when not using a strict
language standard version.

The change is applied to all architectures (except m68k, which doesn't
define them at all).

Fixes #19534

Change-Id: I71238919e50518abaa65fa20365c912a577e3455
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9196
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-04-21 18:56:47 +00:00
Jérôme Duval d6547c7f81 kernel & libbsd.so: add getloadavg() and _user_get_loadavg()
the algorithm and reference values are from FreeBSD.

Change-Id: Ia74a796e13adce6a70434c7546c25ca3d553f11f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9150
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-04-21 18:43:29 +00:00
Trung Nguyen 8da9c85cbf runtime_loader: Add support for RTLD_NOLOAD
Add support for using `RTLD_NOLOAD` with `dlopen` on Haiku.

While not specified in POSIX, this option is widely available (both
GNU/Linux and BSD) and is the only way to atomically check if a shared
object has been loaded.

Change-Id: I061332307d76c84f6a2abb6f92c4ed964bd90a1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9161
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-04-14 16:31:59 +00:00
Augustin Cavalier 5f8c94242b SplayTree: Add PreviousDontSplay to IteratableSplayTree. 2025-04-10 17:59:13 -04:00
Emir SARI cf961dc707 DecimalSpinner: Use BNumberFormat for formatting
Change-Id: Idb45e98a61a0f16893e20aa02b10d7b2e1705454
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7589
Reviewed-by: Emir SARI <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-04-07 21:30:48 +00:00
Augustin Cavalier 9dcf5c5c88 stdio_ext.h: Add missing declaration for __fseterr.
Follow-up to #19479.
2025-04-07 14:48:23 -04:00
PulkoMandy ed280bfcfa mmap: add define for MAP_FILE
This is unused but defined in Darwin, BSD, and Linux.

It allows developers to feel good about specifying that they want to map
a file (which is the default behavior anyway). The value is 0, so
specifying this flag does not have any effect.

This allows to more easily compile code that uses the flag.

Change-Id: I7a880a3090d90b7e8cef5144e82f71beb61147a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9152
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-04-03 18:39:00 +00:00
X512 c02537f91b BPicture: add missing WriteSetBlendingMode method.
Actual blending mode writing is still disabled for now. According to
previous commit messages it cause problems with BView::Begin/EndLayer
API.

Change-Id: Ib3c58b05a949e556e9f14a57822b20cd259e12d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8559
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-03-23 10:30:14 +00:00
PulkoMandy eb853f8901 elf.h: add some missing macros
ElfW(x): to automatically use the relevant Elf32 or Elf64 type for the
current system

NT_GNU_BUILD_ID: constant defining the GNU "build ID" note in ELF files.

WebKit uses both of these to store info in javascript object caches, so
it can detect if the same version of WebKit is being used and the cache
can safely be reused, or if it should be reconstructed.

Change-Id: Ia9eccc1acc79ac4982b87609d2815c4a611e4176
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9143
Reviewed-by: nephele nephele <[email protected]>
2025-03-23 10:29:23 +00:00
Augustin Cavalier c6f736315a BSlider: Copy the UpdateText inside UpdateTextChanged.
We can't rely on it not changing between calls, especially as
MaxUpdateTextWidth() changes the value and re-gets it, and
that's called at the end of this method always. So we need to
keep our own copy rather than using the one that's owned by
the subclass.

Fixes a use-after-free uncovered by the guarded heap in VolumeSlider,
reported in #19493.
2025-03-21 11:54:37 -04:00
Augustin Cavalier 843c97b01f libroot: Make glibc use the native Haiku locale structs.
It accesses values through macros, so just write functions that
fetch the appropriate value from Haiku's structures.

Note that the values for multibyte digit characters are hardcoded.
As far as I can tell, we never set or updated these in glibc's
locale structures, so it always just used the default, so this
should not be a behavioral change from before.
2025-03-20 16:31:53 -04:00
Augustin Cavalier cd7aab83d1 headers/posix: Drop commented-out strsep from string.h.
It's in the BSD header instead.
2025-03-20 14:00:48 -04:00
Augustin Cavalier a5854d713e libroot/glibc: Add missing stdio_ext methods needed by gnulib.
Otherwise it needs to use libio internals to implement these,
which we don't want. musl also exports all these methods for
the same reason.

Implementations taken from glibc 2.15, current gnulib (5077f67), and
in a few cases tweaked for better Haiku support.

Should fix #19479.
2025-03-18 22:03:10 -04:00
Augustin Cavalier 0796aaabfc libroot: Clean up fpurge implementation.
* Take it from upstream glibc 2.15, much closer to the version we use.

 * Drop fpurge from stdio.h, it's nonstandard. Keep it around for
   ABI compatibility for now (BeOS didn't have it.) __fpurge is left
   in stdio_ext.h.
2025-03-18 22:03:10 -04:00
Augustin Cavalier 8fadf59d1a headers: Move asprintf & vasprintf to stdio.h.
They're implemented in libroot, not libbsd, and they're now
in POSIX-2024 anyway.
2025-03-18 18:44:48 -04:00
Augustin Cavalier 20a6449385 kernel: Add thread setting to prevent page waits and use it in the file cache.
See inline comment: otherwise we could deadlock waiting for busy pages.

At the same time, make page_faults_allowed just an int16 and drop
atomics and extra checks, they aren't needed.

Fixes #19441.

Change-Id: I1b7cc06f66b44c3520fa36497c076ee5a6320706
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9120
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-14 18:34:06 +00:00
Augustin Cavalier 95eee47cdc libroot/stdlib: Add qsort_r.
It's in POSIX-2024. Remove the libgnu implementation and just import
the changes from latest FreeBSD (dc36d6f9bb1753f3) instead.

While at it, put the non-standard sort functions behind
_DEFAULT_SOURCE.
2025-03-13 19:30:39 -04:00
Augustin Cavalier 194f7cff83 legacy stdc++: Delete all unused protected streambuf APIs that use IO_FILE directly.
Unfortunately there are some marked "public" that also use it,
so we can't just move the remainder to an internal file and then
drop libio.h from public consumption.

Delete all the unused portions of the public libio.h while at it.
2025-03-13 18:22:33 -04:00
Augustin Cavalier aa3a5e7698 headers: Drop _G_config.h from public headers.
Adjust the two legacy stdc++ headers that still included it;
it seems they didn't themselves depend on any of the definitions it
contained. However, streambuf.h actually did, so put that definition in
libio.h so that it's always present.

(The stdc++ implementation will get the 'real' _G_config.h from
libroot glibc.)
2025-03-13 17:23:44 -04:00
Augustin Cavalier 1799deddfd legacy stdc++: Drop <iostdio.h>.
It couldn't have been used anywhere, because "iolibio.h" is
available only in glibc includes in libroot, not in the
"headers" directories.
2025-03-13 16:36:09 -04:00
Augustin Cavalier 01a481d470 legacy stdc++: Make sure MTSAFE_IO is always enabled.
It's set in _G_config.h, but this file doesn't include that,
so in many cases the "unlocked" function was called instead.
(Most of the stdc++ .cc files did have it set, though.)
2025-03-13 16:35:23 -04:00
Augustin Cavalier 9769edfa33 headers: Get glibc <libio.h> out of the default include path.
It's needed by GCC2 stdc++, but we shouldn't be including it
for all consumers of <stdio.h>, which we were. Drop it,
and adjust all the things that were relying on <stdio_pre.h>'s
definition of __PRINTFLIKE to use the _PRINTFLIKE defined
in BeBuild.h instead.

Hopefully should not cause any breakage; the libroot
implementation of __freading depended on this, but
I didn't see anything else which did.
2025-03-13 15:57:25 -04:00
Augustin Cavalier 70c25855f4 kernel: Move convertutf to utils.
No functional change.
2025-03-12 08:26:19 -04:00
Augustin Cavalier a97c4affc9 kernel: Rename basic "int" functions to "interrupt" (or at least "intr").
"int" of course is also an abbrevation for "integer", so having
two abbreviations is sometimes confusing. The BeOS functions
just use "interrupt" (e.g. "install_io_interrupt_handler"); it
seems we inherited the "int" abbreviation from NewOS.

The basic kernel methods and files related to interrupts are
here adjusted to drop the abbreviation and just use "interrupt(s)".
The architecture-specific functions ("arch_int_*") are mostly
moment left alone for now, though of course architecture-specific
usages of the generic kernel methods are adjusted.

Change-Id: Ic113ea1280a3c78e25f8ca3cc55b24ed5f594eae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9119
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-12 01:58:33 +00:00
Augustin Cavalier 317307ff46 headers/x86[_64]: Name the "mxcsr_mask" fields properly.
These values aren't referenced anywhere at present however.

Change-Id: I870d6321c6d30f850f48f811213124276543a1a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9091
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2025-03-11 02:13:26 +00:00
Augustin Cavalier 6db4b42346 kernel/x86_64: Store FPU state from int_bottom_user in arch_thread always.
The XSAVE area can be quite large (1-2KB+), so rather than always
putting it on the kernel stack, just use the arch_thread FPU state.

Change-Id: Ie64c3ea3ca52cd8a4425ae1da69792588a69832a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9090
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-03-11 02:13:26 +00:00
Augustin Cavalier 4c76039f6f kernel/x86_64: Keep FPU and SSE control on context switch.
This reverts most of c7360f4b02.

Unlike the other floating-point registers, these values are callee-saved
(see "System V Application Binary Interface, AMD64 Architecture
Supplement" section 3.2.1.) So we need to preserve their values and not
reset defaults on context switch.

EMMS, as the previous changes used, does not suffice to clear
exceptions. We could use FNCLEX instead, but we need to reset
x87 state on context switch anyway, so use FNINIT. Do not
reinstate FNCLEX in the exception handler since it will
be executed on context switch anyway.

We also need to ensure a clean initial state, so take care of that
in arch_thread_init.

See also:
 * remarks in 396b74228e
 * as well as 53e2dc0f85

Fixes #19454 and #18624. Doesn't regress #18656 and #19063.
Doesn't seem to affect #19450.

Change-Id: I7179f1ec7304e7aed09ff80f6773e53d5dbdf5f9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9081
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-11 02:13:26 +00:00
Andrew Lindesay 48ca9d08bb Interface: multi add/remove BColumnListView
This change will allow the BColumnListView to have
multiple rows added or removed at the same time.
Without this, applications using the BColumnListView
will need to add and remove rows one by one which,
for longer lists with complex columns, is a
performance problem; an example being HaikuDepot.

Note that this change does not amend the formatting
style on the class's source.

Change-Id: I72303c8b069b686251c3a65af7ae45c8884d5637
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9056
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Andrew Lindesay <[email protected]>
2025-03-07 10:38:28 +00:00
Augustin Cavalier da6325cd03 kernel/thread: Make thread_death_entry use DoublyLinkedList. 2025-03-03 14:08:02 -05:00
Augustin Cavalier 61d76848f0 kernel/thread: Convert Team::thread_list to a DoublyLinkedList.
Increase the size of the Thread structure by another pointer,
but makes thread insertions and removals constant-time.
2025-03-03 13:49:49 -05:00
Augustin Cavalier 76b7ab4c8e kernel: Move struct Thread declaration above struct Team.
Paves the way for using DoublyLinkedList. No functional change.
2025-03-03 11:46:32 -05:00
X512 71368ea719 BPicture: remove point count argument from private draw bezier callback
Fill/StrokeBezier always have 4 points so passing point count is not
needed. Point count is not passed to BView drawing API and not stored in
BPicture data.

Change-Id: Iddb32bd493143d4450acfb76bdc56fc02136448e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8560
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-02-26 19:00:33 +00:00
Augustin Cavalier 0463b9511c bootloader: Refactor semantics of platform_allocate_region() functions.
This cleans up a lot of subtle or hidden inconsistencies:

 * Drop the "exactAddress" parameter. It was added in hrev15708 (2005),
   but all callers in all bootloaders passed "false" to it until 2022,
   when one codepath in the ARM32 EFI loader started using it.

 * Adjust EFI's platform_allocate_lomem to platform_allocate_region_below,
   and add a platform_assign_kernel_address_for_region(). This allows the
   aforementioned ARM EFI codepath to continue to do what it wants,
   which is to get an identity-mapped trampoline page, without having
   functions with confusingly different semantics ("allocate_lomem"
   assigned the virtual addresses as identity-mapped unconditionally,
   but it didn't insert these into the virtual allocated ranges.)

   This also paves the way for other EFI loaders to use this method
   to allocate memory below whatever default the boot services
   would give us.

 * Drop fixed virtual address allocation for all arches on EFI, with the
   exception of fixed addresses inside KERNEL_LOAD_BASE, same as on
   other boot platforms. Anything which wants fixed virtual addresses
   outside that region can use the new "assign kernel address" method.

 * Validate kernel base and size against kMaxKernelSize, instead of
   assuming it fits. This matches behavior of other boot platforms.
   Ideally we would have some more generic routine for mapping the
   kernel, but this suffices for now.

Tested with x86_64 and ARM; both still boot (well, ARM boots as
far as it did before this commit, anyway.)

Change-Id: Ieb4fba752994101191a2335cb5395eb2b726fcbb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9024
Reviewed-by: waddlesplash <[email protected]>
2025-02-21 04:08:51 +00:00
Vladimir Serbinenko 801a0ee83d kernel: Change x86_*_msr to be an inline function on 32-bit platform
Change-Id: Ida5ff96cda06ca4463f15b636f1275977f3ec0ac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9015
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-02-21 02:27:20 +00:00
Augustin Cavalier 2deebfa44b BMenuBar: Move new reserved field to the proper place.
Without this, the amount of padding on the end of the class changes,
which could affect the ABI of any classes that inherit from this one.
2025-02-19 15:10:55 -05:00