[kernel] Move bind_irq syscall to new system object

In order to implement capabilities on system resources like IRQs so that
they may be restricted to drivers only, add a new 'system' kobject type,
and move the bind_irq functionality from endpoint to system.

Also fix some stack bugs passing the initial handles to a program.
This commit is contained in:
2020-10-18 20:45:06 -07:00
parent 2ad90dcb5c
commit 8bb9e22218
14 changed files with 80 additions and 28 deletions

View File

@@ -11,10 +11,9 @@
#include "serial.h"
char inbuf[1024];
j6_handle_t sys = j6_handle_invalid;
j6_handle_t endp = j6_handle_invalid;
j6_process_init *init = nullptr;
extern "C" {
void _init_libc(j6_process_init *);
int main(int, const char **);
@@ -53,9 +52,9 @@ thread_proc()
}
void
_init_libc(j6_process_init *i)
_init_libc(j6_process_init *init)
{
init = i;
sys = init->handles[0];
}
int
@@ -98,6 +97,10 @@ main(int argc, const char **argv)
if (tag != 17)
_syscall_system_log("GOT WRONG TAG FROM SENDRECV");
result = _syscall_system_bind_irq(sys, endp, 3);
if (result != j6_status_ok)
return result;
_syscall_system_log(message);
_syscall_system_log("main thread waiting on child");
@@ -108,7 +111,6 @@ main(int argc, const char **argv)
_syscall_system_log("main testing irqs");
_syscall_endpoint_bind_irq(endp, 3);
serial_port com2(COM2);

View File

@@ -13,7 +13,6 @@ _start:
mov rbp, rsp
mov rdi, rsp
sub rdi, 8
call _init_libc
mov rdi, 0