Allow projects to define their own build.
To create a new project, add a directory under `project` and pass the
project name to `make`:
mkdir project/my_project
# Describe the build for the project.
PROJECT=my_project make
Projects can be maintained separately from the main repository.
Change-Id: I33a9d7ca801e2fb3dd9795ece44577b3b565e913
diff --git a/src/fdt_handler_test.cc b/src/fdt_handler_test.cc
index 9556ede..c544454 100644
--- a/src/fdt_handler_test.cc
+++ b/src/fdt_handler_test.cc
@@ -28,6 +28,7 @@
namespace
{
using ::testing::Eq;
+using ::testing::NotNull;
constexpr size_t TEST_HEAP_SIZE = PAGE_SIZE * 10;
@@ -92,15 +93,22 @@
0x73, 0x74, 0x61, 0x72, 0x74, 0x00, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x2c,
0x69, 0x6e, 0x69, 0x74, 0x72, 0x64, 0x2d, 0x65, 0x6e, 0x64, 0x00};
-TEST(fdt, get_boot_params)
+TEST(fdt, find_memory_ranges)
{
std::unique_ptr<uint8_t[]> test_heap(new uint8_t[TEST_HEAP_SIZE]);
halloc_init((size_t)test_heap.get(), TEST_HEAP_SIZE);
ASSERT_TRUE(mm_init());
+ struct fdt_header *fdt;
+ struct fdt_node n;
struct boot_params params = {};
- EXPECT_TRUE(
- fdt_get_boot_params(pa_init((uintpaddr_t)&test_dtb), ¶ms));
+
+ fdt = fdt_map(pa_init((uintpaddr_t)&test_dtb), &n);
+ ASSERT_THAT(fdt, NotNull());
+ ASSERT_TRUE(fdt_find_child(&n, ""));
+ fdt_find_memory_ranges(&n, ¶ms);
+ ASSERT_TRUE(fdt_unmap(fdt));
+
EXPECT_THAT(params.mem_ranges_count, Eq(3));
EXPECT_THAT(pa_addr(params.mem_ranges[0].begin), Eq(0x00000000));
EXPECT_THAT(pa_addr(params.mem_ranges[0].end), Eq(0x20000000));