Changeset 494 for Whitix/branches/hybrid

Show
Ignore:
Timestamp:
05/13/08 23:56:11 (4 months ago)
Author:
mwhitworth
Message:

Fix page allocation in mmap.c.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/hybrid/memory/mmap.c

    r256 r494  
    2121#include <llist.h> 
    2222#include <malloc.h> 
     23#include <module.h> 
    2324#include <typedefs.h> 
    2425#include <i386/i386.h> 
     
    6061} 
    6162 
     63SYMBOL_EXPORT(VmLookupAddress); 
     64 
    6265/*********************************************************************** 
    6366 * 
     
    251254                }else{ 
    252255                        newPage=PageAlloc(); 
     256 
     257                        if (!newPage) 
     258                                return -ENOMEM; 
     259 
    253260                        VirtMemMapPage(address,newPage->physAddr,area->protection); 
    254261 
     
    268275                        /* So no luck finding it in the VNode's mapping list - read it in */ 
    269276                        newPage=PageAlloc(); 
     277 
     278                        if (!newPage) 
     279                                return -ENOMEM; 
     280 
    270281                        VirtMemMapPage(address,newPage->physAddr,area->protection | PAGE_ACCESSED | PAGE_SHARED); 
    271282 
     
    347358 
    348359        address=PAGE_ALIGN(address); 
     360 
     361//      printf("%s: %d: MMapHandleFault(%#X, %d, %d, %d)\n", current->name, current->pid, address, error, VM_WRITE, VM_USER); 
    349362 
    350363        /* A null pointer has been deferenced */ 
     
    605618 
    606619        if (!(flags & MMAP_FIXED)) 
    607                 address=MMapFindAddress(process,length); 
     620                address=MMapFindAddress(process, length); 
    608621 
    609622        if (address < MMAP_BASE)