2
0
Fork 0

Lower single child tests for NOVA test wrapper

If an single-child init is added to a list of children then it must be
safe to lower the child and add it to the list directly.
This commit is contained in:
Ehmry - 2020-01-28 13:45:54 +01:00
parent 23193460fa
commit fcb0a48401
1 changed files with 73 additions and 44 deletions

View File

@ -2,45 +2,74 @@
let Genode = env:DHALL_GENODE let Genode = env:DHALL_GENODE
in λ(args : Genode.Boot.Type) let Prelude = Genode.Prelude
→ { config =
Genode.Init::{ let ChildEntry = Prelude.Map.Entry Text Genode.Init.Start.Type
, verbose = True
, defaultRoutes = let toChildEntry =
Genode.Init.default.defaultRoutes λ(init : Genode.Init.Type)
# [ Genode.ServiceRoute.parent "IO_MEM" → let childCount = Prelude.List.length ChildEntry init.children
, Genode.ServiceRoute.parent "IO_PORT"
, Genode.ServiceRoute.parent "IRQ" let onlyChild = Prelude.Natural.lessThan childCount 2
, Genode.ServiceRoute.child "Timer" "timer"
] let child =
, children = if onlyChild
[ { mapKey = "timer"
, mapValue = then Prelude.Optional.fold
Genode.Init.Start::{ ChildEntry
, binary = "nova_timer_drv" (Prelude.List.head ChildEntry init.children)
, resources = { caps = 96, ram = Genode.units.MiB 1 } ChildEntry
, provides = [ "Timer" ] (λ(child : ChildEntry) → child)
{ mapKey = ""
, mapValue = Genode.Init.Start::{ binary = "" }
}
else { mapKey = "init", mapValue = Genode.Init.toStart init }
in child
in λ(boot : Genode.Boot.Type)
→ let child = toChildEntry boot.config
in { config =
Genode.Init::{
, defaultRoutes =
Genode.Init.default.defaultRoutes
# [ Genode.ServiceRoute.parent "IO_MEM"
, Genode.ServiceRoute.parent "IO_PORT"
, Genode.ServiceRoute.parent "IRQ"
, Genode.ServiceRoute.child "Timer" "timer"
]
, children =
[ { mapKey = "timer"
, mapValue =
Genode.Init.Start::{
, binary = "nova_timer_drv"
, resources = { caps = 96, ram = Genode.units.MiB 1 }
, provides = [ "Timer" ]
}
} }
} , { mapKey = "harness"
, { mapKey = "harness" , mapValue =
, mapValue = Genode.Init.Start::{
let child = Genode.Init.toStart args.config
in Genode.Init.Start::{
, binary = "sotest-harness" , binary = "sotest-harness"
, exitPropagate = True , exitPropagate = True
, resources = , resources =
{ caps = child.resources.caps + 128 { caps = child.mapValue.resources.caps + 128
, ram = child.resources.ram + Genode.units.MiB 1 , ram =
child.mapValue.resources.ram
+ Genode.units.MiB 1
} }
, config = , config =
Some Some
( Genode.Prelude.XML.element ( Prelude.XML.element
{ name = "config" { name = "config"
, attributes = , attributes = Prelude.XML.emptyAttributes
Genode.Prelude.XML.emptyAttributes
, content = , content =
[ Genode.Init.Start.toXML "init" child ] [ Genode.Init.Start.toXML
child.mapKey
child.mapValue
]
} }
) )
, routes = , routes =
@ -50,19 +79,19 @@ in λ(args : Genode.Boot.Type)
(Some "platform") (Some "platform")
] ]
} }
}
]
}
, rom =
let manifest = env:MANIFEST
in Genode.Boot.toRomPaths
[ { mapKey = "ld.lib.so"
, mapValue = manifest.base-nova.lib.ld-nova.mapValue
} }
, manifest.base-nova.bin.nova_timer_drv
, manifest.os.bin.init
, manifest.sotest-producer.bin.sotest-harness
] ]
# args.rom }
} , rom =
let manifest = env:MANIFEST
in Genode.Boot.toRomPaths
[ Prelude.Map.keyText
"ld.lib.so"
manifest.base-nova.lib.ld-nova.mapValue
, manifest.base-nova.bin.nova_timer_drv
, manifest.os.bin.init
, manifest.sotest-producer.bin.sotest-harness
]
# boot.rom
}