Changeset eb522e8 in mainline for uspace/srv/bd/part/guid_part/guid_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/guid_part/guid_part.c
r9e2e715 reb522e8 47 47 #include <stdlib.h> 48 48 #include <unistd.h> 49 #include <ipc/ipc.h>50 49 #include <ipc/bd.h> 51 50 #include <async.h> … … 83 82 aoff64_t length; 84 83 /** Device representing the partition (outbound device) */ 85 dev _handle_t dev;84 devmap_handle_t dev; 86 85 /** Points to next partition structure. */ 87 86 struct part *next; … … 91 90 92 91 /** Partitioned device (inbound device) */ 93 static dev _handle_t indev_handle;92 static devmap_handle_t indev_handle; 94 93 95 94 /** List of partitions. This structure is an empty head. */ … … 130 129 int i; 131 130 char *name; 132 dev _handle_t dev;131 devmap_handle_t dev; 133 132 uint64_t size_mb; 134 133 part_t *part; … … 155 154 156 155 if (block_size < 512 || (block_size % 512) != 0) { 157 printf(NAME ": invalid block size % d.\n");156 printf(NAME ": invalid block size %zu.\n", block_size); 158 157 return ENOTSUP; 159 158 } … … 191 190 rc = devmap_device_register(name, &dev); 192 191 if (rc != EOK) { 193 devmap_hangup_phone(DEVMAP_DRIVER);194 192 printf(NAME ": Unable to register device %s.\n", name); 195 193 return rc; … … 315 313 ipc_callid_t callid; 316 314 ipc_call_t call; 317 ipcarg_t method;318 dev _handle_t dh;319 int flags;315 sysarg_t method; 316 devmap_handle_t dh; 317 unsigned int flags; 320 318 int retval; 321 319 aoff64_t ba; … … 336 334 337 335 if (part == NULL) { 338 ipc_answer_0(iid, EINVAL);336 async_answer_0(iid, EINVAL); 339 337 return; 340 338 } … … 343 341 344 342 /* Answer the IPC_M_CONNECT_ME_TO call. */ 345 ipc_answer_0(iid, EOK);343 async_answer_0(iid, EOK); 346 344 347 345 if (!async_share_out_receive(&callid, &comm_size, &flags)) { 348 ipc_answer_0(callid, EHANGUP);346 async_answer_0(callid, EHANGUP); 349 347 return; 350 348 } … … 352 350 fs_va = as_get_mappable_page(comm_size); 353 351 if (fs_va == NULL) { 354 ipc_answer_0(callid, EHANGUP);352 async_answer_0(callid, EHANGUP); 355 353 return; 356 354 } … … 360 358 while (1) { 361 359 callid = async_get_call(&call); 362 method = IPC_GET_ METHOD(call);360 method = IPC_GET_IMETHOD(call); 363 361 switch (method) { 364 362 case IPC_M_PHONE_HUNGUP: 365 363 /* The other side has hung up. */ 366 ipc_answer_0(callid, EOK);364 async_answer_0(callid, EOK); 367 365 return; 368 366 case BD_READ_BLOCKS: … … 387 385 break; 388 386 case BD_GET_BLOCK_SIZE: 389 ipc_answer_1(callid, EOK, block_size);387 async_answer_1(callid, EOK, block_size); 390 388 continue; 391 389 case BD_GET_NUM_BLOCKS: 392 ipc_answer_2(callid, EOK, LOWER32(part->length),390 async_answer_2(callid, EOK, LOWER32(part->length), 393 391 UPPER32(part->length)); 394 392 continue; … … 397 395 break; 398 396 } 399 ipc_answer_0(callid, retval);397 async_answer_0(callid, retval); 400 398 } 401 399 }
Note:
See TracChangeset
for help on using the changeset viewer.