Reorganise user-lever ctrlxfer item definitions into an

architecture-dependent and -independent part
This commit is contained in:
Jan Stoess 2010-07-12 16:12:00 +02:00
parent 3ae8f026c3
commit 174c92624d
6 changed files with 405 additions and 562 deletions

View File

@ -1,6 +1,6 @@
/*********************************************************************
*
* Copyright (C) 2002, 2003, 2005, Karlsruhe University
* Copyright (C) 2002, 2003, 2005, 2010, Karlsruhe University
*
* File path: l4/amd64/specials.h
* Description: amd64 specific functions and defines
@ -55,6 +55,27 @@ L4_INLINE int __L4_Msb (L4_Word_t w)
return bitnum;
}
/*
* Architecture specific helper functions.
*/
L4_INLINE int __L4_Lsb (L4_Word_t w) __attribute__ ((const));
L4_INLINE int __L4_Lsb (L4_Word_t w)
{
L4_Word_t bitnum;
__asm__ (
"/* l4_lsb() */ \n"
"bsf %1, %0 \n"
: /* outputs */
"=r" (bitnum)
: /* inputs */
"rm" (w)
);
return bitnum;
}
#endif /* !__L4__AMD64__SPECIALS_H__ */

View File

@ -34,8 +34,8 @@
#define __L4__IA32__ARCH_H__
#include <l4/ia32/specials.h>
#include <l4/thread.h>
#include <l4/kip.h>
#include <l4/ipc.h>
typedef union {
L4_Word_t raw;
@ -110,12 +110,6 @@ L4_INLINE L4_Bool_t L4_IsIoFpage (L4_Fpage_t f)
}
#define L4_EXREGS_CTRLXFER_CONF_FLAG (1UL << 9)
#define L4_EXREGS_CTRLXFER_READ_FLAG (1UL << 10)
#define L4_EXREGS_CTRLXFER_WRITE_FLAG (1UL << 11)
#define L4_EXREGS_EXCHANDLER_FLAG (1UL << 12)
#define L4_EXREGS_SCHEDULER_FLAG (1UL << 13)
#define L4_CTRLXFER_GPREGS_ID (0)
#define L4_CTRLXFER_FPUREGS_ID (1)
#define L4_CTRLXFER_CREGS_ID (2)
@ -212,155 +206,6 @@ L4_INLINE L4_Bool_t L4_IsIoFpage (L4_Fpage_t f)
#define L4_CTRLXFER_REG_ID(id, reg) ((id * 0x10) + reg)
/*
* CtrlXfer Item
*/
typedef union {
L4_Word_t raw[0];
struct {
L4_Word_t C:1;
L4_Word_t __type:3;
L4_Word_t id:8;
L4_Word_t mask:20;
};
} L4_CtrlXferItem_t;
#if defined(__cplusplus)
/*
* IA32 CtrlXfer Item
*/
L4_INLINE void L4_CtrlXferItemInit (L4_CtrlXferItem_t *c, L4_Word_t id)
{
c->raw[0] = 0;
c->__type = 0x06;
c->id = id;
c->mask = 0;
}
L4_INLINE void L4_MsgAppendCtrlXferItem (L4_Msg_t * msg, L4_CtrlXferItem_t *c)
{
L4_Word_t reg=0, num=0, mask = c->mask;
/*
* Add regs according to mask
* */
for (reg+=__L4_Lsb(mask); mask!=0; mask>>=__L4_Lsb(mask)+1,reg+=__L4_Lsb(mask)+1,num++)
msg->msg[msg->tag.X.u + msg->tag.X.t + 2 + num] = c->raw[reg+1];
/* Add item */
if (num)
{
msg->msg[msg->tag.X.u + msg->tag.X.t + 1] = c->raw[0];
msg->tag.X.t += 1 + num;
}
}
L4_INLINE L4_Word_t L4_MsgStoreCtrlXferItem (L4_Msg_t * msg, L4_Word_t mr, L4_CtrlXferItem_t *c)
{
L4_Word_t reg=0, num=0, mask=0;
/* Store item */
c->raw[0] = msg->msg[mr];
mask = c->mask;
/*
* Store regs according to mask
* */
for (reg+=__L4_Lsb(mask); mask!=0; mask>>=__L4_Lsb(mask)+1,reg+=__L4_Lsb(mask)+1,num++)
c->raw[reg+1] = msg->msg[mr + 1 + num];
return num + 1;
}
L4_INLINE L4_Word_t L4_CtrlXferItemId(L4_Msg_t * msg, L4_Word_t mr)
{
L4_CtrlXferItem_t *c = (L4_CtrlXferItem_t *) &msg->msg[mr];
return (c->__type == 0x6) ? c->id : L4_CTRLXFER_INVALID_ID;
}
/*
* IA32 Fault Configuration item
*/
L4_INLINE void L4_FaultConfCtrlXferItemInit (L4_CtrlXferItem_t *c, L4_Word_t fault_id, L4_Word_t fault_mask)
{
c->raw[0] = 0;
c->__type = 0x06;
c->id = fault_id;
c->mask = fault_mask;
}
L4_INLINE void L4_AppendFaultConfCtrlXferItems(L4_Msg_t *msg, L4_Word64_t fault_id_mask, L4_Word_t fault_mask, L4_Word_t C)
{
L4_CtrlXferItem_t item;
L4_Word_t fault_id = 0;
L4_Word_t fault_id_mask_low = fault_id_mask;
L4_Word_t fault_id_mask_high = (fault_id_mask >> 32);
for (fault_id+=__L4_Lsb(fault_id_mask_low); fault_id_mask_low != 0;
fault_id_mask_low>>=__L4_Lsb(fault_id_mask_low)+1,fault_id+=__L4_Lsb(fault_id_mask_low)+1)
{
L4_FaultConfCtrlXferItemInit(&item, fault_id, fault_mask);
item.C = 1;
L4_Append(msg, item.raw[0]);
}
fault_id = 32;
for (fault_id+=__L4_Lsb(fault_id_mask_high); fault_id_mask_high != 0;
fault_id_mask_high>>=__L4_Lsb(fault_id_mask_high)+1,fault_id+=__L4_Lsb(fault_id_mask_high)+1)
{
L4_FaultConfCtrlXferItemInit(&item, fault_id, fault_mask);
item.C = 1;
L4_Append(msg, item.raw[0]);
}
item.C = C;
msg->msg[msg->tag.X.u + msg->tag.X.t] = item.raw[0];
}
/*
* IA32 Single Reg CtrlXfer Item
*/
typedef union {
L4_Word_t raw[2];
struct {
L4_CtrlXferItem_t item;
L4_Word_t reg;
};
} L4_RegCtrlXferItem_t;
L4_INLINE void L4_RegCtrlXferItemInit(L4_RegCtrlXferItem_t *c, L4_Word_t id)
{
L4_CtrlXferItemInit(&c->item, id);
}
L4_INLINE void L4_RegCtrlXferItemSet(L4_RegCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
c->reg = val;
c->item.mask |= (1<<reg);
}
L4_INLINE void L4_MsgAppendRegCtrlXferItem(L4_Msg_t * msg, L4_RegCtrlXferItem_t *c)
{
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreRegCtrlXferItem(L4_Msg_t *msg, L4_Word_t mr, L4_RegCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
}
/*
* IA32 GPRegs
*/
@ -417,9 +262,14 @@ L4_INLINE void L4_MsgAppendGPRegsCtrlXferItem (L4_Msg_t * msg, L4_GPRegsCtrlXfer
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreGPRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_GPRegsCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutGPRegsCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_GPRegsCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetGPRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_GPRegsCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
@ -473,15 +323,19 @@ L4_INLINE void L4_CRegsCtrlXferItemSet(L4_CRegsCtrlXferItem_t *c,
}
L4_INLINE void L4_MsgAppendCRegsCtrlXferItem (L4_Msg_t * msg, L4_CRegsCtrlXferItem_t *c)
{
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreCRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_CRegsCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutCRegsCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_CRegsCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetCRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_CRegsCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
/*
@ -532,15 +386,19 @@ L4_INLINE void L4_DRegsCtrlXferItemSet(L4_DRegsCtrlXferItem_t *c,
}
L4_INLINE void L4_MsgAppendDRegsCtrlXferItem (L4_Msg_t * msg, L4_DRegsCtrlXferItem_t *c)
{
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreDRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_DRegsCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutDRegsCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_DRegsCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetDRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_DRegsCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
@ -575,7 +433,6 @@ L4_INLINE void L4_SegCtrlXferItemInit(L4_SegCtrlXferItem_t *c, L4_Word_t id)
for (i=0; i < L4_CTRLXFER_SEGREG_SIZE; i++)
c->regs.reg[i] = 0;
}
L4_INLINE void L4_SegCtrlXferItemSet(L4_SegCtrlXferItem_t *c,
@ -590,9 +447,14 @@ L4_INLINE void L4_MsgAppendSegCtrlXferItem (L4_Msg_t * msg, L4_SegCtrlXferItem_t
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreSegCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_SegCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutSegCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_SegCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetSegCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_SegCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
/*
@ -639,9 +501,14 @@ L4_INLINE void L4_MsgAppendDTRCtrlXferItem (L4_Msg_t * msg, L4_DTRCtrlXferItem_t
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreDTRCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_DTRCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutDTRCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_DTRCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetDTRCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_DTRCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
/*
@ -696,9 +563,14 @@ L4_INLINE void L4_MsgAppendNonRegExcCtrlXferItem(L4_Msg_t *msg, L4_NonRegExcCtrl
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreNonRegExcCtrlXferItem(L4_Msg_t *msg, L4_Word_t mr, L4_NonRegExcCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutNonRegExcCtrlXferItem(L4_Msg_t *msg, L4_Word_t t, L4_NonRegExcCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetNonRegExcCtrlXferItem(L4_Msg_t *msg, L4_Word_t mr, L4_NonRegExcCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
/*
@ -742,14 +614,20 @@ L4_INLINE void L4_ExecCtrlXferItemSet(L4_ExecCtrlXferItem_t *c,
}
L4_INLINE void L4_MsgAppendExeccCtrlXferItem(L4_Msg_t *msg, L4_ExecCtrlXferItem_t *c)
L4_INLINE void L4_MsgAppendExecCtrlXferItem(L4_Msg_t *msg, L4_ExecCtrlXferItem_t *c)
{
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreExeccCtrlXferItem(L4_Msg_t *msg, L4_Word_t mr, L4_ExecCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutExecCtrlXferItem(L4_Msg_t *msg, L4_Word_t t, L4_ExecCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetExecCtrlXferItem(L4_Msg_t *msg, L4_Word_t mr, L4_ExecCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
@ -809,240 +687,81 @@ L4_INLINE void L4_MsgAppendOtherRegsCtrlXferItem (L4_Msg_t * msg, L4_OtherRegsCt
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreOtherRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_OtherRegsCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutOtherRegsCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_OtherRegsCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE void L4_Init (L4_CtrlXferItem_t *c, L4_Word_t fault_id, L4_Word_t fault_mask)
L4_INLINE L4_Word_t L4_MsgGetOtherRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_OtherRegsCtrlXferItem_t *c)
{
L4_FaultConfCtrlXferItemInit (c, fault_id, fault_mask);
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
L4_INLINE void L4_Init (L4_RegCtrlXferItem_t *c, L4_Word_t id)
{
L4_RegCtrlXferItemInit(c, id);
#if defined(__cplusplus)
#define DECLARE_INIT_SET_APPEND(type) \
L4_INLINE void L4_Init (L4_##type##_t *c) \
{ \
L4_##type##Init(c); \
} \
\
L4_INLINE void L4_Set (L4_##type##_t *c, L4_Word_t reg, L4_Word_t val) \
{ \
L4_##type##Set(c, reg, val); \
} \
\
L4_INLINE void L4_Append (L4_Msg_t *msg, L4_##type##_t *c) \
{ \
L4_MsgAppend##type(msg, c); \
} \
\
L4_INLINE void L4_Put (L4_Msg_t *msg, L4_Word_t t, L4_##type##_t *c) \
{ \
L4_MsgPut##type(msg, t, c); \
} \
\
L4_INLINE L4_Word_t L4_Get (L4_Msg_t *msg, L4_Word_t mr, L4_##type##_t *c) \
{ \
return L4_MsgGet##type(msg, mr, c); \
}
L4_INLINE void L4_Init (L4_CtrlXferItem_t *c, L4_Word_t id)
{
L4_CtrlXferItemInit(c, id);
DECLARE_INIT_SET_APPEND(GPRegsCtrlXferItem)
DECLARE_INIT_SET_APPEND(CRegsCtrlXferItem)
DECLARE_INIT_SET_APPEND(DRegsCtrlXferItem)
DECLARE_INIT_SET_APPEND(NonRegExcCtrlXferItem)
DECLARE_INIT_SET_APPEND(ExecCtrlXferItem)
DECLARE_INIT_SET_APPEND(OtherRegsCtrlXferItem)
#define DECLARE_INIT_SET_APPEND_ID(type) \
L4_INLINE void L4_Init (L4_##type##_t *c, L4_Word_t id) \
{ \
L4_##type##Init(c, id); \
} \
\
L4_INLINE void L4_Set (L4_##type##_t *c, L4_Word_t reg, L4_Word_t val) \
{ \
L4_##type##Set(c, reg, val); \
} \
\
L4_INLINE void L4_Append (L4_Msg_t *msg, L4_##type##_t *c) \
{ \
L4_MsgAppend##type(msg, c); \
} \
\
L4_INLINE void L4_Put (L4_Msg_t *msg, L4_Word_t t, L4_##type##_t *c) \
{ \
L4_MsgPut##type(msg, t, c); \
} \
\
L4_INLINE L4_Word_t L4_Get (L4_Msg_t *msg, L4_Word_t mr, L4_##type##_t *c) \
{ \
return L4_MsgGet##type(msg, mr, c); \
}
L4_INLINE void L4_Init (L4_GPRegsCtrlXferItem_t *c)
{
L4_GPRegsCtrlXferItemInit(c);
}
L4_INLINE void L4_Init (L4_CRegsCtrlXferItem_t *c)
{
L4_CRegsCtrlXferItemInit(c);
}
L4_INLINE void L4_Init (L4_DRegsCtrlXferItem_t *c)
{
L4_DRegsCtrlXferItemInit(c);
}
L4_INLINE void L4_Init (L4_SegCtrlXferItem_t *c, L4_Word_t id)
{
L4_SegCtrlXferItemInit(c, id);
}
L4_INLINE void L4_Init (L4_DTRCtrlXferItem_t *c, L4_Word_t id)
{
L4_DTRCtrlXferItemInit(c, id);
}
L4_INLINE void L4_Init (L4_NonRegExcCtrlXferItem_t *c)
{
L4_NonRegExcCtrlXferItemInit(c);
}
L4_INLINE void L4_Init (L4_ExecCtrlXferItem_t *c)
{
L4_ExecCtrlXferItemInit(c);
}
L4_INLINE void L4_Init (L4_OtherRegsCtrlXferItem_t *c)
{
L4_OtherRegsCtrlXferItemInit(c);
}
L4_INLINE void L4_Set (L4_RegCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
L4_RegCtrlXferItemSet(c, reg, val);
}
L4_INLINE void L4_Set (L4_GPRegsCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
L4_GPRegsCtrlXferItemSet(c, reg, val);
}
L4_INLINE void L4_Set (L4_CRegsCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
L4_CRegsCtrlXferItemSet(c, reg, val);
}
L4_INLINE void L4_Set (L4_DRegsCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
L4_DRegsCtrlXferItemSet(c, reg, val);
}
L4_INLINE void L4_Set (L4_SegCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
L4_SegCtrlXferItemSet(c, reg, val);
}
L4_INLINE void L4_Set (L4_DTRCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
L4_DTRCtrlXferItemSet(c, reg, val);
}
L4_INLINE void L4_Set(L4_NonRegExcCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
L4_NonRegExcCtrlXferItemSet(c, reg, val);
}
L4_INLINE void L4_Set(L4_ExecCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
L4_ExecCtrlXferItemSet(c, reg, val);
}
L4_INLINE void L4_Set(L4_OtherRegsCtrlXferItem_t *c, L4_Word_t reg, L4_Word_t val)
{
L4_OtherRegsCtrlXferItemSet(c, reg, val);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_CtrlXferItem_t *c)
{
L4_MsgAppendCtrlXferItem(msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_RegCtrlXferItem_t *c)
{
L4_MsgAppendRegCtrlXferItem(msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_GPRegsCtrlXferItem_t *c)
{
L4_MsgAppendGPRegsCtrlXferItem(msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_CRegsCtrlXferItem_t *c)
{
L4_MsgAppendCRegsCtrlXferItem(msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_DRegsCtrlXferItem_t *c)
{
L4_MsgAppendDRegsCtrlXferItem(msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_SegCtrlXferItem_t *c)
{
L4_MsgAppendSegCtrlXferItem(msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_DTRCtrlXferItem_t *c)
{
L4_MsgAppendDTRCtrlXferItem(msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_NonRegExcCtrlXferItem_t *c)
{
L4_MsgAppendNonRegExcCtrlXferItem(msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_ExecCtrlXferItem_t *c)
{
L4_MsgAppendExeccCtrlXferItem(msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_OtherRegsCtrlXferItem_t *c)
{
L4_MsgAppendOtherRegsCtrlXferItem(msg, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_CtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_RegCtrlXferItem_t *c)
{
return L4_MsgStoreRegCtrlXferItem(msg, mr, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_GPRegsCtrlXferItem_t *c)
{
return L4_MsgStoreGPRegsCtrlXferItem(msg, mr, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_CRegsCtrlXferItem_t *c)
{
return L4_MsgStoreCRegsCtrlXferItem(msg, mr, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_DRegsCtrlXferItem_t *c)
{
return L4_MsgStoreDRegsCtrlXferItem(msg, mr, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_SegCtrlXferItem_t *c)
{
return L4_MsgStoreSegCtrlXferItem(msg, mr, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_DTRCtrlXferItem_t *c)
{
return L4_MsgStoreDTRCtrlXferItem(msg, mr, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_NonRegExcCtrlXferItem_t *c)
{
return L4_MsgStoreNonRegExcCtrlXferItem(msg, mr, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_ExecCtrlXferItem_t *c)
{
return L4_MsgStoreExeccCtrlXferItem(msg, mr, c);
}
L4_INLINE L4_Word_t L4_Store (L4_Msg_t *msg, L4_Word_t mr, L4_OtherRegsCtrlXferItem_t *c)
{
return L4_MsgStoreOtherRegsCtrlXferItem(msg, mr, c);
}
DECLARE_INIT_SET_APPEND_ID(SegCtrlXferItem)
DECLARE_INIT_SET_APPEND_ID(DTRCtrlXferItem)
#endif /* define(__cplusplus) */
L4_INLINE L4_Word_t L4_ConfCtrlXferItems(L4_ThreadId_t dest)
{
L4_Word_t dummy, old_control;
L4_ThreadId_t dummy_tid;
L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_CONF_FLAG, 0, 0 , 0, 0, L4_nilthread,
&old_control, &dummy, &dummy, &dummy, &dummy, &dummy_tid);
return old_control;
}
L4_INLINE L4_Word_t L4_ReadCtrlXferItems(L4_ThreadId_t dest)
{
L4_Word_t dummy, old_control;
L4_ThreadId_t dummy_tid;
L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_READ_FLAG, 0, 0 , 0, 0, L4_nilthread,
&old_control, &dummy, &dummy, &dummy, &dummy, &dummy_tid);
return old_control;
}
L4_INLINE L4_Word_t L4_WriteCtrlXferItems(L4_ThreadId_t dest)
{
L4_Word_t dummy, old_control;
L4_ThreadId_t dummy_tid;
L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_WRITE_FLAG, 0, 0 , 0, 0, L4_nilthread,
&old_control, &dummy, &dummy, &dummy, &dummy, &dummy_tid);
return old_control;
}
/**********************************************************************
* EVT Logging
**********************************************************************/

View File

@ -35,6 +35,7 @@
#include <l4/types.h>
#include __L4_INC_ARCH(vregs.h)
#include __L4_INC_ARCH(specials.h)
#define __L4_NUM_MRS 64
#define __L4_NUM_BRS 33
@ -445,8 +446,73 @@ static inline L4_StringItem_t * operator += (L4_StringItem_t & dest,
#endif /* __cplusplus */
/*
* CtrlXfer Item
*/
typedef union {
L4_Word_t raw[0];
#if defined(L4_BIG_ENDIAN)
struct {
L4_Word_t mask:20 __PLUS32;
L4_Word_t id:8;
L4_Word_t __type:3;
L4_Word_t C:1;
};
#else
struct {
L4_Word_t C:1;
L4_Word_t __type:3;
L4_Word_t id:8;
L4_Word_t mask:20 __PLUS32;
};
#endif
} L4_CtrlXferItem_t;
L4_INLINE L4_Bool_t L4_IsCtrlXferItem (L4_CtrlXferItem_t * s)
{
return (s->__type == 6);
}
#if defined(__cplusplus)
L4_INLINE L4_Bool_t L4_CtrlXferItem (L4_CtrlXferItem_t * s)
{
return L4_IsCtrlXferItem (s);
}
#endif
L4_INLINE void L4_CtrlXferItemInit (L4_CtrlXferItem_t *c, L4_Word_t id)
{
c->raw[0] = 0;
c->__type = 0x06;
c->id = id;
c->mask = 0;
}
L4_INLINE void L4_FaultConfCtrlXferItemInit (L4_CtrlXferItem_t *c, L4_Word_t fault_id, L4_Word_t fault_mask)
{
c->raw[0] = 0;
c->__type = 0x06;
c->id = fault_id;
c->mask = fault_mask;
}
#if defined(__cplusplus)
L4_INLINE void L4_Init (L4_CtrlXferItem_t *c, L4_Word_t id)
{
L4_CtrlXferItemInit (c, id);
}
L4_INLINE void L4_Init (L4_CtrlXferItem_t *c, L4_Word_t fault_id, L4_Word_t fault_mask)
{
L4_FaultConfCtrlXferItemInit (c, fault_id, fault_mask);
}
#endif
/*
* Cache allocation hints
@ -652,6 +718,53 @@ L4_INLINE void L4_MsgAppendStringItem (L4_Msg_t * msg,
msg->tag.X.t += size;
}
L4_INLINE void L4_MsgAppendCtrlXferItem (L4_Msg_t * msg, L4_CtrlXferItem_t *c)
{
L4_Word_t reg=0, num=0, mask = c->mask;
/*
* Add regs according to mask
* */
for (reg+=__L4_Lsb(mask); mask!=0; mask>>=__L4_Lsb(mask)+1,reg+=__L4_Lsb(mask)+1,num++)
msg->msg[msg->tag.X.u + msg->tag.X.t + 2 + num] = c->raw[reg+1];
/* Add item */
if (num)
{
msg->msg[msg->tag.X.u + msg->tag.X.t + 1] = c->raw[0];
msg->tag.X.t += 1 + num;
}
}
L4_INLINE void L4_AppendFaultConfCtrlXferItems(L4_Msg_t *msg, L4_Word64_t fault_id_mask, L4_Word_t fault_mask, L4_Word_t C)
{
L4_CtrlXferItem_t item;
L4_Word_t fault_id = 0;
L4_Word_t fault_id_mask_low = fault_id_mask;
L4_Word_t fault_id_mask_high = (fault_id_mask >> 32);
for (fault_id+=__L4_Lsb(fault_id_mask_low); fault_id_mask_low != 0;
fault_id_mask_low>>=__L4_Lsb(fault_id_mask_low)+1,fault_id+=__L4_Lsb(fault_id_mask_low)+1)
{
L4_FaultConfCtrlXferItemInit(&item, fault_id, fault_mask);
item.C = 1;
L4_MsgAppendWord(msg, item.raw[0]);
}
fault_id = 32;
for (fault_id+=__L4_Lsb(fault_id_mask_high); fault_id_mask_high != 0;
fault_id_mask_high>>=__L4_Lsb(fault_id_mask_high)+1,fault_id+=__L4_Lsb(fault_id_mask_high)+1)
{
L4_FaultConfCtrlXferItemInit(&item, fault_id, fault_mask);
item.C = 1;
L4_MsgAppendWord(msg, item.raw[0]);
}
item.C = C;
msg->msg[msg->tag.X.u + msg->tag.X.t] = item.raw[0];
}
L4_INLINE void L4_MsgPutWord (L4_Msg_t * msg, L4_Word_t u, L4_Word_t w)
{
msg->msg[u+1] = w;
@ -686,6 +799,22 @@ L4_INLINE void L4_MsgPutStringItem (L4_Msg_t * msg, L4_Word_t t,
__L4_Copy_String (d, s);
}
L4_INLINE void L4_MsgPutCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_CtrlXferItem_t *c)
{
L4_Word_t reg=0, num=0, mask = c->mask;
/*
* Put regs according to mask
* */
for (reg+=__L4_Lsb(mask); mask!=0; mask>>=__L4_Lsb(mask)+1,reg+=__L4_Lsb(mask)+1,num++)
msg->msg[msg->tag.X.u + t + 2 + num] = c->raw[reg+1];
/* Put item */
if (num)
msg->msg[msg->tag.X.u + t + 1] = c->raw[0];
}
L4_INLINE L4_Word_t L4_MsgWord (L4_Msg_t * msg, L4_Word_t u)
{
return msg->msg[u + 1];
@ -721,6 +850,22 @@ L4_INLINE L4_Word_t L4_MsgGetStringItem (L4_Msg_t * msg, L4_Word_t t,
return ((L4_Word_t) e - (L4_Word_t) b) / sizeof (L4_Word_t);
}
L4_INLINE L4_Word_t L4_MsgGetCtrlXferItem (L4_Msg_t * msg, L4_Word_t mr, L4_CtrlXferItem_t *c)
{
L4_Word_t reg=0, num=0, mask=0;
/* Store item */
c->raw[0] = msg->msg[mr];
mask = c->mask;
/*
* Store regs according to mask
* */
for (reg+=__L4_Lsb(mask); mask!=0; mask>>=__L4_Lsb(mask)+1,reg+=__L4_Lsb(mask)+1,num++)
c->raw[reg+1] = msg->msg[mr + 1 + num];
return num + 1;
}
#if defined(__cplusplus)
L4_INLINE void L4_Put (L4_Msg_t * msg, L4_Word_t label,
int u, L4_Word_t * Untyped,
@ -799,6 +944,16 @@ L4_INLINE void L4_Append (L4_Msg_t * msg, L4_StringItem_t * s)
L4_MsgAppendStringItem (msg, s);
}
L4_INLINE void L4_Append (L4_Msg_t * msg, L4_CtrlXferItem_t *c)
{
L4_MsgAppendCtrlXferItem (msg, c);
}
L4_INLINE void L4_Append (L4_Msg_t *msg, L4_Word64_t fault_id_mask, L4_Word_t fault_mask, L4_Word_t C)
{
L4_AppendFaultConfCtrlXferItems (msg, fault_id_mask, fault_mask, C);
}
L4_INLINE void L4_Put (L4_Msg_t * msg, L4_Word_t u, L4_Word_t w)
{
L4_MsgPutWord (msg, u, w);
@ -824,6 +979,11 @@ L4_INLINE void L4_Put (L4_Msg_t * msg, L4_Word_t t, L4_StringItem_t * s)
L4_MsgPutStringItem (msg, t, s);
}
L4_INLINE void L4_Put (L4_Msg_t * msg, L4_Word_t t, L4_CtrlXferItem_t *c)
{
L4_Put (msg, t, c);
}
L4_INLINE L4_Word_t L4_Get (L4_Msg_t * msg, L4_Word_t u)
{
return L4_MsgWord (msg, u);
@ -848,6 +1008,11 @@ L4_INLINE L4_Word_t L4_Get (L4_Msg_t * msg, L4_Word_t t, L4_StringItem_t * s)
{
return L4_MsgGetStringItem (msg, t, s);
}
L4_INLINE L4_Word_t L4_Get (L4_Msg_t * msg, L4_Word_t mr, L4_CtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem (msg, mr, c);
}
#endif /* __cplusplus */
@ -863,11 +1028,11 @@ typedef union {
#if defined(L4_BIG_ENDIAN)
L4_Word_t RcvWindow:28 __PLUS32;
L4_Word_t __zeros:2;
L4_Word_t CtrlXfer : 1;
L4_Word_t c:1;
L4_Word_t s:1;
#else
L4_Word_t s:1;
L4_Word_t CtrlXfer : 1;
L4_Word_t c:1;
L4_Word_t __zeros:2;
L4_Word_t RcvWindow:28 __PLUS32;
#endif

View File

@ -3,7 +3,7 @@
* Copyright (C) 1999-2010, Karlsruhe University
* Copyright (C) 2008-2009, Volkmar Uhlig, IBM Corporation
*
* File path: include/l4/powerpc/arch.h
* File path: l4/powerpc/arch.h
* Description:
*
* Redistribution and use in source and binary forms, with or without
@ -34,13 +34,8 @@
#define __L4__POWERPC__ARCH_H__
#include "specials.h"
#include <l4/thread.h>
#include <l4/ipc.h>
#define L4_EXREGS_CTRLXFER_CONF_FLAG (1UL << 9)
#define L4_EXREGS_CTRLXFER_READ_FLAG (1UL << 10)
#define L4_EXREGS_CTRLXFER_WRITE_FLAG (1UL << 11)
#define L4_EXREGS_EXCHANDLER_FLAG (1UL << 12)
#define L4_EXREGS_SCHEDULER_FLAG (1UL << 13)
#define L4_CTRLXFER_GPREGS0 (0)
#define L4_CTRLXFER_GPREGS1 (1)
@ -144,110 +139,6 @@
#define L4_CTRLXFER_CACHE_NVx(x) (1 + (x))
#define L4_CTRLXFER_CACHE_TVx(x) (5 + (x))
/*
* CtrlXfer Item
*/
typedef union {
L4_Word_t raw[];
struct {
L4_Word_t mask:20;
L4_Word_t id:8;
L4_Word_t __type:3;
L4_Word_t C:1;
};
} L4_CtrlXferItem_t;
/*
* PPC CtrlXfer Item
*/
L4_INLINE void L4_CtrlXferItemInit (L4_CtrlXferItem_t *c, L4_Word_t id)
{
c->raw[0] = 0;
c->__type = 0x06;
c->id = id;
c->mask = 0;
}
L4_INLINE void L4_MsgAppendCtrlXferItem (L4_Msg_t * msg, L4_CtrlXferItem_t *c)
{
L4_Word_t reg=0, num=0, mask = c->mask;
/*
* Add regs according to mask
* */
for (reg+=__L4_Lsb(mask); mask!=0; mask>>=__L4_Lsb(mask)+1,reg+=__L4_Lsb(mask)+1,num++)
msg->msg[msg->tag.X.u + msg->tag.X.t + 2 + num] = c->raw[reg+1];
/* Add item */
if (num)
{
msg->msg[msg->tag.X.u + msg->tag.X.t + 1] = c->raw[0];
msg->tag.X.t += 1 + num;
}
}
L4_INLINE L4_Word_t L4_MsgStoreCtrlXferItem (L4_Msg_t * msg, L4_Word_t mr, L4_CtrlXferItem_t *c)
{
L4_Word_t reg=0, num=0, mask=0;
/* Store item */
c->raw[0] = msg->msg[mr];
mask = c->mask;
/*
* Store regs according to mask
* */
for (reg+=__L4_Lsb(mask); mask!=0; mask>>=__L4_Lsb(mask)+1,reg+=__L4_Lsb(mask)+1,num++)
c->raw[reg+1] = msg->msg[mr + 1 + num];
return num + 1;
}
/*
* Fault Configuration item
*/
L4_INLINE void L4_FaultConfCtrlXferItemInit (L4_CtrlXferItem_t *c, L4_Word_t fault_id, L4_Word_t fault_mask)
{
c->raw[0] = 0;
c->__type = 0x06;
c->id = fault_id;
c->mask = fault_mask;
}
L4_INLINE void L4_AppendFaultConfCtrlXferItems(L4_Msg_t *msg, L4_Word64_t fault_id_mask, L4_Word_t fault_mask, L4_Word_t C)
{
L4_CtrlXferItem_t item;
L4_Word_t fault_id = 0;
L4_Word_t fault_id_mask_low = fault_id_mask;
L4_Word_t fault_id_mask_high = (fault_id_mask >> 32);
for (fault_id+=__L4_Lsb(fault_id_mask_low); fault_id_mask_low != 0;
fault_id_mask_low>>=__L4_Lsb(fault_id_mask_low)+1,fault_id+=__L4_Lsb(fault_id_mask_low)+1)
{
L4_FaultConfCtrlXferItemInit(&item, fault_id, fault_mask);
item.C = true;
L4_Append(msg, item.raw[0]);
}
fault_id = 32;
for (fault_id+=__L4_Lsb(fault_id_mask_high); fault_id_mask_high != 0;
fault_id_mask_high>>=__L4_Lsb(fault_id_mask_high)+1,fault_id+=__L4_Lsb(fault_id_mask_high)+1)
{
L4_FaultConfCtrlXferItemInit(&item, fault_id, fault_mask);
item.C = true;
L4_Append(msg, item.raw[0]);
}
item.C = C;
msg->msg[msg->tag.X.u + msg->tag.X.t] = item.raw[0];
}
/*
* PPC GPRegs
*/
@ -306,9 +197,14 @@ L4_INLINE void L4_MsgAppendGPRegsCtrlXferItem (L4_Msg_t * msg, L4_GPRegsCtrlXfer
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreGPRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_GPRegsCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutGPRegsCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_GPRegsCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetGPRegsCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_GPRegsCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
/*
@ -358,9 +254,14 @@ L4_INLINE void L4_MsgAppendGPRegsXCtrlXferItem (L4_Msg_t * msg, L4_GPRegsXCtrlXf
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreGPRegsXCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_GPRegsXCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutGPRegsXCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_GPRegsXCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetGPRegsXCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_GPRegsXCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
/*
@ -375,6 +276,13 @@ L4_INLINE void L4_MsgAppendFPRegsCtrlXferItem (L4_Msg_t * msg)
msg->tag.X.t += 1;
}
L4_INLINE void L4_MsgPutFPRegsCtrlXferItem (L4_Msg_t * msg, L4_Word_t t)
{
L4_CtrlXferItem_t item;
L4_CtrlXferItemInit(&item, L4_CTRLXFER_FPU);
msg->msg[msg->tag.X.u + t + 1] = item.raw[0];
}
/*
* PPC TLB Regs
@ -433,9 +341,14 @@ L4_INLINE void L4_MsgAppendTLBCtrlXferItem (L4_Msg_t * msg, L4_TLBCtrlXferItem_t
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreTLBCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_TLBCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutTLBCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_TLBCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetTLBCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_TLBCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
/*
@ -495,9 +408,14 @@ L4_INLINE void L4_MsgAppendExceptCtrlXferItem (L4_Msg_t * msg, L4_ExceptCtrlXfer
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreExceptCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_ExceptCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutExceptCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_ExceptCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetExceptCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_ExceptCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
/*
@ -541,9 +459,14 @@ L4_INLINE void L4_MsgAppendIvorCtrlXferItem (L4_Msg_t * msg, L4_IvorCtrlXferItem
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreIvorCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_IvorCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutIvorCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_IvorCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetIvorCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_IvorCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
@ -593,9 +516,9 @@ L4_INLINE void L4_MsgAppendTimerCtrlXferItem (L4_Msg_t * msg, L4_TimerCtrlXferIt
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreTimerCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_TimerCtrlXferItem_t *c)
L4_INLINE L4_Word_t L4_MsgGetTimerCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_TimerCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
@ -645,9 +568,14 @@ L4_INLINE void L4_MsgAppendConfigCtrlXferItem (L4_Msg_t * msg, L4_ConfigCtrlXfer
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreConfigCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_ConfigCtrlXferItem_t *c)
L4_INLINE void L4_MsgPutConfigCtrlXferItem (L4_Msg_t * msg, L4_Word_t t, L4_ConfigCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
L4_MsgPutCtrlXferItem(msg, t, &c->item);
}
L4_INLINE L4_Word_t L4_MsgGetConfigCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_ConfigCtrlXferItem_t *c)
{
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
@ -701,9 +629,9 @@ L4_INLINE void L4_MsgAppendDebugCtrlXferItem (L4_Msg_t * msg, L4_DebugCtrlXferIt
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreDebugCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_DebugCtrlXferItem_t *c)
L4_INLINE L4_Word_t L4_MsgGetDebugCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_DebugCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
@ -758,17 +686,12 @@ L4_INLINE void L4_MsgAppendCacheCtrlXferItem (L4_Msg_t * msg, L4_CacheCtrlXferIt
L4_MsgAppendCtrlXferItem(msg, &c->item);
}
L4_INLINE L4_Word_t L4_MsgStoreCacheCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_CacheCtrlXferItem_t *c)
L4_INLINE L4_Word_t L4_MsgGetCacheCtrlXferItem (L4_Msg_t *msg, L4_Word_t mr, L4_CacheCtrlXferItem_t *c)
{
return L4_MsgStoreCtrlXferItem(msg, mr, &c->item);
return L4_MsgGetCtrlXferItem(msg, mr, &c->item);
}
#if defined(__cplusplus)
L4_INLINE void L4_Init (L4_CtrlXferItem_t *c, L4_Word_t fault_id, L4_Word_t fault_mask)
{
L4_FaultConfCtrlXferItemInit (c, fault_id, fault_mask);
}
#define DECLARE_INIT_SET_APPEND(type) \
L4_INLINE void L4_Init (L4_##type##_t *c) \
{ \
@ -783,6 +706,16 @@ L4_INLINE void L4_Set (L4_##type##_t *c, L4_Word_t reg, L4_Word_t val) \
L4_INLINE void L4_Append (L4_Msg_t *msg, L4_##type##_t *c) \
{ \
L4_MsgAppend##type(msg, c); \
} \
\
L4_INLINE void L4_Put (L4_Msg_t *msg, L4_Word_t t, L4_##type##_t *c) \
{ \
L4_MsgPut##type(msg, t, c); \
} \
\
L4_INLINE void L4_Get (L4_Msg_t *msg, L4_Word_t mr, L4_##type##_t *c) \
{ \
L4_MsgGet##type(msg, mr, c); \
}
DECLARE_INIT_SET_APPEND(GPRegsXCtrlXferItem)
@ -790,32 +723,4 @@ DECLARE_INIT_SET_APPEND(ExceptCtrlXferItem)
DECLARE_INIT_SET_APPEND(ConfigCtrlXferItem)
#endif
L4_INLINE L4_Word_t L4_ConfCtrlXferItems(L4_ThreadId_t dest)
{
L4_Word_t dummy, old_control;
L4_ThreadId_t dummy_tid;
L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_CONF_FLAG, 0, 0 , 0, 0, L4_nilthread,
&old_control, &dummy, &dummy, &dummy, &dummy, &dummy_tid);
return old_control;
}
L4_INLINE L4_Word_t L4_ReadCtrlXferItems(L4_ThreadId_t dest)
{
L4_Word_t dummy, old_control;
L4_ThreadId_t dummy_tid;
L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_READ_FLAG, 0, 0 , 0, 0, L4_nilthread,
&old_control, &dummy, &dummy, &dummy, &dummy, &dummy_tid);
return old_control;
}
L4_INLINE L4_Word_t L4_WriteCtrlXferItems(L4_ThreadId_t dest)
{
L4_Word_t dummy, old_control;
L4_ThreadId_t dummy_tid;
L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_WRITE_FLAG, 0, 0 , 0, 0, L4_nilthread,
&old_control, &dummy, &dummy, &dummy, &dummy, &dummy_tid);
return old_control;
}
#endif /* !__L4__POWERPC__ARCH_H__ */

View File

@ -89,7 +89,7 @@ L4_INLINE L4_Fpage_t L4_Sigma0_GetAny (L4_ThreadId_t s0,
/**
* L4_Sigma0_GetSpecial(L4_Word_t type)
* L4_Sigma0_GetSpecial
*
* Searches the KIP's memory descriptors for special memory segment. Requests
* sigma0 to map the relevant pages into the current address space, (1:1 if

View File

@ -1,6 +1,6 @@
/*********************************************************************
*
* Copyright (C) 2001-2004, 2006, 2008-2009, Karlsruhe University
* Copyright (C) 2001-2004, 2006, 2008-2010, Karlsruhe University
*
* File path: l4/thread.h
* Description: Thread handling interfaces
@ -569,6 +569,12 @@ L4_INLINE L4_ThreadState_t L4_AbortIpc_and_stop (L4_ThreadId_t t,
}
#endif
#define L4_EXREGS_CTRLXFER_CONF_FLAG (1UL << 9)
#define L4_EXREGS_CTRLXFER_READ_FLAG (1UL << 10)
#define L4_EXREGS_CTRLXFER_WRITE_FLAG (1UL << 11)
#define L4_EXREGS_EXCHANDLER_FLAG (1UL << 12)
#define L4_EXREGS_SCHEDULER_FLAG (1UL << 13)
L4_INLINE L4_Word_t L4_AssociateInterrupt (L4_ThreadId_t InterruptThread,
L4_ThreadId_t HandlerThread)
{
@ -582,4 +588,31 @@ L4_INLINE L4_Word_t L4_DeassociateInterrupt (L4_ThreadId_t InterruptThread)
L4_nilthread, InterruptThread, (void *) -1);
}
L4_INLINE L4_Word_t L4_ConfCtrlXferItems(L4_ThreadId_t dest)
{
L4_Word_t dummy, old_control;
L4_ThreadId_t dummy_tid;
L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_CONF_FLAG, 0, 0 , 0, 0, L4_nilthread,
&old_control, &dummy, &dummy, &dummy, &dummy, &dummy_tid);
return old_control;
}
L4_INLINE L4_Word_t L4_ReadCtrlXferItems(L4_ThreadId_t dest)
{
L4_Word_t dummy, old_control;
L4_ThreadId_t dummy_tid;
L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_READ_FLAG, 0, 0 , 0, 0, L4_nilthread,
&old_control, &dummy, &dummy, &dummy, &dummy, &dummy_tid);
return old_control;
}
L4_INLINE L4_Word_t L4_WriteCtrlXferItems(L4_ThreadId_t dest)
{
L4_Word_t dummy, old_control;
L4_ThreadId_t dummy_tid;
L4_ExchangeRegisters (dest, L4_EXREGS_CTRLXFER_WRITE_FLAG, 0, 0 , 0, 0, L4_nilthread,
&old_control, &dummy, &dummy, &dummy, &dummy, &dummy_tid);
return old_control;
}
#endif /* !__L4__THREAD_H__ */