Changes in uspace/srv/bd/rd/rd.c [15f3c3f:47b7006] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/rd/rd.c
r15f3c3f r47b7006 52 52 #include <fibril_synch.h> 53 53 #include <stdio.h> 54 #include < loc.h>54 #include <devmap.h> 55 55 #include <ipc/bd.h> 56 56 #include <macros.h> … … 84 84 * @param icall Call data of the request that opened the connection. 85 85 */ 86 static void rd_connection(ipc_callid_t iid, ipc_call_t *icall , void *arg)86 static void rd_connection(ipc_callid_t iid, ipc_call_t *icall) 87 87 { 88 88 ipc_callid_t callid; … … 123 123 while (true) { 124 124 callid = async_get_call(&call); 125 126 if (!IPC_GET_IMETHOD(call)) {125 switch (IPC_GET_IMETHOD(call)) { 126 case IPC_M_PHONE_HUNGUP: 127 127 /* 128 128 * The other side has hung up. 129 * Exit the fibril.129 * Answer the message and exit the fibril. 130 130 */ 131 131 async_answer_0(callid, EOK); 132 132 return; 133 }134 135 switch (IPC_GET_IMETHOD(call)) {136 133 case BD_READ_BLOCKS: 137 134 ba = MERGE_LOUP32(IPC_GET_ARG1(call), … … 235 232 (void *) rd_ph_addr, rd_size); 236 233 237 int rc = loc_server_register(NAME, rd_connection);234 int rc = devmap_driver_register(NAME, rd_connection); 238 235 if (rc < 0) { 239 236 printf("%s: Unable to register driver (%d)\n", NAME, rc); … … 241 238 } 242 239 243 service_id_t service_id;244 if ( loc_service_register("bd/initrd", &service_id) != EOK) {245 printf("%s: Unable to register device service\n", NAME);246 return false; 247 } 248 240 devmap_handle_t devmap_handle; 241 if (devmap_device_register("bd/initrd", &devmap_handle) != EOK) { 242 printf("%s: Unable to register device\n", NAME); 243 return false; 244 } 245 249 246 fibril_rwlock_initialize(&rd_lock); 250 247 … … 261 258 printf("%s: Accepting connections\n", NAME); 262 259 async_manager(); 263 260 264 261 /* Never reached */ 265 262 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.