[project] Generate syscalls from new interface DSL

This change adds a new interface DSL for specifying objects (with
methods) and interfaces (that expose objects, and optionally have their
own methods).

Significant changes:

- Add the new scripts/definitions Python module to parse the DSL
- Add the new definitions directory containing DSL definition files
- Use cog to generate syscall-related code in kernel and libj6
- Unify ordering of pointer + length pairs in interfaces
This commit is contained in:
Justin C. Miller
2021-08-30 01:05:32 -07:00
parent 80f815c020
commit 186724e751
52 changed files with 4025 additions and 206 deletions

View File

@@ -4,17 +4,18 @@
#include "log.h"
#include "objects/process.h"
#include "objects/thread.h"
#include "syscalls/helpers.h"
namespace syscalls {
j6_status_t
thread_create(void *rip, j6_handle_t *handle)
thread_create(j6_handle_t *handle, uintptr_t entrypoint)
{
thread &parent = thread::current();
process &p = parent.parent();
thread *child = p.create_thread();
child->add_thunk_user(reinterpret_cast<uintptr_t>(rip));
child->add_thunk_user(entrypoint);
*handle = child->self_handle();
child->clear_state(thread::state::loading);
child->set_state(thread::state::ready);
@@ -36,6 +37,18 @@ thread_exit(int32_t status)
return j6_err_unexpected;
}
j6_status_t
thread_kill(j6_handle_t handle)
{
thread *th = get_handle<thread>(handle);
if (!th)
return j6_err_invalid_arg;
log::debug(logs::task, "Killing thread %llx", th->koid());
th->exit(-1);
return j6_status_ok;
}
j6_status_t
thread_pause()
{