[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:
@@ -15,7 +15,7 @@ extern log::logger &g_logger;
|
||||
namespace syscalls {
|
||||
|
||||
j6_status_t
|
||||
system_log(const char *message)
|
||||
log(const char *message)
|
||||
{
|
||||
if (message == nullptr)
|
||||
return j6_err_invalid_arg;
|
||||
@@ -26,7 +26,7 @@ system_log(const char *message)
|
||||
}
|
||||
|
||||
j6_status_t
|
||||
system_noop()
|
||||
noop()
|
||||
{
|
||||
thread &th = thread::current();
|
||||
log::debug(logs::syscall, "Thread %llx called noop syscall.", th.koid());
|
||||
@@ -61,18 +61,18 @@ system_bind_irq(j6_handle_t sys, j6_handle_t endp, unsigned irq)
|
||||
}
|
||||
|
||||
j6_status_t
|
||||
system_map_phys(j6_handle_t sys, j6_handle_t *vma_handle, uintptr_t phys_addr, size_t size, uint32_t flags)
|
||||
system_map_phys(j6_handle_t handle, j6_handle_t * area, uintptr_t phys, size_t size, uint32_t flags)
|
||||
{
|
||||
// TODO: check capabilities on sys handle
|
||||
if (!vma_handle) return j6_err_invalid_arg;
|
||||
if (!area) return j6_err_invalid_arg;
|
||||
|
||||
// TODO: check to see if frames are already used? How would that collide with
|
||||
// the bootloader's allocated pages already being marked used?
|
||||
if (!(flags & vm_flags::mmio))
|
||||
frame_allocator::get().used(phys_addr, memory::page_count(size));
|
||||
frame_allocator::get().used(phys, memory::page_count(size));
|
||||
|
||||
vm_flags vmf = (static_cast<vm_flags>(flags) & vm_flags::driver_mask);
|
||||
construct_handle<vm_area_fixed>(vma_handle, phys_addr, size, vmf);
|
||||
construct_handle<vm_area_fixed>(area, phys, size, vmf);
|
||||
|
||||
return j6_status_ok;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user