- cpu_invplg(pte);
- *pte = *pte | pa | PG_PRESENT;
- int errno = file->ops->read_page(
- file->inode, ptr & (PG_SIZE - 1), PG_SIZE, offset);
+ cpu_invplg((ptr_t)pte);
+ *pte = (*pte & 0xFFF) | pa | PG_PRESENT | PG_ALLOW_USER;
+
+ memset((void*)ptr, 0, PG_SIZE);
+
+ int errno = 0;
+ if (mseg_off < hit_region->flen) {
+ errno =
+ file->ops->read_page(file->inode, (void*)ptr, PG_SIZE, mfile_off);
+ }
+