Changes in / [f126c87:bdfdc51c] in mainline
- Files:
-
- 4 deleted
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/ipc/interfaces.h
rf126c87 rbdfdc51c 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,85 83 INTERFACE_LOGGER_WRITER = 86 84 FOURCC_COMPACT('l', 'o', 'g', 'w') | IFACE_EXCHANGE_SERIALIZE, -
abi/include/abi/ipc/methods.h
rf126c87 rbdfdc51c 51 51 */ 52 52 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 }; 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 202 193 203 194 /** Last system IPC method */ -
abi/include/abi/mm/as.h
rf126c87 rbdfdc51c 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 -150 51 46 /** Address space area info exported to uspace. */ 52 47 typedef struct { -
kernel/Makefile
rf126c87 rbdfdc51c 237 237 generic/src/mm/backend_elf.c \ 238 238 generic/src/mm/backend_phys.c \ 239 generic/src/mm/backend_user.c \240 239 generic/src/mm/slab.c \ 241 240 generic/src/lib/func.c \ … … 279 278 generic/src/ipc/ops/datawrite.c \ 280 279 generic/src/ipc/ops/debug.c \ 281 generic/src/ipc/ops/pagein.c \282 280 generic/src/ipc/ops/sharein.c \ 283 281 generic/src/ipc/ops/shareout.c \ -
kernel/generic/include/ipc/ipc.h
rf126c87 rbdfdc51c 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 156 149 /** Phone which was used to send the call. */ 157 150 phone_t *caller_phone; … … 179 172 extern void ipc_call_release(call_t *); 180 173 181 extern int ipc_call_sync(phone_t *, call_t *);182 174 extern int ipc_call(phone_t *, call_t *); 183 175 extern call_t *ipc_wait_for_call(answerbox_t *, uint32_t, unsigned int); -
kernel/generic/include/ipc/sysipc.h
rf126c87 rbdfdc51c 40 40 #include <typedefs.h> 41 41 42 extern int ipc_req_internal(int, ipc_data_t *);43 44 42 extern sysarg_t sys_ipc_call_async_fast(sysarg_t, sysarg_t, sysarg_t, 45 43 sysarg_t, sysarg_t, sysarg_t); -
kernel/generic/include/mm/as.h
rf126c87 rbdfdc51c 169 169 /** Backend data stored in address space area. */ 170 170 typedef union mem_backend_data { 171 /* anon_backend members */172 struct {173 };174 175 171 /** elf_backend members */ 176 172 struct { … … 185 181 bool anonymous; 186 182 }; 187 188 /** user_backend members */189 struct {190 int pager; /**< Phone to the pager. */191 };192 193 183 } mem_backend_data_t; 194 184 … … 306 296 extern mem_backend_t elf_backend; 307 297 extern mem_backend_t phys_backend; 308 extern mem_backend_t user_backend;309 298 310 299 /* Address space area related syscalls. */ 311 extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int, uintptr_t, 312 int); 300 extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int, uintptr_t); 313 301 extern sysarg_t sys_as_area_resize(uintptr_t, size_t, unsigned int); 314 302 extern sysarg_t sys_as_area_change_flags(uintptr_t, unsigned int); -
kernel/generic/src/ipc/ipc.c
rf126c87 rbdfdc51c 77 77 call->forget = false; 78 78 call->sender = NULL; 79 call->callerbox = &TASK->answerbox;80 79 call->buffer = NULL; 81 80 } … … 186 185 phone->state = IPC_PHONE_FREE; 187 186 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 interrupted212 (void) ipc_wait_for_call(mybox, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE);213 214 slab_free(ipc_answerbox_slab, mybox);215 return EOK;216 187 } 217 188 … … 249 220 spinlock_unlock(&call->forget_lock); 250 221 251 answerbox_t *callerbox = call->callerbox;222 answerbox_t *callerbox = &call->sender->answerbox; 252 223 bool do_lock = ((!selflocked) || (callerbox != &TASK->answerbox)); 253 224 … … 784 755 ipc_cleanup_call_list(&TASK->answerbox, 785 756 &TASK->answerbox.dispatched_calls); 786 757 787 758 ipc_forget_all_active_calls(); 788 759 ipc_wait_for_all_answered_calls(); -
kernel/generic/src/ipc/sysipc.c
rf126c87 rbdfdc51c 106 106 { 107 107 switch (imethod) { 108 case IPC_M_PAGE_IN:109 108 case IPC_M_SHARE_OUT: 110 109 case IPC_M_SHARE_IN: … … 138 137 case IPC_M_CONNECT_TO_ME: 139 138 case IPC_M_CONNECT_ME_TO: 140 case IPC_M_PAGE_IN:141 139 case IPC_M_SHARE_OUT: 142 140 case IPC_M_SHARE_IN: … … 259 257 { 260 258 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_UDEBUG284 udebug_stoppable_begin();285 #endif286 287 rc = ipc_call_sync(phone, call);288 289 #ifdef CONFIG_UDEBUG290 udebug_stoppable_end();291 #endif292 293 if (rc != EOK)294 return EINTR;295 296 process_answer(call);297 } else298 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;304 259 } 305 260 -
kernel/generic/src/ipc/sysipc_ops.c
rf126c87 rbdfdc51c 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;45 44 sysipc_ops_t ipc_m_share_out_ops; 46 45 sysipc_ops_t ipc_m_share_in_ops; … … 55 54 [IPC_M_CONNECT_TO_ME] = &ipc_m_connect_to_me_ops, 56 55 [IPC_M_CONNECT_ME_TO] = &ipc_m_connect_me_to_ops, 57 [IPC_M_PAGE_IN] = &ipc_m_page_in_ops,58 56 [IPC_M_SHARE_OUT] = &ipc_m_share_out_ops, 59 57 [IPC_M_SHARE_IN] = &ipc_m_share_in_ops, -
kernel/generic/src/mm/as.c
rf126c87 rbdfdc51c 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 AS_AREA_ANY, a suitable mappable area is 577 * found. 578 * @param bound Lowest address bound if base is set to AS_AREA_ANY. 576 * If set to -1, a suitable mappable area is found. 577 * @param bound Lowest address bound if base is set to -1. 579 578 * Otherwise ignored. 580 579 * … … 586 585 mem_backend_data_t *backend_data, uintptr_t *base, uintptr_t bound) 587 586 { 588 if ((*base != (uintptr_t) AS_AREA_ANY) && !IS_ALIGNED(*base, PAGE_SIZE))587 if ((*base != (uintptr_t) -1) && !IS_ALIGNED(*base, PAGE_SIZE)) 589 588 return NULL; 590 589 … … 602 601 mutex_lock(&as->lock); 603 602 604 if (*base == (uintptr_t) AS_AREA_ANY) {603 if (*base == (uintptr_t) -1) { 605 604 *base = as_get_unmapped_area(as, bound, size, guarded); 606 605 if (*base == (uintptr_t) -1) { … … 2183 2182 2184 2183 sysarg_t sys_as_area_create(uintptr_t base, size_t size, unsigned int flags, 2185 uintptr_t bound , int pager)2184 uintptr_t bound) 2186 2185 { 2187 2186 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 }2197 2187 as_area_t *area = as_area_create(AS, flags, size, 2198 AS_AREA_ATTR_NONE, backend, &backend_data, &virt, bound);2188 AS_AREA_ATTR_NONE, &anon_backend, NULL, &virt, bound); 2199 2189 if (area == NULL) 2200 return (sysarg_t) AS_MAP_FAILED;2190 return (sysarg_t) -1; 2201 2191 2202 2192 return (sysarg_t) virt; -
uspace/app/tester/Makefile
rf126c87 rbdfdc51c 74 74 mm/malloc3.c \ 75 75 mm/mapping1.c \ 76 mm/pager1.c \77 76 hw/misc/virtchar1.c \ 78 77 hw/serial/serial1.c -
uspace/app/tester/mm/common.c
rf126c87 rbdfdc51c 341 341 342 342 area->addr = as_area_create(AS_AREA_ANY, size, 343 AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE, 344 AS_AREA_UNPAGED); 343 AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE); 345 344 if (area->addr == AS_MAP_FAILED) { 346 345 free(area); -
uspace/app/tester/mm/mapping1.c
rf126c87 rbdfdc51c 43 43 44 44 void *result = as_area_create(AS_AREA_ANY, size, 45 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE , AS_AREA_UNPAGED);45 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 46 46 if (result == AS_MAP_FAILED) 47 47 return NULL; -
uspace/app/tester/tester.c
rf126c87 rbdfdc51c 74 74 #include "mm/malloc3.def" 75 75 #include "mm/mapping1.def" 76 #include "mm/pager1.def"77 76 #include "hw/serial/serial1.def" 78 77 #include "hw/misc/virtchar1.def" -
uspace/app/tester/tester.h
rf126c87 rbdfdc51c 107 107 extern const char *test_malloc3(void); 108 108 extern const char *test_mapping1(void); 109 extern const char *test_pager1(void);110 109 extern const char *test_serial1(void); 111 110 extern const char *test_virtchar1(void); -
uspace/app/trace/syscalls.c
rf126c87 rbdfdc51c 49 49 [SYS_FUTEX_WAKEUP] = { "futex_wakeup", 1, V_ERRNO }, 50 50 51 [SYS_AS_AREA_CREATE] = { "as_area_create", 5, V_ERRNO },51 [SYS_AS_AREA_CREATE] = { "as_area_create", 3, 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
rf126c87 rbdfdc51c 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.54 52 * 55 53 * @return Starting virtual address of the created area on success. … … 57 55 * 58 56 */ 59 void *as_area_create(void *base, size_t size, unsigned int flags , int pager)57 void *as_area_create(void *base, size_t size, unsigned int flags) 60 58 { 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); 59 return (void *) __SYSCALL4(SYS_AS_AREA_CREATE, (sysarg_t) base, 60 (sysarg_t) size, (sysarg_t) flags, (sysarg_t) __entry); 64 61 } 65 62 -
uspace/lib/c/generic/async.c
rf126c87 rbdfdc51c 116 116 #include <stdlib.h> 117 117 #include <macros.h> 118 #include <as.h>119 118 #include "private/libc.h" 120 119 … … 3382 3381 } 3383 3382 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 3390 3383 /** @} 3391 3384 */ -
uspace/lib/c/generic/elf/elf_mod.c
rf126c87 rbdfdc51c 370 370 */ 371 371 a = as_area_create((uint8_t *) base + bias, mem_sz, 372 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, 373 AS_AREA_UNPAGED); 372 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 374 373 if (a == AS_MAP_FAILED) { 375 374 DPRINTF("memory mapping failed (%p, %zu)\n", -
uspace/lib/c/generic/fibril.c
rf126c87 rbdfdc51c 279 279 size_t stack_size = (stksz == FIBRIL_DFLT_STK_SIZE) ? 280 280 stack_size_get() : stksz; 281 fibril->stack = as_area_create( AS_AREA_ANY, stack_size,281 fibril->stack = as_area_create((void *) -1, stack_size, 282 282 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD | 283 AS_AREA_LATE_RESERVE , AS_AREA_UNPAGED);283 AS_AREA_LATE_RESERVE); 284 284 if (fibril->stack == (void *) -1) { 285 285 fibril_teardown(fibril, false); -
uspace/lib/c/generic/io/chargrid.c
rf126c87 rbdfdc51c 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, 63 AS_AREA_UNPAGED); 62 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 64 63 if (scrbuf == AS_MAP_FAILED) 65 64 return NULL; -
uspace/lib/c/generic/malloc.c
rf126c87 rbdfdc51c 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 , AS_AREA_UNPAGED);356 AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE); 357 357 if (astart == AS_MAP_FAILED) 358 358 return false; -
uspace/lib/c/generic/thread.c
rf126c87 rbdfdc51c 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 , AS_AREA_UNPAGED);118 AS_AREA_LATE_RESERVE); 119 119 if (stack == AS_MAP_FAILED) { 120 120 free(uarg); -
uspace/lib/c/include/as.h
rf126c87 rbdfdc51c 38 38 #include <sys/types.h> 39 39 #include <abi/mm/as.h> 40 #include <task.h> 40 41 #include <libarch/config.h> 42 43 #define AS_AREA_ANY ((void *) -1) 44 #define AS_MAP_FAILED ((void *) -1) 41 45 42 46 static inline size_t SIZE2PAGES(size_t size) … … 53 57 } 54 58 55 extern void *as_area_create(void *, size_t, unsigned int , int);59 extern void *as_area_create(void *, size_t, unsigned int); 56 60 extern int as_area_resize(void *, size_t, unsigned int); 57 61 extern int as_area_change_flags(void *, unsigned int); -
uspace/lib/c/include/async.h
rf126c87 rbdfdc51c 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 492 490 #endif 493 491 -
uspace/lib/draw/surface.c
rf126c87 rbdfdc51c 64 64 if (!pixbuf) { 65 65 if ((flags & SURFACE_FLAG_SHARED) == SURFACE_FLAG_SHARED) { 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); 66 pixbuf = (pixel_t *) as_area_create(AS_AREA_ANY, pixbuf_size, 67 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 70 68 if (pixbuf == AS_MAP_FAILED) { 71 69 free(surface); -
uspace/lib/posix/source/sys/mman.c
rf126c87 rbdfdc51c 54 54 return MAP_FAILED; 55 55 56 return as_area_create(start, length, prot , AS_AREA_UNPAGED);56 return as_area_create(start, length, prot); 57 57 } 58 58 -
uspace/srv/hid/compositor/compositor.c
rf126c87 rbdfdc51c 55 55 #include <async.h> 56 56 #include <loc.h> 57 #include <task.h>58 57 59 58 #include <io/keycode.h> -
uspace/srv/hid/console/console.c
rf126c87 rbdfdc51c 49 49 #include <malloc.h> 50 50 #include <as.h> 51 #include <task.h>52 51 #include <fibril_synch.h> 53 52 #include "console.h" -
uspace/srv/hid/output/output.c
rf126c87 rbdfdc51c 32 32 #include <macros.h> 33 33 #include <as.h> 34 #include <task.h>35 34 #include <ipc/output.h> 36 35 #include "port/ega.h" -
uspace/srv/vfs/vfs.c
rf126c87 rbdfdc51c 37 37 38 38 #include <vfs/vfs.h> 39 #include <stdlib.h>40 39 #include <ipc/services.h> 41 #include <abi/ipc/methods.h>42 #include <libarch/config.h>43 40 #include <ns.h> 44 41 #include <async.h> … … 54 51 #define NAME "vfs" 55 52 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 else77 async_answer_0(callid, ENOMEM);78 break;79 80 default:81 async_answer_0(callid, ENOTSUP);82 break;83 }84 }85 }86 87 53 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 88 54 { … … 184 150 int main(int argc, char **argv) 185 151 { 186 int rc;187 188 152 printf("%s: HelenOS VFS server\n", NAME); 189 153 … … 201 165 */ 202 166 plb = as_area_create(AS_AREA_ANY, PLB_SIZE, 203 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE , AS_AREA_UNPAGED);167 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 204 168 if (plb == AS_MAP_FAILED) { 205 169 printf("%s: Cannot create address space area\n", NAME); … … 215 179 216 180 /* 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 /*225 181 * Set a connection handling function/fibril. 226 182 */ … … 236 192 * Register at the naming service. 237 193 */ 238 rc = service_register(SERVICE_VFS);194 int rc = service_register(SERVICE_VFS); 239 195 if (rc != EOK) { 240 196 printf("%s: Cannot register VFS service\n", NAME);
Note:
See TracChangeset
for help on using the changeset viewer.