#include <barrelfish/curdispatcher_arch.h>
#include <barrelfish/dispatcher_arch.h>
#include <barrelfish/waitset_chan.h>
+#include <barrelfish_kpi/domain_params.h>
#include <arch/registers.h>
#include <barrelfish/dispatch.h>
#include <if/interdisp_defs.h>
struct span_domain_state *span_domain_state; ///< Reference to the span_domain_state of the "server"
bool initialized; ///< true if remote core is fully initialized
int cnt; ///< Used to count dispatcher connected
+ size_t pagesize; ///< the pagesize to be used for the heap
};
///< Struct for spanning domains state machine
struct remote_core_state *remote_core_state =
(struct remote_core_state*)arg;
+ /* construct a temporary spawn param to supply the morecore alignment */
+ struct spawn_domain_params params;
+ memset(¶ms, 0, sizeof(params));
+ params.pagesize = remote_core_state->pagesize;
+
/* Initialize the barrelfish library */
- err = barrelfish_init_onthread(NULL);
+ err = barrelfish_init_onthread(¶ms);
if (err_is_fail(err)) {
DEBUG_ERR(err, "barrelfish_init_onthread failed");
abort();
remote_core_state->core_id = disp_get_core_id();
remote_core_state->iref = domain_state->iref;
+ /* get the alignment of the morecore state */
+ struct morecore_state *state = get_morecore_state();
+ remote_core_state->pagesize = state->mmu_state.alignment;
+
/* Create the thread for the new dispatcher to init on */
struct thread *newthread =
thread_create_unrunnable(remote_core_init_enabled,
static bool parse_argv(struct spawn_domain_params *params, size_t *morecore_alignment)
{
+ assert(params);
// grab pagesize config from argv if available
size_t morecore_pagesize = MORECORE_PAGESIZE;
int i = 1;
// in the base cn.
err = morecore_init(BASE_PAGE_SIZE);
} else {
+ /* if there is a pagesize supplied, use this one */
size_t morecore_pagesize = 0;
- parse_argv(params, &morecore_pagesize);
+ if (params != NULL && params->pagesize) {
+ morecore_pagesize = params->pagesize;
+
+ assert(morecore_pagesize == BASE_PAGE_SIZE
+#ifdef __x86_64__
+ || morecore_pagesize == HUGE_PAGE_SIZE
+#endif
+ || morecore_pagesize == LARGE_PAGE_SIZE );
+
+ } else {
+ parse_argv(params, &morecore_pagesize);
#if defined(__i386__) && !defined(CONFIG_PSE)
- morecore_pagesize = BASE_PAGE_SIZE;
+ morecore_pagesize = BASE_PAGE_SIZE;
#endif
+ }
err = morecore_init(morecore_pagesize);
}
if (err_is_fail(err)) {