Files
codezero/tasks/libl4/include/l4lib/arch-arm/utcb.h
Bahadir Balban dce3a9a47c Merged some libl4 utcb headers, moved mr defs to kernel message.h
Headers 3 headers related to message registers and utcbs are now merged under
utcb.h in libl4. Some message register definitions used by the kernel are now
moved into kernel's glue/message.h. This avoids the duplication of same
definitions. Also the total number of mregs are now determined by arch-specific
kernel header, which is good.
2008-02-11 11:45:21 +00:00

49 lines
1.0 KiB
C

#ifndef __ARM_UTCB_H__
#define __ARM_UTCB_H__
#define USER_UTCB_REF 0xFF000FF0
#define L4_KIP_ADDRESS 0xFF000000
#define UTCB_KIP_OFFSET 0xFF0
#ifndef __ASSEMBLY__
#include <l4lib/types.h>
#include <l4/macros.h>
#include INC_GLUE(message.h)
/*
* NOTE: In syslib.h the first few mrs are used by data frequently
* needed for all ipcs. Those mrs are defined the kernel message.h
*/
/* Compact utcb for now! :-) */
struct utcb {
u32 mr[MR_TOTAL];
u32 tid; /* Thread id */
/*
* This field is used by servers as the ptr to current tcb,
* i.e. the task that this server is serving to.
*/
unsigned long usr_handle;
};
/* FIXME: LICENSE/LICENCE */
static inline struct utcb *__L4_ARM_Utcb()
{
return (struct utcb *)(*(struct utcb **)USER_UTCB_REF);
}
/* Functions to read/write utcb registers */
static inline unsigned int read_mr(int offset)
{
return __L4_ARM_Utcb()->mr[offset];
}
static inline void write_mr(unsigned int offset, unsigned int val)
{
__L4_ARM_Utcb()->mr[offset] = val;
}
#endif /* !__ASSEMBLY__ */
#endif /* __ARM_UTCB_H__ */