mmap #8

Merged
mathieu merged 22 commits from mmap into master 2024-02-11 15:29:59 +01:00
Showing only changes of commit bf7008fc98 - Show all commits

View File

@ -388,7 +388,7 @@ free_reg:
int uAddrSpaceSolvePageFault(struct uAddrSpace *as, vaddr_t faultAddr, int isWriteAccess) int uAddrSpaceSolvePageFault(struct uAddrSpace *as, vaddr_t faultAddr, int isWriteAccess)
{ {
struct uAddrVirtualReg *reg; struct uAddrVirtualReg *reg;
int rights = PAGING_MEM_READ; int rights = PAGING_MEM_READ | PAGING_MEM_USER;
reg = findVirtualRegionFromAddr(as, faultAddr, 1); reg = findVirtualRegionFromAddr(as, faultAddr, 1);
@ -400,7 +400,7 @@ int uAddrSpaceSolvePageFault(struct uAddrSpace *as, vaddr_t faultAddr, int isWri
if (isWriteAccess && !(reg->right & PAGING_MEM_WRITE)) if (isWriteAccess && !(reg->right & PAGING_MEM_WRITE))
return -EACCES; return -EACCES;
if (isWriteAccess) if (isWriteAccess || (reg->right & PAGING_MEM_WRITE))
rights |= PAGING_MEM_WRITE; rights |= PAGING_MEM_WRITE;
if (reg->res->ops->nopage(reg, faultAddr, rights)) if (reg->res->ops->nopage(reg, faultAddr, rights))