Changes in / [bdfdc51c:f126c87] in mainline
- Files:
-
- 4 added
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/ipc/interfaces.h
rbdfdc51c rf126c87 81 81 INTERFACE_LOADER = 82 82 FOURCC_COMPACT('l', 'o', 'a', 'd') | IFACE_EXCHANGE_SERIALIZE, 83 INTERFACE_PAGER = 84 FOURCC_COMPACT('p', 'a', 'g', 'e') | IFACE_EXCHANGE_ATOMIC, 83 85 INTERFACE_LOGGER_WRITER = 84 86 FOURCC_COMPACT('l', 'o', 'g', 'w') | IFACE_EXCHANGE_SERIALIZE, -
abi/include/abi/ipc/methods.h
rbdfdc51c rf126c87 51 51 */ 52 52 53 /** This message is sent to answerbox when the phone is hung up 54 * 55 * The numerical value zero (0) of this method is important, 56 * so as the value can be easily tested in conditions. 57 * 58 */ 59 #define IPC_M_PHONE_HUNGUP 0 60 61 /** Clone connection. 62 * 63 * The calling task clones one of its phones for the callee. 64 * 65 * - ARG1 - The caller sets ARG1 to the phone of the cloned connection. 66 * - The callee gets the new phone from ARG1. 67 * 68 * - on answer, the callee acknowledges the new connection by sending EOK back 69 * or the kernel closes it 70 * 71 */ 72 #define IPC_M_CONNECTION_CLONE 1 73 74 /** Protocol for establishing a cloned connection. 75 * 76 * Through this call, the recipient learns about the new cloned connection. 77 * 78 * - ARG5 - the kernel sets ARG5 to contain the hash of the used phone 79 * - on answer, the callee acknowledges the new connection by sending EOK back 80 * or the kernel closes it 81 * 82 */ 83 #define IPC_M_CLONE_ESTABLISH 2 84 85 /** Protocol for initializing callback connections. 86 * 87 * Calling process asks the callee to create a callback connection, 88 * so that it can start initiating new messages. 89 * 90 * The protocol for negotiating is: 91 * - sys_connect_to_me - sends a message IPC_M_CONNECT_TO_ME 92 * - recipient - upon receipt tries to allocate new phone 93 * - if it fails, responds with ELIMIT 94 * - passes call to userspace. If userspace 95 * responds with error, phone is deallocated and 96 * error is sent back to caller. Otherwise 97 * the call is accepted and the response is sent back. 98 * - the hash of the allocated phone is passed to userspace 99 * (on the receiving side) as ARG5 of the call. 100 * 101 */ 102 #define IPC_M_CONNECT_TO_ME 3 103 104 /** Protocol for initializing new foward connections. 105 * 106 * Calling process asks the callee to create for him a new connection. 107 * E.g. the caller wants a name server to connect him to print server. 108 * 109 * The protocol for negotiating is: 110 * - sys_connect_me_to - send a synchronous message to name server 111 * indicating that it wants to be connected to some 112 * service 113 * - arg1/2/3 are user specified, arg5 contains 114 * address of the phone that should be connected 115 * (TODO: it leaks to userspace) 116 * - recipient - if ipc_answer == 0, then accept connection 117 * - otherwise connection refused 118 * - recepient may forward message. 119 * 120 */ 121 #define IPC_M_CONNECT_ME_TO 4 122 123 /** Send as_area over IPC. 124 * - ARG1 - source as_area base address 125 * - ARG2 - size of source as_area (filled automatically by kernel) 126 * - ARG3 - flags of the as_area being sent 127 * 128 * on answer, the recipient must set: 129 * 130 * - ARG1 - dst as_area lower bound 131 * - ARG2 - dst as_area base adress pointer 132 * (filled automatically by the kernel) 133 * 134 */ 135 #define IPC_M_SHARE_OUT 5 136 137 /** Receive as_area over IPC. 138 * - ARG1 - destination as_area size 139 * - ARG2 - user defined argument 140 * 141 * on answer, the recipient must set: 142 * 143 * - ARG1 - source as_area base address 144 * - ARG2 - flags that will be used for sharing 145 * - ARG3 - dst as_area lower bound 146 * - ARG4 - dst as_area base address (filled automatically by kernel) 147 * 148 */ 149 #define IPC_M_SHARE_IN 6 150 151 /** Send data to another address space over IPC. 152 * - ARG1 - source address space virtual address 153 * - ARG2 - size of data to be copied, may be overriden by the recipient 154 * 155 * on answer, the recipient must set: 156 * 157 * - ARG1 - final destination address space virtual address 158 * - ARG2 - final size of data to be copied 159 * 160 */ 161 #define IPC_M_DATA_WRITE 7 162 163 /** Receive data from another address space over IPC. 164 * - ARG1 - destination virtual address in the source address space 165 * - ARG2 - size of data to be received, may be cropped by the recipient 166 * 167 * on answer, the recipient must set: 168 * 169 * - ARG1 - source virtual address in the destination address space 170 * - ARG2 - final size of data to be copied 171 * 172 */ 173 #define IPC_M_DATA_READ 8 174 175 /** Authorize change of recipient's state in a third party task. 176 * - ARG1 - user protocol defined data 177 * - ARG2 - user protocol defined data 178 * - ARG3 - user protocol defined data 179 * - ARG5 - sender's phone to the third party task 180 * 181 * on EOK answer, the recipient must set: 182 * 183 * - ARG1 - recipient's phone to the third party task 184 */ 185 #define IPC_M_STATE_CHANGE_AUTHORIZE 9 186 187 /** Debug the recipient. 188 * - ARG1 - specifies the debug method (from udebug_method_t) 189 * - other arguments are specific to the debug method 190 * 191 */ 192 #define IPC_M_DEBUG 10 53 enum { 54 /** This message is sent to answerbox when the phone is hung up 55 * 56 * The numerical value zero (0) of this method is important, 57 * so as the value can be easily tested in conditions. 58 */ 59 IPC_M_PHONE_HUNGUP = 0, 60 61 /** Clone connection. 62 * 63 * The calling task clones one of its phones for the callee. 64 * 65 * - ARG1 - The caller sets ARG1 to the phone of the cloned connection. 66 * - The callee gets the new phone from ARG1. 67 * 68 * - on answer, the callee acknowledges the new connection by sending EOK back 69 * or the kernel closes it 70 */ 71 IPC_M_CONNECTION_CLONE, 72 73 /** Protocol for establishing a cloned connection. 74 * 75 * Through this call, the recipient learns about the new cloned connection. 76 * 77 * - ARG5 - the kernel sets ARG5 to contain the hash of the used phone 78 * - on answer, the callee acknowledges the new connection by sending EOK back 79 * or the kernel closes it 80 */ 81 IPC_M_CLONE_ESTABLISH, 82 83 /** Protocol for initializing callback connections. 84 * 85 * Calling process asks the callee to create a callback connection, 86 * so that it can start initiating new messages. 87 * 88 * The protocol for negotiating is: 89 * - sys_connect_to_me - sends a message IPC_M_CONNECT_TO_ME 90 * - recipient - upon receipt tries to allocate new phone 91 * - if it fails, responds with ELIMIT 92 * - passes call to userspace. If userspace 93 * responds with error, phone is deallocated and 94 * error is sent back to caller. Otherwise 95 * the call is accepted and the response is sent back. 96 * - the hash of the allocated phone is passed to userspace 97 * (on the receiving side) as ARG5 of the call. 98 */ 99 IPC_M_CONNECT_TO_ME, 100 101 /** Protocol for initializing new foward connections. 102 * 103 * Calling process asks the callee to create for him a new connection. 104 * E.g. the caller wants a name server to connect him to print server. 105 * 106 * The protocol for negotiating is: 107 * - sys_connect_me_to - send a synchronous message to name server 108 * indicating that it wants to be connected to some 109 * service 110 * - arg1/2/3 are user specified, arg5 contains 111 * address of the phone that should be connected 112 * (TODO: it leaks to userspace) 113 * - recipient - if ipc_answer == 0, then accept connection 114 * - otherwise connection refused 115 * - recepient may forward message. 116 */ 117 IPC_M_CONNECT_ME_TO, 118 119 /** Share a single page over IPC. 120 * 121 * - ARG1 - page-aligned offset from the beginning of the memory object 122 * - ARG2 - page size 123 * 124 * on answer, the recipient must set: 125 * 126 * - ARG1 - source user page address 127 */ 128 IPC_M_PAGE_IN, 129 130 /** Receive as_area over IPC. 131 * 132 * - ARG1 - destination as_area size 133 * - ARG2 - user defined argument 134 * 135 * on answer, the recipient must set: 136 * 137 * - ARG1 - source as_area base address 138 * - ARG2 - flags that will be used for sharing 139 * - ARG3 - dst as_area lower bound 140 * - ARG4 - dst as_area base address (filled automatically by kernel) 141 */ 142 IPC_M_SHARE_IN, 143 144 /** Send as_area over IPC. 145 * 146 * - ARG1 - source as_area base address 147 * - ARG2 - size of source as_area (filled automatically by kernel) 148 * - ARG3 - flags of the as_area being sent 149 * 150 * on answer, the recipient must set: 151 * 152 * - ARG1 - dst as_area lower bound 153 * - ARG2 - dst as_area base adress pointer 154 * (filled automatically by the kernel) 155 */ 156 IPC_M_SHARE_OUT, 157 158 /** Receive data from another address space over IPC. 159 * 160 * - ARG1 - destination virtual address in the source address space 161 * - ARG2 - size of data to be received, may be cropped by the recipient 162 * 163 * on answer, the recipient must set: 164 * 165 * - ARG1 - source virtual address in the destination address space 166 * - ARG2 - final size of data to be copied 167 */ 168 IPC_M_DATA_READ, 169 170 /** Send data to another address space over IPC. 171 * 172 * - ARG1 - source address space virtual address 173 * - ARG2 - size of data to be copied, may be overriden by the recipient 174 * 175 * on answer, the recipient must set: 176 * 177 * - ARG1 - final destination address space virtual address 178 * - ARG2 - final size of data to be copied 179 */ 180 IPC_M_DATA_WRITE, 181 182 /** Authorize change of recipient's state in a third party task. 183 * 184 * - ARG1 - user protocol defined data 185 * - ARG2 - user protocol defined data 186 * - ARG3 - user protocol defined data 187 * - ARG5 - sender's phone to the third party task 188 * 189 * on EOK answer, the recipient must set: 190 * 191 * - ARG1 - recipient's phone to the third party task 192 */ 193 IPC_M_STATE_CHANGE_AUTHORIZE, 194 195 /** Debug the recipient. 196 * 197 * - ARG1 - specifies the debug method (from udebug_method_t) 198 * - other arguments are specific to the debug method 199 */ 200 IPC_M_DEBUG, 201 }; 193 202 194 203 /** Last system IPC method */ -
abi/include/abi/mm/as.h
rbdfdc51c rf126c87 44 44 #define AS_AREA_LATE_RESERVE 0x20 45 45 46 #define AS_AREA_ANY ((void *) -1) 47 #define AS_MAP_FAILED ((void *) -1) 48 49 #define AS_AREA_UNPAGED -1 50 46 51 /** Address space area info exported to uspace. */ 47 52 typedef struct { -
kernel/Makefile
rbdfdc51c rf126c87 237 237 generic/src/mm/backend_elf.c \ 238 238 generic/src/mm/backend_phys.c \ 239 generic/src/mm/backend_user.c \ 239 240 generic/src/mm/slab.c \ 240 241 generic/src/lib/func.c \ … … 278 279 generic/src/ipc/ops/datawrite.c \ 279 280 generic/src/ipc/ops/debug.c \ 281 generic/src/ipc/ops/pagein.c \ 280 282 generic/src/ipc/ops/sharein.c \ 281 283 generic/src/ipc/ops/shareout.c \ -
kernel/generic/include/ipc/ipc.h
rbdfdc51c rf126c87 147 147 struct task *sender; 148 148 149 /* 150 * Answerbox that will receive the answer. 151 * This will most of the times be the sender's answerbox, 152 * but we allow for useful exceptions. 153 */ 154 answerbox_t *callerbox; 155 149 156 /** Phone which was used to send the call. */ 150 157 phone_t *caller_phone; … … 172 179 extern void ipc_call_release(call_t *); 173 180 181 extern int ipc_call_sync(phone_t *, call_t *); 174 182 extern int ipc_call(phone_t *, call_t *); 175 183 extern call_t *ipc_wait_for_call(answerbox_t *, uint32_t, unsigned int); -
kernel/generic/include/ipc/sysipc.h
rbdfdc51c rf126c87 40 40 #include <typedefs.h> 41 41 42 extern int ipc_req_internal(int, ipc_data_t *); 43 42 44 extern sysarg_t sys_ipc_call_async_fast(sysarg_t, sysarg_t, sysarg_t, 43 45 sysarg_t, sysarg_t, sysarg_t); -
kernel/generic/include/mm/as.h
rbdfdc51c rf126c87 169 169 /** Backend data stored in address space area. */ 170 170 typedef union mem_backend_data { 171 /* anon_backend members */ 172 struct { 173 }; 174 171 175 /** elf_backend members */ 172 176 struct { … … 181 185 bool anonymous; 182 186 }; 187 188 /** user_backend members */ 189 struct { 190 int pager; /**< Phone to the pager. */ 191 }; 192 183 193 } mem_backend_data_t; 184 194 … … 296 306 extern mem_backend_t elf_backend; 297 307 extern mem_backend_t phys_backend; 308 extern mem_backend_t user_backend; 298 309 299 310 /* Address space area related syscalls. */ 300 extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int, uintptr_t); 311 extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int, uintptr_t, 312 int); 301 313 extern sysarg_t sys_as_area_resize(uintptr_t, size_t, unsigned int); 302 314 extern sysarg_t sys_as_area_change_flags(uintptr_t, unsigned int); -
kernel/generic/src/ipc/ipc.c
rbdfdc51c rf126c87 77 77 call->forget = false; 78 78 call->sender = NULL; 79 call->callerbox = &TASK->answerbox; 79 80 call->buffer = NULL; 80 81 } … … 185 186 phone->state = IPC_PHONE_FREE; 186 187 atomic_set(&phone->active_calls, 0); 188 } 189 190 /** Helper function to facilitate synchronous calls. 191 * 192 * @param phone Destination kernel phone structure. 193 * @param request Call structure with request. 194 * 195 * @return EOK on success or a negative error code. 196 * 197 */ 198 int ipc_call_sync(phone_t *phone, call_t *request) 199 { 200 answerbox_t *mybox = slab_alloc(ipc_answerbox_slab, 0); 201 ipc_answerbox_init(mybox, TASK); 202 203 /* We will receive data in a special box. */ 204 request->callerbox = mybox; 205 206 int rc = ipc_call(phone, request); 207 if (rc != EOK) { 208 slab_free(ipc_answerbox_slab, mybox); 209 return rc; 210 } 211 // TODO: forget the call if interrupted 212 (void) ipc_wait_for_call(mybox, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE); 213 214 slab_free(ipc_answerbox_slab, mybox); 215 return EOK; 187 216 } 188 217 … … 220 249 spinlock_unlock(&call->forget_lock); 221 250 222 answerbox_t *callerbox = &call->sender->answerbox;251 answerbox_t *callerbox = call->callerbox; 223 252 bool do_lock = ((!selflocked) || (callerbox != &TASK->answerbox)); 224 253 … … 755 784 ipc_cleanup_call_list(&TASK->answerbox, 756 785 &TASK->answerbox.dispatched_calls); 757 786 758 787 ipc_forget_all_active_calls(); 759 788 ipc_wait_for_all_answered_calls(); -
kernel/generic/src/ipc/sysipc.c
rbdfdc51c rf126c87 106 106 { 107 107 switch (imethod) { 108 case IPC_M_PAGE_IN: 108 109 case IPC_M_SHARE_OUT: 109 110 case IPC_M_SHARE_IN: … … 137 138 case IPC_M_CONNECT_TO_ME: 138 139 case IPC_M_CONNECT_ME_TO: 140 case IPC_M_PAGE_IN: 139 141 case IPC_M_SHARE_OUT: 140 142 case IPC_M_SHARE_IN: … … 257 259 { 258 260 return SYSIPC_OP(request_process, call, box); 261 } 262 263 /** Make a call over IPC and wait for reply. 264 * 265 * @param phoneid Phone handle for the call. 266 * @param data[inout] Structure with request/reply data. 267 * 268 * @return EOK on success. 269 * @return ENOENT if there is no such phone handle. 270 * 271 */ 272 int ipc_req_internal(int phoneid, ipc_data_t *data) 273 { 274 phone_t *phone; 275 if (phone_get(phoneid, &phone) != EOK) 276 return ENOENT; 277 278 call_t *call = ipc_call_alloc(0); 279 memcpy(call->data.args, data->args, sizeof(data->args)); 280 281 int rc = request_preprocess(call, phone); 282 if (!rc) { 283 #ifdef CONFIG_UDEBUG 284 udebug_stoppable_begin(); 285 #endif 286 287 rc = ipc_call_sync(phone, call); 288 289 #ifdef CONFIG_UDEBUG 290 udebug_stoppable_end(); 291 #endif 292 293 if (rc != EOK) 294 return EINTR; 295 296 process_answer(call); 297 } else 298 IPC_SET_RETVAL(call->data, rc); 299 300 memcpy(data->args, call->data.args, sizeof(data->args)); 301 ipc_call_free(call); 302 303 return EOK; 259 304 } 260 305 -
kernel/generic/src/ipc/sysipc_ops.c
rbdfdc51c rf126c87 42 42 sysipc_ops_t ipc_m_connect_to_me_ops; 43 43 sysipc_ops_t ipc_m_connect_me_to_ops; 44 sysipc_ops_t ipc_m_page_in_ops; 44 45 sysipc_ops_t ipc_m_share_out_ops; 45 46 sysipc_ops_t ipc_m_share_in_ops; … … 54 55 [IPC_M_CONNECT_TO_ME] = &ipc_m_connect_to_me_ops, 55 56 [IPC_M_CONNECT_ME_TO] = &ipc_m_connect_me_to_ops, 57 [IPC_M_PAGE_IN] = &ipc_m_page_in_ops, 56 58 [IPC_M_SHARE_OUT] = &ipc_m_share_out_ops, 57 59 [IPC_M_SHARE_IN] = &ipc_m_share_in_ops, -
kernel/generic/src/mm/as.c
rbdfdc51c rf126c87 574 574 * @param backend_data NULL or a pointer to custom backend data. 575 575 * @param base Starting virtual address of the area. 576 * If set to -1, a suitable mappable area is found. 577 * @param bound Lowest address bound if base is set to -1. 576 * If set to AS_AREA_ANY, a suitable mappable area is 577 * found. 578 * @param bound Lowest address bound if base is set to AS_AREA_ANY. 578 579 * Otherwise ignored. 579 580 * … … 585 586 mem_backend_data_t *backend_data, uintptr_t *base, uintptr_t bound) 586 587 { 587 if ((*base != (uintptr_t) -1) && !IS_ALIGNED(*base, PAGE_SIZE))588 if ((*base != (uintptr_t) AS_AREA_ANY) && !IS_ALIGNED(*base, PAGE_SIZE)) 588 589 return NULL; 589 590 … … 601 602 mutex_lock(&as->lock); 602 603 603 if (*base == (uintptr_t) -1) {604 if (*base == (uintptr_t) AS_AREA_ANY) { 604 605 *base = as_get_unmapped_area(as, bound, size, guarded); 605 606 if (*base == (uintptr_t) -1) { … … 2182 2183 2183 2184 sysarg_t sys_as_area_create(uintptr_t base, size_t size, unsigned int flags, 2184 uintptr_t bound )2185 uintptr_t bound, int pager) 2185 2186 { 2186 2187 uintptr_t virt = base; 2188 mem_backend_t *backend; 2189 mem_backend_data_t backend_data; 2190 2191 if (pager == AS_AREA_UNPAGED) 2192 backend = &anon_backend; 2193 else { 2194 backend = &user_backend; 2195 backend_data.pager = pager; 2196 } 2187 2197 as_area_t *area = as_area_create(AS, flags, size, 2188 AS_AREA_ATTR_NONE, &anon_backend, NULL, &virt, bound);2198 AS_AREA_ATTR_NONE, backend, &backend_data, &virt, bound); 2189 2199 if (area == NULL) 2190 return (sysarg_t) -1;2200 return (sysarg_t) AS_MAP_FAILED; 2191 2201 2192 2202 return (sysarg_t) virt; -
uspace/app/tester/Makefile
rbdfdc51c rf126c87 74 74 mm/malloc3.c \ 75 75 mm/mapping1.c \ 76 mm/pager1.c \ 76 77 hw/misc/virtchar1.c \ 77 78 hw/serial/serial1.c -
uspace/app/tester/mm/common.c
rbdfdc51c rf126c87 341 341 342 342 area->addr = as_area_create(AS_AREA_ANY, size, 343 AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE); 343 AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE, 344 AS_AREA_UNPAGED); 344 345 if (area->addr == AS_MAP_FAILED) { 345 346 free(area); -
uspace/app/tester/mm/mapping1.c
rbdfdc51c rf126c87 43 43 44 44 void *result = as_area_create(AS_AREA_ANY, size, 45 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE );45 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, AS_AREA_UNPAGED); 46 46 if (result == AS_MAP_FAILED) 47 47 return NULL; -
uspace/app/tester/tester.c
rbdfdc51c rf126c87 74 74 #include "mm/malloc3.def" 75 75 #include "mm/mapping1.def" 76 #include "mm/pager1.def" 76 77 #include "hw/serial/serial1.def" 77 78 #include "hw/misc/virtchar1.def" -
uspace/app/tester/tester.h
rbdfdc51c rf126c87 107 107 extern const char *test_malloc3(void); 108 108 extern const char *test_mapping1(void); 109 extern const char *test_pager1(void); 109 110 extern const char *test_serial1(void); 110 111 extern const char *test_virtchar1(void); -
uspace/app/trace/syscalls.c
rbdfdc51c rf126c87 49 49 [SYS_FUTEX_WAKEUP] = { "futex_wakeup", 1, V_ERRNO }, 50 50 51 [SYS_AS_AREA_CREATE] = { "as_area_create", 3, V_ERRNO },51 [SYS_AS_AREA_CREATE] = { "as_area_create", 5, V_ERRNO }, 52 52 [SYS_AS_AREA_RESIZE] = { "as_area_resize", 3, V_ERRNO }, 53 53 [SYS_AS_AREA_DESTROY] = { "as_area_destroy", 1, V_ERRNO }, -
uspace/lib/c/generic/as.c
rbdfdc51c rf126c87 50 50 * @param size Size of the area. 51 51 * @param flags Flags describing type of the area. 52 * @param pager If non-negative, phone to the external pager backing the area. 53 * If AS_AREA_UNPAGED (-1), the area is anonymous. 52 54 * 53 55 * @return Starting virtual address of the created area on success. … … 55 57 * 56 58 */ 57 void *as_area_create(void *base, size_t size, unsigned int flags )59 void *as_area_create(void *base, size_t size, unsigned int flags, int pager) 58 60 { 59 return (void *) __SYSCALL4(SYS_AS_AREA_CREATE, (sysarg_t) base, 60 (sysarg_t) size, (sysarg_t) flags, (sysarg_t) __entry); 61 return (void *) __SYSCALL5(SYS_AS_AREA_CREATE, (sysarg_t) base, 62 (sysarg_t) size, (sysarg_t) flags, (sysarg_t) __entry, 63 (sysarg_t) pager); 61 64 } 62 65 -
uspace/lib/c/generic/async.c
rbdfdc51c rf126c87 116 116 #include <stdlib.h> 117 117 #include <macros.h> 118 #include <as.h> 118 119 #include "private/libc.h" 119 120 … … 3381 3382 } 3382 3383 3384 void *async_as_area_create(void *base, size_t size, unsigned int flags, 3385 async_sess_t *pager) 3386 { 3387 return as_area_create(base, size, flags, pager->phone); 3388 } 3389 3383 3390 /** @} 3384 3391 */ -
uspace/lib/c/generic/elf/elf_mod.c
rbdfdc51c rf126c87 370 370 */ 371 371 a = as_area_create((uint8_t *) base + bias, mem_sz, 372 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 372 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, 373 AS_AREA_UNPAGED); 373 374 if (a == AS_MAP_FAILED) { 374 375 DPRINTF("memory mapping failed (%p, %zu)\n", -
uspace/lib/c/generic/fibril.c
rbdfdc51c rf126c87 279 279 size_t stack_size = (stksz == FIBRIL_DFLT_STK_SIZE) ? 280 280 stack_size_get() : stksz; 281 fibril->stack = as_area_create( (void *) -1, stack_size,281 fibril->stack = as_area_create(AS_AREA_ANY, stack_size, 282 282 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD | 283 AS_AREA_LATE_RESERVE );283 AS_AREA_LATE_RESERVE, AS_AREA_UNPAGED); 284 284 if (fibril->stack == (void *) -1) { 285 285 fibril_teardown(fibril, false); -
uspace/lib/c/generic/io/chargrid.c
rbdfdc51c rf126c87 60 60 if ((flags & CHARGRID_FLAG_SHARED) == CHARGRID_FLAG_SHARED) { 61 61 scrbuf = (chargrid_t *) as_area_create(AS_AREA_ANY, size, 62 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 62 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, 63 AS_AREA_UNPAGED); 63 64 if (scrbuf == AS_MAP_FAILED) 64 65 return NULL; -
uspace/lib/c/generic/malloc.c
rbdfdc51c rf126c87 354 354 size_t asize = ALIGN_UP(size, PAGE_SIZE); 355 355 void *astart = as_area_create(AS_AREA_ANY, asize, 356 AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE );356 AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE, AS_AREA_UNPAGED); 357 357 if (astart == AS_MAP_FAILED) 358 358 return false; -
uspace/lib/c/generic/thread.c
rbdfdc51c rf126c87 116 116 void *stack = as_area_create(AS_AREA_ANY, stack_size, 117 117 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD | 118 AS_AREA_LATE_RESERVE );118 AS_AREA_LATE_RESERVE, AS_AREA_UNPAGED); 119 119 if (stack == AS_MAP_FAILED) { 120 120 free(uarg); -
uspace/lib/c/include/as.h
rbdfdc51c rf126c87 38 38 #include <sys/types.h> 39 39 #include <abi/mm/as.h> 40 #include <task.h>41 40 #include <libarch/config.h> 42 43 #define AS_AREA_ANY ((void *) -1)44 #define AS_MAP_FAILED ((void *) -1)45 41 46 42 static inline size_t SIZE2PAGES(size_t size) … … 57 53 } 58 54 59 extern void *as_area_create(void *, size_t, unsigned int );55 extern void *as_area_create(void *, size_t, unsigned int, int); 60 56 extern int as_area_resize(void *, size_t, unsigned int); 61 57 extern int as_area_change_flags(void *, unsigned int); -
uspace/lib/c/include/async.h
rbdfdc51c rf126c87 488 488 extern void async_remote_state_release_exchange(async_exch_t *); 489 489 490 extern void *async_as_area_create(void *, size_t, unsigned int, async_sess_t *); 491 490 492 #endif 491 493 -
uspace/lib/draw/surface.c
rbdfdc51c rf126c87 64 64 if (!pixbuf) { 65 65 if ((flags & SURFACE_FLAG_SHARED) == SURFACE_FLAG_SHARED) { 66 pixbuf = (pixel_t *) as_area_create(AS_AREA_ANY, pixbuf_size, 67 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 66 pixbuf = (pixel_t *) as_area_create(AS_AREA_ANY, 67 pixbuf_size, 68 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, 69 AS_AREA_UNPAGED); 68 70 if (pixbuf == AS_MAP_FAILED) { 69 71 free(surface); -
uspace/lib/posix/source/sys/mman.c
rbdfdc51c rf126c87 54 54 return MAP_FAILED; 55 55 56 return as_area_create(start, length, prot );56 return as_area_create(start, length, prot, AS_AREA_UNPAGED); 57 57 } 58 58 -
uspace/srv/hid/compositor/compositor.c
rbdfdc51c rf126c87 55 55 #include <async.h> 56 56 #include <loc.h> 57 #include <task.h> 57 58 58 59 #include <io/keycode.h> -
uspace/srv/hid/console/console.c
rbdfdc51c rf126c87 49 49 #include <malloc.h> 50 50 #include <as.h> 51 #include <task.h> 51 52 #include <fibril_synch.h> 52 53 #include "console.h" -
uspace/srv/hid/output/output.c
rbdfdc51c rf126c87 32 32 #include <macros.h> 33 33 #include <as.h> 34 #include <task.h> 34 35 #include <ipc/output.h> 35 36 #include "port/ega.h" -
uspace/srv/vfs/vfs.c
rbdfdc51c rf126c87 37 37 38 38 #include <vfs/vfs.h> 39 #include <stdlib.h> 39 40 #include <ipc/services.h> 41 #include <abi/ipc/methods.h> 42 #include <libarch/config.h> 40 43 #include <ns.h> 41 44 #include <async.h> … … 51 54 #define NAME "vfs" 52 55 56 static void vfs_pager(ipc_callid_t iid, ipc_call_t *icall, void *arg) 57 { 58 async_answer_0(iid, EOK); 59 60 char *buf = memalign(PAGE_SIZE, 1); 61 const char hello[] = "Hello world!"; 62 63 memcpy(buf, hello, sizeof(hello)); 64 65 while (true) { 66 ipc_call_t call; 67 ipc_callid_t callid = async_get_call(&call); 68 69 if (!IPC_GET_IMETHOD(call)) 70 break; 71 72 switch (IPC_GET_IMETHOD(call)) { 73 case IPC_M_PAGE_IN: 74 if (buf) 75 async_answer_1(callid, EOK, (sysarg_t) buf); 76 else 77 async_answer_0(callid, ENOMEM); 78 break; 79 80 default: 81 async_answer_0(callid, ENOTSUP); 82 break; 83 } 84 } 85 } 86 53 87 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 54 88 { … … 150 184 int main(int argc, char **argv) 151 185 { 186 int rc; 187 152 188 printf("%s: HelenOS VFS server\n", NAME); 153 189 … … 165 201 */ 166 202 plb = as_area_create(AS_AREA_ANY, PLB_SIZE, 167 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE );203 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, AS_AREA_UNPAGED); 168 204 if (plb == AS_MAP_FAILED) { 169 205 printf("%s: Cannot create address space area\n", NAME); … … 179 215 180 216 /* 217 * Create a port for the pager. 218 */ 219 port_id_t port; 220 rc = async_create_port(INTERFACE_PAGER, vfs_pager, NULL, &port); 221 if (rc != EOK) 222 return rc; 223 224 /* 181 225 * Set a connection handling function/fibril. 182 226 */ … … 192 236 * Register at the naming service. 193 237 */ 194 intrc = service_register(SERVICE_VFS);238 rc = service_register(SERVICE_VFS); 195 239 if (rc != EOK) { 196 240 printf("%s: Cannot register VFS service\n", NAME);
Note:
See TracChangeset
for help on using the changeset viewer.