source ${genode_dir}/repos/base/run/platform_drv.inc
proc nic_drv { } {
if {[nic_drv_binary] == "usb_drv"} { return usb_drv }
if {[nic_drv_binary] == ""} { return "" }
return nic_drv
}
proc gpio_drv { } {
if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv }
if {[have_spec rpi] && [have_spec foc]} { return foc_gpio_drv }
if {[have_spec gpio]} { return gpio_drv }
}
if {[nic_drv] == ""} {
puts "\n Run script is not supported on this platform. \n"; exit 0 }
proc nic_drv_build { } {
if {[nic_drv] == "nic_drv"} { return drivers/nic }
if {[nic_drv] == "usb_drv"} { return drivers/usb }
}
proc gpio_drv_build { } { if {[gpio_drv] != ""} { return drivers/gpio } }
set targets "core init drivers/timer server/nic_router server/nic_bridge
test/lwip/http_srv_static test/lwip/http_clnt test/lwip/udp
[nic_drv_build] [gpio_drv_build] [platform_drv_build_components]"
proc gpio_drv_config { } {
if {[have_spec gpio]} {
append result {
}
return $result
}
}
proc nic_drv_config { } {
if {[nic_drv] == "nic_drv"} {
append result {
}
return $result
}
if {[nic_drv] == "usb_drv"} {
append result {
}
return $result
}
}
proc client_bin { prot } {
if {$prot == "udp"} { return "test-lwip-udp-client" }
if {$prot == "http"} { return "test-http_clnt" } }
proc server_bin { prot } {
if {$prot == "udp"} { return "test-lwip-udp-server" }
if {$prot == "http"} { return "test-lwip_httpsrv_static" } }
proc client_config { name prot ip_addr gateway netmask nic srv_port srv_ip } {
append result {
}
return $result
}
proc server_config { name prot ip_addr gateway netmask nic port } {
append result {
}
return $result
}
set boot_modules "
core init timer nic_router nic_bridge ld.lib.so libc.lib.so libm.lib.so
lwip.lib.so posix.lib.so [client_bin udp] [server_bin udp]
[client_bin http] [server_bin http] [nic_drv_binary] [gpio_drv]
[platform_drv_boot_modules]"
proc nic_qemu_args { } {
if {[have_spec x86]} { return "-net nic,model=e1000" }
if {[have_spec lan9118]} { return "-net nic,model=lan9118" } }
append qemu_args "-nographic -net user [nic_qemu_args]"