mirror of
https://github.com/drasko/codezero.git
synced 2026-04-04 19:19:03 +02:00
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)
This commit is contained in:
6
tasks/libposix/include/posix/posix_init.h
Normal file
6
tasks/libposix/include/posix/posix_init.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef __POSIX_INIT_H__
|
||||
#define __POSIX_INIT_H__
|
||||
|
||||
void posix_init(void);
|
||||
|
||||
#endif /* __POSIX_INIT_H__ */
|
||||
45
tasks/libposix/include/posix/shpage.h
Normal file
45
tasks/libposix/include/posix/shpage.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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__ */
|
||||
Reference in New Issue
Block a user