Commit Graph

63945 Commits

Author SHA1 Message Date
Máximo Castañeda 2e75ef07fe Fix 32bit build
Change-Id: If7c2da0a28302f5535eda25999b1f877cbca1152
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5315
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-16 16:05:09 +00:00
Augustin Cavalier 9e85b9ea2a network/stack: Return immediately from device_reader_thread after calling device_removed.
Otherwise we can and will use-after-free the device structures.
It seems this code has been broken this way since it was first added
in cc8eceb0af (2010).
2022-05-14 11:52:19 -04:00
PulkoMandy 3ad6b5ecba usb_rndis: accept incoming USB transfers up to 0x4000 size
As required by the spec. Then split them into multiple ethernet frames
as needed.

Fixes #17738.

Change-Id: I71ebff0fe1fc5c8a342d6d06b26eda8e87115e04
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5312
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-14 15:48:51 +00:00
Augustin Cavalier a806e3678a network/stack: Update and add comments in down_device_interface.
The function names in the comment were not been updated in some time,
so synchronize those with how things presently look.

Also add another possible codepath, from device_removed. This one can
and is invoked from the device_reader_thread, in the case where
we get B_DEVICE_NOT_FOUND from receive_data. That is now taken care of
by having wait_for_thread return EDEADLK, we need only note it here.

Change-Id: I18320c2831dce99a34b07de862a0a5c8b4e4e98d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5311
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-14 15:26:32 +00:00
Augustin Cavalier d9694912a7 kernel: Have wait_for_thread fail with EDEADLK when the current thread is specified.
This behavior is not required by POSIX (for pthread_join), but it
is recommended and other OSes seem to implement it.

This constitutes a behavioral change from BeOS, which just deadlocked
as we do before this commit (I checked.) Preserving this behavior does
not seem very useful, though if in the future we need to, adding a check
to libroot is easy enough.

This fixes a deadlock encountered when the usb_rndis driver is unplugged;
the network stack has a removal path that invokes wait_for_thread on
the receive thread, but the function can itself be called from the
receive thread.

Change-Id: Id3639d98a513f2b0f0bacc90d8d27abb5078857b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5310
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-14 15:26:32 +00:00
PulkoMandy 580f28da6d kernel debug: rewrite dump_block to use a single dprintf call
In the syslog, each dprintf call is prefixed with a KERN: prefix,
rendering the dump unreadable. Bufferize things to print each line with
a single call.

Change-Id: I27c1b1f74434fbc6e554acb0a716f0700821bc8d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5305
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-05-14 09:24:00 +00:00
PulkoMandy a5c0d1a80e Enable Werror on some network drivers
Change-Id: Iff3a167da4c7a639f229556c501c2b71133fd8dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5308
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-05-14 09:24:00 +00:00
Alexander von Gluck IV 2439b2b9dc src/tools: hardlink_packages: Autodetect arch from jam remote repository file
Change-Id: Iccbcdb3105bf7762259493b9852446a3c83fbd2f
2022-05-13 15:18:17 -05:00
Alexander von Gluck IV 6a379485c5 src/tools: hardlink_packages: LooseVersion was deprecated
Change-Id: I3711e76d8357651aa6b400a1c9579d40aa64c558
2022-05-13 15:18:17 -05:00
PulkoMandy b248954676 usb_rndis: new driver for Android phones USB connection sharing
Based on usb_ecm and other native USB ethernet drivers which share a
similar structure.

References used to implement this:
- FreeBSD urndis driver
- [MS-RNDIS].pdf v20140501
- Microsoft list of RNDIS OIDs

TODO:
- Better handling of "request id" field to make sure the replies we get
  match up with the requests we sent, and it could allow to have
  multiple requests in flight. However, the FreeBSD driver doesn't
  bother to implement this, if you only ever have one request in flight
  and wait for a reply before sending another, this isn't really needed.
- Endian safety, this code will only work on little endian systems for
  now. Several structures sent/received to/from the device must be little
  endian, so on big endian platforms a lot of byteswapping will be needed,
  or the code rewritten to use some smarter object and not a plain
  struct for all of these.
- Investigate if it's possible to send/receive multiple ethernet frames
  in a single USB transaction for better performance. Our driver
  structure doesn't really allow for it unless the driver implements
  some buffering on its own.

Change-Id: I2c6dacf0c1aeb6c7c1c112e9b16a63e586ea979a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5281
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-05-13 18:00:02 +00:00
Alexander von Gluck IV 21aaa37347 headers/NetworkKit: Drop now-private service calls from NetworkKit.h
Change-Id: I9efdeb7334606e8cd1cf6b394a19e870ff73bd70
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5309
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-05-13 16:01:15 +00:00
Anarchos c2066ed1b1 Fix PXE boot
-tar fs buffer upgraded to 9Mb
-adding some kernel addons

With this settings i was able to fully boot a gcc2hybrid.
The x86_64 started up to the rocket, but could'nt go into Tracker.

Change-Id: I8f9e1f803f4a918419305bce3068ffce027d2548
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5295
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-05-13 08:52:13 +00:00
Alexander von Gluck IV c2a9a890f3 compat/freebsd_network: Catch BSD socket ioctl and act on within stack
Change-Id: Iaf7e645836ffee58b3a8a8e5352048412035ab32
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5296
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-12 19:48:09 +00:00
Jérôme Duval 92450935b2 intel_extreme: when DDI A eDP port isn't enabled by the BIOS, don't enable
we might be connected with an external port (HDMI or DP) which would be later found.

Change-Id: Ibeab4abb651e5b37d7a0fa452286ee34dec7dfbd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5306
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-05-11 18:01:28 +00:00
PulkoMandy 981d0862ed net_buffer: fix build with tracing enabled
Change-Id: Ifc26defe30946f928bbff360ea70f33eb1352745
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5304
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-11 16:43:11 +00:00
Jérôme Duval f808e87ad0 intel_extreme: the eDP port on DDI is mostly found on port A
* for eDP a displayport output should also be found als VBT device type.
* should help with #17730

Change-Id: I893bd2dabfd1730ab545336e2f9a5b15abc194a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5299
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-05-09 07:43:39 +00:00
Niels Sascha Reedijk 929355add7 libroot: return error on partial match in strptime()
The previously implemented behavior of strptime() allowed for partial matches
of strings. For example, if the format string was "%a, %d %b %Y %H:%M:%S", it
would successfully parse "Sun, 07 Dec 2003" as input. This is inconsistent with
the standardization in POSIX.1-2001 (and later).

This change makes strptime() return an error if there is no more data in the
buffer and not the entire format string is parsed.

Change-Id: If066c49fb7fc094f8ccd56703cd01903a0e40cb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5298
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-05-08 07:58:05 +00:00
Jérôme Duval 7ff9722ae3 intel_extreme: reuse DpAux code for DisplayPort
the code is moved in the Port class.

Change-Id: I3beb337e29b26ee4732224723c5b76b5f415a248
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5291
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-05-05 16:26:03 +00:00
Jérôme Duval 1c23e6bcf1 intel_extreme: leverage VBT device type for internal panel
* also handle dp aux on PCH.
* tested on Gen7, should work from Gen6.

Change-Id: I8d99bcdc10c817e66441a6a644df490dd988a74d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5290
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-05-05 16:26:03 +00:00
Augustin Cavalier d98fcb7db6 HID: Return ENODEV instead of B_ERROR if the device was removed.
This should help with diagnosing problems in some failure conditions.
2022-05-03 16:59:19 -04:00
milek7 42c53fc8b8 arm64: Fix ELF relocations.
Change-Id: Icc48649d6a3a8c6b5b5ab845e9025352c1e77dfb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5260
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-03 20:27:18 +00:00
milek7 8417420441 arm64: Do not misalign kernel stack.
AAPCS64 requires stack to be aligned to 16 bytes.
Additionally alignment might be enforced by hardware for every sp-relative
access depending on configuration in SCTLR.

Change-Id: Idd4756dd19386eb491d926b8a9862fa7fa48e506
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5259
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-03 20:27:18 +00:00
milek7 7c69ebda17 arm64: Add mapping of all memory in kernel virtual space at KERNEL_PMAP_BASE.
Change-Id: I828b1ba8c0add614e9df6bba1e14c5e514ec1bad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5258
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-05-03 20:27:18 +00:00
Lt-Henry 2684c64083 usb_hid: Update HID Consumer usage page constants to 1.3 spec
Change-Id: I5ffbcda41547b1a31049b5d7ba73f7327bb8cf04
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5288
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-05-03 19:04:30 +00:00
Jérôme Duval 459f1bcd8d intel_extreme: irq hotplug support for IceLake and newer PCH.
we enable every port interrupt instead of relying on the ports found in the VBT.
ATM only log the plug state when it changes.

Change-Id: I5175fb137d11f0114beb2915a4f363341cfe8e36
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5287
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-05-03 18:15:48 +00:00
Jérôme Duval 46bbf334f6 intel_extreme: parse VBT device configs, use this to skip unused ports
* BDB version from 111
* for DDI from Gen9
* for HDMI and DisplayPort from Gen6
* use the first port to create the mode list
* also probe DDI Port A
* the aux channel helps to select the correct dp aux registers.

Change-Id: I80549a6ec0477bed768cc5f388959b606d50c1b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5286
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-05-03 08:48:34 +00:00
Autocomitter 2aac05508f Update translations from Pootle 2022-04-30 08:15:54 +00:00
Jessica Hamilton 2798df0e80 HaikuDepot: fix build rules
* Fixes a couple issues with independent target warnings, causing
  parallel build problems.

Change-Id: Id968709094c9d5efa4cb443c62c41c83c9622355
2022-04-29 15:24:03 +00:00
David Karoly 83f755b5d8 kernel/arm: add memory barriers for page table ops
Introduce memory barriers according to ARMARM,
section G.5.3 TLB maintenance operations and barriers

Sequence for mapping memory in (both L1 and L2):
* DSB
* Invalidate i-cache (TODO)
* Insert new entry in page directory / page table
* DSB
* ISB

Sequence for mapping memory out:
* Remove page table entry
* DSB
* Invalidate TLB entry
* DSB
* ISB

Sequence for updating a page table entry:
* Update page table entry
* DSB
* Invalidate TLB entry
* Invalidate branch predictor (TODO)
* DSB
* ISB

Note: i-cache invalidation and branch predictor invalidation is
not implemented yet as this commit focuses on implementing memory
barriers.

Change-Id: I192fa80f6b43117236a4be6fa8c988afca90e015
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5241
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-04-28 19:57:49 +00:00
Jérôme Duval cf5f513b3b file_systems: add entry_cache_(add/missing) in btrfs,ext2,exfat lookup methods.
Change-Id: I77857421a65f371bc885f1d4eb66ef2ab4376e56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5252
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-04-28 19:16:48 +00:00
Mashijams 2cecdeed2e xfs : fix build with trace enabled, improve error checks
- Remove referencing an undeclared identifier

    - Instead of an assert, just log an error for XFS V5 filesystems
      and don't try to mount them

Change-Id: I67303aff89b81a28b7333569fea8113b6020dc54
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5204
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-04-28 19:16:12 +00:00
Jérôme Duval 1d2cf139a8 strace: trace fcntl and wait_for_child syscalls parameters
Change-Id: I774e8343139a2bdb3c2f60f37cab3a7207739c7c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5251
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-04-27 06:00:58 +00:00
Augustin Cavalier 68d1b97e4f Clean up mouse functions in InterfaceDefs.
* Fully remove unused and deprecated functions.
 * Comment as to which functions are deprecated.
 * Rename _by_name functions to be without the suffix, as this is C++
   and there's no reason not to use overloads here.

Change-Id: I4e2152f17806605eb965795417013cea800e661e
2022-04-26 19:59:01 -04:00
Augustin Cavalier 467ffecdbb HaikuDepot: Temporarily disable viewing usage statistics.
It causes crashes (see #17689) and I was unable to determine the cause;
and it causes very noticeable lag (see #16879.) It can be reinstated
once those problems are fixed.
2022-04-26 17:51:51 -04:00
Augustin Cavalier 7d7de13527 HaikuDepot: Fix leak of ProcessCoordinators.
This function is supposed to take ownership of the coordinator item,
but it didn't do that in all cases. Use a BReference(..., true)
to do that.
2022-04-26 17:50:53 -04:00
Augustin Cavalier a173592b40 Tracker: Fix memory leak in IconCache::SetIcon.
How often this would have occurred before thumbnail support I'm not sure,
but at least now that we have thumbnails, the icons are changed out
with not insignificant frequency, especially on read-only filesystems.
2022-04-26 15:03:01 -04:00
Augustin Cavalier a64cdd1dcc Tracker: Overhaul thumbnail generation logic.
* Use a JobQueue and BJobs to generate the thumbnails, instead of
   spawning a potentially unlimited number of threads (which can
   of course rapidly exhaust resources.) Use two threads: one for
   smaller files, and another for larger files.

 * Directly insert the new thumbnails into the icon cache once they
   have been generated, avoiding the port-search dance on filesystems
   that do not support writing attributes (or at least large ones.)

 * Skip calling mimeset, is it not needed after the previous commit.

 * Combine all the duplicated image-scaling logic into one function.

May help with or fix #17225, #17619, and other thumbnail-related matters
e.g. #17557. Also addresses comments from the mailing list last summer.
2022-04-26 14:55:12 -04:00
Augustin Cavalier 6750cef9ca Tracker: Thumbnail attribute changes should cause an icon refresh.
This way, a full mimeset need not be run to trigger an icon update,
and also other applications can write thumbnails and trigger updates.
2022-04-26 14:44:12 -04:00
Augustin Cavalier 5192c3bfff Tracker: Move thumbnail-manipulation code to its own file.
Preparatory work for refactoring thumbnail generation to not use
so many resources (threads, ports, etc.)
2022-04-25 23:10:03 -04:00
Augustin Cavalier 457d8a9282 Tracker: Remove unused rgb_color creation function.
Nothing seems to use it. make_color should be used instead.
2022-04-25 22:28:46 -04:00
Augustin Cavalier c6b6adc407 Tracker: Replace custom LooperAutoLocker with AutoLocker<BLooper>. 2022-04-25 22:28:45 -04:00
Jessica Hamilton a43a4e9fbf Terminal: fix missing attribute state for the history buffer.
* This presented itself as 24-bit colour rendering as white on black
  when scrolling through the history.
2022-04-26 13:24:02 +12:00
Augustin Cavalier 07b83028cd emulex_oce: Remove.
It doesn't seem to work anymore, and it doesn't look to be particularly
maintained on FreeBSD's side of things. I think kallisti5 was the only
person who ever even attempted to use it.
2022-04-25 19:26:10 -04:00
Augustin Cavalier acfde4597c kernel/condition_variable: Downgrade another panic into a debug print.
Fixes #17686.
2022-04-25 19:20:31 -04:00
Augustin Cavalier acdd772db0 DiskProbe: Check we actually have a buffer before computing the offset.
Fixes #17709.
2022-04-25 19:16:28 -04:00
Augustin Cavalier 925b83a85a HaikuDepot: Fix scrolling the list triggering "looping."
If two PACKAGE_SELECTED messages were queued at once, then we would
wind up in a loop between the two, triggering the "looping" behavior.
Instead, do not send a PACKAGE_SELECTED message when programatically
changing what package is selected, which is more efficient anyway.

Fixes #11732.
2022-04-25 18:59:55 -04:00
Augustin Cavalier a386685453 HaikuDepot: Cause and wait for the package-populator thread to exit on window close.
May help with #17689.
2022-04-25 18:46:13 -04:00
Augustin Cavalier 4e16be4fa0 kernel: Do not invoke memalign with 0 as the alignment argument.
The memalign() function has special semantics for its arguments
even when -fno-builtin is enabled, it seems (that may be a problem
on Clang's part, however.) The alloc_align attribute, which we apply
to the memalign_etc function, does not seem to have the same problems;
at least its documentation at GCC gives no indication that 0 is not a
legal value to pass.

Change-Id: Ie5ba090b924ac3577775165d20f11f9696be97f3
2022-04-25 18:14:44 -04:00
Augustin Cavalier 8f68daed84 kernel: Make use of the new ConditionVariable lock-switching APIs in a few places. 2022-04-25 17:59:50 -04:00
Augustin Cavalier 8af7b72d8d OS.h: Remove set_timezone function from header, place behind _BEOS_R5_COMPATIBLE_.
Long ago deprecated, not used in the tree.
2022-04-25 17:25:55 -04:00