Commit Graph

64092 Commits

Author SHA1 Message Date
Augustin Cavalier
b12b802c4d freebsd_network: Add an extended bus_dmamap_sync API for partial syncs.
To preserve proper semantics with the OpenBSD layer, this is needed.
2022-07-01 23:15:07 -04:00
Augustin Cavalier
7ff2f10462 OpenBSD wlan drivers: We cannot back out of initialization at preinit.
Otherwise we get KDLs. Fixes #17811.
2022-07-01 22:09:06 -04:00
Augustin Cavalier
27fda3e46f kernel/fifo: Properly support opening FIFOs in O_RDWR mode.
While pipe() only supports a read end and a write end, named FIFOs
are supposed to allow opening in read/write mode (which, indeed,
is something the Fish shell seems to require.)

The code that checks open_mode in the read/write routines was introduced
all the way back in 2003 (2469f26dfc).
At that time, the VFS did not do open_mode checks on FDs in the
I/O syscalls, so these doubled as permissions checks. Now, however,
the VFS does check that in common_user_io, so we can remove these
entirely and let things behave as they should.

Additionally, there is now also no reason to prevent select()ing
on both events for the same FD independent of open_mode, so
allow that too.

Change-Id: Ib3cba76d18e91b7c00d1695e8d29dd47cae06b79
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5427
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-07-01 18:57:28 +00:00
David Karoly
fe3405c087 kernel/arm: ensure page dir is correctly aligned
Page directory physical address must be aligned on 16K and
it must be mapped to a contiguous physical region.

Change-Id: I6723023c9deaa1c4a1081cf5a984a1766241a532
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5423
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-07-01 18:39:30 +00:00
Jérôme Duval
0db74b55dc btrfs: fix SMAP violation, reading inline uncompressed data
should fix for #17061

Change-Id: I5973be6c443e8cf4460c6a3aca7b5378e90d717b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5426
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-30 15:47:08 +00:00
Jérôme Duval
374a3a07a1 libtracker: don't try to fix permissions on read-only volumes
* instead try to guess the type, find the app, and launch the app with the document refs.
* fix #5783

Change-Id: Icd25a81ff28038fec0494045390edc6271433b07
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5425
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-30 15:47:08 +00:00
John Scipione
3571cd8a6b StyledEdit: Add comment explaining MakeFocus() loc
... to explain hrev562209 by Jim906 which fixes #17733
StyledEdit: give initial focus to the TextView

No functional change

Change-Id: Id428290d8d3530e5ef9213489625c1968984d323
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5422
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-30 15:38:41 +00:00
Alexander von Gluck IV
946bd9ab3c HaikuPorts: bump arm build-packages via davidkaroly
* Downgrades icu-67 to 57 given crashing issues
  (riscv64 saw similar issues, cause unknown still)

Change-Id: I7927c7892fa517e5c51f86082b4df5977af92eb2
2022-06-30 07:56:05 -05:00
Jérôme Duval
187f73dbf5 bfs: take in account the block_run allocation group when computing reserved blocks.
after hrev56221, the block bitmaps can span over multiple allocation groups.
Blocks would be allocated in the block bitmaps, especially root indexes (for instance 2.5TB, blocksize 2k).

Change-Id: I35d21d48e84945e5f949a272d530c466ae6506ac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5420
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-30 08:25:12 +00:00
Augustin Cavalier
2884a00088 ralinkwifi: Import USB modules.
Not entirely sure if these are working as they were not really tested.
But they don't seem to cause KDLs at least, so the worst that happens
is that the WiFi devices fail to work.
2022-06-29 13:17:15 -04:00
Augustin Cavalier
e410069738 freebsd_network: Implement USB routines needed by Ralink USB modules.
Tested by nephele with a RT2573. The device starts and scans for networks,
but hits some USB errors probably related to buffer sizing which I'm
not quite sure what the cause of could be. More work (by someone who
owns these devices) may be required.
2022-06-29 13:16:13 -04:00
Augustin Cavalier
db4df8fcf5 freebsd_network: Use the real usb_endian.h.
Turns out some FreeBSD drivers use these macros on types other
than the ones declared in this header and expect them to behave
as array accessors, so we really do have to keep the originals.
2022-06-29 13:14:47 -04:00
Augustin Cavalier
00096a9d1f USB: Add default max packet size for SuperSpeed bulk endpoints.
We already had one for High-Speed endpoints, but SuperSpeed endpoints
also have a fixed size, similar to Control endpoints.

May help with some devices failing to configure.
2022-06-29 10:36:36 -04:00
Jim906
5b5da451b3 StyledEdit: give initial focus to the TextView
* Move the existing MakeFocus call to after the window layout is built.
* Also, add calls to Activate so that StyledEdit becomes the active
  window after its find or replace window is closed/hidden, even if
  another application is set to 'always on top.'
* Fixes #17733.

Change-Id: I8380e8ce2760ffa3f3467a618a0d843826e4ac99
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5416
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: humdinger <humdingerb@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-06-29 06:44:08 +00:00
David Karoly
84360889a2 ldscripts: remove linker script for Raspberry Pi
This linker script was introduced in commit 5426ff9 in 2012
predating both the EFI and the raw u-boot ARM loader,
at that time it seems that it was intended to be used
as part of a 'raspberrypi_arm' boot platform which does
not exist anymore. So this is not needed anymore.

Change-Id: I530e922807fe6d80f74248f2dc7ed25cdc8bcb1c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5419
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-28 17:10:40 +00:00
Trung Nguyen
908107a15f libs/bsd: implemented dl_iterate_phdr
dl_iterate_phdr now fills the first four fields of
struct dl_phdr_info. The last four fields remain
unimplemented, as it requires help from the
runtime_loader.

Change-Id: Id96a7c7ac05633a71b9fb62c98b3a40f7d4f255b
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2022-06-28 13:07:54 -04:00
Augustin Cavalier
045f7a5f3a headers/bsd: Rewrite link_elf.h.
Include only the APIs we are (shortly) going to actually support.

The other structures and functions declared in this file were
never supported nor used anywhere in Haiku's tree.
2022-06-28 13:07:53 -04:00
Mikael Konradsson
c5702ad4e8 DiskProbe: Clean up old compiler pragmas for BeOS and Dano.
Change-Id: I0c8a4ce6c8d1c8994e2f89a4d35db3ac0ae03117
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4714
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-28 16:48:33 +00:00
Augustin Cavalier
63816858af boot/platform/u-boot: Drop ARM support.
Newer versions of u-boot support EFI natively, which is what we
have been making use of instead.

There may be some use for the "native" u-boot loader still on PowerPC,
but otherwise the EFI support is much more advanced and even in u-boot
supports as or more features than "native" loaders, so there is no
reason to keep this around.
2022-06-28 12:27:06 -04:00
Alexander G. M. Smith
7c09ef1255 FAT: Fix 32 bit gcc2 compile.
You can't initialize struct fields in the declaration in gcc2, but you
can set them up in a constructor.  So made one for struct diri,
and initialize nested sub-structures too.

Change-Id: Ic8b824bc157cca4cdb8c4e41afdca596776c0d55
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4995
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-28 15:40:41 +00:00
X512
4ac797a9cf kernel/arch/riscv64: implement breakpoint interrupt
Change-Id: I1e9f33e505a1de4be2e77535efe36bae96a982ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5293
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2022-06-28 15:38:55 +00:00
David Karoly
0d560e87ee kernel/lib: add missing musl include
This is needed to fix the build on arm as atomic_arch.h
relies on musl libc.h and features.h

Change-Id: I5bfa32b7b0fa1662cc9ee8cd8fa3037d8a5e2431
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5418
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-28 13:35:42 +00:00
Jérôme Duval
b5417d2089 bfs: don't allocate more than the maximum in an AllocationGroup
* The reserved blocks could exhaust the first allocation group, so iterate as much as needed.
* fix #11753

Change-Id: Ib1d7f87946f7b96dfcade8f5778a14065d965f6b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5417
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-28 06:02:19 +00:00
Jérôme Duval
1e68c512da runtime_loader: accept type STT_FUNC when STT_OBJECT is requested
trying to load a PIE executable produced by golang show the following (for pthread_create)
    12: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  UND pthread_create
 12655: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND pthread_create

It's the same for Linux or Solaris, so I suppose we're being too picky.

Change-Id: Ibe817c231365aba8b2eb88eb3f556d2bd1db384a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5392
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-06-28 06:02:01 +00:00
Mashijams
6c478b54f6 xfs: version 3 Inodes and shortform directory
- Implemented xfs v5 inodes (known as v3 inodes) and necessary metadata integrity checks

- Implemented correct data fork pointer which handles both xfs v4 and v5 directories

- We can now read inodes and shortform directories for both xfs versions completely fine

Change-Id: I8a75ec1dc663d567d3bf6db64be4a27b55d709b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5396
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-27 15:00:30 +00:00
Gerasim Troeglazov
e511f0c1cb usb_serial: add WinChipHead (CH340/CH341) support
Fixes #15872.

Change-Id: I3b43094574045464ca0d3e024f8b5aac32ce5210
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5401
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-27 09:15:58 +00:00
Jérôme Duval
caf0369a89 ext2: check volume state when mounting
we deny mounting read/write when not clean or with errors.

Change-Id: Ie0188319618d9d8e7199b308c007fbaeacaed87c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5400
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-06-25 20:16:06 +00:00
Jérôme Duval
732f5f0f87 ext2: accept block count until the disk size plus one
my understanding is that it's possible that the last block (for instance of size 4KB)
is too large for the last few partition sectors, if the partition size isn't a multiple
of the block size.

Change-Id: I88c709d6e449aa52358fd9343c9f68f7ac1c01fe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5399
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-25 20:16:06 +00:00
Jérôme Duval
442298d494 kernel/devfs: improve devfs_compute_geometry_size
the old code could lead to an odd head count, thus a smaller partition size.
with power of two, this works at least accurately if the size is aligned.
we should probably introduce a new ioctl or extend the current one to avoid this problem.

Change-Id: Ia6c034262b1756e901d6ad76ab17b278b2314631
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5398
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-25 20:16:06 +00:00
Autocomitter
faefd309d9 Update translations from Pootle 2022-06-25 08:11:32 +00:00
Jérôme Duval
d2e5fc7fa4 usb_disk: add support for drives bigger than 2TB
* tested read/write with a NTFS partition at the end of a 5TB USB hard disk.
* fix #14670

Change-Id: Ic005dfb7ef94b50a2d6fc8099ef5c83ec6b4a730
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5397
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-25 07:05:26 +00:00
Jérôme Duval
e49b671dcf kernel/vfs: lstat a symlinked dir with a trailing slash should traverse
golang's TestSymlinkWithTrailingSlash exhibits the bug.

Change-Id: I7e16bad9857e9be042fc215a587c861bc4eef716
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5395
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-06-24 08:31:44 +00:00
Augustin Cavalier
c95c5ed821 idualwifi7260: Merge patch from OpenBSD for some 9xxx devices. 2022-06-22 14:34:17 -04:00
Augustin Cavalier
a928b16e36 freebsd_network: Unlock the taskqueue before waiting for threads.
Also set tq_threads to NULL to prevent double-frees.
2022-06-22 00:34:37 -04:00
Augustin Cavalier
7e1c1d3020 openbsd_network: Adjust reference-taking in bus_dmamap_load_mbuf.
dm_segs is a flexible-length array at the end of a structure.
Taking its address with & gives the same address as using it without,
however, the types are not identical in the different cases.

This should fix some warnings about incompatibile pointer types
while not changing behavior.
2022-06-21 23:23:02 -04:00
Augustin Cavalier
4b6af34c06 kernel: Move aligned_alloc to heap.cpp alongside calloc.
It is independent of whatever heap implementation is actually in use,
so it belongs in here (even if this file is probably not the right
place for such functions in the first place.)

This allows the kernel to be built once again with things other than
the default slab heap.
2022-06-21 22:59:57 -04:00
Augustin Cavalier
8e059bfa63 ralinkwifi (ral): Upgrade to FreeBSD 13.1
One new device ID.
2022-06-21 17:34:52 -04:00
Augustin Cavalier
b071913066 freebsd_network & drivers: Remove need to specify FBSD_TASKQUEUES.
Instead make FBSD_TASKQUEUES a combination flag of all taskqueues,
so that if even one is needed, the init_taskqueues function will
be invoked appropriately.
2022-06-21 17:22:37 -04:00
Augustin Cavalier
b4bf3ed0d5 drivers/network: Adjust all HAIKU_DRIVER_REQUIREMENTS for taskqueues.
Many of these did not need taskqueues at all. Others can hang off
the WLAN feature's implicit usage of taskqueues.
2022-06-21 17:12:29 -04:00
Augustin Cavalier
0163191229 freebsd_network: Rework taskqueues implementation.
* Use FreeBSD's queue management directly, only retaining thread
   creation and synchronization functions from Haiku.

 * Use FreeBSD's task structure declarations.

 * Use a standard non-FAST taskqueue for taskqueue_thread.

 * Rewrite header and adjust consumers as appropriate.
2022-06-21 16:17:50 -04:00
Augustin Cavalier
ed20f6660f glue: Add comment that argv_save and __main_thread_id need not be set here.
But they still are so the glue code is compatible with older Haiku versions.
2022-06-21 13:16:07 -04:00
Jérôme Duval
032b1422c2 kernel/device_manager: don't insert device node before nodes of the same priority
fix #16512

Change-Id: I76ce4cfc9346492008c11ca53302ca4df6a6b514
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5393
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-06-21 16:55:01 +00:00
Augustin Cavalier
c27c987075 freebsd_network: Fix address restriction computation in bus_dma.
The min/max usage was reversd from what it should be. This
would have led to the least restrictive restrictions being the
ones that were checked, instead of the most restrictive.
2022-06-21 12:24:04 -04:00
Augustin Cavalier
2c81f88085 freebsd_network: Clean up bus_dma restrictions implementation.
* Remove support for filters (again): they are deprecated in FreeBSD
   and no driver we have uses them. This allows the loop in the
   _validate_address function to be dropped entirely.

 * Clean up parent tag handling logic.
2022-06-21 12:24:04 -04:00
PulkoMandy
e866d6e941 ps2: disable keyboard during multiplexing probing
My machine does not have an AUX/Mouse port at all. As a result, the
commands all get sent to the keyboard, which confuses the keyboard and
it eventually resets. This is generally harmless, but it ends up
resetting the keyboard, which cancels the effect of the commands to set
the repeat rate and delay during boot.

By disabling the keyboard during this step, we can avoid interference
with it.

Change-Id: Ic0513972a31e030a15577477c3d3fe32d4ce9bd3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5387
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-06-21 15:52:53 +00:00
X512
b2059b9f15 libroot: set __main_thread_id in libroot initialize_before instead of entry point
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>
2022-06-21 11:49:50 +00:00
Augustin Cavalier
b3dab377a9 idualwifi7260 & iaxwifi200: Enable PCI busmastering.
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.
2022-06-20 17:17:20 -04:00
Augustin Cavalier
561bb7bac5 idualwifi7260 & iaxwifi200: Do not return but go to the appropriate fail.
This way, we will actually tear down what state got initialized.
2022-06-20 17:15:45 -04:00
Augustin Cavalier
22bdb7ba70 iaxwifi200: Add missing if_free_inplace on deinit.
It may make sense to place this later so that we don't need to add
another goto label, but that can be experimented with later.
2022-06-20 17:14:53 -04:00
Augustin Cavalier
891bd14810 packages/Haiku: Clean up WiFi firmware rules.
* 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.
2022-06-20 13:27:13 -04:00