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