mirror of
https://github.com/drasko/codezero.git
synced 2026-02-17 20:33:14 +01:00
Various changes to incorporate new utcb setup.
Issues with l4_return value not reaching client side modified: libs/c/include/stdio.h modified: src/arch/arm/exception.c modified: src/glue/arm/init.c modified: tasks/fs0/src/task.c modified: tasks/libl4/include/l4lib/arch-arm/utcb.h modified: tasks/libl4/src/arm/syscalls.S modified: tasks/libl4/src/init.c deleted: tasks/libl4/tagfilelist modified: tasks/libposix/open.c modified: tasks/mm0/include/utcb.h modified: tasks/mm0/include/vm_area.h modified: tasks/mm0/main.c modified: tasks/mm0/src/init.c modified: tasks/mm0/src/task.c modified: tasks/mm0/src/utcb.c modified: tasks/mm0/src/vm_object.c
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
#include <utcb.h>
|
||||
#include <lib/addr.h>
|
||||
#include <l4/macros.h>
|
||||
#include <l4lib/arch/syscalls.h>
|
||||
#include <l4lib/arch/syslib.h>
|
||||
#include <task.h>
|
||||
#include INC_GLUE(memlayout.h)
|
||||
|
||||
static struct address_pool utcb_vaddr_pool;
|
||||
@@ -29,4 +32,45 @@ void *utcb_vaddr_new(void)
|
||||
return address_new(&utcb_vaddr_pool, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends utcb address information to requester task, allocates
|
||||
* an address if it doesn't exist and the requester is asking
|
||||
* for its own.
|
||||
*/
|
||||
int task_send_utcb_address(l4id_t sender, l4id_t taskid)
|
||||
{
|
||||
struct tcb *task = find_task(taskid);
|
||||
|
||||
/* Is the task asking for its own utcb address */
|
||||
if (sender == taskid) {
|
||||
/*
|
||||
* It hasn't got one allocated. We allocate one here,
|
||||
* but only because the requester is requesting for its
|
||||
* own utcb.
|
||||
*/
|
||||
if (!task->utcb_address)
|
||||
task->utcb_address = (unsigned long)utcb_vaddr_new();
|
||||
|
||||
/* Return it to requester */
|
||||
printf("%s: Returning 0x%x\n", __FUNCTION__, task->utcb_address);
|
||||
return l4_ipc_return(task->utcb_address);
|
||||
|
||||
/* A task is asking for someone else's utcb */
|
||||
} else {
|
||||
/* Only vfs is allowed to do so yet, because its a server */
|
||||
if (sender == VFS_TID) {
|
||||
/*
|
||||
* Return utcb address to requester. Note if there's
|
||||
* none allocated so far, requester gets 0. We don't
|
||||
* allocate one here.
|
||||
*/
|
||||
printf("%s: Returning 0x%x\n", __FUNCTION__,
|
||||
task->utcb_address);
|
||||
return l4_ipc_return(task->utcb_address);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user