Commit Graph

2620 Commits

Author SHA1 Message Date
Daniel Martin 370dde2255 CPUID returns CPU Features in EDX and extended features in ECX
No functional changes

Change-Id: I98a9e5c9658a5464ba6fa71bc5d2c5d646a57ab1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7672
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-05-17 17:25:26 +00:00
Augustin Cavalier d3192e1006 kernel/util: Adjust includes of VectorMap.
This way it can be included even if "util" isn't in the header search
path.
2024-04-26 16:21:19 -04:00
milek7 6034ee94a2 arm64: Use WFI for idling
Change-Id: I00f17c1db7c032879da59d17c67c13c24e0b9ef8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7519
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2024-03-12 20:44:21 +00:00
milek7 51edf9322c arm64: Save/restore TPIDR_EL0 in _arch_context_swap
It's not used for anything by the OS but userspace might want
to use it for its own purposes.

Change-Id: Icda4bcd6de9d68596555e81293c8bd075f80a2a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7511
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-03-07 15:53:37 +00:00
milek7 06fae14eb9 arm64: Save/restore FPU state when handling IRQ or syscall
Change-Id: I8b2a36d57f410c0d06ca5ce90d1b997494072c94
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7510
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-03-07 13:28:27 +00:00
X512 02463fb461 kernel/int: consolidate interrupt vector number to `int32`
This is no-op for 32 bit platforms because `int32` is defined as `long` there.

Change interrupt vector number from 64 bits to 32 bits for 64 bit platforms.

Change-Id: I52d1ad616cab16488804e9733c7afaf772a670ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7507
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2024-03-06 16:03:45 +00:00
X512 629f071bb9 pci: extend MSI interrupt vector number to 32 bits
Also increase MSI message data size to 32 bits according to PCIe spec.

Remove 0xff check for MSI interrupts because it is potentially valid
interrupt vector number. Reject 0xff only for legacy pin interrupts.

- MSI-X supports up to 2048 interrupts per device that do not fit to
`uint8`.

- Non-x86 systems may use separate interrupt vector ranges for
hard-wired interrupts and MSI interrupts so `uint8` is not enough to
represent all of them.

Change-Id: Iaf9ffb197ec23db0f97ffe3ea756d28d7bfc8705
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7433
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-02-28 23:17:42 +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 <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-14 21:31:01 +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 25209d81f7

Change-Id: I5c1b399377102f3eb10bc6d7f7247afbaf6d8483
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7089
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-10-31 18:15:42 +00:00
Augustin Cavalier bb2808d615 bootloader: Implement TSC calibration via hypervisor CPUID leaf.
While debugging some problems on the HaikuPorts build VMs, mmlr
noticed their clocks had an alarming amount of drift. This prompted
an investigation into TSC calibration mechanisms, and the discovery
that there is a VM-specific one which we did not implement.

This mechanism is more accurate than counting cycles on VMs where
cycles can be "stolen" (the probable cause of the aforementioned
clock drift.)

Tested in VMware (works out of the box) and on QEMU/KVM
(may need TSC frequency specified or a host with invariant TSC.)

Change-Id: I4ccfdb2e4e2621404ec9026e7106c02bf96faf18
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7063
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-10-25 00:53:55 +00:00
Augustin Cavalier 5c32c5ef2f condition_variable: Reorder members for optimal sizing.
Class size now 48 instead of 56 bytes (on x86_64.) No functional change.
2023-10-09 21:08:53 -04:00
Augustin Cavalier 788b1b12b6 Get rid of kernel_c++_structs mechanism.
This undoes fc7864091e.

It was only ever used by the FreeBSD compatibility layer,
only supported one structure, and created problems with
concurrent builds.
2023-10-09 20:26:21 -04:00
Yn0ga cbb88108d5 Various PowerPC fixes
* Removed atomic operations placeholders for modern ones
* Fix chrpscript & hfsmaps location for CDBootImage (haiku-boot-cd target)
* add of_blocks & of_blocksize openfirmware call

Change-Id: Iaaddc2c566d108976ac5e5e08caea1fc59523e06
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6987
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-10-06 20:38:24 +00:00
Augustin Cavalier ef9e2f627b kernel/arch: Make arch_debug_get_caller() a macro implemented by a builtin.
Only the x86 and PPC implementations look like they would have worked,
while the builtin is available and will work across all architectures.
We already use it unconditionally in some parts of libroot.

Change-Id: I2dffb3b2c7cdd605092382b9d649151adb921bb4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6942
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-09-23 18:41:04 +00:00
David Karoly dc3b3e172d m68k: VMTranslationMap.h is not needed in arch_vm.h
Change-Id: Ica0efdeabaa73be0030e0522352c0c3bf311a9ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6913
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-09-17 19:12:33 +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 <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-08-21 17:55:16 +00:00
Trung Nguyen 303ff56a5f unix: Implement SO_RCVBUF
Implemented `UnixBufferQueue::SetCapacity` so that `setsockopt`
with `SO_RCVBUF` will not always return an error.

Change-Id: I2d9be84633f84474fac64b379e9f89ef2751a094
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6816
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-08-13 21:14:51 +00:00
Augustin Cavalier 9b28ebf997 DoublyLinkedQueue: Rework Remove() function.
Equivalent to the changes done to DoublyLinkedList
(in 904e9f5512305dbc0eed9146e8a0b2d597269b71.)
2023-08-04 13:25:56 -04:00
Augustin Cavalier 74662b662d DoublyLinkedQueue: Adjust API to match that of DoublyLinkedList.
It appears nothing actually uses this method anyway.
2023-08-04 13:17:18 -04:00
Augustin Cavalier 65c74c6474 DoublyLinkedQueue: Adjust whitespace.
No functional change.
2023-08-04 13:11:52 -04:00
Augustin Cavalier 904e9f5512 DoublyLinkedList: Rework Remove() function.
* Check fFirst/fLast instead of previous/next. Avoids
   list corruption when trying to remove already-removed
   elements, instead will cause null-dereference KDL.

 * Always set next/previous to NULL even when DEBUG is not
   enabled.
2023-08-03 13:18:26 -04:00
Augustin Cavalier 5ae1a17908 Revert "DoublyLinkedList: Add a RemoveAllBefore convenience function."
This reverts commit c6cd9b51a2.

This wound up being unnecessary for the event_queue implementation,
and furthermore is of dubious value in general.
2023-08-03 12:45:36 -04:00
Augustin Cavalier f66d2b46a8 kernel: Add event queue implementation to wait for objects efficiently.
Based on hamishm's original patch from 2015, but heavily modified,
refactored, and reworked.

From the original commit message:

> When an object is deleted, a B_EVENT_INVALID event is delivered,
> and the object is unregistered from the queue.
>
> The special event flag B_EVENT_ONE_SHOT can be passed in when adding
> an object so that the object is automatically unregistered when an
> event is delivered.

Modifications to the original change include:

 * Removed the public interface (syscalls remain private for the moment)

 * Event list queueing/dequeueing almost entirely rewritten, including:
  - Clear events field when dequeueing.

  - Have B_EVENT_QUEUED actually indicate whether the event has been
    appended to the linked list (or not), based around lock state.
    The previous logic was prone to races and double-insertions.

  - "Modify" is now just "Deselect + Select" performed at once;
    previously it could cause use-after-frees.

  - Unlock for deselect only once at the end of dequeue.

  - Handle INVALID events still in the queue upon destruction,
    fixing memory leaks.

 * Deduplified code with wait_for_objects.

 * Use of C++ virtual dispatch instead of C-style enum + function calls,
   and BReferenceable plus destructors for teardown.

 * Removed select/modify/delete flags. Select/Modify are now the same
   operation on the syscall interface, and "Delete" is done when 0
   is passed for "events". Additionally, the events selected can be fetched
   by passing -1 for "events".

 * Implemented level-triggered mode.

 * Use of BStackOrHeapArray and other convenience routines in syscalls.

Change-Id: I1d2f094fd981c95215a59adbc087523c7bbbe40b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6745
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-07-29 15:53:15 +00:00
Augustin Cavalier f64c46e636 kernel & libroot: Implement per-team unnamed semaphores.
This requires breaking syscall ABI to add the "flags" parameter
to _kern_mutex_sem_release.

Resolves a TODO.
2023-07-25 16:26:22 -04:00
Augustin Cavalier aca21731ff kernel/condition_variable: Return the count of unblocked threads from Notify.
No reason not to, and it's needed in user_mutex to avoid a very rare
potential race, anyway.
2023-07-25 15:27:40 -04:00
X512 0235c04759 util/Bitmap: add more utility methods
Change-Id: I021c2fafa01266e8a38c1cb2fd748fd89a4b75bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6742
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-07-24 21:00:56 +00:00
Augustin Cavalier c6cd9b51a2 DoublyLinkedList: Add a RemoveAllBefore convenience function.
Extracted from hamishm's event queue patches.
2023-07-24 16:09:42 -04:00
Augustin Cavalier a2efc7ec03 AVLTree: Unify removal implementations.
Extracted from hamishm's eventqueue patches.
2023-07-24 16:09:21 -04:00
X512 1d9ad3fad7 mmu/riscv64: implement global page mapping support
ASID allocation is not supported yet, so always use ASID 0 for user pages for now.

Change-Id: I021e77dae692c22984bc625dd0588362bece45b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6698
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-07-11 17:34:31 +00:00
Augustin Cavalier 30fda09a95 kernel: Rewrite KDEBUG_RW_LOCK_DEBUG.
Previously this just turned the rw_lock into the equivalent of a
recursive_lock, which meant that reader vs. writer assertions
were of no use.

Now, we have a per-thread static array which stores the held read
locks, allowing ASSERT_READ_LOCKED_RW_LOCK to work properly,
and allowing multiple readers to be active at a time.

This probably should still remain disabled even on nightly builds,
but at least it's much more useful as a debugging tool than it was
beforehand.

Change-Id: I386b2bc2ada8df42f4ab11a05563ef22af58e77f
2023-06-29 21:04:40 -04:00
Niels Sascha Reedijk 3fb092979e kernel: provide kernel-level equivalents for math.h and stdlib.h
GCC 13 is more strict about what C++ features are available in a freestanding
(= build without standard library) build. The `stdlib.h` and `math.h` headers
are redefined as part of libstdc++. If the object is built as freestanding, it
should be assumed that none of the standard library functions are available.

The solution in Haiku has been to add part of the standard library into the
kernel shared object. The method of exposing them has been to allow the
use of `stdlib.h` and `math.h` in the kernel and in kernel add-ons.

This change allows that approach to continue. What it does, is that it defines
specific headers which will be picked up when a module is built using private
kernel headers. When building for the kernel (or for the boot module), it will
bypass GCC 13's libstdc++ default behaviour of not including the POSIX/platform
header with all the function definitions.

An alternative to be considered for the longer term is to specifically define
the parts of the C/C++ standard library that is available in the kernel in
these headers, or create custom headers when building kernel modules (which is
how Linux approaches it).

Change-Id: Icab4614f642219fa77732b02401570708ee9a963
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6645
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-06-28 07:11:17 +00:00
Augustin Cavalier 70e8eacb35 kernel: Implement realloc_etc and make use of it. 2023-06-19 16:33:22 -04:00
Trung Nguyen bdcc293fa8 kernel/vm: handle page protections in cut_area
- Resize the `page_protections` array in `cut_area` and also shift
the bits if necessary.
- Set the correct protection array as well as the real page
protections for the second area produced by `cut_area`.

Change-Id: I62293480487e869420ebe5a3bc729cec2a14c687
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6395
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-06-19 15:59:11 +00:00
Augustin Cavalier 93d7d1c52c user_mutex: Per-team contexts.
This requires the introduction of the flag B_USER_MUTEX_SHARED, and then
actually using the SHARED flags in pthread structures to determine when
it should be passed through.

This commit still uses wired memory even for per-team contexts.
That will change in the next commit.

GLTeapot FPS seems about the same.

Change-Id: I749a00dcea1531e113a65299b6d6610f57511fcc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6602
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-06-19 14:56:10 +00:00
David Karoly b799d160f2 kernel/arm/paging: implement Modified Flag
* Introduce SWDBM flag similarly to the arm64 port
* Reuse TEX[2] for SWDBM flag which should be availble
  to be used by the operating system if TEX remap
  is enabled.
* Introduce SetAndClearPageTableEntryFlags for updating
  accessed and modified flags atomically
* Startup sequence is handled similarly to accessed flag, i.e.
  set Modified flag in initially mapped pages in bootloader and early map.
* Once the kernel initialization has progressed enough,
  pages are mapped as read-only and modified flag handling is done
  in the page fault handler.

Change-Id: I8f761e2c6325d1b91481abd569d5e8befded0761
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6518
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-06-18 11:18:24 +00:00
Augustin Cavalier 6554d7448d kernel: Print the first 4 chars of cvar names in KDL "threads" command.
Condition variables are now a pretty common way the kernel blocks threads.
That means the "threads" command was getting difficult to navigate, since
at any given time, a lot of threads could be blocked on "cvar".

Now we try (carefully, because it could fault!) to fetch the first 4
characters of the "type" name and display then. This suffices to
distinguish the most common object block types in the list at a glance
(e.g. "cvar:port" for port reads, the most common.)

Change-Id: I94f4b59fd78b7ebdce913944551a5e98f0ca2e33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6605
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-06-13 19:41:07 +00:00
PulkoMandy 37e1b12911 framebuffer: report display EDID data
This allows to see the display in Screen preferences, and know its DPI
and physical size (as much as EDID data can be trusted). This
information could be used to compute the default font size, for example,
so it's important that all drivers provide it whenever possible.

Change-Id: Ic3d04e53cf5fcb24e22d35661d2b364a257947da
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6576
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-06-11 11:23:01 +00:00
Augustin Cavalier 6f3f29c7dd user_mutex: Refactor locking and unblocking mechanism.
Suppose the following scenario:

1. Thread A holds a mutex.

2. Thread B goes to acquire the mutex, winds up in kernel waiting.

3. Thread A unlocks; first unsets the LOCKED flag.
   As WAITING is set, it calls the kernel; but instead of processing
   this immediately, the thread is suspended for any reason (locks,
   reschedule, etc.)

4. Thread B hits a timeout, or a signal. It then unblocks in the kernel,
   which causes the WAITING flag to be unset.

5. Thread C goes to acquire the lock. It sets the LOCKED flag.
   It sees the WAITING flag is not set, so it returns at once,
   having successfully acquired the lock.

6. Thread A, suspended back in step 3, resumes.

Now we encounter the problem. Under the previous code, the following
would occur.

7. Thread A sees that no threads are waiting. It thus unsets the LOCKED
   flag, and returns from the kernel. Now we have a mutex theoretically
   held by thread C but which (illegally) has no LOCKED flag set!

8. Some other thread tries to acquire the lock, and succeeds, for LOCKED
   is not set. We now have one lock owned by two separate threads.
   That's very bad!

The solution, in this commit, is to (1) switch from using "atomic_or"
to lock mutexes, to using "atomic_test_and_set", and (2) mandate that
_kern_unblock_mutex must be invoked with the mutex already unlocked.

Trying to solve the problem with (2) but without (1) produces other
complications and would overall be more complicated. For instance,
all existing userland code expected that it would set LOCKED, but then
check LOCKED|WAITING. If _kern_mutex_unlock does not unset LOCKED,
then whichever thread sets LOCKED when it was previously unset is
now the mutex's undisputed owner, and if it fails to notice this,
would deadlock.

That could have been solved with extra checks at all lock points, but
then that would mean locks would not be acquired "fairly": it would
be possible for any thread to race with an unlocking thread, and
acquire the lock before the kernel had a chance to wake anyone up.

Given how fast atomics can be, and how slow invoking the kernel is
comparatively, that would probably make our mutexes extremely "unfair."
This would not violate the POSIX specification, but it does seem like
a dangerous choice to make in implementing these APIs.

Linux's "futex" API, which our API bears some similarities to, requires
at least one atomic test-and-set for an uncontended acquisition,
and multiple atomics more for even the simplest case of contended
acquisition. If it works for them, it should work for us, too.

Fixes #18436.

Change-Id: Ib8c28acf04ce03234fe738e41aa0969ca1917540
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6537
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-06-08 16:49:05 +00:00
Augustin Cavalier 0450e7b802 USB: Acquire the device manager lock before Explore.
We must do this to prevent lock order inversion: when busses are
initialized, they are started by the (locked) device manager, and
then acquire the explore lock. We must do the same in Explore itself,
for when called by the explore thread, we would otherwise first acquire
the explore lock, then (when publishing new nodes) acquire the device lock.

Should fix #18421 and #18393.
2023-05-31 16:49:41 -04:00
Augustin Cavalier cb1df90e30 Revert "kernel/vm: handle page protections in cut_area"
This reverts commit de07bc3fa5.

That's what I get for fixing bugs on test branches.
2023-05-31 14:48:23 -04:00
Trung Nguyen de07bc3fa5 kernel/vm: handle page protections in cut_area
- Resize the `page_protections` array in `cut_area` and also shift
the bits if necessary.
- Set the correct protection array as well as the real page
protections for the second area produced by `cut_area`.

Change-Id: I62293480487e828970ebe5a3bc729cec2a14c687
2023-05-31 14:47:40 -04:00
Trung Nguyen bfd3d33765 strace: Print detailed signal information
- Add support for retrieving the `siginfo_t` structure of a signal
event from the Debugger API.
- Add code to `strace` to display this information every time a
signal event occurs, similar to the Linux `strace` tool.

Change-Id: If4e92bbae049ee0b52efaf9fc911d66511da62f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6393
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-31 16:34:12 +00:00
Augustin Cavalier 55a468820c USB: Support physical-vector bulk requests.
Introduce a new utility method, "generic_memcpy", which takes
generic_addr_t plus indications of whether these specify virtual or
physical addresses (and potentially user addresess) and calls the
appropriate memcpy variant depending.

All bus drivers adjusted to support this at once. We don't actually
take advantage of the physical addresses in any way (yet), as USB
controllers have some pretty specific requirements that would have
to be carefully validated to use these directly.

All bus drivers tested and confirmed to still be working.

Change-Id: I66326667e148091147bb2b3d0843a26fb7e5bda6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6479
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-30 17:54:28 +00:00
Augustin Cavalier 65cdc13e7d kernel: Migrate struct generic_io_vec to a private header outside src/.
This way it is more easily accessed from drivers outside the kernel,
which it soon will be, without having to add an explicit UseHeaders.
(The drivers that use it already all use the IOScheduler.)

No functional change.

Change-Id: Ibc2d2678e37d9d7ab73391cb17b72cca86f92132
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6477
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-30 17:54:28 +00:00
Augustin Cavalier e223e8e94b kernel/x86: Initialize IO-APIC only after PCI enumeration is complete.
Before the PCI refactor, PCI initialization/enumeration occurred
immediately after the PCI module was loaded, and so by the time
we got to IOAPIC initialization, it was already complete.

After the refactor, PCI enumeration is deferred until slightly later,
and so we would try to initialize IO-APICs without knowing PCI
information. This would fail, as read_irq_routing_table needs to
have that available.

Hopefully fixes #18425, #18393, #18398.

Change-Id: I1e4b06367da26eeb10085a1c6322ed39885b632b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6476
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-29 19:44:32 +00:00
Trung Nguyen b809279cd8 kernel/team: Allow retrieving more attributes
- Stored the additional start time of each team, expressed by
milliseconds since boot.
- Added more fields to the `team_info` structure. These field
include those provided by the `get_extended_team_info` syscall as
well as the newly introduced `start_time`.
- Extended the `_kern_get_team_info` system call to receive an
additional `size_t` argument. If this size is smaller than or
equal to the size of the old `team_info` structure, the newly
added attributes will not be retrieved.

Change-Id: I22ee6b91ad2ee3b66a7f770036c79a718c5f115c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6390
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2023-05-17 11:07:14 +00:00
David Karoly 84745ade1b kernel/arm/paging: use simplified permission model
Change-Id: Ie0ed357ee9ca5bee4c10c6cbf74eaba77acdd179
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6435
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2023-05-16 18:07:45 +00:00
X512 6550124ea0 riscv64: implement memory barriers
Change-Id: Ied9e6dad38968cee6e828dff6ec413e6281086cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6436
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-05-10 20:55:18 +00:00
David Karoly 6c58b765f3 kernel/arm: use inline functions for accessing coproc registers
Change-Id: I626ef5722f4ae043de9e8b0c37dbde97ac0513be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6422
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-05-09 20:50:42 +00:00
Augustin Cavalier 0c2a5bb5ea Replace the "tty" driver with a "pty" driver.
This new driver uses the "generic" TTY layer, unlike the old driver
which had its own implementation (which the generic module was derived
from, originally.)

The remaining bits of support for controlling TTYs is added to the kernel &
generic layer at the same time, which should allow for serial interfaces
to be controlling terminals now, as well.

Tested with bash, nano, vim; all seems to still be working as expected.
2023-05-09 16:04:09 -04:00