X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/9b8e0c494de6b447b44454112748f702dffec90d..74926d2db1d9f3228acdfca03013a8ba0ac1d8c0:/lunaix-os/kernel/asm/x86/pfault.c?ds=sidebyside diff --git a/lunaix-os/kernel/asm/x86/pfault.c b/lunaix-os/kernel/asm/x86/pfault.c index 4f0ccda..2388f38 100644 --- a/lunaix-os/kernel/asm/x86/pfault.c +++ b/lunaix-os/kernel/asm/x86/pfault.c @@ -102,9 +102,15 @@ intr_routine_page_fault(const isr_param* param) ptr = PG_ALIGN(ptr); memset(ptr, 0, PG_SIZE); - int errno = file->ops->read_page(file->inode, ptr, PG_SIZE, offset); + int errno = 0; + if (hit_region->init_page) { + errno = hit_region->init_page(hit_region, ptr, offset); + } else { + errno = file->ops->read_page(file->inode, ptr, PG_SIZE, offset); + } + if (errno < 0) { - kprintf(KERROR "fail to read page (%d)\n", errno); + kprintf(KERROR "fail to populate page (%d)\n", errno); goto segv_term; }