mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-25 16:31:06 +00:00
8d5005e03a
The driver is faily simple and does not support fancy features like TCP checksum offloading or vlan filtering, but it is fully capable of running every Genode network based scenario I've tried. Its currently known to work on virt_qemu arm platforms and x86_64. Fix #3825
55 lines
1.3 KiB
PHP
55 lines
1.3 KiB
PHP
set qemu_spawn_id ""
|
|
set qemu_args [get_cmd_arg --qemu-args ""]
|
|
|
|
|
|
#
|
|
# Enable run scripts to extend 'qemu_arg' via 'append' without bothering
|
|
# about the required whitespace in front of the custom arguments.
|
|
#
|
|
append qemu_args " "
|
|
|
|
|
|
proc qemu_args { } {
|
|
global qemu_args
|
|
return $qemu_args
|
|
}
|
|
|
|
proc qemu_nic_model {} {
|
|
if [have_spec lan9118] { return lan9118 }
|
|
if [have_spec zynq] { return cadence_gem }
|
|
if [have_spec x86] { return e1000 }
|
|
return nic_model_missing
|
|
}
|
|
|
|
proc append_qemu_nic_args { { extra_netdev_args "" } } {
|
|
global qemu_args
|
|
append qemu_args " -netdev user,id=net0"
|
|
|
|
if { $extra_netdev_args ne "" } {
|
|
append qemu_args ",$extra_netdev_args"
|
|
}
|
|
|
|
if {[have_spec virt_qemu]} {
|
|
append qemu_args " -global virtio-mmio.force-legacy=false "
|
|
append qemu_args " -device virtio-net-device,bus=virtio-mmio-bus.0,netdev=net0 "
|
|
} else {
|
|
append qemu_args " -net nic,model=[qemu_nic_model],netdev=net0 "
|
|
}
|
|
}
|
|
|
|
|
|
##
|
|
# Check whether Qemu support is available
|
|
#
|
|
# XXX should by removed in favor of [have_include "exec/qemu"]
|
|
#
|
|
proc is_qemu_available { } {
|
|
if {[expr [have_spec linux] && {"[board]"} == {"linux"}]} { return false }
|
|
|
|
if {[have_spec rpi]} {
|
|
puts stderr "skipping execution because platform is not supported by qemu"
|
|
return false
|
|
}
|
|
return true
|
|
}
|