Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

setdirty.c File Reference

#include "mi.h"

Go to the source code of this file.

Functions

VOID MiSetDirtyBit (IN PVOID FaultingAddress, IN PMMPTE PointerPte, IN ULONG PfnHeld)

Variables

ULONG MmSetDirtyCount


Function Documentation

VOID MiSetDirtyBit IN PVOID  FaultingAddress,
IN PMMPTE  PointerPte,
IN ULONG  PfnHeld
 

Definition at line 28 of file mips/setdirty.c.

References MI_PFN_ELEMENT, MI_SET_ACCESSED_IN_PTE, MiReleasePageFileSpace(), MmSetDirtyCount, _MMPFN::OriginalPte, TRUE, _MMPTE::u, and _MMPFN::u3.

00036 : 00037 00038 This routine sets dirty in the specified PTE and the modify bit in the 00039 correpsonding PFN element. If any page file space is allocated, it 00040 is deallocated. 00041 00042 Arguments: 00043 00044 FaultingAddress - Supplies the faulting address. 00045 00046 PointerPte - Supplies a pointer to the corresponding valid PTE. 00047 00048 PfnHeld - Supplies TRUE if the PFN mutex is already held. 00049 00050 Return Value: 00051 00052 None. 00053 00054 Environment: 00055 00056 Kernel mode, APC's disabled, Working set mutex held. 00057 00058 --*/ 00059 00060 { 00061 MMPTE TempPte; 00062 ULONG PageFrameIndex; 00063 PMMPFN Pfn1; 00064 KIRQL OldIrql; 00065 00066 // 00067 // The page is NOT copy on write, update the PTE setting both the 00068 // dirty bit and the accessed bit. Note, that as this PTE is in 00069 // the TB, the TB must be flushed. 00070 // 00071 00072 MmSetDirtyCount += 1; //fixfix - remove 00073 00074 PageFrameIndex = PointerPte->u.Hard.PageFrameNumber; 00075 Pfn1 = MI_PFN_ELEMENT (PageFrameIndex); 00076 00077 TempPte = *PointerPte; 00078 TempPte.u.Hard.Dirty = 1; 00079 MI_SET_ACCESSED_IN_PTE (&TempPte, 1); 00080 *PointerPte = TempPte; 00081 00082 // 00083 // Check state of PFN mutex and if not held, don't update PFN database. 00084 // 00085 00086 00087 if (PfnHeld) { 00088 00089 // 00090 // Set the modified field in the PFN database, also, if the phyiscal 00091 // page is currently in a paging file, free up the page file space 00092 // as the contents are now worthless. 00093 // 00094 00095 if ((Pfn1->OriginalPte.u.Soft.Prototype == 0) && 00096 (Pfn1->u3.e1.WriteInProgress == 0)) { 00097 00098 // 00099 // This page is in page file format, deallocate the page file space. 00100 // 00101 00102 MiReleasePageFileSpace (Pfn1->OriginalPte); 00103 00104 // 00105 // Change original PTE to indicate no page file space is reserved, 00106 // otherwise the space will be deallocated when the PTE is 00107 // deleted. 00108 // 00109 00110 Pfn1->OriginalPte.u.Soft.PageFileHigh = 0; 00111 } 00112 00113 Pfn1->u3.e1.Modified = 1; 00114 } 00115 00116 // 00117 // The TB entry must be flushed as the valid PTE with the dirty bit clear 00118 // has been fetched into the TB. If it isn't flushed, another fault 00119 // is generated as the dirty bit is not set in the cached TB entry. 00120 // 00121 00122 KeFillEntryTb ((PHARDWARE_PTE)PointerPte, FaultingAddress, TRUE); 00123 00124 return; 00125 } }


Variable Documentation

ULONG MmSetDirtyCount
 

Definition at line 25 of file mips/setdirty.c.

Referenced by MiSetDirtyBit().


Generated on Sat May 15 19:45:38 2004 for test by doxygen 1.3.7