Changeset eb522e8 in mainline for uspace/srv/bd/part/mbr_part/mbr_part.c
- Timestamp:
- 2011-06-01T08:43:42Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8d6c1f1
- Parents:
- 9e2e715 (diff), e51a514 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/part/mbr_part/mbr_part.c
r9e2e715 reb522e8 57 57 #include <stdlib.h> 58 58 #include <unistd.h> 59 #include <ipc/ipc.h>60 59 #include <ipc/bd.h> 61 60 #include <async.h> … … 101 100 aoff64_t length; 102 101 /** Device representing the partition (outbound device) */ 103 dev _handle_t dev;102 devmap_handle_t dev; 104 103 /** Points to next partition structure. */ 105 104 struct part *next; … … 142 141 143 142 /** Partitioned device (inbound device) */ 144 static dev _handle_t indev_handle;143 static devmap_handle_t indev_handle; 145 144 146 145 /** List of partitions. This structure is an empty head. */ … … 181 180 int i; 182 181 char *name; 183 dev _handle_t dev;182 devmap_handle_t dev; 184 183 uint64_t size_mb; 185 184 part_t *part; … … 206 205 207 206 if (block_size < 512 || (block_size % 512) != 0) { 208 printf(NAME ": invalid block size % d.\n");207 printf(NAME ": invalid block size %zu.\n", block_size); 209 208 return ENOTSUP; 210 209 } … … 242 241 rc = devmap_device_register(name, &dev); 243 242 if (rc != EOK) { 244 devmap_hangup_phone(DEVMAP_DRIVER);245 243 printf(NAME ": Unable to register device %s.\n", name); 246 244 return rc; … … 393 391 ipc_callid_t callid; 394 392 ipc_call_t call; 395 ipcarg_t method;396 dev _handle_t dh;397 int flags;393 sysarg_t method; 394 devmap_handle_t dh; 395 unsigned int flags; 398 396 int retval; 399 397 uint64_t ba; … … 414 412 415 413 if (part == NULL) { 416 ipc_answer_0(iid, EINVAL);414 async_answer_0(iid, EINVAL); 417 415 return; 418 416 } … … 421 419 422 420 /* Answer the IPC_M_CONNECT_ME_TO call. */ 423 ipc_answer_0(iid, EOK);421 async_answer_0(iid, EOK); 424 422 425 423 if (!async_share_out_receive(&callid, &comm_size, &flags)) { 426 ipc_answer_0(callid, EHANGUP);424 async_answer_0(callid, EHANGUP); 427 425 return; 428 426 } … … 430 428 fs_va = as_get_mappable_page(comm_size); 431 429 if (fs_va == NULL) { 432 ipc_answer_0(callid, EHANGUP);430 async_answer_0(callid, EHANGUP); 433 431 return; 434 432 } … … 438 436 while (1) { 439 437 callid = async_get_call(&call); 440 method = IPC_GET_ METHOD(call);438 method = IPC_GET_IMETHOD(call); 441 439 switch (method) { 442 440 case IPC_M_PHONE_HUNGUP: 443 441 /* The other side has hung up. */ 444 ipc_answer_0(callid, EOK);442 async_answer_0(callid, EOK); 445 443 return; 446 444 case BD_READ_BLOCKS: … … 465 463 break; 466 464 case BD_GET_BLOCK_SIZE: 467 ipc_answer_1(callid, EOK, block_size);465 async_answer_1(callid, EOK, block_size); 468 466 continue; 469 467 case BD_GET_NUM_BLOCKS: 470 ipc_answer_2(callid, EOK, LOWER32(part->length),468 async_answer_2(callid, EOK, LOWER32(part->length), 471 469 UPPER32(part->length)); 472 470 continue; … … 475 473 break; 476 474 } 477 ipc_answer_0(callid, retval);475 async_answer_0(callid, retval); 478 476 } 479 477 }
Note:
See TracChangeset
for help on using the changeset viewer.