summaryrefslogtreecommitdiff
path: root/rt
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-10-05 18:18:19 -0400
committerOri Bernstein <ori@eigenstate.org>2014-10-05 18:18:19 -0400
commitb8e1d4c0252943545bbcde039cc227401b8c03ab (patch)
treeed14ab8997a7d7bee3cadbe91f3d05bfb2b0da94 /rt
parent97540583eefeed60052f9831d68e7eb7bbbe8906 (diff)
downloadmc-b8e1d4c0252943545bbcde039cc227401b8c03ab.tar.gz
Add plan9 mkfiles and runtime.
Diffstat (limited to 'rt')
-rw-r--r--rt/_myrrt-plan9.s19
-rw-r--r--rt/mkfile6
2 files changed, 25 insertions, 0 deletions
diff --git a/rt/_myrrt-plan9.s b/rt/_myrrt-plan9.s
new file mode 100644
index 0000000..c9d5853
--- /dev/null
+++ b/rt/_myrrt-plan9.s
@@ -0,0 +1,19 @@
+#define NPRIVATES 16
+
+TEXT _main(SB), 1, $(2*8+NPRIVATES*8)
+ MOVQ AX, _tos(SB)
+ LEAQ 16(SP), AX
+ MOVQ AX, _privates(SB)
+ MOVL $NPRIVATES, _nprivates(SB)
+ MOVL inargc-8(FP), RARG
+ LEAQ inargv+0(FP), AX
+ MOVQ AX, 8(SP)
+ CALL main(SB)
+
+loop:
+ MOVQ $_exits<>(SB), RARG
+ CALL exits(SB)
+ JMP loop
+
+DATA _exits<>+0(SB)/4, $"main"
+GLOBL _exits<>+0(SB), $5
diff --git a/rt/mkfile b/rt/mkfile
new file mode 100644
index 0000000..18e4310
--- /dev/null
+++ b/rt/mkfile
@@ -0,0 +1,6 @@
+</$objtype/mkfile
+
+_myrrt.$O: _myrrt-plan9.s
+ $AS -o _myrrt.$O _myrrt-plan9.s
+
+</sys/src/cmd/mkone