Ignore:
Timestamp:
Dec 18, 2011, 10:28:22 PM (14 years ago)
Author:
dmik
Message:

Merge branch gcc-kmk to trunk.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 bin
        2 Makefile.inc
         1env.cmd
         2LocalConfig.kmk
    • Property svn:mergeinfo set to
      /branches/gcc-kmkmergedeligible
  • trunk/src/kernel32/mmapview.cpp

    r21302 r21916  
    2828#include <stdlib.h>
    2929#include <string.h>
    30 #include <win\virtual.h>
     30#include <win/virtual.h>
    3131#include <odincrt.h>
    3232#include <handlemanager.h>
     
    3434#include "oslibdos.h"
    3535#include "oslibmem.h"
    36 #include <winimagepeldr.h>
    37 #include <custombuild.h> 
     36#include "winimagepeldr.h"
     37#include <custombuild.h>
    3838
    3939#define DBG_LOCALLOG    DBG_mmapview
     
    5151//
    5252//******************************************************************************
    53 Win32MemMapView::Win32MemMapView(Win32MemMap *map, ULONG offset, ULONG size, 
     53Win32MemMapView::Win32MemMapView(Win32MemMap *map, ULONG offset, ULONG size,
    5454                                 ULONG fdwAccess, Win32MemMap *owner)
    5555{
     
    8787    {
    8888        //shared memory map, so map it into our address space
    89         if(OSLibDosGetNamedSharedMem((LPVOID *)&viewaddr, map->getMemName()) != OSLIB_NOERROR) 
     89        if(OSLibDosGetNamedSharedMem((LPVOID *)&viewaddr, map->getMemName()) != OSLIB_NOERROR)
    9090        {
    9191            dprintf(("new OSLibDosGetNamedSharedMem FAILED"));
     
    104104    }
    105105    else {
    106         if(mfAccess & MEMMAP_ACCESS_COPYONWRITE) 
     106        if(mfAccess & MEMMAP_ACCESS_COPYONWRITE)
    107107        {
    108108            //A copy on write view is a private copy of the memory map
     
    118118        }
    119119        }
    120         else 
     120        else
    121121        if(OSLibDosAliasMem(viewaddr, size, &pMapView, accessAttr) != OSLIB_NOERROR) {
    122122            dprintf(("new OSLibDosAliasMem FAILED"));
     
    126126        }
    127127    }
    128     //Allocate bitmap for all pages of a COW view to track which pages are 
     128    //Allocate bitmap for all pages of a COW view to track which pages are
    129129    //shared and which are private (copy on write -> private page)
    130     if(fdwAccess == FILE_MAP_COPY) 
     130    if(fdwAccess == FILE_MAP_COPY)
    131131    {
    132132        DWORD nrPages = mSize >> PAGE_SHIFT;
     
    242242    viewpagestart = mOffset >> PAGE_SHIFT;
    243243    nrviewpages = mSize >> PAGE_SHIFT;
    244     if(mSize & 0xFFF) 
     244    if(mSize & 0xFFF)
    245245        nrviewpages++;
    246246
     
    248248        return; //outside this view
    249249    }
    250     if(startpage + nrpages > viewpagestart + nrviewpages) { 
     250    if(startpage + nrpages > viewpagestart + nrviewpages) {
    251251        nrpages -= ((startpage + nrpages) - (viewpagestart + nrviewpages));
    252252    }
     
    286286    }
    287287
    288     if( ( (mfAccess & MEMMAP_ACCESS_COPYONWRITE) && (flags != PAGEVIEW_GUARD)  ) || 
    289         ( (flags == PAGEVIEW_GUARD) && !(mfAccess & MEMMAP_ACCESS_COPYONWRITE) ) ) 
     288    if( ( (mfAccess & MEMMAP_ACCESS_COPYONWRITE) && (flags != PAGEVIEW_GUARD)  ) ||
     289        ( (flags == PAGEVIEW_GUARD) && !(mfAccess & MEMMAP_ACCESS_COPYONWRITE) ) )
    290290    {
    291291        //PAGEVIEW_GUARD only applies to COW views
    292292        //PAGEVIEW_VIEW/READONLY does not apply to COW views
    293         return TRUE; 
     293        return TRUE;
    294294    }
    295295    if(mOffset + mSize <= offset || mOffset >= offset + size) {
     
    320320    }
    321321
    322     if(flags == PAGEVIEW_GUARD || (mfAccess & MEMMAP_ACCESS_COPYONWRITE)) 
     322    if(flags == PAGEVIEW_GUARD || (mfAccess & MEMMAP_ACCESS_COPYONWRITE))
    323323    {
    324324        DWORD startpage = (offset - mOffset) >> PAGE_SHIFT;
     
    330330        //of the COW pages, then only the shared pages must be changed.
    331331        //So check each page if it is still shared.
    332         for(int i=startpage;i<startpage+nrPages;i++) 
     332        for(int i=startpage;i<startpage+nrPages;i++)
    333333    {
    334             if(!isCOWPage(i)) 
     334            if(!isCOWPage(i))
    335335            {//page is still shared, so set the guard flag
    336336                rc = OSLibDosSetMem((char *)pMapView+(offset - mOffset), PAGE_SIZE, accessAttr);
     
    354354//******************************************************************************
    355355//******************************************************************************
    356 int Win32MemMapView::findViews(Win32MemMap *map, int nrViews, 
     356int Win32MemMapView::findViews(Win32MemMap *map, int nrViews,
    357357                               Win32MemMapView *viewarray[])
    358358{
     
    362362  Win32MemMapView *view = mapviews, *nextview;
    363363
    364   if(view != NULL) 
     364  if(view != NULL)
    365365  {
    366       while(view && i < nrViews) 
     366      while(view && i < nrViews)
    367367      {
    368368          if(view->getParentMap() == map)
     
    384384  Win32MemMapView *view = mapviews, *nextview;
    385385
    386   if(view != NULL) 
     386  if(view != NULL)
    387387  {
    388       while(view) 
     388      while(view)
    389389      {
    390390          nextview = view->next;
     
    404404// Win32MemMap::findMapByView
    405405//
    406 // Find the map of the view that contains the specified starting address 
     406// Find the map of the view that contains the specified starting address
    407407// and has the specified access type
    408408//
Note: See TracChangeset for help on using the changeset viewer.