Added per-task ipc flags checking instead of the active task flags.

Previously during ipc copy, only the currently active task flags were
checked. This means the flags of whoever doing the actual copy was used
in the ipc. Now flags are stored in the ktcb and checked by the copy routine.

Current use of the flags is to determine short/full/extended ipc.
This commit is contained in:
Bahadir Balban
2009-05-28 11:50:39 +03:00
parent 53310aa31b
commit b977e6597e
6 changed files with 88 additions and 52 deletions

View File

@@ -32,6 +32,7 @@ void fault_ipc_to_pager(u32 faulty_pc, u32 fsr, u32 far)
u32 mr[MR_TOTAL] = { [MR_TAG] = L4_IPC_TAG_PFAULT,
[MR_SENDER] = current->tid };
fault_kdata_t *fault = (fault_kdata_t *)&mr[MR_UNUSED_START];
unsigned int saved_flags;
/* Fill in fault information to pass over during ipc */
fault->faulty_pc = faulty_pc;
@@ -57,9 +58,16 @@ void fault_ipc_to_pager(u32 faulty_pc, u32 fsr, u32 far)
((unsigned long)&mr[0] -
offsetof(syscall_context_t, r3));
/* Save current ipc flags and set current flags to short ipc */
saved_flags = tcb_get_ipc_flags(current);
tcb_set_ipc_flags(current, L4_IPC_FLAGS_SHORT);
/* Send ipc to the task's pager */
ipc_sendrecv(current->pagerid, current->pagerid, 0);
/* Restore ipc flags */
tcb_set_ipc_flags(current, saved_flags);
/*
* FIXME: CHECK TASK KILL REPLY !!!
* Here, pager has handled the request and sent us back a message.