ReactOS 0.4.16-dev-338-g34e76ad
freelist.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/mm/freelist.c
5 * PURPOSE: Handle the list of free physical pages
6 *
7 * PROGRAMMERS: David Welch (welch@cwcom.net)
8 * Robert Bergkvist
9 */
10
11/* INCLUDES ****************************************************************/
12
13#include <ntoskrnl.h>
14#define NDEBUG
15#include <debug.h>
16
17#define MODULE_INVOLVED_IN_ARM3
18#include "ARM3/miarm.h"
19
20#define ASSERT_IS_ROS_PFN(x) ASSERT(MI_IS_ROS_PFN(x) == TRUE);
21
22/* GLOBALS ****************************************************************/
23
25
29
37
40
41/* FUNCTIONS *************************************************************/
42
46{
49
50 /* Find the first user page */
51 OldIrql = MiAcquirePfnLock();
52
53 if (FirstUserLRUPfn == NULL)
54 {
55 MiReleasePfnLock(OldIrql);
56 return 0;
57 }
58
61
62 MiReleasePfnLock(OldIrql);
63
64 return Page;
65}
66
67static
68VOID
70{
72
74
75 if (FirstUserLRUPfn == NULL)
76 FirstUserLRUPfn = Pfn;
77
79
80 if (LastUserLRUPfn != NULL)
82 LastUserLRUPfn = Pfn;
83}
84
85static
86VOID
88{
90
91 /* Unset the page as a user page */
92 ASSERT(Page != 0);
93
95
97
98 if (Pfn->PreviousLRU)
99 {
100 ASSERT(Pfn->PreviousLRU->NextLRU == Pfn);
101 Pfn->PreviousLRU->NextLRU = Pfn->NextLRU;
102 }
103 else
104 {
105 ASSERT(FirstUserLRUPfn == Pfn);
107 }
108
109 if (Pfn->NextLRU)
110 {
111 ASSERT(Pfn->NextLRU->PreviousLRU == Pfn);
112 Pfn->NextLRU->PreviousLRU = Pfn->PreviousLRU;
113 }
114 else
115 {
116 ASSERT(Pfn == LastUserLRUPfn);
118 }
119
120 Pfn->PreviousLRU = Pfn->NextLRU = NULL;
121}
122
124NTAPI
125MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast)
126{
127 PFN_NUMBER Page = 0;
129
130 /* Find the next user page */
131 OldIrql = MiAcquirePfnLock();
132
133 PMMPFN PreviousPfn = MiGetPfnEntry(PreviousPage);
134 PMMPFN NextPfn = PreviousPfn->NextLRU;
135
136 /*
137 * Move this one at the end of the list.
138 * It may be freed by MmDereferencePage below.
139 * If it's not, then it means it is still hanging in some process address space.
140 * This avoids paging-out e.g. ntdll early just because it's mapped first time.
141 */
142 if ((MoveToLast) && (MmGetReferenceCountPage(PreviousPage) > 1))
143 {
144 MmRemoveLRUUserPage(PreviousPage);
145 MmInsertLRULastUserPage(PreviousPage);
146 }
147
148 if (NextPfn)
149 {
150 Page = MiGetPfnEntryIndex(NextPfn);
152 }
153
154 MmDereferencePage(PreviousPage);
155
156 MiReleasePfnLock(OldIrql);
157
158 return Page;
159}
160
162NTAPI
164{
165 /* Must be a free or zero page, with no references, linked */
166 return ((Pfn1->u3.e1.PageLocation <= StandbyPageList) &&
167 (Pfn1->u1.Flink) &&
168 (Pfn1->u2.Blink) &&
169 !(Pfn1->u3.e2.ReferenceCount));
170}
171
173NTAPI
175{
176 /* Standby list or higher, unlinked, and with references */
177 return !MiIsPfnFree(Pfn1);
178}
179
180PMDL
181NTAPI
186 IN MI_PFN_CACHE_ATTRIBUTE CacheAttribute,
187 IN ULONG MdlFlags)
188{
189 PMDL Mdl;
190 PFN_NUMBER PageCount, LowPage, HighPage, SkipPages, PagesFound = 0, Page;
191 PPFN_NUMBER MdlPage, LastMdlPage;
193 PMMPFN Pfn1;
194 INT LookForZeroedPages;
195
197 DPRINT("ARM3-DEBUG: Being called with %I64x %I64x %I64x %lx %d %lu\n", LowAddress, HighAddress, SkipBytes, TotalBytes, CacheAttribute, MdlFlags);
198
199 //
200 // Convert the low address into a PFN
201 //
202 LowPage = (PFN_NUMBER)(LowAddress.QuadPart >> PAGE_SHIFT);
203
204 //
205 // Convert, and normalize, the high address into a PFN
206 //
207 HighPage = (PFN_NUMBER)(HighAddress.QuadPart >> PAGE_SHIFT);
208 if (HighPage > MmHighestPhysicalPage) HighPage = MmHighestPhysicalPage;
209
210 //
211 // Validate skipbytes and convert them into pages
212 //
213 if (BYTE_OFFSET(SkipBytes.LowPart)) return NULL;
214 SkipPages = (PFN_NUMBER)(SkipBytes.QuadPart >> PAGE_SHIFT);
215
216 /* This isn't supported at all */
217 if (SkipPages) DPRINT1("WARNING: Caller requesting SkipBytes, MDL might be mismatched\n");
218
219 //
220 // Now compute the number of pages the MDL will cover
221 //
223 do
224 {
225 //
226 // Try creating an MDL for these many pages
227 //
228 Mdl = MmCreateMdl(NULL, NULL, PageCount << PAGE_SHIFT);
229 if (Mdl) break;
230
231 //
232 // This function is not required to return the amount of pages requested
233 // In fact, it can return as little as 1 page, and callers are supposed
234 // to deal with this scenario. So re-attempt the allocation with less
235 // pages than before, and see if it worked this time.
236 //
237 PageCount -= (PageCount >> 4);
238 } while (PageCount);
239
240 //
241 // Wow, not even a single page was around!
242 //
243 if (!Mdl) return NULL;
244
245 //
246 // This is where the page array starts....
247 //
248 MdlPage = (PPFN_NUMBER)(Mdl + 1);
249
250 //
251 // Lock the PFN database
252 //
253 OldIrql = MiAcquirePfnLock();
254
255 //
256 // Are we looking for any pages, without discriminating?
257 //
258 if ((LowPage == 0) && (HighPage == MmHighestPhysicalPage))
259 {
260 //
261 // Well then, let's go shopping
262 //
263 while (PagesFound < PageCount)
264 {
265 /* Grab a page */
267 MI_SET_PROCESS2("Kernel");
268
269 /* FIXME: This check should be smarter */
270 Page = 0;
271 if (MmAvailablePages != 0)
273
274 if (Page == 0)
275 {
276 /* This is not good... hopefully we have at least SOME pages */
277 ASSERT(PagesFound);
278 break;
279 }
280
281 /* Grab the page entry for it */
282 Pfn1 = MiGetPfnEntry(Page);
283
284 //
285 // Make sure it's really free
286 //
287 ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
288
289 /* Now setup the page and mark it */
290 Pfn1->u3.e2.ReferenceCount = 1;
291 Pfn1->u2.ShareCount = 1;
292 MI_SET_PFN_DELETED(Pfn1);
293 Pfn1->u4.PteFrame = 0x1FFEDCB;
294 Pfn1->u3.e1.StartOfAllocation = 1;
295 Pfn1->u3.e1.EndOfAllocation = 1;
296 Pfn1->u4.VerifierAllocation = 0;
297
298 //
299 // Save it into the MDL
300 //
301 *MdlPage++ = MiGetPfnEntryIndex(Pfn1);
302 PagesFound++;
303 }
304 }
305 else
306 {
307 //
308 // You want specific range of pages. We'll do this in two runs
309 //
310 for (LookForZeroedPages = 1; LookForZeroedPages >= 0; LookForZeroedPages--)
311 {
312 //
313 // Scan the range you specified
314 //
315 for (Page = LowPage; Page < HighPage; Page++)
316 {
317 //
318 // Get the PFN entry for this page
319 //
320 Pfn1 = MiGetPfnEntry(Page);
321 ASSERT(Pfn1);
322
323 //
324 // Make sure it's free and if this is our first pass, zeroed
325 //
326 if (MiIsPfnInUse(Pfn1)) continue;
327 if ((Pfn1->u3.e1.PageLocation == ZeroedPageList) != LookForZeroedPages) continue;
328
329 /* Remove the page from the free or zero list */
330 ASSERT(Pfn1->u3.e1.ReadInProgress == 0);
332 MI_SET_PROCESS2("Kernel");
334
335 //
336 // Sanity checks
337 //
338 ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
339
340 //
341 // Now setup the page and mark it
342 //
343 Pfn1->u3.e2.ReferenceCount = 1;
344 Pfn1->u2.ShareCount = 1;
345 MI_SET_PFN_DELETED(Pfn1);
346 Pfn1->u4.PteFrame = 0x1FFEDCB;
347 Pfn1->u3.e1.StartOfAllocation = 1;
348 Pfn1->u3.e1.EndOfAllocation = 1;
349 Pfn1->u4.VerifierAllocation = 0;
350
351 //
352 // Save this page into the MDL
353 //
354 *MdlPage++ = Page;
355 if (++PagesFound == PageCount) break;
356 }
357
358 //
359 // If the first pass was enough, don't keep going, otherwise, go again
360 //
361 if (PagesFound == PageCount) break;
362 }
363 }
364
365 //
366 // Now release the PFN count
367 //
368 MiReleasePfnLock(OldIrql);
369
370 //
371 // We might've found less pages, but not more ;-)
372 //
373 if (PagesFound != PageCount) ASSERT(PagesFound < PageCount);
374 if (!PagesFound)
375 {
376 //
377 // If we didn' tfind any pages at all, fail
378 //
379 DPRINT1("NO MDL PAGES!\n");
381 return NULL;
382 }
383
384 //
385 // Write out how many pages we found
386 //
387 Mdl->ByteCount = (ULONG)(PagesFound << PAGE_SHIFT);
388
389 //
390 // Terminate the MDL array if there's certain missing pages
391 //
392 if (PagesFound != PageCount) *MdlPage = LIST_HEAD;
393
394 //
395 // Now go back and loop over all the MDL pages
396 //
397 MdlPage = (PPFN_NUMBER)(Mdl + 1);
398 LastMdlPage = MdlPage + PagesFound;
399 while (MdlPage < LastMdlPage)
400 {
401 //
402 // Check if we've reached the end
403 //
404 Page = *MdlPage++;
405 if (Page == LIST_HEAD) break;
406
407 //
408 // Get the PFN entry for the page and check if we should zero it out
409 //
410 Pfn1 = MiGetPfnEntry(Page);
411 ASSERT(Pfn1);
414 }
415
416 //
417 // We're done, mark the pages as locked
418 //
419 Mdl->Process = NULL;
420 Mdl->MdlFlags |= MDL_PAGES_LOCKED;
421 return Mdl;
422}
423
424VOID
425NTAPI
427{
428 PMMPFN Pfn1;
429
430 /* PFN database must be locked */
432
433 Pfn1 = MiGetPfnEntry(Pfn);
434 ASSERT(Pfn1);
435 ASSERT_IS_ROS_PFN(Pfn1);
436
437 if (ListHead)
438 {
439 /* Should not be trying to insert an RMAP for a non-active page */
440 ASSERT(MiIsPfnInUse(Pfn1) == TRUE);
441
442 /* Set the list head address */
443 Pfn1->RmapListHead = ListHead;
444 }
445 else
446 {
447 /* ReactOS semantics dictate the page is STILL active right now */
448 ASSERT(MiIsPfnInUse(Pfn1) == TRUE);
449
450 /* In this case, the RMAP is actually being removed, so clear field */
451 Pfn1->RmapListHead = NULL;
452
453 /* ReactOS semantics will now release the page, which will make it free and enter a colored list */
454 }
455}
456
458NTAPI
460{
461 PMMPFN Pfn1;
462
463 /* PFN database must be locked */
465
466 /* Get the entry */
467 Pfn1 = MiGetPfnEntry(Pfn);
468 ASSERT(Pfn1);
469
470 if (!MI_IS_ROS_PFN(Pfn1))
471 {
472 return NULL;
473 }
474
475 /* Should not have an RMAP for a non-active page */
476 ASSERT(MiIsPfnInUse(Pfn1) == TRUE);
477
478 /* Get the list head */
479 return Pfn1->RmapListHead;
480}
481
482VOID
483NTAPI
485{
486 KIRQL oldIrql;
487 PMMPFN Pfn1;
488
489 Pfn1 = MiGetPfnEntry(Pfn);
490 ASSERT(Pfn1);
491 ASSERT_IS_ROS_PFN(Pfn1);
492
493 oldIrql = MiAcquirePfnLock();
494 Pfn1->u1.SwapEntry = SwapEntry;
495 MiReleasePfnLock(oldIrql);
496}
497
499NTAPI
501{
502 SWAPENTRY SwapEntry;
503 KIRQL oldIrql;
504 PMMPFN Pfn1;
505
506 Pfn1 = MiGetPfnEntry(Pfn);
507 ASSERT(Pfn1);
508 ASSERT_IS_ROS_PFN(Pfn1);
509
510 oldIrql = MiAcquirePfnLock();
511 SwapEntry = Pfn1->u1.SwapEntry;
512 MiReleasePfnLock(oldIrql);
513
514 return(SwapEntry);
515}
516
517VOID
518NTAPI
520{
521 PMMPFN Pfn1;
522
523 DPRINT("MmReferencePage(PysicalAddress %x)\n", Pfn << PAGE_SHIFT);
524
526 ASSERT(Pfn != 0);
528
529 Pfn1 = MiGetPfnEntry(Pfn);
530 ASSERT(Pfn1);
531 ASSERT_IS_ROS_PFN(Pfn1);
532
533 ASSERT(Pfn1->u3.e2.ReferenceCount != 0);
534 Pfn1->u3.e2.ReferenceCount++;
535}
536
537ULONG
538NTAPI
540{
541 ULONG RCount;
542 PMMPFN Pfn1;
543
545
546 DPRINT("MmGetReferenceCountPage(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT);
547
548 Pfn1 = MiGetPfnEntry(Pfn);
549 ASSERT(Pfn1);
550 ASSERT_IS_ROS_PFN(Pfn1);
551
552 RCount = Pfn1->u3.e2.ReferenceCount;
553
554 return(RCount);
555}
556
558NTAPI
560{
561 return MiIsPfnInUse(MiGetPfnEntry(Pfn));
562}
563
564VOID
565NTAPI
567{
568 PMMPFN Pfn1;
569 DPRINT("MmDereferencePage(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT);
570
572
573 Pfn1 = MiGetPfnEntry(Pfn);
574 ASSERT(Pfn1);
575 ASSERT_IS_ROS_PFN(Pfn1);
576
577 ASSERT(Pfn1->u3.e2.ReferenceCount != 0);
578 Pfn1->u3.e2.ReferenceCount--;
579 if (Pfn1->u3.e2.ReferenceCount == 0)
580 {
581 /* Apply LRU hack */
582 if (Pfn1->u4.MustBeCached)
583 {
585 Pfn1->u4.MustBeCached = 0;
586 }
587
588 /* Mark the page temporarily as valid, we're going to make it free soon */
590
591 /* It's not a ROS PFN anymore */
592 Pfn1->u4.AweAllocation = FALSE;
593
594 /* Bring it back into the free list */
595 DPRINT("Legacy free: %lx\n", Pfn);
597 }
598}
599
601NTAPI
603{
604 PFN_NUMBER PfnOffset;
605 PMMPFN Pfn1;
607
608 OldIrql = MiAcquirePfnLock();
609
610#if MI_TRACE_PFNS
611 switch(Type)
612 {
613 case MC_SYSTEM:
615 break;
616 case MC_USER:
618 break;
619 default:
620 ASSERT(FALSE);
621 }
622#endif
623
624 PfnOffset = MiRemoveZeroPage(MI_GET_NEXT_COLOR());
625 if (!PfnOffset)
626 {
627 MiReleasePfnLock(OldIrql);
628 return 0;
629 }
630
631 DPRINT("Legacy allocate: %lx\n", PfnOffset);
632 Pfn1 = MiGetPfnEntry(PfnOffset);
633 Pfn1->u3.e2.ReferenceCount = 1;
635
636 /* This marks the PFN as a ReactOS PFN */
637 Pfn1->u4.AweAllocation = TRUE;
638
639 /* Allocate the extra ReactOS Data and zero it out */
640 Pfn1->u1.SwapEntry = 0;
641 Pfn1->RmapListHead = NULL;
642
643 Pfn1->NextLRU = NULL;
644 Pfn1->PreviousLRU = NULL;
645
646 if (Type == MC_USER)
647 {
648 Pfn1->u4.MustBeCached = 1; /* HACK again */
649 MmInsertLRULastUserPage(PfnOffset);
650 }
651
652 MiReleasePfnLock(OldIrql);
653 return PfnOffset;
654}
655
656/* EOF */
unsigned char BOOLEAN
Type
Definition: Type.h:7
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
PFN_NUMBER MmResidentAvailablePages
Definition: freelist.c:27
PMMPFN LastUserLRUPfn
Definition: freelist.c:39
VOID NTAPI MmSetSavedSwapEntryPage(PFN_NUMBER Pfn, SWAPENTRY SwapEntry)
Definition: freelist.c:484
static VOID MmInsertLRULastUserPage(PFN_NUMBER Page)
Definition: freelist.c:69
VOID NTAPI MmSetRmapListHeadPage(PFN_NUMBER Pfn, PMM_RMAP_ENTRY ListHead)
Definition: freelist.c:426
BOOLEAN NTAPI MiIsPfnFree(IN PMMPFN Pfn1)
Definition: freelist.c:163
SWAPENTRY NTAPI MmGetSavedSwapEntryPage(PFN_NUMBER Pfn)
Definition: freelist.c:500
PMMPFN MmPfnDatabase
Definition: freelist.c:24
VOID NTAPI MmDereferencePage(PFN_NUMBER Pfn)
Definition: freelist.c:566
PFN_NUMBER NTAPI MmAllocPage(ULONG Type)
Definition: freelist.c:602
PFN_NUMBER MmResidentAvailableAtInit
Definition: freelist.c:28
PFN_NUMBER NTAPI MmGetLRUFirstUserPage(VOID)
Definition: freelist.c:45
VOID NTAPI MmReferencePage(PFN_NUMBER Pfn)
Definition: freelist.c:519
PMMPFN FirstUserLRUPfn
Definition: freelist.c:38
BOOLEAN NTAPI MmIsPageInUse(PFN_NUMBER Pfn)
Definition: freelist.c:559
#define ASSERT_IS_ROS_PFN(x)
Definition: freelist.c:20
SIZE_T MmDriverCommit
Definition: freelist.c:32
SIZE_T MmProcessCommit
Definition: freelist.c:33
static VOID MmRemoveLRUUserPage(PFN_NUMBER Page)
Definition: freelist.c:87
PMDL NTAPI MiAllocatePagesForMdl(IN PHYSICAL_ADDRESS LowAddress, IN PHYSICAL_ADDRESS HighAddress, IN PHYSICAL_ADDRESS SkipBytes, IN SIZE_T TotalBytes, IN MI_PFN_CACHE_ATTRIBUTE CacheAttribute, IN ULONG MdlFlags)
Definition: freelist.c:182
ULONG NTAPI MmGetReferenceCountPage(PFN_NUMBER Pfn)
Definition: freelist.c:539
SIZE_T MmtotalCommitLimitMaximum
Definition: freelist.c:36
BOOLEAN NTAPI MiIsPfnInUse(IN PMMPFN Pfn1)
Definition: freelist.c:174
PFN_NUMBER MmAvailablePages
Definition: freelist.c:26
SIZE_T MmPagedPoolCommit
Definition: freelist.c:34
SIZE_T MmSharedCommit
Definition: freelist.c:31
SIZE_T MmTotalCommittedPages
Definition: freelist.c:30
PFN_NUMBER NTAPI MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast)
Definition: freelist.c:125
SIZE_T MmPeakCommitment
Definition: freelist.c:35
PMM_RMAP_ENTRY NTAPI MmGetRmapListHeadPage(PFN_NUMBER Pfn)
Definition: freelist.c:459
PFN_NUMBER MmHighestPhysicalPage
Definition: meminit.c:31
#define MI_IS_ROS_PFN(x)
Definition: miarm.h:1116
PFN_NUMBER NTAPI MiRemoveZeroPage(IN ULONG Color)
Definition: pfnlist.c:537
VOID NTAPI MiUnlinkFreeOrZeroedPage(IN PMMPFN Entry)
Definition: pfnlist.c:137
#define MI_SET_PFN_DELETED(x)
Definition: miarm.h:208
VOID NTAPI MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex)
Definition: pfnlist.c:611
#define MI_GET_NEXT_COLOR()
Definition: miarm.h:246
PFN_NUMBER NTAPI MiRemoveAnyPage(IN ULONG Color)
Definition: pfnlist.c:477
enum _MI_PFN_CACHE_ATTRIBUTE MI_PFN_CACHE_ATTRIBUTE
PMDL NTAPI MmCreateMdl(IN PMDL Mdl, IN PVOID Base, IN SIZE_T Length)
Definition: mdlsup.c:378
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
@ ZeroedPageList
Definition: mmtypes.h:153
@ ActiveAndValid
Definition: mmtypes.h:159
@ StandbyPageList
Definition: mmtypes.h:155
VOID NTAPI MiZeroPhysicalPage(IN PFN_NUMBER PageFrameIndex)
Definition: pfnlist.c:122
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
Definition: mm.h:1047
#define MI_SET_PROCESS2(x)
Definition: mm.h:319
@ MI_USAGE_MDL
Definition: mm.h:339
@ MI_USAGE_SECTION
Definition: mm.h:333
@ MI_USAGE_CACHE
Definition: mm.h:342
#define MC_USER
Definition: mm.h:114
#define MI_ASSERT_PFN_LOCK_HELD()
Definition: mm.h:1043
FORCEINLINE PFN_NUMBER MiGetPfnEntryIndex(IN PMMPFN Pfn1)
Definition: mm.h:1067
#define MC_SYSTEM
Definition: mm.h:115
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
Definition: mm.h:1306
ULONG_PTR SWAPENTRY
Definition: mm.h:57
#define MI_SET_USAGE(x)
Definition: mm.h:317
ULONG * PPFN_NUMBER
Definition: ke.h:9
ULONG PFN_NUMBER
Definition: ke.h:9
#define DPRINT
Definition: sndvol32.h:73
USHORT ReadInProgress
Definition: mm.h:361
USHORT PageLocation
Definition: mm.h:365
Definition: mm.h:374
PMM_RMAP_ENTRY RmapListHead
Definition: mm.h:411
struct _MMPFN::@1805::@1811 e2
ULONG_PTR MustBeCached
Definition: mm.h:423
struct _MMPFN * NextLRU
Definition: mm.h:435
union _MMPFN::@1804 u2
union _MMPFN::@1803 u1
union _MMPFN::@1808 u4
MMPFNENTRY e1
Definition: mm.h:397
ULONG_PTR VerifierAllocation
Definition: mm.h:420
ULONG_PTR ShareCount
Definition: mm.h:390
struct _MMPFN * PreviousLRU
Definition: mm.h:436
union _MMPFN::@1805 u3
SWAPENTRY SwapEntry
Definition: mm.h:384
ULONG_PTR AweAllocation
Definition: mm.h:421
ULONG_PTR PteFrame
Definition: mm.h:418
Definition: mm.h:266
#define LIST_HEAD(name, type)
Definition: queue.h:167
#define TAG_MDL
Definition: tag.h:89
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG LowPart
Definition: typedefs.h:106
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS HighAddress
Definition: mmfuncs.h:226
#define BYTE_OFFSET(Va)
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, _Size)
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS _In_ PHYSICAL_ADDRESS SkipBytes
Definition: mmfuncs.h:227
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS _In_ PHYSICAL_ADDRESS _In_ SIZE_T TotalBytes
Definition: mmfuncs.h:228
#define MDL_PAGES_LOCKED
Definition: mmtypes.h:19