Added the first means to pass information between 2 tasks using the

utcb as a shared page instead of the message registers.

Implemented the code that passes task information from mm0 to fs0
using the fs0 utcb. The code seems to work OK but:

There's an issue with anon pages that they end up on the same swapfile
and with same file offsets (e.g. utcb and stack at offset 0). Need to
fix this issue but otherwise this implementation seems to work.

TODO:
- Separate anon regions into separate vmfiles.
- Possibly map the stacks from virtual files so that they can be
  read from userspace in the future for debugging.
- Possibly utcb could be created as a shared memory object using shmget/shmat
  during startup.
This commit is contained in:
Bahadir Balban
2008-02-29 21:56:05 +00:00
parent 55117c600b
commit 4f346cea53
9 changed files with 166 additions and 19 deletions

View File

@@ -14,11 +14,23 @@
#include <l4lib/ipcdefs.h>
#include <fcntl.h>
/*
* 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.
*/
void *copy_to_utcb(void *arg, int size)
{
BUG_ON(size > PAGE_SIZE);
memcpy(utcb->buf, arg, size);
}
static inline int l4_open(const char *pathname, int flags, mode_t mode)
{
int fd;
write_mr(L4SYS_ARG0, (unsigned long)pathname);
// write_mr(L4SYS_ARG0, (unsigned long)pathname);
copy_to_utcb(pathname, strlen(pathname));
write_mr(L4SYS_ARG1, flags);
write_mr(L4SYS_ARG2, (u32)mode);