USB driver polling user app, handle only one XHCI controller for now, Implement USB device addressing
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user