USB driver polling user app, handle only one XHCI controller for now, Implement USB device addressing
All checks were successful
Build ISO image / build-and-deploy (push) Successful in 3m47s
Build documentation / build-and-deploy (push) Successful in 2m38s

This commit is contained in:
2026-03-29 18:59:20 +02:00
parent 69f063198a
commit 482afb47d7
22 changed files with 383 additions and 56 deletions

View File

@@ -1,5 +1,6 @@
#include <aux/compiler.h>
#include <device/device.h>
#include <device_info.h>
#include <fs/path.h>
#include <fs/vfs.h>
#include <libk/assert.h>
@@ -1076,6 +1077,26 @@ DEFINE_SYSCALL (sys_get_proc_info) {
return SYSRESULT (proc_populate_proc_infos (infos, infos_count));
}
/* int get_device_info (struct device_info* infos, size_t count) */
DEFINE_SYSCALL (sys_get_device_info) {
uint64_t fp;
uintptr_t uvaddr_infos = a1;
size_t infos_count = (size_t)a2;
spin_lock (&proc->lock, &fp);
struct procgroup* procgroup = proc->procgroup;
spin_unlock (&proc->lock, fp);
struct device_info* infos =
sys_get_user_buffer (procgroup, uvaddr_infos, infos_count * sizeof (struct device_info));
if (infos == NULL)
return SYSRESULT (-ST_BAD_ADDRESS_SPACE);
return SYSRESULT (device_populate_device_infos (infos, infos_count));
}
static syscall_handler_func_t handler_table[] = {
[SYS_QUIT] = &sys_quit,
[SYS_TEST] = &sys_test,
@@ -1114,6 +1135,7 @@ static syscall_handler_func_t handler_table[] = {
[SYS_STREAM_WRITE] = &sys_stream_write,
[SYS_STREAM_READ] = &sys_stream_read,
[SYS_GET_PROC_INFO] = &sys_get_proc_info,
[SYS_GET_DEVICE_INFO] = &sys_get_device_info,
};
syscall_handler_func_t syscall_find_handler (int syscall_num) {