Some minor changes

Need to reimplement exchange_registers
This commit is contained in:
Bahadir Balban
2008-09-12 10:47:36 +03:00
parent af03975dc1
commit 0b3ab05a98
4 changed files with 12 additions and 8 deletions

View File

@@ -104,7 +104,7 @@ int arch_setup_new_thread(struct ktcb *new, struct ktcb *orig)
* policy on the microkernel, but it is currently the best solution.
*
* A cleaner but slower way would be the pager setting child registers
* via exchanges_registers() and start the child thread afterwards.
* via exchange_registers() and start the child thread afterwards.
*/
KTCB_REF_MR0(new)[MR_RETURN] = 0;
@@ -129,7 +129,7 @@ int arch_setup_new_thread(struct ktcb *new, struct ktcb *orig)
}
int thread_setup_new_ids(struct task_ids *ids, unsigned int flags,
struct tcb *new, struct tcb *orig)
struct ktcb *new, struct ktcb *orig)
{
/* For tid, allocate requested id if it's available, else a new one */
if ((ids->tid = id_get(thread_id_pool, ids->tid)) < 0)
@@ -158,7 +158,7 @@ int thread_setup_new_ids(struct task_ids *ids, unsigned int flags,
/* If thread space is the same, tgid is either new or existing one */
if (flags == THREAD_CREATE_SAMESPC) {
/* Check if same tgid is expected */
if (ids->tgid != task->tgid) {
if (ids->tgid != orig->tgid) {
if ((ids->tgid = id_get(tgroup_id_pool,
ids->tgid)) < 0)
ids->tgid = id_new(tgroup_id_pool);
@@ -167,6 +167,8 @@ int thread_setup_new_ids(struct task_ids *ids, unsigned int flags,
/* Set all ids */
set_task_ids(new, ids);
return 0;
}
/*

View File

@@ -40,9 +40,10 @@ static inline l4id_t l4_get_sender(void)
/*
* When doing an ipc the sender never has to be explicitly set in
* the utcb via this function since it is passed in the argument
* registers. This is only used for restoring the sender on the
* utcb in order to complete an earlier ipc.
* the utcb via this function since this information is found out
* by the microkernel by checking the system caller's id. This is
* only used for restoring the sender on the utcb in order to
* complete an earlier ipc.
*/
static inline void l4_set_sender(l4id_t sender)
{

View File

@@ -47,7 +47,7 @@ int fork(void)
return ret;
}
extern int arch_clone(int, int);
extern int arch_clone(l4id_t to, l4id_t from);
int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ...)
{

View File

@@ -54,6 +54,7 @@ int do_fork(struct tcb *parent)
struct task_ids ids = {
.tid = TASK_ID_INVALID,
.spid = parent->spid,
.tgid = TASK_ID_INVALID /* FIXME: !!! FIX THIS */
};
/* Make all shadows in this task read-only */
@@ -81,7 +82,7 @@ int do_fork(struct tcb *parent)
l4_ipc_return((int)utcb_shm);
return 0;
}
/* FIXME: We should munmap() parent's utcb page from child */
/* FIXME: Should we munmap() parent's utcb page from child? */
/*
* Map and prefault child utcb to vfs so that vfs need not