mirror of
https://github.com/drasko/codezero.git
synced 2026-01-13 19:33:15 +01:00
- 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)
46 lines
1015 B
C
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__ */
|