Removed special-case utcb shared page from posix services.

Previously a so-called utcb shared page was used for transfering
data between posix services. This was a special shmat/get/dt case
allocating from its own virtual pool. Now the term utcb is renamed
as a shared page and integrated with the shm* handling routines.

Generic l4 threads will use long-ipc and not this method. Posix
services will continue to communicate on a shared page for now.
	modified:   tasks/libl4/include/l4lib/ipcdefs.h
	modified:   tasks/libl4/src/init.c
	new file:   tasks/libposix/init.c
	modified:   tasks/mm0/include/shm.h
	modified:   tasks/mm0/include/task.h
	deleted:    tasks/mm0/include/utcb.h
	modified:   tasks/mm0/main.c
	modified:   tasks/mm0/src/boot.c
	modified:   tasks/mm0/src/clone.c
	modified:   tasks/mm0/src/execve.c
	modified:   tasks/mm0/src/exit.c
	modified:   tasks/mm0/src/init.c
	modified:   tasks/mm0/src/shm.c
	modified:   tasks/mm0/src/task.c
	deleted:    tasks/mm0/src/utcb.c
	deleted:    tools/l4-qemu
This commit is contained in:
Bahadir Balban
2009-04-22 11:58:58 +03:00
parent 8d82fa5f5e
commit 203f053878
16 changed files with 209 additions and 268 deletions

View File

@@ -19,8 +19,8 @@
/* For ping ponging */
#define L4_IPC_TAG_SYNC 3
/* To obtain utcb address */
#define L4_IPC_TAG_UTCB 4
/* To obtain default shared page address */
#define L4_IPC_TAG_SHPAGE 4
/* XXX: unused */
#define L4_IPC_TAG_GRANT 5

View File

@@ -34,77 +34,6 @@ struct kip *kip;
*/
struct utcb utcb;
/*
* Shared utcb page for this task. Used for passing data among ipc
* parties when message registers are not big enough. Every thread
* has right to own one, and it has an address unique to every
* thread. It must be explicitly mapped by both parties of the ipc
* in order to be useful.
*/
void *utcb_page;
/*
* Obtains a unique address for the task's shared utcb page. Note this
* does *not* map the utcb, just returns the address. This address
* is used as an shm key to map it via shmget()/shmat() later on.
*/
static void *l4_utcb_page(void)
{
void *addr;
int err;
/* We're asking it for ourself. */
write_mr(L4SYS_ARG0, self_tid());
/* Call pager with utcb address request. Check ipc error. */
if ((err = l4_sendrecv(PAGER_TID, PAGER_TID, L4_IPC_TAG_UTCB)) < 0) {
printf("%s: L4 IPC Error: %d.\n", __FUNCTION__, err);
return PTR_ERR(err);
}
/* Check if syscall itself was successful */
if (IS_ERR(addr = (void *)l4_get_retval())) {
printf("%s: Request UTCB Address Error: %d.\n",
__FUNCTION__, (int)addr);
return addr;
}
return addr;
}
/*
* Initialises a non-pager task's shared memory utcb page
* using posix semantics. Used during task initialisation
* and by child tasks after a fork.
*/
int utcb_init(void)
{
int shmid;
void *shmaddr;
/*
* Initialise utcb only if we're not the pager.
* The pager does it differently for itself.
*/
if (self_tid() != PAGER_TID) {
/* Obtain our utcb page address */
utcb_page = l4_utcb_page();
//printf("%s: UTCB Read from mm0 as: 0x%x\n", __FUNCTION__,
// (unsigned long)utcb_page);
/* Use it as a key to create a shared memory region */
BUG_ON((shmid = shmget((key_t)utcb_page,
PAGE_SIZE, IPC_CREAT)) < 0);
/* Attach to the region */
BUG_ON((shmaddr = shmat(shmid, utcb_page, 0)) < 0);
BUG_ON(shmaddr != utcb_page);
}
return 0;
}
void __l4_init(void)
{
@@ -123,7 +52,5 @@ void __l4_init(void)
(__l4_exchange_registers_t)kip->exchange_registers;
__l4_kmem_control = (__l4_kmem_control_t)kip->kmem_control;
__l4_time = (__l4_time_t)kip->time;
utcb_init();
}