Wiring between mm0 page cache and vfs almost what it should look like.

This implements the infrastructure for read/write system calls where
file content is first searched in mm0's page cache and then read-in
or written via the vfs read/write functions.
	modified:   tasks/fs0/src/syscalls.c
	modified:   tasks/mm0/include/lib/bit.h
	modified:   tasks/mm0/include/lib/idpool.h
	modified:   tasks/mm0/include/task.h
	modified:   tasks/mm0/include/vm_area.h
	modified:   tasks/mm0/main.c
	modified:   tasks/mm0/src/devzero.c
	modified:   tasks/mm0/src/fault.c
	new file:   tasks/mm0/src/file.c
	modified:   tasks/mm0/src/init.c
	modified:   tasks/mm0/src/lib/bit.c
	modified:   tasks/mm0/src/lib/idpool.c
	modified:   tasks/mm0/src/task.c
This commit is contained in:
Bahadir Balban
2008-02-18 22:26:39 +00:00
parent 0fdc64ba2d
commit d67d6b84a9
13 changed files with 365 additions and 57 deletions

View File

@@ -25,13 +25,14 @@
* for handling syscalls that access file content (i.e. read/write) since
* it maintains the page cache.
*/
int send_pager_sys_open(l4id_t sender, int fd, unsigned long vnum)
int send_pager_sys_open(l4id_t sender, int fd, unsigned long vnum, unsigned long size)
{
int err;
write_mr(L4SYS_ARG0, sender);
write_mr(L4SYS_ARG1, fd);
write_mr(L4SYS_ARG2, vnum);
write_mr(L4SYS_ARG3, size);
if ((err = l4_send(PAGER_TID, L4_IPC_TAG_PAGER_SYSOPEN)) < 0) {
printf("%s: L4 IPC Error: %d.\n", __FUNCTION__, err);
@@ -104,7 +105,7 @@ int sys_open(l4id_t sender, const char *pathname, int flags, unsigned int mode)
t->fd[fd] = v->vnum;
/* Tell the pager about opened vnode information */
BUG_ON(send_pager_sys_open(sender, fd, v->vnum) < 0);
BUG_ON(send_pager_sys_open(sender, fd, v->vnum, v->size) < 0);
return 0;
}