Changeset 5c2af75 in mainline
- Timestamp:
- 2016-08-30T16:10:26Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2f6ad06
- Parents:
- 072607b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/backend_user.c
r072607b r5c2af75 39 39 #include <mm/as.h> 40 40 #include <mm/page.h> 41 #include <abi/ipc/methods.h> 42 #include <ipc/sysipc.h> 41 43 #include <synch/mutex.h> 42 44 #include <typedefs.h> 43 45 #include <align.h> 44 46 #include <debug.h> 47 #include <errno.h> 48 #include <log.h> 45 49 46 50 static bool user_create(as_area_t *); … … 125 129 ASSERT(IS_ALIGNED(upage, PAGE_SIZE)); 126 130 127 return AS_PF_FAULT; 131 if (!as_area_check_access(area, access)) 132 return AS_PF_FAULT; 133 134 ipc_data_t data = {}; 135 IPC_SET_IMETHOD(data, IPC_M_PAGE_IN); 136 IPC_SET_ARG1(data, upage - area->base); 137 IPC_SET_ARG2(data, PAGE_SIZE); 138 139 int rc = ipc_req_internal(area->backend_data.pager, &data); 140 141 if (rc != EOK) { 142 log(LF_USPACE, LVL_FATAL, 143 "Page-in request for page %#" PRIxn 144 " at pager %d failed with error %d.", 145 upage, area->backend_data.pager, rc); 146 return AS_PF_FAULT; 147 } 148 149 if (IPC_GET_RETVAL(data) != EOK) 150 return AS_PF_FAULT; 151 152 /* 153 * A successful reply will contain the physical frame in ARG1. 154 * The physical frame will have the reference count already 155 * incremented. 156 */ 157 158 uintptr_t frame = IPC_GET_ARG1(data); 159 page_mapping_insert(AS, upage, frame, as_area_get_flags(area)); 160 if (!used_space_insert(area, upage, 1)) 161 panic("Cannot insert used space."); 162 163 return AS_PF_OK; 128 164 } 129 165
Note:
See TracChangeset
for help on using the changeset viewer.