diff --git a/xtoskrnl/includes/mm/colors.hh b/xtoskrnl/includes/mm/colors.hh index d48c3d9..e6e3183 100644 --- a/xtoskrnl/includes/mm/colors.hh +++ b/xtoskrnl/includes/mm/colors.hh @@ -19,6 +19,7 @@ namespace MM { private: STATIC PMMCOLOR_TABLES FreePages[FreePageList + 1]; + STATIC MMPFNLIST ModifiedPages[MM_PAGING_COLORS]; STATIC ULONG PagingColors; STATIC ULONG PagingColorsMask; @@ -26,9 +27,10 @@ namespace MM STATIC XTAPI VOID ComputePageColoring(VOID); STATIC XTAPI PMMCOLOR_TABLES GetFreePages(MMPAGELISTS PageList, ULONG Color); - STATIC XTAPI ULONG GetNextColor(); - STATIC XTAPI ULONG GetPagingColors(); - STATIC XTAPI ULONG GetPagingColorsMask(); + STATIC XTAPI PMMPFNLIST GetModifiedPages(IN ULONG Color); + STATIC XTAPI ULONG GetNextColor(VOID); + STATIC XTAPI ULONG GetPagingColors(VOID); + STATIC XTAPI ULONG GetPagingColorsMask(VOID); STATIC XTAPI VOID InitializeColorTables(VOID); }; } diff --git a/xtoskrnl/mm/colors.cc b/xtoskrnl/mm/colors.cc index 5774785..df39cc8 100644 --- a/xtoskrnl/mm/colors.cc +++ b/xtoskrnl/mm/colors.cc @@ -49,6 +49,23 @@ MM::Colors::GetFreePages(MMPAGELISTS PageList, return &FreePages[PageList][Color]; } +/** + * Retrieves a pointer to the modified pages list for a specific color. + * + * @param Color + * Supplies the specific color index. + * + * @return This routine returns a pointer to the corresponding MMPFNLIST structure. + * + * @since XT 1.0 + */ +XTAPI +PMMPFNLIST +MM::Colors::GetModifiedPages(IN ULONG Color) +{ + return &ModifiedPages[Color]; +} + /** * Retrieves the next available color for page coloring. * @@ -58,7 +75,7 @@ MM::Colors::GetFreePages(MMPAGELISTS PageList, */ XTAPI ULONG -MM::Colors::GetNextColor() +MM::Colors::GetNextColor(VOID) { /* Increment the color counter and wrap it around using the mask */ return ((++PagingColors) & PagingColorsMask); @@ -73,7 +90,7 @@ MM::Colors::GetNextColor() */ XTAPI ULONG -MM::Colors::GetPagingColors() +MM::Colors::GetPagingColors(VOID) { /* Return the total number of page colors */ return PagingColors; @@ -88,7 +105,7 @@ MM::Colors::GetPagingColors() */ XTAPI ULONG -MM::Colors::GetPagingColorsMask() +MM::Colors::GetPagingColorsMask(VOID) { /* Return the mask used for page coloring calculations */ return PagingColorsMask; diff --git a/xtoskrnl/mm/data.cc b/xtoskrnl/mm/data.cc index ead62f1..06bdf9b 100644 --- a/xtoskrnl/mm/data.cc +++ b/xtoskrnl/mm/data.cc @@ -12,6 +12,9 @@ /* Array of free page lists segregated by cache color */ PMMCOLOR_TABLES MM::Colors::FreePages[FreePageList + 1]; +/* Array of modified pages segregated by cache color */ +MMPFNLIST MM::Colors::ModifiedPages[MM_PAGING_COLORS]; + /* Number of supported page colors */ ULONG MM::Colors::PagingColors;