DT_INIT, DT_INIT_ARRAY, initialize_before, initialize_after are called before
executable entry point so __main_thread_id may be uninitalized there. It cause
getpid() to return zero if called in one of image initalizers before main().
Fixes#11797.
Change-Id: Ia745db9ffeaeb6de4dd46b868b1575d0780b54d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5254
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
The FreeBSD KPIs that we emulate expect this to be done manually,
so we have to do it before we begin doing PCI access.
Fixes firmware load failures and device initialization problems
since the introduction of the OpenBSD driver replacing the FreeBSD one.
* Nothing uses the plural forms anymore, so drop them.
* Nothing uses the "PACKAGE" field, so drop it.
Once the Marvell driver is migrated to use a package instead of the
archive, we can drop even more of this related to HAIKU_WIFI_FIRMWARE_DO_EXTRACT.
The WiFi firmware rules are only needed for a few very old drivers.
Any devices we are going to bootstrap on will use one of the wifi_firmwares
packages instead.
These functions should return an error if the input_server is not
running. They still give the default value in this case, but they now
return an error code.
Change-Id: I706cded7c780d913d4f36164596b2b7794db6f22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5385
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This does nothing, keep the TODO but remove the useless code.
Change-Id: I14611289e1153e406ff7dec93729bceedef7d9af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5384
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The old keyboard preferences used to save its window position in the
keyboard_settings file. The new Input preferences does not, but part of
the code had not been removed yet so it would still open the file (and
then do nothing with it)
Change-Id: Ic5e1d6bd6a8452bd779dc73872148d5c32ab12e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5383
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Also drop unused vblank semaphore storage
* Spotted by X512. These are from intel_extreme
which was used as a base *ages* ago.
Change-Id: I2a6baaa4849baeb8c8cf10e2046d0fbe10c3a356
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5389
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Recently we introduced Spleen as a larger font for KDL for high
resolution displays. However, it looks quite different from our original
font. I designed an enlarged version of our original font (designed by
Brian J. Swetland and also found in NewOS, LK and Fuchsia) to use
instead.
Change-Id: I10872e407d45b906f8b6c7ba44b2f993dcd19bff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5382
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Used explicit type declaration instead of auto and old style
map erase() function to (hopefully) make it compatible with gcc2 builds.
Change-Id: I8314665a3a3468f11bcac11367ee69d9a3ed2a05
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5380
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
- Implemented version 5 superblock fields and necessary macros.
- Checksum functions are implemented which will be used for crc verification and crc updates.
- fssh_kernal_priv.h ROUNDDOWN macro definition is consistent with kernal.h definition.
Change-Id: I49b7c939bfd3ea1bffc85b3db42bc678dcce75cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5350
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Otherwise we will get "Auto-select" even if something more specific
applies, e.g. in the case of IFM_IEEE80211 at least.
Fixes media type detection for OpenBSD drivers.
This requires using the FreeBSD if_media.h (for now, anyway)
and adding a subtype_mask to the data structures. But this
does work.
Now 802.11 media will be displayed in ifconfig and Network
preferences.
I got a strange whole-system hang in file_cache_resize into this
function. Possibly the page was spuriously busy, perhaps it wasn't,
but not having function arguments on x86_64 in stack traces, I was
unable to deduce what page was actually being waited on.
In case it happens again, this should allow it to be debugged further
by placing the address of the vm_page structure in the thread wait
informations. (A string is not very useful here anyway.)
This was introduced into the main API in 2010 (d72ede75fb),
but was actually only fully used for the past month (c2a9a890f3)
when SIOCGIFMEDIA was supported for all *BSD drivers and not just WiFi.
Most userland consumers of this structure did not use it correctly,
as was the case in #17770, and only worked because in the fallback case
the network stack just treated it as if it were an ifreq.
Nothing actually used the ifm_count/ifm_ulist (though tentative APIs
were exposed for it) as noted by previous commits; and the fact that
Haiku's IFM_* declarations are so spartan makes most of the returned
values unintelligible to userland without using FreeBSD compat headers.
If, in the future, we decide to implement ifmedia listing and selection
properly, that should likely be done with separate ioctls instead of
having multi-function ones like this.
This is technically an ABI break, but in practice it should not matter:
ifmediareq::ifm_current aligns with ifreq::ifr_media, so the things
that used this structure like our in-tree code did will continue to work.
Until this past May, the only other field that was usually set was
ifm_active, but in the absence of setting ifm_status all non-Haiku
consumers should ignore it completely.
The only consumer of this ioctl that I know of out of the tree,
wpa_supplicant, still works after these changes.
* Remove unused variable.
* Use original value for IFM_AVALID, we do not need to remap this one.
(Actually we do not need to remap IFM_ACTIVE here either, but it makes
some things slightly easier to work with rather than remapping it
in a different location.)
This functionally disables most of the functionality of the BSD-style
SIOCGIFMEDIA, but it was never used in userland (because if it had,
it would have triggered SMAP violations in the compatibility layer.)
SIOCGIFMEDIA returns BSD-style media values, which mostly overlap
with Haiku ones but have a few differences still. These are taken care
of in the compat layer by ETHER_GET_LINK_STATE, which is where this
media value comes from, but are not by SIOCGIFMEDIA which just passes
back whatever the drivers do.
Fixes#17770, at least for ethernet drivers.
All the drivers that support ETHER_GET_LINK_STATE set this correctly;
and more specifically, it should actually not be set on some devices
(WiFi devices, specifically). Since SIOCGIFMEDIA has always been
passed through directly to the driver if it supports it, WiFi
devices worked anyway because this value never made it to userland.
That will soon change, hence this needed to be fixed.
We need not (in fact, must not) revalidate addresses if we are just
going to coalesce with the previous segment; otherwise, we will incorrectly
reject buffers that are more than page-aligned.
Should fix#17798 and the new KDL in #14260.
* Turn lastaddrp into a reference instead of a pointer.
* Use PAGESIZE instead of B_PAGE_SIZE for consistency.
* Rename "nsegs" variables to "seg" as it is an offset and not a count.
No functional change intended.
I got my pointer math wrong because some things in RNDIS use uint32 as
the base, but some things are in bytes. Most of the time this would result
in an offset past the end of the USB buffer, so it would just lead to
ignoring all but the first packet. But if the first packet was small enough,
it would point somewhere still in the buffer, and we would read the wrong
data.
Fixes#17775
Change-Id: I32ec0081336b1f772d4dc3099a0ac2c691aa12f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5377
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Not sure if other phones could use another value, but it's better to
follow the spec. Also add some bounds checks with traces for now if we
see something strange.
Change-Id: I5c7bc37c4730e6a08bf0bf10fed975bf2012102e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5376
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
FreeBSD seems to do this, too, and sets BUS_SPACE_MAXSIZE appropriately
(which it seems we already do.) Fixes 32-bit builds following previous
commits.
This way sendmsg's argument will also be traced.
Change-Id: I40b44ffc732d884393f944bc2b1ced7b0a551287
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5354
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This actually has another advantage: if we can use musl sources
in the kernel POSIX support, then we can drop some of the BSD
sources that are used only in the kernel and have a different
implementation in userland (e.g. strtod) and have just one
version for both.
These are BSD extensions, not POSIX functions. They were needed
in libroot by the previous versions of the ftw/nftw implementations,
but the musl versions do not need them, and so we can move them to
libbsd.
This is a minor ABI break, but hopefully whatever was using them
in libroot also links to libbsd. If not, that's an easy enough fix.
(These were only added to libroot in 2013.)