Otherwise we might fail with B_NO_MEMORY, or wait for long periods of
time, which we don't want to do in such a critical routine.
Should improve system responsiveness (or even prevent application
crashes) under high memory pressure.
POSIX-2024 says:
> There is no correlation between values of the st_blocks and
> st_blksize, and the f_bsize (from <sys/statvfs.h>) structure members.
Some code in Haiku has mixed that up in the past (e.g. the write_overlay).
This will allow a constant to be used instead, clarifying what's happening.
POSIX-2024 does not actually require this constant, but it does say:
> Traditionally, some implementations defined the multiplier for
> st_blocks in <sys/param.h> as the symbol DEV_BSIZE.
And indeed, glibc, musl, and FreeBSD (at least) all define it.
So it seems to make sense for us to do the same.
Related to #19251.
* Drop the global definitions from ctype.h, and move them to
the internal LocaleData.h: the functions should be used always
when building new applications (as they're thread-safe.)
* Make __ctype_get_mb_cur_max thread-safe and move it to live
alongside the other __ctype...() methods.
* Put the __ctype...() methods in two files, clearly indicating
versions: ctype_loc_global for the global (non-thread-safe) versions,
used for the kernel, and ctype_loc_thread for the libroot versions.
* Consolidate more internal functions into LocaleInternal.cpp.
It's specified in POSIX, and FreeBSD puts it in this file.
Distinguish it from _POSIX_SEM_VALUE_MAX (which is really a
"minimum value this can have" as specified in POSIX.)
input touchpad settings header:
- click finger behaviour (enabled by default)
- Emulation of different button clicks depending on the
number of fingers that are pressed at the same time on
any location of the touchable surface of the device.
- Clicking with 1 finger triggers a primary button click,
usually left button click.
- Clicking with 2 fingers triggers a secondary button click,
usually right button click.
- Clicking with 3 fingers triggers a terciary button click,
usually middle button click.
This feature is useful for clickpads that are input devices
lacking a separated set of buttons from the touch area.
input preflet:
- Implement clickfinger
input mouse:
- Handle and provide new settings for clickfinger behaviour
input mouse mm:
- Implement clickfinger in the user space
- Enables button emulation based on the number of fingers pressing
at the same time the touch surface.
Userful feature for clickpads.
Change-Id: Ibaa06df3887793158093cc08f6281fc080e85c3b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9923
Reviewed-by: Adrien Destugues <[email protected]>
input touchpad settings header:
- software button areas (enabled by default)
- Emulation of buttons clicks based on which small area
assinged by each button is pressed. For instance, a
software button area on the bottom of the touchpad
could be divided on 3 subareas one for each button.
This new feature is useful for clickpads that are input devices
lacking a separated set of buttons from the touch area. However,
we may prefer to make the GUI better suppot "single button" devices.
Disabled by default as we don't currently have a way to adjust the
default settings according to the presence of physical buttons,
and having this disabled yields an OK experience on all machines.
Having the soft buttons in addition to physical buttons would just
be too strange.
input preflet:
- Implement software button areas
input mouse:
- Handle and provide new settings for software button areas
input mouse mm:
- Implement software button areas in the user space
- At the moment only a bottom located software button area
simulating 3 different buttons is enabled.
There is a working implementation 2 buttons only but not
enabled in the code base.
TODO for other type of software button areas is there.
Change-Id: I255cb1a7eac0d18064c63a2a0d4b158be7370a17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9922
Reviewed-by: Adrien Destugues <[email protected]>
input headers:
- Add edge motion constants
input touchpad settings header:
- Edge motion (enabled by default as on tap drag)
- Help moving the cursor and the primary finger transitions
from one place of the touchpad to its edge and then stays
on the edge for some time.
The default matches the current hardcoded behaviour.
input preflet:
- Implement edge motion options
input mouse:
- Handle and provide new setting for edge motion
input mouse mm:
- Enable edge motion on tap drag based on settings instead of being hardcoded
- Some users who didn't have a chance to read the users' documentation could
wrognly believe that this feature is a bug by not understanting why
unexpected cursor movement happen at constant speed on some scenarios
sometimes not even realising that it happens when the finger is approaching
to the edges of the touch area by mistake.
At least, even if this is the current default setting at the moment, this
enables the chance to change it instead of being a obscure hardcoded feature.
input mouse mm:
- Enhance edge motion with extra behaviours
- Support for other edge motion aids apart from "on tap drag only".
Change-Id: Ice50139f9f8001494f7e2a46bb1521a1e525cade
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9921
Reviewed-by: Adrien Destugues <[email protected]>
input touchpad settings header:
- Implement two-fingers natural scrolling (enabled by default)
- Sets scrolling with 2 fingers on the touchpad making
the content to move in the same direction as the finger.
input preflet:
- Implement 2 fingers natural scrolling
input mouse:
- Handle and provide new settings for 2 finger natural scrolling
input mouse mm:
- Implement two-finger natural scrolling feature
- Implement natural scrolling for two-finger scrolling completely
separated from reverse scrolling for egde scrolling only.
Change-Id: Idf673ec34a424b20183ed90761f297340d521526
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9919
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
* Use LITTLE_ENDIAN instead of __LITTLE_ENDIAN (LITTLE_ENDIAN is what
POSIX now specifies and everyone seems to define - NetBSD also
defines _LITTLE_ENDIAN, but not __LITTLE_ENDIAN)
* file descriptors greater than 2 must be explicitly passed to a child
on NetBSD. POSIX leaves that unspecified, see
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#exec
* system library functions get declared with visibility "default" on
NetBSD, so a "hidden" visibility attribute is ignored on a
redeclaration. Work around by putting the functions in a namespace -
as they are extern "C", they still end up in the object file without
the namespace qualifier.
* remove the cast on the NULL pointer on the funopen call - it's not
needed and the types are different between FreeBSD (fpos_t) and
NetBSD/OpenBSD (off_t); also trying to change that upstream
https://github.com/openSUSE/libsolv/pull/603
Change-Id: I6ab7f3c74d18960d7589b403a1c219cdac85a453
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10133
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Similar to open firmware implementation.
This allows to load the kernel from a remote_disk_server.
IP address is recovered using LoadOptions with a syntax similar to the
Linux kernel network boot "ip" parameter. If this is not set, no network
booting is attempted, in order to not slow down normal booting by
waiting on network traffic.
Change-Id: I17738bbcde85921672965b9936a2b484f1e57c6c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3678
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
The uart virtual address changes as soon as we apply the kernel memory
map. gUART is used only after that, from serial_init() onwards. So it
should use the virtual address, and not the physical address it was
previously created with while parsing the FDT.
Change-Id: I8c8a024fe564b49d6555f8e48f5ab31652d30708
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10068
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Prepare for replacement of modified version used in input_server addons.
Adapt existing callers.
The "this" argument is required, and the CALLED macro can only set it to
one single value for an entire file currently. So, in any case where at
least one standalone function or static method uses CALLED, the macro
has to use a NULL pointer for all calls.
Change-Id: I42fdcbeaf6dd039d4c4369818220ad85e0b8087e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10041
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Add and fix description of the current values for fingerWith
field and related constants along with future expectations
for the same. The latest explainted as TODO item.
Change-Id: I876a9cf03a935309159401a6c88d9047bf225f90
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9863
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Previously we ran DHCP negotiation on the looper thread. This meant
that we just blocked it for long periods of time, which stopped
configuration settings changes from working properly, and causing
the Network preferences panel to hang when net_server failed to
respond to its messages.
Now, we spawn a separate thread to do the real work on, and unlock
the looper around the recvfrom() with long timeouts. There's now a
kMsgAutoConfigureFailed that is sent when auto-configuration fails,
so that the AutoconfigLooper can fallback as before. Additionally,
the main NetServer class quits loopers for devices on any configuration
change, rather than deferring it unecessarily (and possibly wrongly, in
some cases.)
Fixes#18037. Probably fixes#17300 and may help with others.
* It's not really possible to distinguish between a first startup
and a restart inside app_server itself. Due to the new BServer
setup, the same port will still be used, too. So, change the
messages sent to just "AppServerStarted".
* Since the message is sent out much later than the port is created,
by the time applications see it, the app_server may have already
been started a while and applications may have connected to it.
So, check if we really need to reconnect in BApplication before
actually trying to do that.
* BWindow now starts with updates disabled, so they must be
enabled after reconnecting.
After this commit, basic app_server restart functionality works again;
it's restarted automatically by launch_daemon after dying or being killed
and applications automatically reconnect. However, some problems still
linger (e.g. Terminal doesn't always recreate its windows, colors
on the Desktop look wrong, missing desktop background image, etc.)
They're not needed anymore. The VMTranslationMap method was confusingly
named anyway, as the other Debug* methods are for use in KDL, while
this one required the regular locks and flush mechanisms.
Change-Id: Ic1baf3d786071562d8beaeb768d996cd1d34f9b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9706
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
* prefer v3 over v2
* adding efi attributes in gBootVolume KMessage is a bit of a hack, but
shouldn't hurt older kernels.
Change-Id: If5ea19dafa5a845872eb8d577e77a6935539ce20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9685
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested by OscarL and confirmed to be working on at least
one machine, though on others it hangs, so leaving out
of the default builds for now.
This adds an "acpi_processor_id" field to x86 arch_cpu_info,
gleaned from the MADT, so we can match our cpu_ents to ACPI
processor objects. (FreeBSD does a similar mapping, see
their acpi_cpu_probe method.)
Change-Id: Idb5e3c1fc1efaa4256d60ea17dd1824345369687
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9637
Reviewed-by: waddlesplash <[email protected]>
- Resolve TODO about using map for server area_id lookup.
- Remove server cloned area delete request logic because it is less
efficient and robust. Cloned area delete request messages may be
missed if client message queue is full so it may cause cloned area
leak.
- Implement reference counting for cloned areas instead.
Change-Id: Ie434ad36c2761ab0df00d341d55a6cea67b69830
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9667
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
BAffineTransform is not POD type and contains vtable. Reading it from
byte stream as-is will cause vtable corruption.
Change-Id: I1371444444ffa47f77a88f5f82b3fe6ea031b14c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9660
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This should make use-after-frees more likely to be caught by the
standard paranoia facilities (and make them less likely to be
exploitable as memory will take longer to be reused.)
These instructions are only available on more recent CPUs (MWAITX
on AMD since around 2015 or so, TPAUSE on Intel since around 2020.)
They allow idly waiting on the TSC even when interrupts are
disabled.
Most hypervisors do not have these available (KVM does provide
them, though not on all configurations), but on bare metal this
should make a nice difference to KDL power consumption: I tested
with a Ryzen 3700X, according to my UPS (so including monitor
and peripherals) the system used ~106 W at idle, 160 W in KDL
before this patch, and 125 W in KDL after it.
Change-Id: Id7a22ecd33f3fc005b2c312f945dc3cd364e96fa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9604
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
The idea is to add a facility that will use less CPU than
the loops we currently use. The default implementation just
calls spin(), which is rdtsc+pause. This already may save
some power compared to what we previously did, which was to
re-check serial ports, PS/2, etc. every single loop in
the debugger, broken up only by "pause".
Change-Id: Ie421adae5c25ad6ae0c266d1d28c2ea7b81ae465
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9603
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>