Files
codezero/tasks/libposix/include/posix/shpage.h
Bahadir Balban 54a9b2901d Removed allocation of utcb shared pages by mm0 completely.
- Now libl4 has no references to utcb page or shmat etc.
- Pager does not deal with special case utcb page allocation.
  It instead allocates a shared page from shm memory pool.
- All tasks working to original standard.

Next:
- Add per-thread utcb allocation from the kernel
- Add larger register file for standard ipc
- Add long ipc (up to 1Kb)
2009-04-22 14:48:43 +03:00

46 lines
1015 B
C

/*
* A default shared page is used by every thread
* to pass large data for system calls.
*
* This file contains relevant shpage definitions.
*/
#ifndef __LIBPOSIX_SHPAGE_H__
#define __LIBPOSIX_SHPAGE_H__
#include <l4/macros.h>
#include <l4lib/arch/syscalls.h>
#include <l4lib/arch/syslib.h>
#include <l4lib/ipcdefs.h>
#include <l4lib/utcb.h>
#include INC_GLUE(memory.h)
extern void *shared_page;
int shared_page_init(void);
/*
* Arguments that are too large to fit in message registers are
* copied onto another area that is still on the utcb, and the servers
* map-in the task utcb and read those arguments from there.
*/
static inline int copy_to_shpage(void *arg, int offset, int size)
{
if (offset + size > PAGE_SIZE)
return -1;
memcpy(shared_page + offset, arg, size);
return 0;
}
static inline int copy_from_shpage(void *buf, int offset, int size)
{
if (offset + size > PAGE_SIZE)
return -1;
memcpy(buf, shared_page + offset, size);
return 0;
}
#endif /* __LIBPOSIX_SHPAGE_H__ */