summary refs log tree commit diff stats
path: root/lib/genode/alloc.nim
diff options
context:
space:
mode:
authorEmery Hemingway <ehmry@posteo.net>2021-04-09 16:29:10 +0200
committerGitHub <noreply@github.com>2021-04-09 16:29:10 +0200
commit8aa5991beaa01f25a90d4115ed2495c92221f603 (patch)
tree55b3196be766a057d1af6219ce4f298bc6db6de9 /lib/genode/alloc.nim
parent86a1dcf92864f50fb1ab076cf58e19a3da81d301 (diff)
downloadNim-8aa5991beaa01f25a90d4115ed2495c92221f603.tar.gz
Genode platform fixes (#17521)
* Genode: move dyncall failures to runtime

Do not use the "error" pragma to warn that dynamic library loading is
not implemented, print a message at runtime and exit.

* Genode: use stricter dataspace type in page allocator

* Genode: remove compiler configuration from nim.cfg

Self-hosting Nim is not supported on Genode and defining the
cross-compilation environment can be done externally.

* Genode: use new mutex API

* Genode: call nim_component_construct as a C procedure

* Genode: implement echo for NimStringV2
Diffstat (limited to 'lib/genode/alloc.nim')
-rw-r--r--lib/genode/alloc.nim14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/genode/alloc.nim b/lib/genode/alloc.nim
index a21a3ad7b..3ddd3074b 100644
--- a/lib/genode/alloc.nim
+++ b/lib/genode/alloc.nim
@@ -17,18 +17,18 @@ when not defined(genode):
 when not declared(GenodeEnv):
   include genode/env
 
-type DataspaceCapability {.
-  importcpp: "Genode::Dataspace_capability", pure.} = object
+type RamDataspaceCapability {.
+  importcpp: "Genode::Ram_dataspace_capability", pure.} = object
 
 type
   Map = object
     attachment: pointer
     size: int
-    ds: DataspaceCapability
+    ds: RamDataspaceCapability
 
   SlabMeta = object
     next: ptr MapSlab
-    ds: DataspaceCapability
+    ds: RamDataspaceCapability
 
   MapSlab = object
     meta: SlabMeta
@@ -45,11 +45,11 @@ proc capsAvail(env: GenodeEnv): int {.
   ## Return the number of available capabilities.
   ## Each dataspace allocation consumes a capability.
 
-proc allocDataspace(env: GenodeEnv; size: int): DataspaceCapability {.
+proc allocDataspace(env: GenodeEnv; size: int): RamDataspaceCapability {.
   importcpp: "#->pd().alloc(@)".}
   ## Allocate a dataspace and its capability.
 
-proc attachDataspace(env: GenodeEnv; ds: DataspaceCapability): pointer {.
+proc attachDataspace(env: GenodeEnv; ds: RamDataspaceCapability): pointer {.
   importcpp: "#->rm().attach(@)".}
   ## Attach a dataspace into the component address-space.
 
@@ -57,7 +57,7 @@ proc detachAddress(env: GenodeEnv; p: pointer) {.
   importcpp: "#->rm().detach(@)".}
   ## Detach a dataspace from the component address-space.
 
-proc freeDataspace(env: GenodeEnv; ds: DataspaceCapability) {.
+proc freeDataspace(env: GenodeEnv; ds: RamDataspaceCapability) {.
   importcpp: "#->pd().free(@)".}
   ## Free a dataspace.