Add the following:
- CS and SS registers
- For 32bit: DS, ES, FS, GS registers (on 64 bit these are not part of
the iframe structure)
- CR2 register (fault address)
- Hardware interrupt number
- Hardware error code
The hardware error code, interrupt number and fault address are not
modifiable by the signal handlers. The other registers can be modified.
This is used for example in dosemu to intercept errors from JIT generated
code and resume execution. Wine can also make use of it.
In order to not change the size of struct mcontext, these are inserted
in a region of the FXSAVE structure that is available for the OS to
store some data (as documented by Intel) and that we didn't use before.
Fixes#7867
Change-Id: Ia3c27a2c728e32995196c646c1d78adf40e793ed
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9456
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
The RTLD_GROUP flag to dlopen comes from Solaris. It makes the symbol
resolution for dlopen not use the global symbols from the current team
(anything that's already loaded). The loaded object must be explicitly
linked against any symbol it needs to use (or it can use dlsym to search
symbols in the global scope explicitly).
This is also how symbol resolution worked in BeOS, meaning we already
have the code to do this, and just need to enable it.
This can be used in dosemu, where DOS-like executable are linked against
their own C library and should not use symbols from libroot.
Fixes#19674.
Change-Id: I8d127c7812a31e231edb1e44edf70b868c2670e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9450
Reviewed-by: waddlesplash <[email protected]>
Like check_access_permissions() but for write_stat() hook instead
of access().
Basic logic copied from BFS, but with the UID/GID logic rewritten
to better conform to behavior on other OSes: notably, we allow
chown() requests that keep the UID the same to go through, same
as Linux seems to, which should fix#19666. We now also validate
that the GID is one of the current team's groups.
That is, just add the supertype if it does not exist. Leave getting it
to the callers that need it.
Fixes: #19653
Change-Id: I79d804161d28684e16a0d84ec3a2fb6788c0b506
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9436
Reviewed-by: waddlesplash <[email protected]>
x86_64 already does this and it seems to work fine. Since stack areas
grow downwards and should always have a guard page, overruns shouldn't
be too much of a concern (for that matter, randomization still makes
a difference here also, it seems.)
This allows us to regain another ~256 MB or so of contiguous address
space (areas smaller than that could still be inserted in the 0x6.. to
0x7.. block, but if you had 10MB of free address space below 0x6..,
and 246MB above it, you couldn't allocate a 256MB block.)
Part of #19592.
Remove shared message handling from ColorListView,
you are expected to implement this yourself and these
message constants were not actually being used by
the message target.
Do color drop handling in Appearance and Terminal.
Handle all color drops in WasDropped().
Allow current selection to remain, only update color.
TODO Changing selection on external drops should be
fixed in BListView. Work-around in BColorListView.
Fixes#19562
Change-Id: Ic99bbb1288fd736778eac831d38e453122815abc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9296
Reviewed-by: John Scipione <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
To allow consumers to cause the "don't fragment" bit to be set in
all IPv4 packet headers.
There is no standard way of doing this, and different OSes expose
this option in different ways. Linux has "IP_MTU_DISCOVER", but it
takes an enum, not a boolean. NetBSD and OpenBSD appear to have
no socket option, instead they have "IP_MTUDISC", an option for
the "ip_output()" kernel-level network stack method.
"IP_DONTFRAG" sockopt originates on FreeBSD, and it seems macOS now
also supports it in version 11+. Windows has "IP_DONTFRAGMENT",
which, at a glance, appears to do the same thing. So this looks
like the one that makes the most sense to adopt.
This doesn't add any code to process MTU changes yet, though.
Change-Id: I492d22dbd0ee5f4ab35c600396ad3d3ec9f4f200
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9401
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Same structure as used for error_reply, to contain information
(like path MTU or redirect gateway) from the original error packet,
so that upper layers don't have to re-parse it.
Nothing uses or passes it around at present, but it will be used
in the next commits.
Change-Id: I38a3dec5506bdcb77a7850294082db7be74dd80f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9399
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
* POSIX also specifies in6 availability in in.h, not just RFCs.
* Drop IPPORT_USERRESERVED. It's in RFC 1700, but FreeBSD and musl
do not define it, and OpenBSD and NetBSD disagree on its value
(the RFC says 5000, while OpenBSD used this "49151" starting
in 1998.)
* Organize the remainder with clear indications of what RFC defined them
(if indeed they were specified in an RFC.)
* Drop "helpful macros"; they're guarded by _KERNEL on OpenBSD.
Change-Id: Ia20be56398130ee22d70b38ee25a3f609b567c3b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9398
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
checked against the output of the test sortix/os-test/udp/connect-send-error-send
* icmp: add more error codes
Change-Id: I7b1695d37cf5eae8cd09132047404b990f8791dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9394
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
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]>
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]>
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]>
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]>
* 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.
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]>
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]>
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]>
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]>
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]>
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.
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.
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.
* 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.
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]>
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.
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.
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.)