From a900e6fb7852ec88c916606129214de12097186a Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Wed, 23 Apr 2025 18:41:48 +0200 Subject: [PATCH] ealanos: Tests for new heap implementation. --- repos/ealanos/src/test/coreheap_test/main.cc | 42 +++++++++++++++++++ .../ealanos/src/test/coreheap_test/target.mk | 6 +++ 2 files changed, 48 insertions(+) create mode 100644 repos/ealanos/src/test/coreheap_test/main.cc create mode 100644 repos/ealanos/src/test/coreheap_test/target.mk diff --git a/repos/ealanos/src/test/coreheap_test/main.cc b/repos/ealanos/src/test/coreheap_test/main.cc new file mode 100644 index 0000000000..d6bbd9d57f --- /dev/null +++ b/repos/ealanos/src/test/coreheap_test/main.cc @@ -0,0 +1,42 @@ +/** + * @file main.cc + * @author your name (you@domain.com) + * @brief Component for testing CPU core-local heaps + * @version 0.1 + * @date 2025-04-23 + * + * @copyright Copyright (c) 2025 + * + */ + +#include +#include +#include +#include + +namespace Ealan::Memory { + class CoreheapTest; + using namespace Genode; +} + +class Ealan::Memory::CoreheapTest +{ + private: + Env &_env; + Core_heap<64, 2048> _heap{_env.pd(), _env.rm()}; + + public: + + CoreheapTest(Env &env) : _env(env) + { + log("Starting tests for Core_heap"); + + void *p = _heap.aligned_alloc(42, 16); + log("Allocated memory at ", p); + } +}; + +void Component::construct(Genode::Env &env) +{ + static Ealan::Memory::CoreheapTest test(env); +} \ No newline at end of file diff --git a/repos/ealanos/src/test/coreheap_test/target.mk b/repos/ealanos/src/test/coreheap_test/target.mk new file mode 100644 index 0000000000..3470ac8c0f --- /dev/null +++ b/repos/ealanos/src/test/coreheap_test/target.mk @@ -0,0 +1,6 @@ +TARGET = coreheap_test +SRC_CC = main.cc +LIBS = base +INC_DIR = $(PRG_DIR) +INC_DIR += $(REP_DIR)/include +