Changes in / [75a2dc08:fd210de] in mainline
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ipc/event_types.h
r75a2dc08 rfd210de 39 39 EVENT_KLOG = 0, 40 40 EVENT_KCONSOLE, 41 EVENT_WAIT,42 41 EVENT_END 43 42 } event_type_t; 44 45 typedef enum wait_type {46 TASK_CREATE = 0,47 TASK_DESTROY48 } wait_type_t;49 43 50 44 #endif -
kernel/generic/src/proc/task.c
r75a2dc08 rfd210de 197 197 interrupts_restore(ipl); 198 198 199 /*200 * Notify about task creation.201 */202 if (event_is_subscribed(EVENT_WAIT))203 event_notify_3(EVENT_WAIT, TASK_CREATE, LOWER32(ta->taskid),204 UPPER32(ta->taskid));205 206 199 return ta; 207 200 } … … 235 228 if (atomic_predec(&t->as->refcount) == 0) 236 229 as_destroy(t->as); 237 238 /*239 * Notify about task destruction.240 */241 if (event_is_subscribed(EVENT_WAIT))242 event_notify_3(EVENT_WAIT, TASK_DESTROY, LOWER32(t->taskid),243 UPPER32(t->taskid));244 230 245 231 free(t); -
kernel/generic/src/udebug/udebug.c
r75a2dc08 rfd210de 182 182 183 183 if (THREAD->udebug.active && THREAD->udebug.go == false) { 184 TASK->udebug.begin_call = NULL;185 184 mutex_unlock(&THREAD->udebug.lock); 186 185 mutex_unlock(&TASK->udebug.lock); -
tools/config.py
r75a2dc08 rfd210de 34 34 import os 35 35 import re 36 import commands 36 import time 37 import subprocess 37 38 import xtui 38 39 … … 225 226 "Create output configuration" 226 227 227 revision = commands.getoutput('bzr version-info --custom --template="{revision_id}" 2> /dev/null') 228 timestamp = commands.getoutput('date "+%Y-%m-%d %H:%M:%S"') 228 timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 229 version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0].split(':') 230 231 if (len(version) == 3): 232 revision = version[1] 233 if (version[0] != 1): 234 revision += 'M' 235 revision += ' (%s)' % version[2] 236 else: 237 revision = None 229 238 230 239 outmk = file(mkname, 'w') … … 266 275 outdf.write(' -D%s=%s -D%s_%s' % (varname, default, varname, default)) 267 276 268 outmk.write('REVISION = %s\n' % revision) 277 if (revision is not None): 278 outmk.write('REVISION = %s\n' % revision) 279 outmc.write('#define REVISION %s\n' % revision) 280 outdf.write(' "-DREVISION=%s"' % revision) 281 269 282 outmk.write('TIMESTAMP = %s\n' % timestamp) 270 271 outmc.write('#define REVISION %s\n' % revision)272 283 outmc.write('#define TIMESTAMP %s\n' % timestamp) 273 274 outdf.write(' "-DREVISION=%s" "-DTIMESTAMP=%s"\n' % (revision, timestamp)) 284 outdf.write(' "-DTIMESTAMP=%s"\n' % timestamp) 275 285 276 286 outmk.close() -
uspace/lib/libc/generic/vfs/vfs.c
r75a2dc08 rfd210de 122 122 int res; 123 123 ipcarg_t rc; 124 ipcarg_t rc_orig; 124 125 aid_t req; 125 126 dev_handle_t dev_handle; … … 141 142 rc = ipc_data_write_start(vfs_phone, (void *) mpa, mpa_size); 142 143 if (rc != EOK) { 143 async_wait_for(req, NULL);144 async_wait_for(req, &rc_orig); 144 145 async_serialize_end(); 145 146 futex_up(&vfs_phone_futex); 146 147 free(mpa); 147 return (int) rc; 148 if (rc_orig == EOK) 149 return (int) rc; 150 else 151 return (int) rc_orig; 148 152 } 149 153 150 154 rc = ipc_data_write_start(vfs_phone, (void *) opts, str_size(opts)); 151 155 if (rc != EOK) { 152 async_wait_for(req, NULL);156 async_wait_for(req, &rc_orig); 153 157 async_serialize_end(); 154 158 futex_up(&vfs_phone_futex); 155 159 free(mpa); 156 return (int) rc; 160 if (rc_orig == EOK) 161 return (int) rc; 162 else 163 return (int) rc_orig; 157 164 } 158 165 159 166 rc = ipc_data_write_start(vfs_phone, (void *) fs_name, str_size(fs_name)); 160 167 if (rc != EOK) { 161 async_wait_for(req, NULL);168 async_wait_for(req, &rc_orig); 162 169 async_serialize_end(); 163 170 futex_up(&vfs_phone_futex); 164 171 free(mpa); 165 return (int) rc; 172 if (rc_orig == EOK) 173 return (int) rc; 174 else 175 return (int) rc_orig; 166 176 } 167 177 … … 169 179 rc = async_req_0_0(vfs_phone, IPC_M_PING); 170 180 if (rc != EOK) { 171 async_wait_for(req, NULL);181 async_wait_for(req, &rc_orig); 172 182 async_serialize_end(); 173 183 futex_up(&vfs_phone_futex); 174 184 free(mpa); 175 return (int) rc; 185 if (rc_orig == EOK) 186 return (int) rc; 187 else 188 return (int) rc_orig; 176 189 } 177 190 … … 202 215 rc = ipc_data_write_start(vfs_phone, pa, pa_size); 203 216 if (rc != EOK) { 204 async_wait_for(req, NULL); 217 ipcarg_t rc_orig; 218 219 async_wait_for(req, &rc_orig); 205 220 async_serialize_end(); 206 221 futex_up(&vfs_phone_futex); 207 222 free(pa); 208 return (int) rc; 223 if (rc_orig == EOK) 224 return (int) rc; 225 else 226 return (int) rc_orig; 209 227 } 210 228 async_wait_for(req, &rc); … … 240 258 241 259 if (rc != EOK) 242 260 return (int) rc; 243 261 244 262 return (int) IPC_GET_ARG1(answer); … … 274 292 rc = ipc_data_read_start(vfs_phone, (void *)buf, nbyte); 275 293 if (rc != EOK) { 276 async_wait_for(req, NULL); 277 async_serialize_end(); 278 futex_up(&vfs_phone_futex); 279 return (ssize_t) rc; 294 ipcarg_t rc_orig; 295 296 async_wait_for(req, &rc_orig); 297 async_serialize_end(); 298 futex_up(&vfs_phone_futex); 299 if (rc_orig == EOK) 300 return (ssize_t) rc; 301 else 302 return (ssize_t) rc_orig; 280 303 } 281 304 async_wait_for(req, &rc); … … 301 324 rc = ipc_data_write_start(vfs_phone, (void *)buf, nbyte); 302 325 if (rc != EOK) { 303 async_wait_for(req, NULL); 304 async_serialize_end(); 305 futex_up(&vfs_phone_futex); 306 return (ssize_t) rc; 326 ipcarg_t rc_orig; 327 328 async_wait_for(req, &rc_orig); 329 async_serialize_end(); 330 futex_up(&vfs_phone_futex); 331 if (rc_orig == EOK) 332 return (ssize_t) rc; 333 else 334 return (ssize_t) rc_orig; 307 335 } 308 336 async_wait_for(req, &rc); … … 376 404 rc = ipc_data_read_start(vfs_phone, (void *)stat, sizeof(struct stat)); 377 405 if (rc != EOK) { 378 async_wait_for(req, NULL); 379 async_serialize_end(); 380 futex_up(&vfs_phone_futex); 381 return (ssize_t) rc; 406 ipcarg_t rc_orig; 407 408 async_wait_for(req, &rc_orig); 409 async_serialize_end(); 410 futex_up(&vfs_phone_futex); 411 if (rc_orig == EOK) 412 return (ssize_t) rc; 413 else 414 return (ssize_t) rc_orig; 382 415 } 383 416 async_wait_for(req, &rc); … … 391 424 { 392 425 ipcarg_t rc; 426 ipcarg_t rc_orig; 393 427 aid_t req; 394 428 … … 405 439 rc = ipc_data_write_start(vfs_phone, pa, pa_size); 406 440 if (rc != EOK) { 407 async_wait_for(req, NULL);441 async_wait_for(req, &rc_orig); 408 442 async_serialize_end(); 409 443 futex_up(&vfs_phone_futex); 410 444 free(pa); 411 return (int) rc; 445 if (rc_orig == EOK) 446 return (int) rc; 447 else 448 return (int) rc_orig; 412 449 } 413 450 rc = ipc_data_read_start(vfs_phone, stat, sizeof(struct stat)); 414 451 if (rc != EOK) { 415 async_wait_for(req, NULL);452 async_wait_for(req, &rc_orig); 416 453 async_serialize_end(); 417 454 futex_up(&vfs_phone_futex); 418 455 free(pa); 419 return (int) rc; 456 if (rc_orig == EOK) 457 return (int) rc; 458 else 459 return (int) rc_orig; 420 460 } 421 461 async_wait_for(req, &rc); … … 476 516 rc = ipc_data_write_start(vfs_phone, pa, pa_size); 477 517 if (rc != EOK) { 478 async_wait_for(req, NULL); 518 ipcarg_t rc_orig; 519 520 async_wait_for(req, &rc_orig); 479 521 async_serialize_end(); 480 522 futex_up(&vfs_phone_futex); 481 523 free(pa); 482 return (int) rc; 524 if (rc_orig == EOK) 525 return (int) rc; 526 else 527 return (int) rc_orig; 483 528 } 484 529 async_wait_for(req, &rc); … … 506 551 rc = ipc_data_write_start(vfs_phone, pa, pa_size); 507 552 if (rc != EOK) { 508 async_wait_for(req, NULL); 553 ipcarg_t rc_orig; 554 555 async_wait_for(req, &rc_orig); 509 556 async_serialize_end(); 510 557 futex_up(&vfs_phone_futex); 511 558 free(pa); 512 return (int) rc; 559 if (rc_orig == EOK) 560 return (int) rc; 561 else 562 return (int) rc_orig; 513 563 } 514 564 async_wait_for(req, &rc); … … 532 582 { 533 583 ipcarg_t rc; 584 ipcarg_t rc_orig; 534 585 aid_t req; 535 586 … … 553 604 rc = ipc_data_write_start(vfs_phone, olda, olda_size); 554 605 if (rc != EOK) { 555 async_wait_for(req, NULL);606 async_wait_for(req, &rc_orig); 556 607 async_serialize_end(); 557 608 futex_up(&vfs_phone_futex); 558 609 free(olda); 559 610 free(newa); 560 return (int) rc; 611 if (rc_orig == EOK) 612 return (int) rc; 613 else 614 return (int) rc_orig; 561 615 } 562 616 rc = ipc_data_write_start(vfs_phone, newa, newa_size); 563 617 if (rc != EOK) { 564 async_wait_for(req, NULL);618 async_wait_for(req, &rc_orig); 565 619 async_serialize_end(); 566 620 futex_up(&vfs_phone_futex); 567 621 free(olda); 568 622 free(newa); 569 return (int) rc; 623 if (rc_orig == EOK) 624 return (int) rc; 625 else 626 return (int) rc_orig; 570 627 } 571 628 async_wait_for(req, &rc); -
uspace/srv/fs/fat/fat_fat.c
r75a2dc08 rfd210de 451 451 } 452 452 453 void 454 fat_zero_cluster(struct fat_bs *bs, dev_handle_t dev_handle, fat_cluster_t c) 455 { 456 int i; 457 block_t *b; 458 unsigned bps; 459 460 bps = uint16_t_le2host(bs->bps); 461 462 for (i = 0; i < bs->spc; i++) { 463 b = _fat_block_get(bs, dev_handle, c, i, BLOCK_FLAGS_NOREAD); 464 memset(b->data, 0, bps); 465 b->dirty = true; 466 block_put(b); 467 } 468 } 469 453 470 /** 454 471 * @} -
uspace/srv/fs/fat/fat_fat.h
r75a2dc08 rfd210de 84 84 extern void fat_fill_gap(struct fat_bs *, struct fat_node *, fat_cluster_t, 85 85 off_t); 86 extern void fat_zero_cluster(struct fat_bs *, dev_handle_t, fat_cluster_t); 86 87 87 88 #endif -
uspace/srv/fs/fat/fat_ops.c
r75a2dc08 rfd210de 332 332 /* idxp->lock held */ 333 333 if (flags & L_DIRECTORY) { 334 int i; 335 block_t *b; 336 337 /* 338 * Populate the new cluster with unused dentries. 339 */ 340 for (i = 0; i < bs->spc; i++) { 341 b = _fat_block_get(bs, dev_handle, mcl, i, 342 BLOCK_FLAGS_NOREAD); 343 /* mark all dentries as never-used */ 344 memset(b->data, 0, bps); 345 b->dirty = false; 346 block_put(b); 347 } 334 /* Populate the new cluster with unused dentries. */ 335 fat_zero_cluster(bs, dev_handle, mcl); 348 336 nodep->type = FAT_DIRECTORY; 349 337 nodep->firstc = mcl; … … 462 450 * We need to grow the parent in order to create a new unused dentry. 463 451 */ 464 if (parentp-> idx->pfc == FAT_CLST_ROOT) {452 if (parentp->firstc == FAT_CLST_ROOT) { 465 453 /* Can't grow the root directory. */ 466 454 fibril_mutex_unlock(&parentp->idx->lock); … … 472 460 return rc; 473 461 } 462 fat_zero_cluster(bs, parentp->idx->dev_handle, mcl); 474 463 fat_append_clusters(bs, parentp, mcl); 475 b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NOREAD); 464 parentp->size += bps * bs->spc; 465 parentp->dirty = true; /* need to sync node */ 466 b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NONE); 476 467 d = (fat_dentry_t *)b->data; 477 /*478 * Clear all dentries in the block except for the first one (the first479 * dentry will be cleared in the next step).480 */481 memset(d + 1, 0, bps - sizeof(fat_dentry_t));482 468 483 469 hit: -
uspace/srv/ns/task.h
r75a2dc08 rfd210de 35 35 36 36 #include <ipc/ipc.h> 37 #include <event.h>38 37 39 38 extern int task_init(void); 40 39 extern void process_pending_wait(void); 41 40 42 extern void wait_notification(wait_type_t et, task_id_t id);43 41 extern void wait_for_task(task_id_t id, ipc_call_t *call, ipc_callid_t callid); 44 42 -
uspace/srv/vfs/vfs_node.c
r75a2dc08 rfd210de 188 188 } 189 189 190 assert(node->size == result->size );190 assert(node->size == result->size || node->type != VFS_NODE_FILE); 191 191 assert(node->lnkcnt == result->lnkcnt); 192 192 assert(node->type == result->type || result->type == VFS_NODE_UNKNOWN);
Note:
See TracChangeset
for help on using the changeset viewer.