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

@@ -13,13 +13,21 @@
#include <l4lib/types.h>
#include <l4lib/utcb.h>
#define __TASKNAME__ "mm0"
#define __TASKNAME__ __PAGERNAME__
#define TASK_OFILES_MAX 32
/* Allow per-task anonymous memory to grow as much as 1 MB for now. */
#define TASK_SWAPFILE_MAXSIZE SZ_1MB
struct vm_file;
struct file_descriptor {
unsigned long vnum;
unsigned long cursor;
struct vm_file *vmfile;
};
/* Stores all task information that can be kept in userspace. */
struct tcb {
/* Task list */
@@ -53,6 +61,9 @@ struct tcb {
/* Per-task swap file for now */
struct vm_file *swap_file;
/* File descriptors for this task */
struct file_descriptor fd[TASK_OFILES_MAX];
/* Pool to generate swap file offsets for fileless anonymous regions */
struct id_pool *swap_file_offset_pool;
};