1/*
2 * Copyright 2017, Data61, CSIRO (ABN 41 687 119 230)
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#include <assert.h>
8#include <camkes.h>
9#include <stddef.h>
10#include <stdint.h>
11#include <stdio.h>
12
13extern char *morecore_area;
14extern size_t morecore_size;
15
16void m_morecore_range(uintptr_t base, size_t size) {
17    printf("Server's range is %p - %p\n"
18           "Client's range is %p - %p\n", (void*)morecore_area,
19           (void*)((uintptr_t)morecore_area + morecore_size), (void*)base,
20           (void*)(base + size));
21#ifdef NDEBUG
22    printf("WARNING: ASSERTIONS DISABLED; NOTHING WILL BE TESTED\n");
23#endif
24    assert(((uintptr_t)morecore_area + morecore_size <= base ||
25            base + size <= (uintptr_t)morecore_area) &&
26        "morecore regions overlap");
27    printf("All OK\n");
28}
29