Changeset eb522e8 in mainline for uspace/srv/bd/rd/rd.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/rd/rd.c
r9e2e715 reb522e8 39 39 */ 40 40 41 #include <ipc/ipc.h>42 41 #include <ipc/services.h> 43 42 #include <ipc/ns.h> … … 98 97 * Answer the first IPC_M_CONNECT_ME_TO call. 99 98 */ 100 ipc_answer_0(iid, EOK);99 async_answer_0(iid, EOK); 101 100 102 101 /* 103 102 * Now we wait for the client to send us its communication as_area. 104 103 */ 105 int flags;104 unsigned int flags; 106 105 if (async_share_out_receive(&callid, &comm_size, &flags)) { 107 106 fs_va = as_get_mappable_page(comm_size); … … 109 108 (void) async_share_out_finalize(callid, fs_va); 110 109 } else { 111 ipc_answer_0(callid, EHANGUP);110 async_answer_0(callid, EHANGUP); 112 111 return; 113 112 } … … 118 117 * Close the connection. 119 118 */ 120 ipc_answer_0(callid, EHANGUP);119 async_answer_0(callid, EHANGUP); 121 120 return; 122 121 } … … 124 123 while (true) { 125 124 callid = async_get_call(&call); 126 switch (IPC_GET_ METHOD(call)) {125 switch (IPC_GET_IMETHOD(call)) { 127 126 case IPC_M_PHONE_HUNGUP: 128 127 /* … … 130 129 * Answer the message and exit the fibril. 131 130 */ 132 ipc_answer_0(callid, EOK);131 async_answer_0(callid, EOK); 133 132 return; 134 133 case BD_READ_BLOCKS: … … 153 152 break; 154 153 case BD_GET_BLOCK_SIZE: 155 ipc_answer_1(callid, EOK, block_size);154 async_answer_1(callid, EOK, block_size); 156 155 continue; 157 156 case BD_GET_NUM_BLOCKS: 158 ipc_answer_2(callid, EOK, LOWER32(rd_size / block_size),157 async_answer_2(callid, EOK, LOWER32(rd_size / block_size), 159 158 UPPER32(rd_size / block_size)); 160 159 continue; … … 169 168 break; 170 169 } 171 ipc_answer_0(callid, retval);170 async_answer_0(callid, retval); 172 171 } 173 172 } … … 230 229 } 231 230 232 printf("%s: Found RAM disk at %p, %d bytes\n", NAME, rd_ph_addr, rd_size); 231 printf("%s: Found RAM disk at %p, %zu bytes\n", NAME, 232 (void *) rd_ph_addr, rd_size); 233 233 234 234 int rc = devmap_driver_register(NAME, rd_connection); … … 238 238 } 239 239 240 dev_handle_t dev_handle; 241 if (devmap_device_register("bd/initrd", &dev_handle) != EOK) { 242 devmap_hangup_phone(DEVMAP_DRIVER); 240 devmap_handle_t devmap_handle; 241 if (devmap_device_register("bd/initrd", &devmap_handle) != EOK) { 243 242 printf("%s: Unable to register device\n", NAME); 244 243 return false;
Note:
See TracChangeset
for help on using the changeset viewer.