diff --git a/recipes/src/block_shred/content.mk b/recipes/src/block_shred/content.mk new file mode 100644 index 0000000..7256b68 --- /dev/null +++ b/recipes/src/block_shred/content.mk @@ -0,0 +1,31 @@ +PORT_DIR = $(call port_dir,$(GENODE_DIR)/repos/libports/ports/pcg-c) + +pcg_srcs = $(notdir $(wildcard $(PORT_DIR)/src/lib/pcg-c/src/*-$(1).c)) + +MIRROR_FROM_PORT_DIR := $(addprefix src/lib/pcg-c/src/,\ + $(call pcg_srcs,8) \ + $(call pcg_srcs,16) \ + $(call pcg_srcs,32) \ + $(call pcg_srcs,64) \ + $(call pcg_srcs,128) ) \ + include/pcg-c/pcg_variants.h + +MIRROR_FROM_REP_DIR = include/world/rdrand.h + +content: $(MIRROR_FROM_PORT_DIR) $(MIRROR_FROM_REP_DIR) + +$(MIRROR_FROM_PORT_DIR): + mkdir -p $(dir $@) + cp -r $(PORT_DIR)/$@ $@ + +content: + mkdir -p lib/mk lib/import include/pcg-c + cp $(GENODE_DIR)/repos/libports/lib/mk/libpcg_random.mk lib/mk + cp $(GENODE_DIR)/repos/libports/lib/import/import-libpcg_random.mk lib/import + cp $(GENODE_DIR)/repos/libports/include/pcg-c/genode_inttypes.h include/pcg-c + +$(MIRROR_FROM_REP_DIR): + $(mirror_from_rep_dir) + +SRC_DIR = src/app/block_shred +include $(GENODE_DIR)/repos/base/recipes/src/content.inc diff --git a/recipes/src/block_shred/hash b/recipes/src/block_shred/hash new file mode 100644 index 0000000..a05a0d0 --- /dev/null +++ b/recipes/src/block_shred/hash @@ -0,0 +1 @@ +2019-03-31-d f5989b68c9898c5ca053529e84968a55817a5e02 diff --git a/recipes/src/block_shred/used_apis b/recipes/src/block_shred/used_apis new file mode 100644 index 0000000..0311c67 --- /dev/null +++ b/recipes/src/block_shred/used_apis @@ -0,0 +1,4 @@ +base +os +block_session +jitterentropy diff --git a/src/app/blk_shred/main.cc b/src/app/block_shred/main.cc similarity index 97% rename from src/app/blk_shred/main.cc rename to src/app/block_shred/main.cc index b990218..c7bb9b7 100644 --- a/src/app/blk_shred/main.cc +++ b/src/app/block_shred/main.cc @@ -44,12 +44,15 @@ namespace Blk_shred { PKT_BUF_SIZE = PKT_SIZE*2 + (32<<10) }; - uint64_t pcg_init[2] = PCG32_INITIALIZER; + uint64_t pcg_init[2] PCG32_INITIALIZER; } struct Blk_shred::Main { + Main(Main const &); + Main &operator = (Main const &); + Genode::Env &env; Timer::Connection timer { env }; @@ -66,8 +69,8 @@ struct Blk_shred::Main size_t blk_size = 0; Block::sector_t blk_total= 0; - rand_data *jent; - pcg32_random_t pcg; + rand_data *jent { nullptr }; + pcg32_random_t pcg PCG32_INITIALIZER; template void die(ARGS &&... args) diff --git a/src/app/blk_shred/target.mk b/src/app/block_shred/target.mk similarity index 59% rename from src/app/blk_shred/target.mk rename to src/app/block_shred/target.mk index 2548bdd..a5711db 100644 --- a/src/app/blk_shred/target.mk +++ b/src/app/block_shred/target.mk @@ -1,5 +1,3 @@ -TARGET = blk_shred +TARGET = block_shred LIBS = base jitterentropy libpcg_random SRC_CC = main.cc - -CC_CXX_WARN_STRICT =