Changeset 741

Show
Ignore:
Timestamp:
07/07/08 17:26:25 (2 months ago)
Author:
mwhitworth
Message:

Add VirtChangeProtection for SysMemoryProtect.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/trunk/arch/i386/mm/virt.c

    r624 r741  
    397397 
    398398SYMBOL_EXPORT(VirtMapPhysRange); 
     399 
     400int VirtChangeProtection(DWORD start, DWORD end, int protection) 
     401{ 
     402        DWORD address; 
     403 
     404        for (address=start; address<end; address+=PAGE_SIZE) 
     405        { 
     406                DWORD virtEnt=PGDIR_ENT(address); 
     407 
     408                if (pageDir[virtEnt]) 
     409                { 
     410                        if (pageTable[PGTABLE_ENT(address)] & PAGE_PRESENT) 
     411                        { 
     412                                pageTable[PGTABLE_ENT(address)] &= ~(0xFFF); 
     413                                pageTable[PGTABLE_ENT(address)] |= protection; 
     414//                              KePrint("address = %#X\n", pageTable[PGTABLE_ENT(address)]); 
     415                        } 
     416                } 
     417        } 
     418 
     419        return 0; 
     420} 
     421 
     422SYMBOL_EXPORT(VirtChangeProtection); 
    399423 
    400424void VirtUnmapPhysPage(DWORD virt)