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

@@ -9,6 +9,7 @@
#include INC_GLUE(message.h)
void exregs_set_mr(struct exregs_data *s, int offset, unsigned long val)
{
/* Get MR0 */
@@ -30,6 +31,14 @@ void exregs_set_pager(struct exregs_data *s, l4id_t pagerid)
s->flags |= EXREGS_SET_PAGER;
}
void exregs_set_utcb(struct exregs_data *s, unsigned long phys,
unsigned long virt)
{
s->utcb_phys = phys;
s->utcb_virt = virt;
s->flags |= EXREGS_SET_UTCB;
}
void exregs_set_stack(struct exregs_data *s, unsigned long sp)
{
s->context.sp = sp;

View File

@@ -9,9 +9,18 @@
#include <l4/macros.h>
#include INC_GLUE(message.h)
/* Old macro */
#if 0
.macro utcb_address rx
ldr \rx, =utcb
.endm
#endif
/* New macro does double dereference */
.macro utcb_address rx
ldr \rx, =kip_utcb_ref @ First get pointer to utcb pointer in KIP
ldr \rx, [\rx] @ Get UTCB address from UTCB pointer in KIP
.endm
BEGIN_PROC(l4_thread_switch)
ldr r12, =__l4_thread_switch
@@ -152,7 +161,7 @@ END_PROC(l4_time)
/*
* System call that controls thread creation, destruction and modification.
* @r0 = thread action, @r1 = &ids
* @r0 = thread action, @r1 = &ids, @r2 = utcb address
*/
BEGIN_PROC(l4_thread_control)
stmfd sp!, {lr}