Commit Graph
100 Commits
Author SHA1 Message Date
Jérôme Duval c38a5f9099 ProcessController: save and restore "Power saving" mode
fix #11823

Change-Id: I1284587fa814cd3e121e1c5913f0fe1e15865d9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7670
Reviewed-by: waddlesplash <[email protected]>
2024-05-17 17:26:34 +00:00
Jérôme Duval baa67e1184 boot/bios_ia32: check that the vga mode was successfully set
before trying to write to the frame buffer.
* QEMU can now be started without a standard vga output (-vga none).

Change-Id: Id46cd4d70ce16e2156e0b0668fb88f09112067a0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7667
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-05-04 17:05:40 +00:00
Jérôme Duval f758e73fe6 libbsd: add pthread_sigqueue()
* like sigqueue() but for threads. was added recently to FreeBSD, long before to glibc.
* also include features.h in gnu/pthread.h

Change-Id: I73bca666e2c67d7ff05f341bf85d71df9ccccbe5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7659
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-05-02 18:07:23 +00:00
Jérôme Duval d2ac1f5ab2 network/stack: inherit selected options from the parent socket
similar commit in FreeBSD:
https://github.com/freebsd/freebsd-src/commit/d29b95ecc0d049406d27a6c11939d40a46658733
Change-Id: I370d39c603a3f54158aa2eaf2ad5a30e744beda0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7658
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-05-01 17:54:36 +00:00
Jérôme Duval 85ea044bdb intel_reg: tool to read and write mmio registers
the intel_extreme driver has to be loaded.

Change-Id: I0cf438b1f4ace2ca0eb26cd72a8495721c088d95
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7630
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-04-26 08:40:34 +00:00
Jérôme Duval 9673f7b8bf ramfs: honor the O_DIRECTORY flag on open()
by returning B_NOT_A_DIRECTORY on non-directory nodes, fix #18896.
* like BFS, opening a directory read-write returns B_IS_A_DIRECTORY, instead of
switching read-only.
* fill st_blocks.

Change-Id: I706dc13209299b95be3da04ae19a6a9397b50c37
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7629
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-04-24 19:56:29 +00:00
Jérôme Duval 51bce128f7 tcp: don't allow read on listening sockets
fix #18884

Change-Id: If4e337316ea4faa2f00fa73295c57e93de0a2cbc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7616
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Rene Gollent <[email protected]>
2024-04-12 20:09:31 +00:00
Jérôme Duval 43d1a0dc3c runtime_loader: Implement DT_RUNPATH
DT_RUNPATH is generated by the linker instead of DT_RPATH when using --enable-new-dtags
It seems to be the default when using ld.lld
Normally one difference is LD_LIBRARY_PATH is checked before DT_RUNPATH (and not with DT_RPATH),
but we don't check LD_LIBRARY_PATH at the moment. Checking LIBRARY_PATH isn't an option, because
runtime_loader dosesn't use default paths, test suites would define LIBRARY_PATH empty.
Tested with tcpdump build_matrix.sh script, with clang 17, local libpcap, which requires
--disable-new-dtags on r1beta4.

Change-Id: Iacccde8d20e25ad14c5c548dd8832ea32b67e228
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7539
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-03-22 15:58:53 +00:00
Jérôme Duval 142723d197 libbsd: fix timespeccmp()
Change-Id: I5c1b1e5c4c583c0758b9f1b6eee67cb83053461d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7514
Reviewed-by: waddlesplash <[email protected]>
2024-03-07 21:40:05 +00:00
Jérôme Duval afeee28538 network/stack: fix trace build
Change-Id: Idbb27469bfcafaecbca5e13378a3e0c8d30d4201
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7513
Reviewed-by: waddlesplash <[email protected]>
2024-03-07 21:40:05 +00:00
Jérôme Duval 49d736ca2a tcp: actually send finish when needed by the state
fix #18327 after hrev57546

Change-Id: I352a325f3c2068d06996c278246f7a30f5bfcbe0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7504
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-03-04 19:23:28 +00:00
Jérôme Duval d0f06357f5 app_server FontManager: load all fonts and named-variants from a file
BFont::LoadFont can now use an index (0-based) and an optional named-instance (1-based)
to select the font variant from a file.
BFont::LoadFont can also use an index when loading from memory.

Change-Id: I0ce3eb6cc77d32cf43847416561eafe3063ca693
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7402
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Máximo Castañeda <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-03-01 18:04:33 +00:00
Jérôme Duval b3a7feb168 network/ping: remove workarounds for connect()
Change-Id: I42829566a0f449f1a46f029aaff577efb30ef79b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7477
Reviewed-by: waddlesplash <[email protected]>
2024-02-27 22:20:01 +00:00
Jérôme Duval e4efd92e78 ipv4 & ipv6: implement connect() by setting the socket's peer address
Change-Id: Ic0fdc3f1a880aaef9326d8d4bfb13199c1d61dd4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7476
Reviewed-by: waddlesplash <[email protected]>
2024-02-27 22:20:01 +00:00
Jérôme Duval d24476aaf0 device_manager: PCI_display is used for virtio gpu
the mapping was missing as noticed by Julian Harnath.

Change-Id: I8ea3420e1de543571daf82d8c16ec95ac3423826
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7431
Reviewed-by: waddlesplash <[email protected]>
2024-02-26 18:16:06 +00:00
Jérôme Duval 3bf4cdb73b network/ping: update to freebsd-current
* our ip modules don't support connect()/send(). Just use sendto().
* ping6 disappears, ping supports -4 or -6 to force IPv4 or IPv6

Change-Id: I1e982e354cc75d3a314c5bbbfffa0373e8f4d9af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7427
Reviewed-by: waddlesplash <[email protected]>
2024-02-26 14:06:29 +00:00
Jérôme Duval 01dc1ea4cf libbsd: add strtonum(), nitems(), timespec operation functions from FreeBSD
Change-Id: I56b677b382d17a27d243b615de19bec10f3a2810
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7426
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-02-26 14:06:29 +00:00
Jérôme Duval 4d6b8a5796 app_server: Switch default UI font to Noto Sans.
fixes #18793

Change-Id: If53229acd6c00e1a800c6808f3f0261ae59d99bb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7400
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: nephele nephele <[email protected]>
2024-02-13 12:01:31 +00:00
Jérôme Duval 0f792e577c BMenu: std::stable_sort uses a comparator function returning bool
thanks Madmax for the pointer.
fixes #18775

Change-Id: I1934c90a2976ce12c4aa8adb0205c48c239627d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7401
Reviewed-by: Adrien Destugues <[email protected]>
2024-02-12 09:48:53 +00:00
Jérôme Duval a1bc100a78 listusb: fix MaxPacketSize, display length
audio: fix zero divide, add missing newline
Change-Id: Ia7d0ae6e403938291471185b14e07dc3e0f90ef4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7369
Reviewed-by: waddlesplash <[email protected]>
2024-02-03 14:52:45 +00:00
Jérôme Duval 4a6a465c80 intel_extreme: for DDI, map the ddc pin to the GPIO
add port G for Gen12

Change-Id: I70bba2d6d2ec0fbad8bdbec14412ea982690d563
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5626
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-01-31 18:32:58 +00:00
Jérôme Duval b352d8ccd8 virtio_gpu: add the accelerant to the regular image
fix 32-bit warnings

Change-Id: If85acfce1ac93998c13e5d9fa2e02823e219e428
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7342
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: X512 X512 <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2024-01-24 09:54:55 +00:00
Jérôme Duval 591a1d179a AdapterIO: add FlushBefore() to strip the beginning of the MallocIO object
by default, AdapterIO is initialized with a BMallocIO object, which will
be extended indefinitely. Flushing regularly is necessary to avoid
excessive memory usage. Tested in StreamRadio.

Change-Id: I9f3142c0a2300ad44dc54ccf6932d41c9526320b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7302
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-01-23 09:49:17 +00:00
Jérôme Duval 0b733c9c80 virtio_gpu: initial driver
sample for qemu: -device virtio-vga,edid=on,xres=1024,yres=768 -display sdl
display mode can be set in the Screen preferences.

Change-Id: If1d6aeecb208ce7c62c42eea1a95c71237c4375a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7038
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2024-01-18 17:44:40 +00:00
Jérôme Duval 33fb08b1a5 ccp: add new IDs
Change-Id: Id9b2512d9f3b44d6ea25cb939dfd3054fe07600a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7338
Reviewed-by: waddlesplash <[email protected]>
2024-01-16 17:09:34 +00:00
Jérôme Duval 84cc2b9655 random: move virtio in a subdir
Change-Id: Idd776d6599613807c611cc6f72d8c1d2b9234946
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7337
Reviewed-by: waddlesplash <[email protected]>
2024-01-16 17:09:34 +00:00
Jérôme Duval 21d87cd45a app_server: recursive scan in /dev/graphics/
* /dev/graphics/virtio_gpu/0 is a valid entry
* app_server doesn't set the initial mode if it's identical; use
0x0 as initial resolution.

Change-Id: Ica0323e6c5d78b39f05499edc93fa9c949b97dc8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7037
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2024-01-16 07:09:47 +00:00
Jérôme Duval 77cf55c4ad kernel/vfs: create_vnode should also create non existing entries when traversing
Fixes #18355.

Change-Id: I96abb95c14a74bcf9fec802badeb16c978a3b3d1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6321
Reviewed-by: waddlesplash <[email protected]>
2024-01-10 17:43:46 +00:00
Jérôme Duval 96bad7685b PowerStatus: add state "Not charging"
some laptops decide to not charge a fast full battery to not consume a cycle.
In this discharging state, the current rate is zero, thus no time left can be computed.
We add a state "Not charging" to clearly differentiate and avoid user confusion.
PowerStatus was triggering low battery notifications, this is also fixed.

Change-Id: I4745c78eb0863ab01fe34cb065707d068cff0f0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7300
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-01-09 04:07:05 +00:00
Jérôme Duval fffd9d7dd4 AdapterIO: only for SEEK_SET is the position absolute
Change-Id: I8debbcc0a2d9e499bebcebe5361475737dc8f9f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7295
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-01-04 15:06:37 +00:00
Jérôme Duval e2f1a42ea9 acpi: add device tree attributes from _CLS if available
means B_DEVICE_TYPE, B_DEVICE_SUB_TYPE, B_DEVICE_INTERFACE.
_CLS is rare, it means I don't own devices with this attribute.

from the spec: _CLS:
Class Code – supplies OSPM with the PCI-defined class, subclass and programming interface for a device. Optional.

Change-Id: I4f7b7ed66cbe6b4ff4511cb13df2af218350a5d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7210
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2023-12-19 05:40:16 +00:00
Jérôme Duval e691cf1eed ffmpeg: avcodec_free_context seems to also free extradata
* context->extradata seems to be set to fExtraData or fInputFormat.MetaData().
Both are managed by us, so set context->extradata to NULL before freeing.
* avcodec_close() shouldn't use according to the documentation:
"Use avcodec_free_context() to destroy a codec context (either open or closed).
Opening and closing a codec context multiple times is not supported anymore – use multiple codec contexts instead."
* fix #18713

Change-Id: I820deefcffea52a39fcb7587153d40dc03c85024
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7208
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-12-15 07:55:38 +00:00
Jérôme Duval 1a7cf57024 usb_hid: the report value for an array is an index starting at the logical minimum
to be tested, related to bug #18641

Change-Id: I54b09001a7baf5e868eb5f26ca3064d4e6f31e53
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7069
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-12-11 18:17:06 +00:00
Jérôme Duval 9fb1ce2781 radeon: use the KernelStaticLibrary rule
to build with GCC 13 on x86

Change-Id: I1a79154e3c41a86e34542feff99f3b0a331ef8b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7188
Reviewed-by: waddlesplash <[email protected]>
2023-12-06 19:16:19 +00:00
Jérôme Duval 7be86b18a3 libgraphicscommon.a: use the KernelStaticLibrary rule
to build with GCC 13 on x86

Change-Id: Ic775196ffff556dd12381c7b374100bb46838973
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7187
Reviewed-by: waddlesplash <[email protected]>
2023-12-06 19:16:19 +00:00
Jérôme Duval ff45b65f4d acpi: use the KernelStaticLibrary rule
to build with GCC 13 on x86

Change-Id: If4e37cf5e15038169a16eab048cad4cd6b905707
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7186
Reviewed-by: waddlesplash <[email protected]>
2023-12-06 19:16:19 +00:00
Jérôme Duval f2acc47f43 acpi: update AcpiOsAcquireGlobalLock and AcpiOsReleaseGlobalLock
implementations from FreeBSD. Because the argument wasn't volatile,
the compiler wasn't considerung reading the lock content.
* fix the acquire and release loops:
The loop could be exited when any new values were read.
Instead the return value should be checked against the old value.

Old x86 gcc2 asm loop in AcpiOsAcquireGlobalLock:
   11660:       89 c8                   mov    %ecx,%eax
   11662:       f0 0f b1 1a             lock cmpxchg %ebx,(%edx)
   11666:       39 0a                   cmp    %ecx,(%edx)
   11668:       74 f6                   je     11660 <AcpiOsAcquireGlobalLock+0x20>

New x86 gcc13 asm loop in AcpiOsAcquireGlobalLock:

    4d58:       8b 11                   mov    (%ecx),%edx
    4d5a:       89 d0                   mov    %edx,%eax
    4d5c:       89 d3                   mov    %edx,%ebx
    4d5e:       83 e0 fc                and    $0xfffffffc,%eax
    4d61:       83 cb 03                or     $0x3,%ebx
    4d64:       f6 c2 02                test   $0x2,%dl
    4d67:       75 05                   jne    4d6e <AcpiOsAcquireGlobalLock+0x1e>
    4d69:       83 c8 02                or     $0x2,%eax
    4d6c:       89 c3                   mov    %eax,%ebx
    4d6e:       89 d0                   mov    %edx,%eax
    4d70:       f0 0f b1 19             lock cmpxchg %ebx,(%ecx)
    4d74:       75 e2                   jne    4d58 <AcpiOsAcquireGlobalLock+0x8>

Old x86 gcc2 asm loop in AcpiOsReleaseGlobalLock:
   11690:       89 c8                   mov    %ecx,%eax
   11692:       f0 0f b1 1a             lock cmpxchg %ebx,(%edx)
   11696:       39 0a                   cmp    %ecx,(%edx)
   11698:       74 f6                   je     11690 <AcpiOsReleaseGlobalLock+0x10>

New x86 gcc13 asm loop in AcpiOsReleaseGlobalLock:
    4d88:       8b 11                   mov    (%ecx),%edx
    4d8a:       89 d3                   mov    %edx,%ebx
    4d8c:       89 d0                   mov    %edx,%eax
    4d8e:       83 e3 fc                and    $0xfffffffc,%ebx
    4d91:       f0 0f b1 19             lock cmpxchg %ebx,(%ecx)
    4d95:       75 f1                   jne    4d88 <AcpiOsReleaseGlobalLock+0x8>

Change-Id: Ia55ba8666efe8b5c198a01db100b4747b72df4a0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7185
Reviewed-by: waddlesplash <[email protected]>
2023-12-06 19:16:19 +00:00
Jérôme Duval 153bb8ef67 Revert "ACPICA removed our cast we need for gcc 2.95.3"
This reverts commit fe0910891a.

Change-Id: I5887dcbfad83fb10978cd58bda5c2dc540226fe3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7184
Reviewed-by: waddlesplash <[email protected]>
2023-12-06 19:16:19 +00:00
Jérôme Duval a45709f630 Revert "ACPICA fixes for gcc2.95.3"
This reverts commit 3f6f7f7420.

Change-Id: If47a81ada6c7fe38c1e40bed4381a384ef25c050
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7183
Reviewed-by: waddlesplash <[email protected]>
2023-12-06 19:16:19 +00:00
Jérôme Duval 1b8870852e ffmpeg: fix leak when decoding audio frames
removing the memset in _DecodeSomeAudioFramesIntoEmptyDecodedDataBuffer fixes #18654
also free correctly resources in AVCodecDecoder destructor.

Change-Id: I2d6de6b50ba6767f669eb765dad96d28d43100fb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7108
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-11-14 23:13:51 +00:00
Jérôme Duval c7360f4b02 kernel/x86_64: on context switch, load defaults in fpu control and mxcsr
after a0131eaae2884fdced27158c3d34732d1656aca9 mxcsr was possibly also incorrect.
fpu control and mxcsr will be restored with fxrstor/xrstor.
no need to clear pending exceptions on #MF
fix #18656 (and #18624 after reverting).

Change-Id: I7dd5e2e4610747c5b82abd6c67e302d264b4be92
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7104
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-11-14 21:31:01 +00:00
Jérôme Duval 2d005cca08 ext2: implement set_flags
needed for fcntl(F_SETFL)

Change-Id: I2e71bcf70d794f690985e8c26ae1b0be51a0e590
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7094
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-11-08 13:39:21 +00:00
Jérôme Duval dd8a03b78d bootloader/x86: fix rdtsc for x86_64
should fix regression after hrev57346, see #18647
explained in details at https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html

Change-Id: Ic471c594b87da0bcee346db4a2f78ee1e1d59fe9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7093
Reviewed-by: waddlesplash <[email protected]>
2023-11-03 18:30:06 +00:00
Jérôme Duval 53e2dc0f85 kernel/x86_64: clear any pending exceptions on #MF
* also on x86 for simplicity.
* fixes #18624
* also makes x87 FPU data registers available for x87 floating instructions. EMMS is cheap.
see https://github.com/cloudius-systems/osv/commit/25209d81f7b872111beb02ab9758f0d86898ec6b

Change-Id: I5c1b399377102f3eb10bc6d7f7247afbaf6d8483
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7089
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-10-31 18:15:42 +00:00
Jérôme Duval 208006054c kernel/vm: put pages in order on the clear page queue
possibly help with #15789:
I was testing virtual_block devices with dd, and noticed it didn't work with higher block sizes.
Indeed the driver was passing a list of single pages, very inefficient. To be remarked is that
the physical pages were reversed in memory, causing get_memory_map to provide a map of single pages.
What happens: dd fills up the buffer from 0 until the block size, causing soft faults for still unmapped
pages. Each fault maps a cleared physical page out of the clear page queue. This means that some page runs
are actually put reversed in the clear page queue, which this commit fixes.

Change-Id: I36395849c7f13086b44a1b284cc0c858d8c29f75
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7081
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
2023-10-30 19:04:51 +00:00
Jérôme Duval 1a497824d8 ext2: recalculate extent metadata checksum each time the metadata changes.
this fixes an assert when reading extents written in Haiku.

Change-Id: Iba2cc3b35ed6886db0749a0f50b24053def5aac3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7079
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-10-30 09:16:07 +00:00
Jérôme Duval 6dd8733058 ext2: ext2_rename(): if the target exists, it should be unlinked.
* the target inode would still exist, unreferenced.
* also remove from entry_cache.
* this fixes fsck complaining about unreferenced inodes.

Change-Id: I4d48d6bf89bdd37d366da0ae4795e42bcc0532d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7078
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-10-30 09:16:07 +00:00
Jérôme Duval 7b97f05bb9 ext2: DirectoryIterator: the dotdot entry size is the entry block minus what comes before.
* the problem appears after the directory has been splitted.
* this fixes fsck complaining about an invalid directory entry.

Change-Id: I1566a279fc6438cb735439be002c634882e5a83b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7077
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-10-30 09:16:07 +00:00
Jérôme Duval 3319ef3f8e ext2: BitmapBlock::FindPreviousMarked(): index shouldn't go negative
fix #14404

Change-Id: I831c7d5cabbb804ab74d582caafb1d6cd281ca34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7076
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-10-30 09:16:07 +00:00
Jérôme Duval 8b5675204c virtio_block: serialize requests, copy using user_memcpy
fix #18621 #18286

Change-Id: Ia1ecb1b3623b10b42bf6153bdbabb7053179ee3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7048
Reviewed-by: waddlesplash <[email protected]>
2023-10-16 20:05:08 +00:00
Jérôme Duval 0decdc641e virtio_pci: fix support for MSI-X shared
remove support for MSI

Change-Id: I8049030b2febd3558a7710cfd89db03a17cb5f7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7036
Reviewed-by: waddlesplash <[email protected]>
2023-10-15 13:02:41 +00:00
Jérôme Duval 6d42b430d1 virtio: support modern devices
fixes #17239 #17238

Change-Id: Ia5b6347110a60fab18852079b30dca6301010474
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6995
Reviewed-by: Jérôme Duval <[email protected]>
2023-10-15 13:02:41 +00:00
Jérôme Duval efbeada748 gnu: add sched_getcpu()
on x86_64 implemented with rdtscp or rdpid, generically with a syscall.

Change-Id: I8f776848bf35575abec8a8c612c4a25d8550daea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6866
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-08-21 17:55:16 +00:00
Jérôme Duval 7713305bd2 pch_thermal: add Lewisburg and Wellsburg ids
Change-Id: I2acbec140d8d6155549b0c802f465f004a7a67ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6867
Reviewed-by: Adrien Destugues <[email protected]>
2023-08-21 12:32:11 +00:00
Jérôme Duval ef611e96c4 kernel/x86: also write the cpu number when the rdpid instruction is available
Change-Id: I5b37fe8aff9b4cf12fbd4dd60a91eb09f11f4e2b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6807
Reviewed-by: waddlesplash <[email protected]>
2023-08-10 16:35:03 +00:00
Jérôme Duval 67ee1d1a3e kernel/x86: don't load microcode on intel when already up to date
on Pentium Silver, loading the microcode on the boot cpu also updates the other ones.

Change-Id: Ifbd767e7d73fdbc8ae2bf0740fcce523e500de1b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6806
Reviewed-by: waddlesplash <[email protected]>
2023-08-10 16:35:03 +00:00
Jérôme Duval b761f9250a unix: respect MSG_DONTWAIT on recvmsg
fix #18548

Change-Id: I33f502c2a376be6dbdf913f9613aab9d4c5a3644
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6802
Reviewed-by: waddlesplash <[email protected]>
2023-08-09 17:10:28 +00:00
Jérôme Duval 3487453788 unix: respect MSG_DONTWAIT on sendmsg()
fix bug #18539

Change-Id: Id21362028287d1cbdac469226e6b52f4547a276f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6796
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-08-07 13:24:45 +00:00
Jérôme Duval 18d6122240 Terminal: support for underline color and styles
the text is now printed above the underline.

Change-Id: I1a3a7713bf514830106532e1534793e0fe158bc2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6706
Reviewed-by: waddlesplash <[email protected]>
2023-07-21 18:12:41 +00:00
Jérôme Duval 3801ec71a3 emuxki: use user_memcpy to read/write the user buffers.
* map registers kernel only.
* alloc buffer user only.
* may help with #18475 and #18467

Change-Id: I3f739b98e0ec2d07e83c15a614b8b1d1722025e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6657
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-06-26 10:05:47 +00:00
Jérôme Duval 9c4bd82612 ifconfig: check the family when different from AF_UNSPEC
fix #18443

Change-Id: I05df404311f7e2048b83d5c4ebfdf8e1b0fc64c0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6597
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-06-12 14:07:07 +00:00
Jérôme Duval 47b66bb676 loopback_frame: when the interface address isn't set, use the destination
fix #18429

Change-Id: Ifd0a15e052bbde9eb3d8875249e03152e6292994
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6482
Reviewed-by: waddlesplash <[email protected]>
2023-05-30 16:15:49 +00:00
Jérôme Duval 7c18d58f2b usb: explore on BusManager::Start()
registering new devices requires the device_manager lock. The explore thread would wait
that the initial device scan is over to register devices.

Change-Id: I46529ab0926f349023f06ada3411979c0950dfcf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6475
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-05-29 18:11:26 +00:00
Jérôme Duval 840faa402b strace: add network definitions
move select/poll to network.cpp

Change-Id: Ie70b2f5ae890b69db633ea5f45d2e8f0a2441a13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6468
Reviewed-by: waddlesplash <[email protected]>
2023-05-23 18:41:51 +00:00
Jérôme Duval ec97248c2a tcp: handle linger with zero timeout
ReadData() should return the current error on closed state, not always not connected.

Change-Id: I286ac1dd9ded127e8658ceb61088783b9993eacf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6459
Reviewed-by: Rene Gollent <[email protected]>
2023-05-19 18:55:04 +00:00
Jérôme Duval 740f3ca4ae net_socket: binding on the same socket should return an error
Change-Id: I7b948435f6e4009d9c11d2163172ad0ab6484e1d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6458
Reviewed-by: waddlesplash <[email protected]>
2023-05-19 18:55:04 +00:00
Jérôme Duval e5f221f598 ipv4: bind() should return EADDRNOTAVAIL when the address isn't available
"EADDRNOTAVAIL: The specified address is not available from the local machine."

Change-Id: Ic306acc60459f5b518eb53f4123c5e3a255b178e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6457
Reviewed-by: waddlesplash <[email protected]>
2023-05-19 18:55:04 +00:00
Jérôme Duval b7d9790fc2 unix: accept() shouldn't return B_TIMEOUT but B_WOULD_BLOCK
it's already handled when breaking the loop.

Change-Id: I47aa8105ff32e97aa4e1c0b2e9292e4516ee155a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6456
Reviewed-by: waddlesplash <[email protected]>
2023-05-19 18:55:04 +00:00
Jérôme Duval fc13358aca net_socket: getpeername: IsConnected() when parent is not set
this fixes a test in libuv

Change-Id: I3002f9c44794ff3f8215ebc000fefa0f90b80279
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6455
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-05-19 18:55:04 +00:00
Jérôme Duval 9c1af36c30 tcp: report disconnected events for tcp
* FIONREAD shouldn't report errors, only EINVAL when listening
* read available data in closing and closing-wait states
* fix #18327

Change-Id: Idd53a043a72ef6c7b282ea669895ff2e947adbb4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6420
Reviewed-by: waddlesplash <[email protected]>
2023-05-19 18:55:04 +00:00
Jérôme Duval 30d2a5e189 kernel/fifo: just send a disconnect for readers without writers.
just send an error for writers without readers

Change-Id: I4808e5dec29c840b72423a1bb10cb8f0ebc23bb5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6419
Reviewed-by: waddlesplash <[email protected]>
2023-05-19 18:55:04 +00:00
Jérôme Duval 030814a8fc kernel/wait_for_objects: make select() watch more events
read: read + disconnect + error
write: write + error

Change-Id: I68a0cfc47b155d56a69e459f0dda1736c3a2a215
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6418
Reviewed-by: waddlesplash <[email protected]>
2023-05-19 18:55:04 +00:00
Jérôme Duval 702e7b011c kernel/fifo: fix commands like "tail -f file | grep"
'tail' selects read events on its write-only file descriptors,
so let's use B_SELECT_READ only for read-write file descriptors.

Change-Id: I5bb3837f82a7b06ec367fe871c15d67beb2d412c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6417
Reviewed-by: waddlesplash <[email protected]>
2023-05-19 18:55:04 +00:00
Jérôme Duval fa82fcc532 ifconfig: check the family is available
* fixes #6489
* fixes 64-bit warnings

Change-Id: I6ddfee8ec418881fddc0561b8b464a7d739dec9e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6454
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-05-19 15:35:00 +00:00
Jérôme Duval 4e9653027d net_stack: for local delivery, also capture packets when enabled
the packet capture expects frames: prepend an ethernet header for the capture.

Change-Id: I3d09da2a5a6924a545cc4fbc9dd1577bd3248226
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6452
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-05-19 15:33:09 +00:00
Jérôme Duval e2b57695fc loopback_frame: apply an ethernet header for packet capture
* the packet capture expects frames, so loopback_frame should actually apply framing and deframing
for loopback packets.
* datalink: set the address for host routes
* device_interfaces: call the deframing if any in device_enqueue_buffer()
tested with ping 127.0.0.1 and ping6 ::1, while removing the local flag on both routes.

Change-Id: I2085735bdac3bb85908189a2e1acb2540818c7bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6451
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2023-05-19 15:33:09 +00:00
Jérôme Duval 9ef39f3c0c icmp6,ipv6_datagram: disable tracing
Change-Id: Idb7593c3463c79dc4caff27b427e970c7fe94a8b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6453
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-05-19 12:21:20 +00:00
Jérôme Duval bd7bb43761 PCI_x86: remove
Change-Id: I54335b6390dc5e312225a3100fd88d4e49838d35
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6331
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-04-25 15:54:32 +00:00
Jérôme Duval 2982f45075 freebsd_network: drop PCI_x86
Change-Id: Ie185f63b56bc564b794e5900609fe9f0465de602
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6330
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-04-25 15:54:32 +00:00
Jérôme Duval 7c58a5a3fb tcp: avoid overflow of the advertised window with window scaling enabled
tcp_segment_header.advertised_window is 16 bits.

Previously, instead of using the maximum window, zero would be sent, thus
the partner wouldn't send anything.

fix #18337

Change-Id: Ibff98ee58b84bdf52527a7821648a5faf20c5589
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6359
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-04-16 18:53:41 +00:00
Jérôme Duval fc5d11e9ab busses: remove unneeded PCI_x86.h
Change-Id: Ia231eadc02856f68daa0184c12e7d54853ac9322
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6326
Reviewed-by: Jérôme Duval <[email protected]>
2023-04-11 15:01:20 +00:00
Jérôme Duval 6239b2a907 libroot/glibc: apply upstream fix for printf_fphex: Fix up long double fphex.
https://github.com/bminor/glibc/commit/a53b7a4e4b39d90f5964841c63492cf233aa17b8
fix #18353
2023-04-09 18:38:30 +02:00
Jérôme Duval 8aadf2e84a setvolume: implement some common features
unmute when increasing volume, mute at the minimum volume, don't decrease volume when muted

Change-Id: Ifd671b2a8d7d8a4da2bc15adc18f9aa7c46e66d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6017
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-02-16 11:40:17 +00:00
Jérôme Duval 042c401bb0 intel_extreme: add PCI ids for Haswell ULT GT1 Mobile
for bug #18215

Change-Id: If49bc262d0c5eb7082fb749222ca6534d5c55aa3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5991
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2023-01-13 05:48:37 +00:00
Jérôme Duval 37223744b7 kernel/x86: add a hybrid type per cpu, to be dumped when the feature exists.
for AlderLake CPUs

Change-Id: I4beba04e3ac95d7564684ee86de99c894b57a15c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5988
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2023-01-10 20:40:11 +00:00
Jérôme Duval 42aa87de9e asus-wmi: always pass five arguments for WMI calls
Some laptops like G713QM-HX121 or FX705DY have an ACPI WMI DSL, which evaluates five arguments
for all method IDs similar to
https://github.com/torvalds/linux/commit/98e865a522983f2afde075648ec9d15ea4bb9194
but with 5 arguments:

        Method (WMNB, 3, Serialized)
        {
            P8XH (Zero, 0x11)
            CreateDWordField (Arg2, Zero, IIA0)
            CreateDWordField (Arg2, 0x04, IIA1)
            CreateDWordField (Arg2, 0x08, IIA2)
            CreateDWordField (Arg2, 0x0C, IIA3)
            CreateDWordField (Arg2, 0x10, IIA4)
            Local0 = (Arg1 & 0xFFFFFFFF)

Patch to fix proposed by Reijo F from russian haiku os chat on #18189

Change-Id: I4536029600e6e9608aceafa45b36af8f0ffe35b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5977
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2023-01-02 15:00:19 +00:00
Jérôme Duval c9e5ef8796 strace: shows values for create_pipe and socketpair.
Change-Id: I45ee381044b2e3d4ff0ed1daa61ac5bab949bcdb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5390
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-12-24 09:40:21 +00:00
Jérôme Duval 3b8430dfcf strace: add an option to filter syscalls by name or by type
the type lists are hardcoded for now.

Change-Id: Iae89046ee52d3812354de619bfd9625217479c49
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5597
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-12-23 09:57:37 +00:00
Jérôme Duval 2c08dd5bc5 bus/USB.h: header for usb device items
Change-Id: Ic36733af169948f54d7d938dfab1cb5aeb34ab9a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5956
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-12-22 17:43:32 +00:00
Jérôme Duval 8b26b08a34 listdev: list USB devices too
Change-Id: I14c626b6a37c95196ce87ec6b1bbb76ff14cdb4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5955
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-12-22 17:43:32 +00:00
Jérôme Duval d9f90ce7f3 Shortcuts: provide some default actions for mute, increment and decrement volume media keys
Works for HID-aware devices (USB & PS/2).

Change-Id: I45e9ededaab1699f30e55fb644ec0e3ceebeb191
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5937
Reviewed-by: Adrien Destugues <[email protected]>
2022-12-19 13:51:02 +00:00
Jérôme Duval c44b267fb3 ps2: switch to HID keycodes for media/acpi keys
reference: http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf
I tested volume keys successfully.

Change-Id: I2649eb7829bcc9bfdbef26ae4a36179505aec56a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5944
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-12-19 13:51:02 +00:00
Jérôme Duval 6e0950ff9f Shortcuts: accept consumer keys for shortcuts
for now the hexadecimal code will be displayed.

Change-Id: Id5594f2d806cbd391ece8740332947e92814e238
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5915
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-12-19 13:51:02 +00:00
Jérôme Duval 6333726b2e setvolume: add options to mute, increment, decrement the master volume
also set the background flag

Change-Id: Ie198476d666a0cd290520d15534afa3a73cf8a1f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5936
Reviewed-by: Adrien Destugues <[email protected]>
2022-12-17 15:19:26 +00:00
Jérôme Duval 7fb137c2b2 efi/x86_64: skip reserved memory blocks when finding out the memory top
fix #16712

Change-Id: Ib2ae08bc47008098a6b0c231a759d5e91f88fd33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5912
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-12-15 04:11:35 +00:00
Jérôme Duval 76ddb69a3a usb_raw: abort transfers cleanly on kill, fix use-after-free
* aborted transfers will release the notify semaphore when the cancel is notified.
* the allocated buffer would be freed on return, while the usb stack eventually copied
data in the buffer in our back, leading to KDL crashes, because the freed buffer would
be right reallocated for some kernel team structures.
* regression introduced by hrev55806, the transfers didn't need to be cancelled before.

Change-Id: Ifb6e941f71d05c37c36f878059c33883bb72a67c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5905
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-12-14 04:53:09 +00:00
Jérôme Duval fb69e06195 kernel: load cpu amd microcode update if loaded by the bootloader
we detect basically the cpu info before loading the microcode,
to be able to detect the vendor, and avoid any update on hypervisor.

I couldn't test because my cpu doesn't have any update available.

Change-Id: I6aea830158423b3ee13b640be8a788fc9041e23c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5859
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-11-30 08:50:59 +00:00
Jérôme Duval 616edea7fb boot_loader: load amd microcode update data file
switched to non-packaged paths

Change-Id: I331d4d6ed1af1ce6fa68109c9c6baf4a92bdc7b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5858
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-11-30 08:50:59 +00:00
Jérôme Duval 652d5f6347 ccp: driver for the RNG part of CCP on AMD
the entropy source is read every second and pushed to the PRNG.
the PCI device is tested, not the ACPI.

Change-Id: I9bb6b21c7189b28a1d8a624d83b33ff6682152dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5825
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-11-28 13:33:01 +00:00
Jérôme Duval bce7dc883a silicon_image_3112: use kernel read/write protection for map_physical_memory
Change-Id: I04655afb3f552e5919923ab96f96f32d0f8db6b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5834
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-11-27 17:06:27 +00:00