summary refs log tree commit diff stats
path: root/lib/genode/env.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/genode/env.nim')
-rw-r--r--lib/genode/env.nim29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/genode/env.nim b/lib/genode/env.nim
new file mode 100644
index 000000000..babe2a8a0
--- /dev/null
+++ b/lib/genode/env.nim
@@ -0,0 +1,29 @@
+#
+#
+#            Nim's Runtime Library
+#        (c) Copyright 2018 Emery Hemingway
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+#
+# This file contains the minimum required definitions
+# for interacting with the initial Genode environment.
+# It is reserved for use only within the standard
+# library. See `componentConstructHook` in the system
+# module for accessing the Genode environment after the
+# standard library has finished initializating.
+#
+
+when not defined(genode):
+  {.error: "Genode only module".}
+
+type
+  GenodeEnvObj* {.importcpp: "Genode::Env", header: "<base/env.h>", pure.} = object
+  GenodeEnvPtr* = ptr GenodeEnvObj
+
+const runtimeEnvSym* = "nim_runtime_env"
+
+when not defined(nimscript):
+  var runtimeEnv* {.importcpp: runtimeEnvSym.}: GenodeEnvPtr