2
0
Fork 0

Update dhall-genode, use report_rom inference

This commit is contained in:
Ehmry - 2020-03-04 17:34:06 +01:00
parent a61c3532e8
commit 19dccc4862
4 changed files with 44 additions and 97 deletions

View File

@ -14,14 +14,14 @@ let Resources = Init.Resources
let ServiceRoute = Init.ServiceRoute let ServiceRoute = Init.ServiceRoute
let reportRomRoute = let label =
λ(service : Text) λ(label : Text)
→ λ(label : Text) → { local = label, route = label } : Child.Attributes.Label
→ ServiceRoute.childLabel service "report_rom" (Some label) (None Text)
let reportRomReport = reportRomRoute "Report" let relabel =
λ(local : Text)
let reportRomROM = reportRomRoute "ROM" → λ(route : Text)
→ { local = local, route = route } : Child.Attributes.Label
let drivers = let drivers =
Init::{ Init::{
@ -45,31 +45,6 @@ let drivers =
, ServiceRoute.parent "IO_MEM" , ServiceRoute.parent "IO_MEM"
] ]
} }
, report_rom =
Child.flat
Child.Attributes::{
, binary = "report_rom"
, resources = Resources::{ ram = Genode.units.MiB 2 }
, provides = [ "ROM", "Report" ]
, config =
Init.Config::{
, content =
[ XML.text
''
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
<policy label="driver_manager -> pci_devices" report="platform_drv -> pci"/>
<policy label="usb_drv -> config" report="driver_manager -> usb_drv.config"/>
<policy label="driver_manager -> usb_devices" report="usb_drv -> devices"/>
<policy label="dynamic -> config" report="driver_manager -> init.config"/>
<policy label="driver_manager -> ahci_ports" report="dynamic -> ahci_ports"/>
<policy label="driver_manager -> nvme_ns" report="dynamic -> nvme_ns"/>
<policy label="rom_reporter -> acpi" report="acpi_drv -> acpi"/>
<policy label="rom_reporter -> pci_devices" report="platform_drv -> pci"/>
<policy label="rom_reporter -> usb_devices" report="usb_drv -> devices"/>
''
]
}
}
, rom_reporter = , rom_reporter =
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
@ -85,6 +60,8 @@ let drivers =
'' ''
] ]
} }
, reportRoms =
[ label "acpi", label "pci_devices", label "usb_devices" ]
, routes = , routes =
let routeReportToParent = let routeReportToParent =
λ(label : Text) λ(label : Text)
@ -92,11 +69,8 @@ let drivers =
"Report" "Report"
(Some label) (Some label)
(Some label) (Some label)
in [ reportRomROM "acpi" in [ routeReportToParent "acpi"
, reportRomROM "pci_devices"
, reportRomROM "usb_devices"
, routeReportToParent "acpi"
, routeReportToParent "pci_devices" , routeReportToParent "pci_devices"
, routeReportToParent "usb_devices" , routeReportToParent "usb_devices"
] ]
@ -108,9 +82,9 @@ let drivers =
, priority = 1 , priority = 1
, resources = , resources =
Resources::{ caps = 350, ram = Genode.units.MiB 4 } Resources::{ caps = 350, ram = Genode.units.MiB 4 }
, romReports = [ label "acpi" ]
, routes = , routes =
[ ServiceRoute.parent "IO_MEM" [ ServiceRoute.parent "IO_MEM"
, reportRomReport "acpi"
, ServiceRoute.parentLabel , ServiceRoute.parentLabel
"Report" "Report"
(Some "smbios_table") (Some "smbios_table")
@ -128,6 +102,8 @@ let drivers =
, constrainPhys = True , constrainPhys = True
} }
, provides = [ "Acpi", "Platform" ] , provides = [ "Acpi", "Platform" ]
, reportRoms = [ label "acpi" ]
, romReports = [ relabel "pci" "pci_devices" ]
, routes = , routes =
[ ServiceRoute.parent "IRQ" [ ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IO_MEM" , ServiceRoute.parent "IO_MEM"
@ -137,8 +113,6 @@ let drivers =
"ROM" "ROM"
(Some "system") (Some "system")
(Some "system") (Some "system")
, reportRomROM "acpi"
, reportRomReport "pci"
] ]
, config = , config =
Init.Config::{ Init.Config::{
@ -190,10 +164,10 @@ let drivers =
, resources = , resources =
Resources::{ caps = 200, ram = Genode.units.MiB 16 } Resources::{ caps = 200, ram = Genode.units.MiB 16 }
, provides = [ "Input", "Usb" ] , provides = [ "Input", "Usb" ]
, reportRoms = [ relabel "config" "usb_drv.config" ]
, romReports = [ relabel "devices" "usb_devices" ]
, routes = , routes =
[ ServiceRoute.child "Platform" "platform_drv" [ ServiceRoute.child "Platform" "platform_drv"
, reportRomROM "config"
, reportRomReport "devices"
, ServiceRoute.parentLabel , ServiceRoute.parentLabel
"Report" "Report"
(Some "config") (Some "config")
@ -241,17 +215,21 @@ let drivers =
Child.Attributes::{ Child.Attributes::{
, binary = "driver_manager" , binary = "driver_manager"
, priority = 1 , priority = 1
, reportRoms =
[ label "ahci_ports"
, label "nvme_ns"
, label "pci_devices"
, label "usb_devices"
]
, romReports =
[ relabel "init.config" "dynamic.config"
, label "usb_drv.config"
]
, routes = , routes =
[ reportRomReport "init.config" [ ServiceRoute.parentLabel
, reportRomReport "usb_drv.config"
, ServiceRoute.parentLabel
"Report" "Report"
(Some "block_devices") (Some "block_devices")
(Some "block_devices") (Some "block_devices")
, reportRomROM "usb_devices"
, reportRomROM "pci_devices"
, reportRomROM "ahci_ports"
, reportRomROM "nvme_ns"
, ServiceRoute.parentLabel , ServiceRoute.parentLabel
"ROM" "ROM"
(Some "usb_policy") (Some "usb_policy")
@ -266,12 +244,11 @@ let drivers =
, resources = , resources =
Resources::{ caps = 1400, ram = Genode.units.MiB 64 } Resources::{ caps = 1400, ram = Genode.units.MiB 64 }
, provides = [ "Framebuffer", "Block" ] , provides = [ "Framebuffer", "Block" ]
, romReports = [ label "ahci_ports", label "nvme_ns" ]
, reportRoms = [ relabel "config" "dynamic.config" ]
, routes = , routes =
[ ServiceRoute.child "Platform" "platform_drv" [ ServiceRoute.child "Platform" "platform_drv"
, reportRomReport "ahci_ports"
, reportRomReport "nvme_ns"
, ServiceRoute.child "Usb" "usb_drv" , ServiceRoute.child "Usb" "usb_drv"
, reportRomROM "config"
, ServiceRoute.parent "Timer" , ServiceRoute.parent "Timer"
, ServiceRoute.parent "Report" , ServiceRoute.parent "Report"
, ServiceRoute.parent "IO_MEM" , ServiceRoute.parent "IO_MEM"

View File

@ -6,8 +6,8 @@ stdenv.mkDerivation {
name = "dhall-genode"; name = "dhall-genode";
src = fetchgit { src = fetchgit {
url = "https://git.sr.ht/~ehmry/dhall-genode"; url = "https://git.sr.ht/~ehmry/dhall-genode";
rev = "672325a0f2247041cfdf9b3b0c9642adbfbd58a0"; rev = "16cad9fbbee3fbd1c167377c93ee1d60f9d21e37";
sha256 = "0iwniwkx0zcrfqv3dkjg5x5638xyxkhnqni4ydzg2b3bw4wa27id"; sha256 = "0gjad37zd1kb5dlnkb3m8pd1ibzcc9yqf6vgyv3imffj1vhdl14n";
}; };
DHALL_PRELUDE = prelude + "/package.dhall"; DHALL_PRELUDE = prelude + "/package.dhall";
buildCommand = '' buildCommand = ''

View File

@ -22,32 +22,19 @@ let childRomRoute =
→ λ(from : Text) → λ(from : Text)
→ ServiceRoute.childLabel "ROM" child (Some from) (None Text) → ServiceRoute.childLabel "ROM" child (Some from) (None Text)
let label = \(_ : Text) -> { local = _, route = _ }
in Init::{ in Init::{
, verbose = True , verbose = True
, children = , children =
toMap toMap
{ report_rom = { , drivers =
Child.flat
Child.Attributes::{
, binary = "report_rom"
, provides = [ "ROM", "Report" ]
, config =
Init.Config::{
, attributes = toMap { verbose = "yes" }
, content =
[ Genode.Prelude.XML.text
''
<policy label="test-driver_manager -> block_devices" report="drivers -> block_devices"/>
''
]
}
}
, drivers =
Init.toChild Init.toChild
drivers drivers
Init.Attributes::{ Init.Attributes::{
, provides = [ "Block", "Framebuffer", "Input" ] , provides = [ "Block", "Framebuffer", "Input" ]
, resources = Init.Resources::{ ram = Genode.units.MiB 4 } , resources = Init.Resources::{ ram = Genode.units.MiB 4 }
, romReports = [ label "block_devices" ]
, routes = , routes =
[ parentRomRoute [ parentRomRoute
"managed/input_filter" "managed/input_filter"
@ -56,7 +43,7 @@ in Init::{
, childRomRoute "dynamic_rom" "capslock" , childRomRoute "dynamic_rom" "capslock"
, childRomRoute "dynamic_rom" "numlock" , childRomRoute "dynamic_rom" "numlock"
, childRomRoute "dynamic_rom" "system" , childRomRoute "dynamic_rom" "system"
, ServiceRoute.child "Report" "report_rom" , ServiceRoute.child "Report" "_report_rom"
, ServiceRoute.parent "Timer" , ServiceRoute.parent "Timer"
, Genode.Init.ServiceRoute.parent "IRQ" , Genode.Init.ServiceRoute.parent "IRQ"
, Genode.Init.ServiceRoute.parent "IO_MEM" , Genode.Init.ServiceRoute.parent "IO_MEM"
@ -99,8 +86,9 @@ in Init::{
'' ''
] ]
} }
, reportRoms = [ label "block_devices" ]
, routes = , routes =
[ childRomRoute "report_rom" "block_devices" [
, ServiceRoute.child "Block" "drivers" , ServiceRoute.child "Block" "drivers"
, ServiceRoute.child "Framebuffer" "drivers" , ServiceRoute.child "Framebuffer" "drivers"
, ServiceRoute.child "Input" "drivers" , ServiceRoute.child "Input" "drivers"

View File

@ -12,6 +12,8 @@ let Resources = Init.Resources
let ServiceRoute = Init.ServiceRoute let ServiceRoute = Init.ServiceRoute
let label = λ(_ : Text) → { local = _, route = _ } : Child.Attributes.Label
in { config = in { config =
Init::{ Init::{
, verbose = True , verbose = True
@ -25,22 +27,6 @@ in { config =
, resources = Resources::{ ram = Genode.units.MiB 3 } , resources = Resources::{ ram = Genode.units.MiB 3 }
, routes = [ ServiceRoute.child "Platform" "platform_drv" ] , routes = [ ServiceRoute.child "Platform" "platform_drv" ]
} }
, acpi_report_rom =
Child.flat
Child.Attributes::{
, binary = "report_rom"
, provides = [ "ROM", "Report" ]
, config =
Init.Config::{
, content =
[ XML.text
''
<policy label="smbios_decoder -> smbios_table" report="acpi_drv -> smbios_table"/>
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
''
]
}
}
, acpi_drv = , acpi_drv =
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
@ -52,9 +38,9 @@ in { config =
, constrainPhys = True , constrainPhys = True
} }
, provides = [ "Platform", "Acpi" ] , provides = [ "Platform", "Acpi" ]
, romReports = [ label "acpi" ]
, routes = , routes =
[ ServiceRoute.child "Report" "acpi_report_rom" [ ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IO_MEM" , ServiceRoute.parent "IO_MEM"
, ServiceRoute.parent "IO_PORT" , ServiceRoute.parent "IO_PORT"
] ]
@ -69,17 +55,13 @@ in { config =
, ram = Genode.units.MiB 4 , ram = Genode.units.MiB 4
, constrainPhys = True , constrainPhys = True
} }
, reportRoms = [ label "acpi" ]
, provides = [ "Platform", "Acpi" ] , provides = [ "Platform", "Acpi" ]
, routes = , routes =
[ ServiceRoute.parent "Timer" [ ServiceRoute.parent "Timer"
, ServiceRoute.parent "IRQ" , ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IO_MEM" , ServiceRoute.parent "IO_MEM"
, ServiceRoute.parent "IO_PORT" , ServiceRoute.parent "IO_PORT"
, ServiceRoute.childLabel
"ROM"
"acpi_report_rom"
(Some "acpi")
(None Text)
] ]
, config = , config =
Init.Config::{ Init.Config::{
@ -95,7 +77,7 @@ in { config =
} }
, rom = , rom =
let manifest = env:MANIFEST let manifest = env:MANIFEST
in Genode.Boot.toRomPaths in Genode.Boot.toRomPaths
[ manifest.drivers.bin.acpi_drv [ manifest.drivers.bin.acpi_drv
, manifest.drivers.bin.platform_drv , manifest.drivers.bin.platform_drv