mirror of
https://github.com/drasko/codezero.git
synced 2026-03-01 02:03:29 +01:00
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:
@@ -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;
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Initialise system call offsets.
|
||||
* Initialise system call offsets and utcb reference.
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Bahadir Balban
|
||||
* Copyright (C) 2007-2009 Bahadir Bilgehan Balban
|
||||
*/
|
||||
#include <l4lib/kip.h>
|
||||
#include <l4lib/arch/syslib.h>
|
||||
@@ -27,16 +27,20 @@ __l4_time_t __l4_time = 0;
|
||||
struct kip *kip;
|
||||
|
||||
/*
|
||||
* Private UTCB of this task. Used only for pushing/reading ipc
|
||||
* message registers.
|
||||
* Reference to private UTCB of this thread.
|
||||
* Used only for pushing/reading ipc message registers.
|
||||
*/
|
||||
struct utcb utcb;
|
||||
struct utcb **kip_utcb_ref;
|
||||
|
||||
|
||||
void __l4_init(void)
|
||||
{
|
||||
/* Kernel interface page */
|
||||
kip = l4_kernel_interface(0, 0, 0);
|
||||
|
||||
/* Reference to utcb field of KIP */
|
||||
kip_utcb_ref = (struct utcb **)&kip->utcb;
|
||||
|
||||
__l4_ipc = (__l4_ipc_t)kip->ipc;
|
||||
__l4_map = (__l4_map_t)kip->map;
|
||||
__l4_unmap = (__l4_unmap_t)kip->unmap;
|
||||
|
||||
Reference in New Issue
Block a user