* Spirograph uses SetBits with length 1 und 4, which can't work as
expected. As Spirograph uses the same source and target colorspace,
the memcpy codepath is used with the right length.
* fix #12931
Change-Id: I4f27e748fb842c2d81d4161e7c94586844995bdf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8562
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Previously it was not initialized until "post-VM", but there are
a number of ways VM initialization can go wrong that it would
be nice to know about without needing a serial port.
On arches which map the whole physical memory into the kernel
address space (x86_64, at least), we can get the bluescreen facility
initialized using KERNEL_PMAP_BASE. On other architectures, we
just fail to init then, and do the usual setup later on.
A slight bit of extra code cleanup in blue_screen_init_early:
we now just call module->info.std_ops() rather than a
frame-buffer-console specific method.
If the vnode's reference count is already > 0 and we can increment
it from there, then we know it's already used and we don't need
to run any further checks. This saves us having to acquire the
vnode lock every single time we want to get the vnode.
(IsBusy() doesn't use an atomic get to fetch the flags value,
but as this is the first read of the value after having acquired
the vnode lock, that should not be a problem.)
Adjust free_vnode, while at it, to not set a positive reference count
during destruction, to be fully certain nothing will see this vnode
as being available for use, and add an assertion checking this.
Improves "git status" time significantly, at least in the case where
all vnodes are in the disk caches. This fast path also seems to be hit
very many times (> 100,000) on boot, and in compile jobs, too.
Change-Id: Ibcc65aecbfcdc4f3fca42baa3756e39aab8b9efb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8583
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
When the transfer is canceled, there is no new data received. So we
should stop the processing and inform the network stack that the
transfer is canceled.
Change-Id: I5c991899292b84e6d9bc589348a5ab32384ea09a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8577
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The MAC address is randomly generated each time the device is connected.
So there is no way to match with a previous session and reattach the
interface transparently.
Change-Id: I8aea95d5a09621a0dcdd7ce89787663a38435001
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8576
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This lock protects a linked-list. In all cases but one, the only
operation done while holding the lock is to remove a single item
from the list and decrement a counter. Acquiring a mutex itself
involves multiple linked-list operations protected by spinlocks,
so cut out the overhead and just use a spinlock directly.
In the one case where we do more than just remove an item, we
hold an additional write-lock, and so we don't run any risk of
causing "spinlock could not be acquired for a long time" KDLs,
as in that case the threads will be waiting on the rwlock instead.
Reduces lock contention in the VFS. Compiling HaikuDepot and the
mime_db with -j4 (in a VM), the sys time decreased a bit (~10.1s
to ~9.9s), and real time went down by more (~31s to ~29s.) "git status"
performance also improved a bit, but we seem to be contending for
vnode locks now in that case.
Avoids needing a nonstandard "offsetof", and inlines more methods.
No behavioral change intended.
Also rename "next" to "hash_next" for clarity, and remove an unused
"next" field from LockWaiter.
Applications that don't call open() or like functions too often,
and call many FD-related methods across multiple threads at once
(like "git status") now don't wait on the context lock as much.
("git status" performance isn't much improved because threads just
hit the "unused vnodes" lock instead.)
- Convert libroot from a page to a group, so that it can list the
included file and functions in the generated book (like the kits)
- Add unistd.dox and move the relevant part of ioctl details there
- Make sure to use C89-compatible comments only in POSIX headers
Change-Id: I8f0412e4c75de6f48018a0436909f8b0076342a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6369
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Exposes a new field on mouse events named "device" that specifices what
type of device the event originates from. This is then used in
PadBlocker to ignore events that don't originate from trackpads.
This field should also be exposed to the public API in case any program
in userspace want to use it, as it may be useful for other purposes.
Fixes #19238 and #17821
Change-Id: Ic0f8c088cf5d2b0414a8e69498b48f2a3e370d73
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8557
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The driver had its own header file with definitions from the USB video
specification. Use the system ones already in place for use in listusb.
Also recognize devices which advertise themselves as "miscellaneous" in
the device descriptor, this is the recommended way in the specification
as the usb_video interface may be only part of a device, with other
interfaces and endpoints used for audio or for HID for example.
Change-Id: I7e2e45328dcc1e81c407937e8dd3d77209c5c52a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8581
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Superblock field blocks_per_ag is confusing, as it holds the number
of bitmap blocks that are in each allocation group, not the number
of disk blocks per allocation group. Try to clarify when possible.
Change-Id: I60dad9d3c5245dd126ecfea817108e2cefa4cf02
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8566
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
* Allocate blocks and add them to the hash table so they are
available for a future block_cache_get call.
* Make use of prefetching in FAT driver.
* A client filesystem may request to prefetch a block run that
contains some blocks that are already cached. The request will
be truncated at the first such block in the run.
* Fixes #19186.
Change-Id: I8d2e3cff15e5b46569438e0dc085e2b391aa57a5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8525
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Render an icon to indicate that the
package provides a native application.
Change-Id: I3aa6468be488a62b317d3107ad1490916c857ca2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8528
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Changes to the package model to factor-out
screenshots, to adjust the notifications and to
adjust depots so that packages cannot be added
more than once under the same name.
Change-Id: I2f9219a1cbc0f42631bddff00852c447fd66c929
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8563
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This flag is only really needed for modifications to queues, mappings,
etc. on the page, and not on regular reads and writes. For that,
"busy" suffices.
This mirrors the file cache's behavior, and avoids invalidly
holding the page's "accessed" state without the cache lock.
Fixes #19233.
This way, we report the real receive/send statistics, not just
the ones the stack knows.
Adjust the FreeBSD compatibility layer to report its stats directly
so they are accounted for this way.
We can't call the callbacks (as the comments correctly indicated),
but we can certainly delete the transfer objects, since they
rightfully belong to us.
Should fix #19242, #19241, #19180 and possibly other recent regressions.
Also fixes a long-standing memory leak from this scenario.
This reverts commit 6211ae2575.
It breaks multiple applications that worked fine on BeOS,
so clearly this tweak was correct after all, or at least mostly correct.
Change-Id: I3b228ba2119dd33067b8defedd6db4ae9ead9124
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8537
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Based on X512's original change, but with more modifications:
* Don't use _ in macro parameter names to appease GCC 2.
* Get rid of ioctl_args struct. We don't need it anymore,
and just adding parameters of the same types has the
exact same ABI on x86 and x86_64, so this doesn't break
any existing compiled code.
* Add (void*) cast to third parameter.
* Enable for _KERNEL_MODE also.
Change-Id: Id4ad8b85f54836fd26dc6278226954d0a081d5f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8533
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This will allow unistd.h to define it even in _KERNEL_MODE.
Change-Id: I6669c670353dda7cc202017d707a6bce3b5519e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8561
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
PadBlocker wasn't handling key repeats, so once key repeat started
kicking in, it would register it as keypress and consequently block any
B_MOUSE_DOWN event that followed.
Fixes #19238 and possibly #17821.
Change-Id: I1dccca5a31021866a61aa95bbeecfb0ba37facac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8532
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Left top position will be set to zero.
It is a common pattern to define `BRect` value with only width and height so it allow to simplify code a bit.
Change-Id: Ie14644843324c9e5bcc55e7cfbd557a8884559d3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8535
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Avoid declaring random friend classes in public header. Allow to access
private methods from arbitrary source if needed.
Change-Id: Iac2cf0ca59e483aa0657e3fe1fc47080c661cf8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8534
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Continued work to normalize the data model
in the application.
Change-Id: I6dc6d17cff866b18f56431056958092c8bdc3a19
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8524
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Two minor behavioral changes: EINVAL is now returned on invalid
times in more places, and clock_settime now rounds up instead of down.
Otherwise all should be as before.