This commit is contained in:
Ehmry - 2019-07-06 14:16:37 +02:00
parent 8e5510d5e3
commit 51eeb3cec7
10 changed files with 198 additions and 0 deletions

3
.gitmodules vendored
View File

@ -106,3 +106,6 @@
[submodule "libretro/cores/yabause/upstream"]
path = libretro/cores/yabause/upstream
url = https://github.com/libretro/yabause.git
[submodule "solo5/upstream"]
path = solo5/upstream
url = https://github.com/Solo5/solo5.git

32
solo5/Tupfile Normal file
View File

@ -0,0 +1,32 @@
TARGET_NAME = solo5
LIBS += genode-os
include_rules
: solo5.symbols |> !abi_stub |>
: solo5.pc.in |> ^ SED %B^ \
sed \
-e "s|@includedir@|`nix-store --add upstream/include`|" \
-e "s|@version@|`git describe`|" \
< %f > %o \
|> $(PKG_CONFIG_DIR)/solo5.pc $(GENODE_DIR)/<pkg-config>
: |> cc -Iupstream/include/solo5 upstream/%o/%o.c -o %o |> mfttool
DEFINES += -D__SOLO5_BINDINGS__
CXXFLAGS += -Drestrict=__restrict__
DEFINES += -Wno-builtin-declaration-mismatch
INCLUDES += -Iupstream/include/solo5
INCLUDES += -Iupstream/include/crt
#: foreach ../../tenders/common/mft.c |> !cc |> {obj}
BINDINGS_DIR = upstream/bindings/genode
: foreach $(BINDINGS_DIR)/*.cc |> !cxx |> {obj}
: {obj} |> !lib |> solo5.lib.so {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

2
solo5/Tuprules.tup Normal file
View File

@ -0,0 +1,2 @@
DEFINES += -Wno-builtin-declaration-mismatch
INCLUDES += -I$(TUP_CWD)

7
solo5/solo5.pc.in Normal file
View File

@ -0,0 +1,7 @@
includedir=@includedir@
Name: solo5
Version: @version@
Description: Solo5 sandboxed execution environment
Cflags: -I${includedir}/crt -I${includedir}/solo5
Libs: -l:solo5.lib.so

15
solo5/solo5.symbols Normal file
View File

@ -0,0 +1,15 @@
solo5_abort T
solo5_block_acquire T
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_acquire T
solo5_net_info T
solo5_net_read T
solo5_net_write T
solo5_set_tls_base T
solo5_yield T

12
solo5/stdint.h Normal file
View File

@ -0,0 +1,12 @@
// Genode stdint.h
#include <base/fixed_stdint.h>
typedef genode_int8_t int8_t;
typedef genode_uint8_t uint8_t;
typedef genode_int16_t int16_t;
typedef genode_uint16_t uint16_t;
typedef genode_int32_t int32_t;
typedef genode_uint32_t uint32_t;
typedef genode_int64_t int64_t;
typedef genode_uint64_t uint64_t;
typedef unsigned long uintptr_t;

34
solo5/test/Tupfile Normal file
View File

@ -0,0 +1,34 @@
TARGET_NAME = solo5_tests
LIBS += solo5 genode-base
PKG_DEPENDS += \
_/src/init \
_/src/nic_loopback \
_/src/ram_block \
_/src/sequence \
_/src/solo5 \
_/src/$(BIN_NAME) \
include_rules
run ./test_rules.sh \
blk \
dumpcore \
exception \
fpu \
globals \
hello \
net \
net_2if \
notls \
quiet \
ssp \
time \
wnox \
xnow \
: foreach {bin} |> !collect_bin |>
: runtime |> !collect_pkg_runtime |>
include &(BIN_RULES)
include &(PKG_RULES)

85
solo5/test/runtime Normal file
View File

@ -0,0 +1,85 @@
<runtime ram="32M" caps="1000" binary="init">
<!--
<events>
<timeout meaning="failed" sec="60" />
<log meaning="succeeded">
[init] child "test" exited with exit value 0
</log>
<log meaning="failed">Error: </log>
</events>
-->
<content>
<rom label="nic_loopback"/>
<rom label="ram_block"/>
<rom label="sequence"/>
<rom label="solo5.lib.so"/>
<rom label="test_blk"/>
<rom label="test_dumpcore"/>
<rom label="test_exception"/>
<rom label="test_fpu"/>
<rom label="test_globals"/>
<rom label="test_hello"/>
<rom label="test_net"/>
<rom label="test_net_2if"/>
<rom label="test_notls"/>
<rom label="test_quiet"/>
<rom label="test_ssp"/>
<rom label="test_time"/>
<rom label="test_wnox"/>
<rom label="test_xnow"/>
</content>
<config>
<parent-provides>
<service name="CPU"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
<service name="Timer"/>
</parent-provides>
<default-route> <any-service> <parent/> <any-child/> </any-service> </default-route>
<start name="nic_loopback" caps="96">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Nic"/> </provides>
</start>
<start name="ram_block" caps="96">
<resource name="RAM" quantum="9M"/>
<provides> <service name="Block"/> </provides>
<config size="8M" block_size="4096"/>
</start>
<start name="test" caps="256">
<binary name="sequence"/>
<resource name="RAM" quantum="16M"/>
<config>
<start name="solo5-test_hello">
<config>
<solo5 cmdline="Hello_Solo5"/>
<nic/> <blk/>
</config>
</start>
<start name="solo5-test_blk">
<config> <block/> </config>
</start>
<start name="test_dumpcore"/>
<start name="test_exception"/>
<start name="test_fpu"/>
<start name="test_globals"/>
<start name="test_net"/>
<start name="test_net_2if"/>
<start name="test_notls"/>
<start name="test_quiet"/>
<start name="test_ssp"/>
<start name="test_time"/>
<start name="test_wnox"/>
<start name="test_xnow"/>
</config>
</start>
</config>
</runtime>

7
solo5/test/test_rules.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
for T in ${@}
do
echo ": foreach ../upstream/tests/test_${T}/*.c |> !cc |> ${T}_%B.o {${T}-obj}"
echo ": {${T}-obj} |> !prg |> test_${T} {bin}"
done

1
solo5/upstream Submodule

@ -0,0 +1 @@
Subproject commit d0ca2cb1bf77c9467b2ade2269322dc3ec23863c