feat: nearly complete POSIX.1-2008 compliant terminal interface implementation
[lunaix-os.git] / lunaix-os / arch / i386 / mm / pfault.c
index 165062c6fd965ca20c4536f930f004c22b3512a7..faf7da066d30a3cba019c1775b9af66c4fca2a86 100644 (file)
@@ -92,7 +92,7 @@ intr_routine_page_fault(const isr_param* param)
                 goto oom;
             }
 
                 goto oom;
             }
 
-            *pte = *pte | pa | get_ptattr(hit_region);
+            *pte = pa | get_ptattr(hit_region);
             memset((void*)PG_ALIGN(ptr), 0, PG_SIZE);
             goto resolved;
         }
             memset((void*)PG_ALIGN(ptr), 0, PG_SIZE);
             goto resolved;
         }
@@ -115,14 +115,11 @@ intr_routine_page_fault(const isr_param* param)
         }
 
         cpu_flush_page((ptr_t)pte);
         }
 
         cpu_flush_page((ptr_t)pte);
-        *pte = (*pte & 0xFFF) | pa | get_ptattr(hit_region);
+        *pte = pa | get_ptattr(hit_region);
 
         memset((void*)ptr, 0, PG_SIZE);
 
 
         memset((void*)ptr, 0, PG_SIZE);
 
-        int errno = 0;
-        if (mseg_off < hit_region->flen) {
-            errno = file->ops->read_page(file->inode, (void*)ptr, mfile_off);
-        }
+        int errno = file->ops->read_page(file->inode, (void*)ptr, mfile_off);
 
         if (errno < 0) {
             ERROR("fail to populate page (%d)", errno);
 
         if (errno < 0) {
             ERROR("fail to populate page (%d)", errno);