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

View File

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

View File

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

View File

@ -12,6 +12,8 @@ let Resources = Init.Resources
let ServiceRoute = Init.ServiceRoute
let label = λ(_ : Text) → { local = _, route = _ } : Child.Attributes.Label
in { config =
Init::{
, verbose = True
@ -25,22 +27,6 @@ in { config =
, resources = Resources::{ ram = Genode.units.MiB 3 }
, 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 =
Child.flat
Child.Attributes::{
@ -52,9 +38,9 @@ in { config =
, constrainPhys = True
}
, provides = [ "Platform", "Acpi" ]
, romReports = [ label "acpi" ]
, routes =
[ ServiceRoute.child "Report" "acpi_report_rom"
, ServiceRoute.parent "IRQ"
[ ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IO_MEM"
, ServiceRoute.parent "IO_PORT"
]
@ -69,17 +55,13 @@ in { config =
, ram = Genode.units.MiB 4
, constrainPhys = True
}
, reportRoms = [ label "acpi" ]
, provides = [ "Platform", "Acpi" ]
, routes =
[ ServiceRoute.parent "Timer"
, ServiceRoute.parent "IRQ"
, ServiceRoute.parent "IO_MEM"
, ServiceRoute.parent "IO_PORT"
, ServiceRoute.childLabel
"ROM"
"acpi_report_rom"
(Some "acpi")
(None Text)
]
, config =
Init.Config::{