- Add several missing assertions documented on the MSDN page "Checked Build ASSERTs"
[reactos.git] / reactos / ntoskrnl / mm / ARM3 / iosup.c
index 5d3452b..7ea8297 100644 (file)
@@ -57,7 +57,22 @@ MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress,
     PMMPFN Pfn1 = NULL;
     MI_PFN_CACHE_ATTRIBUTE CacheAttribute;
     BOOLEAN IsIoMapping;
-    
+
+    //
+    // Must be called with a non-zero count
+    //
+    ASSERT(NumberOfBytes != 0);
+
+    //
+    // Make sure the upper bits are 0 if this system
+    // can't describe more than 4 GB of physical memory.
+    // FIXME: This doesn't respect PAE, but we currently don't
+    // define a PAE build flag since there is no such build.
+    //
+#if !defined(_M_AMD64)
+    ASSERT(PhysicalAddress.HighPart == 0);
+#endif
+
     //
     // Normalize and validate the caching attributes
     //