diff --git a/repos/libports/include/solo5/stdint.h b/repos/libports/include/solo5/stdint.h new file mode 100644 index 000000000..21f30459e --- /dev/null +++ b/repos/libports/include/solo5/stdint.h @@ -0,0 +1,12 @@ +#include + +typedef genode_uint8_t uint8_t; +typedef genode_int8_t int8_t; +typedef genode_uint16_t uint16_t; +typedef genode_int16_t int16_t; +typedef genode_uint32_t uint32_t; +typedef genode_int32_t int32_t; +typedef genode_uint64_t uint64_t; +typedef genode_int64_t int64_t; +typedef unsigned long uintptr_t; +typedef unsigned long size_t; diff --git a/repos/libports/lib/import/import-solo5.mk b/repos/libports/lib/import/import-solo5.mk new file mode 100644 index 000000000..ca8264494 --- /dev/null +++ b/repos/libports/lib/import/import-solo5.mk @@ -0,0 +1,4 @@ +SOLO5_PORT_DIR := $(call select_from_ports,solo5) + +INC_DIR += $(SOLO5_PORT_DIR)/include/solo5 +INC_DIR += $(call select_from_repositories,/include/solo5) diff --git a/repos/libports/lib/mk/solo5.mk b/repos/libports/lib/mk/solo5.mk new file mode 100644 index 000000000..43dc0cd6e --- /dev/null +++ b/repos/libports/lib/mk/solo5.mk @@ -0,0 +1,14 @@ +REQUIRES += 64bit + +SHARED_LIB = yes + +include $(REP_DIR)/lib/import/import-solo5.mk + +INC_DIR += $(SOLO5_PORT_DIR)/src/lib/solo5/bindings +INC_DIR += $(REP_DIR)/src/lib/solo5 + +CC_OPT += -D__SOLO5_BINDINGS__ -Drestrict=__restrict__ + +SRC_CC = bindings.cc + +vpath %.cc $(SOLO5_PORT_DIR)/src/lib/solo5/bindings/genode diff --git a/repos/libports/lib/symbols/solo5 b/repos/libports/lib/symbols/solo5 new file mode 100644 index 000000000..61ca6cd7a --- /dev/null +++ b/repos/libports/lib/symbols/solo5 @@ -0,0 +1,13 @@ +solo5_abort T +solo5_app_main U +solo5_block_info T +solo5_block_read T +solo5_block_write T +solo5_clock_monotonic T +solo5_clock_wall T +solo5_console_write T +solo5_exit T +solo5_net_info T +solo5_net_read T +solo5_net_write T +solo5_yield T diff --git a/repos/libports/ports/solo5.hash b/repos/libports/ports/solo5.hash new file mode 100644 index 000000000..730fe9bb4 --- /dev/null +++ b/repos/libports/ports/solo5.hash @@ -0,0 +1 @@ +38981f1a735dfaa4bffc241db5d3b31e2b47163c diff --git a/repos/libports/ports/solo5.port b/repos/libports/ports/solo5.port new file mode 100644 index 000000000..e384b6f95 --- /dev/null +++ b/repos/libports/ports/solo5.port @@ -0,0 +1,13 @@ +LICENSE := ISC +VERSION := HEAD +DOWNLOADS := solo5.archive + +OWNER := Solo5 +REPO := solo5 +REV := 58e855e149b069174b97176dcc0cba077e8a7440 +URL(solo5) := https://github.com/$(OWNER)/$(REPO)/archive/$(REV).tar.gz +SHA(solo5) := b90e727a75b447caa5668c4babf306e1d34c0d1534665900f09d559ef47366a9 +DIR(solo5) := src/lib/solo5 + +DIRS := include/solo5 +DIR_CONTENT(include/solo5) = src/lib/solo5/include/solo5/solo5.h diff --git a/repos/libports/recipes/api/solo5/content.mk b/repos/libports/recipes/api/solo5/content.mk new file mode 100644 index 000000000..9ab4bcfb5 --- /dev/null +++ b/repos/libports/recipes/api/solo5/content.mk @@ -0,0 +1,14 @@ +content: include lib/symbols/solo5 LICENSE + +PORT_DIR := $(call port_dir,$(REP_DIR)/ports/solo5)/src/lib/solo5 + +include: + mkdir -p $@ + cp -r $(PORT_DIR)/include $@ + cp -r $(REP_DIR)/include $@ + +lib/symbols/solo5: + $(mirror_from_rep_dir) + +LICENSE: + cp $(PORT_DIR)/$@ $@ diff --git a/repos/libports/recipes/api/solo5/hash b/repos/libports/recipes/api/solo5/hash new file mode 100644 index 000000000..39cdd0ded --- /dev/null +++ b/repos/libports/recipes/api/solo5/hash @@ -0,0 +1 @@ +- diff --git a/repos/libports/recipes/src/solo5/api b/repos/libports/recipes/src/solo5/api new file mode 100644 index 000000000..19e0c9e73 --- /dev/null +++ b/repos/libports/recipes/src/solo5/api @@ -0,0 +1 @@ +solo5 diff --git a/repos/libports/recipes/src/solo5/content.mk b/repos/libports/recipes/src/solo5/content.mk new file mode 100644 index 000000000..70db88ed3 --- /dev/null +++ b/repos/libports/recipes/src/solo5/content.mk @@ -0,0 +1,21 @@ +PORT_DIR_SOLO5 := $(call port_dir,$(REP_DIR)/ports/solo5) + +SRC_DIR = src/lib/solo5 + +MIRROR_FROM_REP_DIR = \ + include/solo5 \ + lib/import/import-solo5.mk \ + lib/mk/solo5.mk \ + +content: $(SRC_DIR) $(MIRROR_FROM_REP_DIR) + +$(SRC_DIR): + mkdir -p $@ + cp -rH $(REP_DIR)/$@/* $@/ + cp -r $(PORT_DIR_SOLO5)/$@/* $@/ + cp -r $(PORT_DIR_SOLO5)/include/solo5/solo5.h $@/ + cp $(PORT_DIR_SOLO5)/$@/LICENSE . + echo 'LIBS=solo5' > $@/target.mk + +$(MIRROR_FROM_REP_DIR): + $(mirror_from_rep_dir) diff --git a/repos/libports/recipes/src/solo5/hash b/repos/libports/recipes/src/solo5/hash new file mode 100644 index 000000000..39cdd0ded --- /dev/null +++ b/repos/libports/recipes/src/solo5/hash @@ -0,0 +1 @@ +- diff --git a/repos/libports/recipes/src/solo5/used_apis b/repos/libports/recipes/src/solo5/used_apis new file mode 100644 index 000000000..b14db96ac --- /dev/null +++ b/repos/libports/recipes/src/solo5/used_apis @@ -0,0 +1,6 @@ +base +os +block_session +nic_session +rtc_session +timer_session diff --git a/repos/libports/run/mirage_net.run b/repos/libports/run/mirage_net.run new file mode 100644 index 000000000..3388c7c91 --- /dev/null +++ b/repos/libports/run/mirage_net.run @@ -0,0 +1,117 @@ +if {![have_spec x86_64]} { + puts "\nSolo5 requires a 64bit architecture\n" + exit 0 +} + +if {![file exists bin/mirage]} { + puts "" + puts "A mirage image must be provided at 'bin/mirage' to execute this scenario." + puts "" + exit 1 +} + +if {[have_spec linux]} { + puts "" + puts "This scenario is not available for the Linux platform." + puts "" + exit 1 +} + +create_boot_directory + +import_from_depot \ + genodelabs/src/[base_src] \ + genodelabs/src/init \ + genodelabs/src/rtc_drv \ + +source ${genode_dir}/repos/base/run/platform_drv.inc + +set build_components { + drivers/nic + drivers/rtc + lib/solo5 +} + +append_platform_drv_build_components + +lappend_if [expr {[nic_drv_binary] == "nic_drv"}] build_components drivers/nic +lappend_if [expr {[nic_drv_binary] == "usb_drv"}] build_components drivers/usb + +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 } + return gpio_drv } + +lappend_if [have_spec gpio] build_components drivers/gpio + +build $build_components + +append config { + + + + + + + + + + + + + + + } + +append_platform_drv_config + +append_if [have_spec gpio] config " + + + + + " + +append config { + + + + + + + + + + + + + + + + + + +} + +install_config $config + +set boot_modules { + mirage + rtc_drv + solo5.lib.so +} + +# platform-specific modules +append_platform_drv_boot_modules + +lappend boot_modules [nic_drv_binary] + +lappend_if [have_spec gpio] boot_modules [gpio_drv] + +build_boot_image $boot_modules + +append qemu_args " -nographic -net user" + +append_if [have_spec x86] qemu_args " -net nic,model=e1000 " +append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " + +run_genode_until forever diff --git a/repos/libports/run/solo5.run b/repos/libports/run/solo5.run new file mode 100644 index 000000000..434556e81 --- /dev/null +++ b/repos/libports/run/solo5.run @@ -0,0 +1,99 @@ +if {![have_spec 64bit]} { + puts "\nSolo5 requires a 64bit architecture\n" + exit 0 +} + +if {[have_spec linux]} { + puts "\nRunscript not compatible with base-linux drivers\n" + exit 0 +} + +create_boot_directory + +import_from_depot \ + genodelabs/src/[base_src] \ + genodelabs/src/init \ + genodelabs/src/rtc_drv \ + +install_config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} + +build { + app/sequence + server/nic_loopback + server/ram_blk + test/solo5 +} + +build_boot_image { + nic_loopback + ram_blk + sequence + solo5.lib.so + solo5-test_blk + solo5-test_fpu + solo5-test_globals + solo5-test_hello + solo5-test_quiet + solo5-test_time +} + +append qemu_args " -nographic " + +run_genode_until {child "test" exited with exit value 0} 40 diff --git a/repos/libports/run/solo5_ping.run b/repos/libports/run/solo5_ping.run new file mode 100644 index 000000000..9b8876309 --- /dev/null +++ b/repos/libports/run/solo5_ping.run @@ -0,0 +1,123 @@ +if {![have_spec x86_64]} { + puts "\nSolo5 requires a 64bit architecture\n" + exit 0 +} + +if {[have_spec linux]} { + puts "\nRunscript not compatible with base-linux drivers\n" + exit 0 +} + +create_boot_directory + +import_from_depot \ + genodelabs/src/[base_src] \ + genodelabs/src/init \ + genodelabs/src/rtc_drv \ + +source ${genode_dir}/repos/base/run/platform_drv.inc + +append config { + + + + + + + + + + + + + + + + } + +append_platform_drv_config + +append config { + + + + + + + + + + + + + + + } [nic_drv_config] { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} + +install_config $config + +append build_components { + app/ping + drivers/nic + server/nic_bridge + test/solo5/ping_serve +} + +append_platform_drv_build_components +build $build_components + +append boot_modules { + nic_bridge + ping + } [nic_drv_binary] { + solo5-test_ping_serve + solo5.lib.so +} + +append_platform_drv_boot_modules +build_boot_image $boot_modules + +append qemu_args " -nographic " + +run_genode_until {child "ping" exited with exit value 0} 60 diff --git a/repos/libports/src/lib/solo5/target.mk b/repos/libports/src/lib/solo5/target.mk new file mode 100644 index 000000000..ee186f12a --- /dev/null +++ b/repos/libports/src/lib/solo5/target.mk @@ -0,0 +1,2 @@ +TARGET = dummy-solo5 +LIBS = solo5 diff --git a/repos/libports/src/test/solo5/abort/target.mk b/repos/libports/src/test/solo5/abort/target.mk new file mode 100644 index 000000000..c52248b9b --- /dev/null +++ b/repos/libports/src/test/solo5/abort/target.mk @@ -0,0 +1 @@ +include $(REP_DIR)/src/test/solo5/test.inc diff --git a/repos/libports/src/test/solo5/blk/target.mk b/repos/libports/src/test/solo5/blk/target.mk new file mode 100644 index 000000000..c52248b9b --- /dev/null +++ b/repos/libports/src/test/solo5/blk/target.mk @@ -0,0 +1 @@ +include $(REP_DIR)/src/test/solo5/test.inc diff --git a/repos/libports/src/test/solo5/exception/target.mk b/repos/libports/src/test/solo5/exception/target.mk new file mode 100644 index 000000000..c52248b9b --- /dev/null +++ b/repos/libports/src/test/solo5/exception/target.mk @@ -0,0 +1 @@ +include $(REP_DIR)/src/test/solo5/test.inc diff --git a/repos/libports/src/test/solo5/fpu/target.mk b/repos/libports/src/test/solo5/fpu/target.mk new file mode 100644 index 000000000..c52248b9b --- /dev/null +++ b/repos/libports/src/test/solo5/fpu/target.mk @@ -0,0 +1 @@ +include $(REP_DIR)/src/test/solo5/test.inc diff --git a/repos/libports/src/test/solo5/globals/target.mk b/repos/libports/src/test/solo5/globals/target.mk new file mode 100644 index 000000000..c52248b9b --- /dev/null +++ b/repos/libports/src/test/solo5/globals/target.mk @@ -0,0 +1 @@ +include $(REP_DIR)/src/test/solo5/test.inc diff --git a/repos/libports/src/test/solo5/hello/target.mk b/repos/libports/src/test/solo5/hello/target.mk new file mode 100644 index 000000000..c52248b9b --- /dev/null +++ b/repos/libports/src/test/solo5/hello/target.mk @@ -0,0 +1 @@ +include $(REP_DIR)/src/test/solo5/test.inc diff --git a/repos/libports/src/test/solo5/ping_serve/target.mk b/repos/libports/src/test/solo5/ping_serve/target.mk new file mode 100644 index 000000000..c52248b9b --- /dev/null +++ b/repos/libports/src/test/solo5/ping_serve/target.mk @@ -0,0 +1 @@ +include $(REP_DIR)/src/test/solo5/test.inc diff --git a/repos/libports/src/test/solo5/quiet/target.mk b/repos/libports/src/test/solo5/quiet/target.mk new file mode 100644 index 000000000..c52248b9b --- /dev/null +++ b/repos/libports/src/test/solo5/quiet/target.mk @@ -0,0 +1 @@ +include $(REP_DIR)/src/test/solo5/test.inc diff --git a/repos/libports/src/test/solo5/test.inc b/repos/libports/src/test/solo5/test.inc new file mode 100644 index 000000000..7a7fa3aaa --- /dev/null +++ b/repos/libports/src/test/solo5/test.inc @@ -0,0 +1,8 @@ +TEST_NAME := test_$(subst $(REP_DIR)/src/test/solo5/,,$(PRG_DIR)) +TARGET = solo5-$(TEST_NAME) + +LIBS += solo5 + +SRC_C += $(TEST_NAME).c + +vpath %.c $(call select_from_ports,solo5)/src/lib/solo5/tests/$(TEST_NAME) diff --git a/repos/libports/src/test/solo5/time/target.mk b/repos/libports/src/test/solo5/time/target.mk new file mode 100644 index 000000000..c52248b9b --- /dev/null +++ b/repos/libports/src/test/solo5/time/target.mk @@ -0,0 +1 @@ +include $(REP_DIR)/src/test/solo5/test.inc diff --git a/tool/autopilot.list b/tool/autopilot.list index 1bf9a24cf..49449b277 100644 --- a/tool/autopilot.list +++ b/tool/autopilot.list @@ -97,6 +97,7 @@ seoul-auto signal slab smartcard +solo5 stdcxx sub_rm synced_interface