mm0 compiles, still previous issues on.

This commit is contained in:
Bahadir Balban
2008-04-20 23:34:25 +01:00
parent d8d65a6301
commit e3cc14515c
2 changed files with 7 additions and 5 deletions

View File

@@ -209,6 +209,7 @@ void vm_object_print(struct vm_object *vmo);
/* Used for pre-faulting a page from mm0 */ /* Used for pre-faulting a page from mm0 */
int prefault_page(struct tcb *task, unsigned long address, int prefault_page(struct tcb *task, unsigned long address,
unsigned int vmflags); unsigned int vmflags);
struct page *page_init(struct page *page);
/* To get currently mapped page of a virtual address on a task */ /* To get currently mapped page of a virtual address on a task */
struct page *task_virt_to_page(struct tcb *t, unsigned long virtual); struct page *task_virt_to_page(struct tcb *t, unsigned long virtual);

View File

@@ -289,15 +289,15 @@ int sys_read(l4id_t sender, int fd, void *buf, int count)
/* FIXME: Add error handling to this */ /* FIXME: Add error handling to this */
/* Extends a file's size by adding it new pages */ /* Extends a file's size by adding it new pages */
int new_file_pages(struct vmfile *f, unsigned long start, unsigned long end) int new_file_pages(struct vm_file *f, unsigned long start, unsigned long end)
{ {
unsigned long npages = end - start; unsigned long npages = end - start;
struct page *page; struct page *page;
void *vaddr, *paddr; void *paddr;
int err;
/* Allocate the memory for new pages */ /* Allocate the memory for new pages */
paddr = alloc_page(npages); if (!(paddr = alloc_page(npages)))
return -ENOMEM;
/* Process each page */ /* Process each page */
for (unsigned long i = 0; i < npages; i++) { for (unsigned long i = 0; i < npages; i++) {
@@ -316,6 +316,8 @@ int new_file_pages(struct vmfile *f, unsigned long start, unsigned long end)
/* Update vm object */ /* Update vm object */
f->vm_obj.npages += npages; f->vm_obj.npages += npages;
return 0;
} }
/* Writes user data in buffer into pages in cache */ /* Writes user data in buffer into pages in cache */
@@ -342,7 +344,6 @@ int sys_write(l4id_t sender, int fd, void *buf, int count)
unsigned long cursor, byte_offset; unsigned long cursor, byte_offset;
struct vm_file *vmfile; struct vm_file *vmfile;
struct tcb *t; struct tcb *t;
int cnt;
int err; int err;
BUG_ON(!(t = find_task(sender))); BUG_ON(!(t = find_task(sender)));