1 /* $Id: pager.c,v 1.11 2002/09/08 10:23:36 chorns Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/mm/pager.c
6 * PURPOSE: Moves infrequently used data out of memory
7 * PROGRAMMER: David Welch (welch@cwcom.net)
12 /* INCLUDES ****************************************************************/
14 #include <ddk/ntddk.h>
15 #include <internal/ps.h>
16 #include <internal/ke.h>
17 #include <internal/mm.h>
20 #include <internal/debug.h>
22 /* GLOBALS *******************************************************************/
24 static HANDLE PagerThreadHandle
;
25 static CLIENT_ID PagerThreadId
;
26 static KEVENT PagerThreadEvent
;
27 static BOOLEAN PagerThreadShouldTerminate
;
29 /* FUNCTIONS *****************************************************************/
31 static NTSTATUS STDCALL
32 MmPagerThreadMain(PVOID Ignored
)
38 Status
= KeWaitForSingleObject(&PagerThreadEvent
,
43 if (!NT_SUCCESS(Status
))
45 DbgPrint("PagerThread: Wait failed\n");
48 if (PagerThreadShouldTerminate
)
50 DbgPrint("PagerThread: Terminating\n");
51 return(STATUS_SUCCESS
);
56 NTSTATUS
MmInitPagerThread(VOID
)
60 PagerThreadShouldTerminate
= FALSE
;
61 KeInitializeEvent(&PagerThreadEvent
,
65 Status
= PsCreateSystemThread(&PagerThreadHandle
,
72 if (!NT_SUCCESS(Status
))
77 return(STATUS_SUCCESS
);