Derive a new IPC buffer cap when inserting into the initial threads TCB to remove mapping information

For any other thread setting the IPC buffer via TCB_Configure will result
in a derived capability being installed that does not have mapping information.
This leads to a expected behaviour that setting a new IPC buffer (even if it is
the same as the current one), will not perform an unmapping.
This commit is contained in:
Adrian Danis 2014-10-17 15:51:52 +11:00
parent 28eb695464
commit 04106920c3

View file

@ -370,6 +370,7 @@ create_initial_thread(
pptr_t pptr;
cap_t cap;
tcb_t* tcb;
deriveCap_ret_t dc_ret;
/* allocate TCB */
pptr = alloc_region(TCB_BLOCK_SIZE_BITS);
@ -382,6 +383,13 @@ create_initial_thread(
tcb->tcbTimeSlice = CONFIG_TIME_SLICE;
Arch_initContext(&tcb->tcbContext);
/* derive a copy of the IPC buffer cap for inserting */
dc_ret = deriveCap(SLOT_PTR(pptr_of_cap(root_cnode_cap), BI_CAP_IT_IPCBUF), ipcbuf_cap);
if (dc_ret.status != EXCEPTION_NONE) {
printf("Failed to derive copy of IPC Buffer\n");
return false;
}
/* initialise TCB (corresponds directly to abstract specification) */
cteInsert(
root_cnode_cap,
@ -394,7 +402,7 @@ create_initial_thread(
SLOT_PTR(pptr, tcbVTable)
);
cteInsert(
ipcbuf_cap,
dc_ret.cap,
SLOT_PTR(pptr_of_cap(root_cnode_cap), BI_CAP_IT_IPCBUF),
SLOT_PTR(pptr, tcbBuffer)
);