]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
tools: config-create: Place hypervisor and inmates at default addresses
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 26 Aug 2014 16:50:15 +0000 (18:50 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Thu, 28 Aug 2014 06:36:10 +0000 (08:36 +0200)
If no location is specified and no memmap is found, use the default
address 0x3b000000 for the hypervisor and inmates region. This reduces
the need for adapting the included cell demo configs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools/jailhouse-config-create

index 7aedd5c5427298b74d95635028063159cae653b1..7fc8671fd548488334fae117f21dbe0f86b4cfaa 100755 (executable)
@@ -446,7 +446,22 @@ def parse_cmdline():
 
 
 def alloc_mem(regions, size):
-    mem = [0, size]
+    mem = [0x3b000000, size]
+    for r in regions:
+        if (
+            r.typestr == 'System RAM' and
+            r.start <= mem[0] and
+            r.stop + 1 >= mem[0] + mem[1]
+           ):
+            if r.start < mem[0]:
+                head_r = MemRegion(r.start, mem[0] - 1, r.typestr, r.comments)
+                regions.insert(regions.index(r), head_r)
+            if r.stop + 1 > mem[0] + mem[1]:
+                tail_r = MemRegion(mem[0] + mem[1], r.stop, r.typestr,
+                                   r.comments)
+                regions.insert(regions.index(r), tail_r)
+            regions.remove(r)
+            return mem
     for r in reversed(regions):
         if (r.typestr == 'System RAM' and r.size() >= mem[1]):
             mem[0] = r.start