[libj6] Move remaining j6 headers out of src/include
This means the kernel now depends on libj6. I've added the macro definition __j6kernel when building for the kernel target, so I can remove parts with #ifdefs.
This commit is contained in:
@@ -6,7 +6,7 @@ kernel = module("kernel",
|
||||
output = "jsix.elf",
|
||||
targets = [ "kernel" ],
|
||||
description = "jsix kernel",
|
||||
deps = [ "util", "cpu", "bootproto" ],
|
||||
deps = [ "util", "cpu", "bootproto", "j6" ],
|
||||
includes = [ "." ],
|
||||
sources = [
|
||||
"apic.cpp",
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <arch/memory.h>
|
||||
#include <bootproto/kernel.h>
|
||||
#include <j6/init.h>
|
||||
#include <util/no_construct.h>
|
||||
|
||||
#include "assert.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include <j6/init.h>
|
||||
#include <util/spinlock.h>
|
||||
|
||||
#include "apic.h"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#pragma once
|
||||
// vim: ft=cpp
|
||||
|
||||
// The kernel depends on libj6 for some shared code,
|
||||
// but should not include the user-specific code.
|
||||
#ifndef __j6kernel
|
||||
|
||||
#include <j6/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -42,3 +46,5 @@ for id, scope, method in syscalls.methods:
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __j6kernel
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// The kernel depends on libj6 for some shared code,
|
||||
// but should not include the user-specific code.
|
||||
#ifndef __j6kernel
|
||||
|
||||
#include <stdint.h>
|
||||
#include <j6/init.h>
|
||||
#include <j6/types.h>
|
||||
@@ -39,3 +43,5 @@ _init_libj6(uint64_t *rsp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __j6kernel
|
||||
|
||||
@@ -5,10 +5,15 @@ j6 = module("j6",
|
||||
includes = [ "include" ],
|
||||
sources = [
|
||||
"init.cpp",
|
||||
"include/j6/syscalls.h.cog",
|
||||
"syscalls.s.cog",
|
||||
])
|
||||
|
||||
from glob import glob
|
||||
definitions = glob('definitions/**/*.def', recursive=True)
|
||||
j6.add_input("include/j6/syscalls.h.cog", deps=definitions)
|
||||
j6.add_input("syscalls.s.cog", deps=definitions)
|
||||
|
||||
j6.add_depends([
|
||||
"include/j6/syscalls.h.cog",
|
||||
"syscalls.s.cog",
|
||||
], definitions)
|
||||
|
||||
|
||||
@@ -27,11 +27,12 @@
|
||||
; ctx.parse("syscalls.def")
|
||||
; syscalls = ctx.interfaces['syscalls']
|
||||
;
|
||||
; for id, scope, method in syscalls.methods:
|
||||
; if scope:
|
||||
; name = f"{scope.name}_{method.name}"
|
||||
; else:
|
||||
; name = method.name
|
||||
; cog.outl(f"define_syscall {name:20}, {id}")
|
||||
; if target != "kernel":
|
||||
; for id, scope, method in syscalls.methods:
|
||||
; if scope:
|
||||
; name = f"{scope.name}_{method.name}"
|
||||
; else:
|
||||
; name = method.name
|
||||
; cog.outl(f"define_syscall {name:20}, {id}")
|
||||
; ]]]
|
||||
; [[[end]]]
|
||||
|
||||
Reference in New Issue
Block a user