Ongoing work for adding per-thread UTCB structures.

Added setting of utcb address to l4_thread_control.
This is going to be moved to exchange_registers() since we need to pass
both the utcb physical and virtual address and exregs fits such context
modification better than thread_control.
This commit is contained in:
Bahadir Balban
2009-04-29 16:53:04 +03:00
parent 54a9b2901d
commit 7a81db8782
35 changed files with 424 additions and 72 deletions

View File

@@ -29,7 +29,11 @@ SECTIONS
/* rodata is needed else your strings will link at physical! */
.rodata : AT (ADDR(.rodata) - offset) { *(.rodata) }
.rodata1 : AT (ADDR(.rodata1) - offset) { *(.rodata1) }
.data : AT (ADDR(.data) - offset) { *(.data) }
.data : AT (ADDR(.data) - offset)
{
*(.data)
}
. = ALIGN(4K);
_start_init = .;
.init : AT (ADDR(.init) - offset) { *(.init.stack) }
. = ALIGN(8);

View File

@@ -11,6 +11,7 @@
#include INC_GLUE(memlayout.h)
#include <l4/lib/list.h>
#include <l4lib/arch/types.h>
#include <l4lib/arch/syscalls.h>
#include <l4lib/utcb.h>
#include <lib/addr.h>
#include <l4/api/kip.h>
@@ -53,6 +54,20 @@ struct task_vma_head {
int tcb_refs;
};
/*
* TLS and UTCB bookkeeping:
*
* This structure is shared among threads whose utcbs are on the same
* physical page. Threads with utcbs on different physical pages have
* their own utcb_data structure, even though they are in the same
* address space, and share their vm_area_list structure.
*/
struct utcb_data {
unsigned long phys; /* Physical utcb address */
unsigned long virt; /* Virtual utcb address */
u32 bit; /* Bitvector of free utcb slots on page */
struct page *p; /* Physical page */
};
/* Stores all task information that can be kept in userspace. */
struct tcb {
@@ -104,6 +119,9 @@ struct tcb {
/* Default ipc-shared-page information */
void *shared_page;
/* Task's utcb data */
struct utcb_data *utcb;
/* Virtual memory areas */
struct task_vma_head *vm_area_head;

View File

@@ -7,10 +7,10 @@
#define __VM_AREA_H__
#include <stdio.h>
#include <task.h>
#include <l4/macros.h>
#include <l4/config.h>
#include <l4/types.h>
#include <task.h>
#include <arch/mm.h>
#include <lib/spinlock.h>