Files
codezero/tasks/libl4/include/l4lib/arch-arm/utcb.h
Bahadir Balban e7b0e46065 Preparing to add utcbs at disjoint virtual addresses.
This will help when syscalls have long arguments individual
utcbs can be mapped to server tasks and kept mapped in until the
tasks die, as opposed to map requests every time a server task maps
a different utcb at the same virtual address.

The changes have preparation code to also passing the utcb info
through the stack as part of the environment.

To sum up env and arg regions have also been added above the stack and
env region is to be used to pass on the utcb address information at
task startup.
2008-02-28 00:25:04 +00:00

50 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 */
/*
* For passing ipc data larger than mrs,
* that is, if the callee is allowed to map it
*/
char userbuf[];
};
extern struct utcb *utcb;
static inline struct utcb *l4_get_utcb()
{
return utcb;
// (struct utcb **)USER_UTCB_REF;
}
/* Functions to read/write utcb registers */
static inline unsigned int read_mr(int offset)
{
return l4_get_utcb()->mr[offset];
}
static inline void write_mr(unsigned int offset, unsigned int val)
{
l4_get_utcb()->mr[offset] = val;
}
#endif /* !__ASSEMBLY__ */
#endif /* __ARM_UTCB_H__ */