mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[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:
@@ -23,7 +23,8 @@ variables:
|
|||||||
"-ggdb",
|
"-ggdb",
|
||||||
|
|
||||||
"-D__ELF__",
|
"-D__ELF__",
|
||||||
"-D__JSIX__",
|
"-D__jsix__",
|
||||||
|
"-D__j6kernel",
|
||||||
"-U__linux",
|
"-U__linux",
|
||||||
"-U__linux__",
|
"-U__linux__",
|
||||||
"-DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1",
|
"-DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1",
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ rule compile_asm
|
|||||||
deps = gcc
|
deps = gcc
|
||||||
|
|
||||||
rule parse_cog
|
rule parse_cog
|
||||||
command = $cog -o $out -d $cogflags $in
|
command = $cog -o $out -d -D target=$target $cogflags $in
|
||||||
description = Parsing $name
|
description = Parsing $name
|
||||||
|
|
||||||
rule exe
|
rule exe
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ variables:
|
|||||||
"-g",
|
"-g",
|
||||||
|
|
||||||
"-D__ELF__",
|
"-D__ELF__",
|
||||||
"-D__JSIX__",
|
"-D__jsix__",
|
||||||
"-U__linux",
|
"-U__linux",
|
||||||
"-U__linux__",
|
"-U__linux__",
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ kernel = module("kernel",
|
|||||||
output = "jsix.elf",
|
output = "jsix.elf",
|
||||||
targets = [ "kernel" ],
|
targets = [ "kernel" ],
|
||||||
description = "jsix kernel",
|
description = "jsix kernel",
|
||||||
deps = [ "util", "cpu", "bootproto" ],
|
deps = [ "util", "cpu", "bootproto", "j6" ],
|
||||||
includes = [ "." ],
|
includes = [ "." ],
|
||||||
sources = [
|
sources = [
|
||||||
"apic.cpp",
|
"apic.cpp",
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <arch/memory.h>
|
#include <arch/memory.h>
|
||||||
#include <bootproto/kernel.h>
|
#include <bootproto/kernel.h>
|
||||||
#include <j6/init.h>
|
|
||||||
#include <util/no_construct.h>
|
#include <util/no_construct.h>
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <j6/init.h>
|
|
||||||
#include <util/spinlock.h>
|
#include <util/spinlock.h>
|
||||||
|
|
||||||
#include "apic.h"
|
#include "apic.h"
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// vim: ft=cpp
|
// 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>
|
#include <j6/types.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -42,3 +46,5 @@ for id, scope, method in syscalls.methods:
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#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 <stdint.h>
|
||||||
#include <j6/init.h>
|
#include <j6/init.h>
|
||||||
#include <j6/types.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" ],
|
includes = [ "include" ],
|
||||||
sources = [
|
sources = [
|
||||||
"init.cpp",
|
"init.cpp",
|
||||||
|
"include/j6/syscalls.h.cog",
|
||||||
|
"syscalls.s.cog",
|
||||||
])
|
])
|
||||||
|
|
||||||
from glob import glob
|
from glob import glob
|
||||||
definitions = glob('definitions/**/*.def', recursive=True)
|
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")
|
; ctx.parse("syscalls.def")
|
||||||
; syscalls = ctx.interfaces['syscalls']
|
; syscalls = ctx.interfaces['syscalls']
|
||||||
;
|
;
|
||||||
; for id, scope, method in syscalls.methods:
|
; if target != "kernel":
|
||||||
; if scope:
|
; for id, scope, method in syscalls.methods:
|
||||||
; name = f"{scope.name}_{method.name}"
|
; if scope:
|
||||||
; else:
|
; name = f"{scope.name}_{method.name}"
|
||||||
; name = method.name
|
; else:
|
||||||
; cog.outl(f"define_syscall {name:20}, {id}")
|
; name = method.name
|
||||||
|
; cog.outl(f"define_syscall {name:20}, {id}")
|
||||||
; ]]]
|
; ]]]
|
||||||
; [[[end]]]
|
; [[[end]]]
|
||||||
|
|||||||
Reference in New Issue
Block a user