aboutsummaryrefslogtreecommitdiff
path: root/module/loader.m
diff options
context:
space:
mode:
authorbhgv <bhgv.empire@gmail.com>2018-03-01 16:54:45 +0200
committerbhgv <bhgv.empire@gmail.com>2018-03-01 16:54:45 +0200
commitb786f20bbab5a59046aa78a2c6c2a11536497202 (patch)
tree0851ecdec889eb9b7ba3751cc04d4f0b474e4a9e /module/loader.m
inferno-os tree was separated from the inferno-os-android (separated from the Android driver)
Diffstat (limited to 'module/loader.m')
-rw-r--r--module/loader.m48
1 files changed, 48 insertions, 0 deletions
diff --git a/module/loader.m b/module/loader.m
new file mode 100644
index 0000000..597e2ba
--- /dev/null
+++ b/module/loader.m
@@ -0,0 +1,48 @@
+#
+# External loader interface
+#
+Nilmod: module
+{
+};
+
+Loader: module
+{
+ PATH: con "$Loader";
+
+ Inst: adt
+ {
+ op: byte;
+ addr: byte;
+ src: int;
+ mid: int;
+ dst: int;
+ };
+
+ Typedesc: adt
+ {
+ size: int;
+ map: array of byte;
+ };
+
+ Link: adt
+ {
+ name: string;
+ sig: int;
+ pc: int;
+ tdesc: int;
+ };
+
+ Niladt: adt
+ {
+ };
+
+ ifetch: fn(mp: Nilmod): array of Inst;
+ tdesc: fn(mp: Nilmod): array of Typedesc;
+ newmod: fn(name: string, ss, nlink: int,
+ inst: array of Inst, data: ref Niladt): Nilmod;
+ tnew: fn(mp: Nilmod, size: int, map: array of byte): int;
+ link: fn(mp: Nilmod): array of Link;
+ ext: fn(mp: Nilmod, idx, pc: int, tdesc: int): int;
+ dnew: fn(size: int, map: array of byte): ref Niladt;
+ compile: fn(mp: Nilmod, flag: int): int;
+};