Changes in uspace/srv/bd/file_bd/file_bd.c [15f3c3f:47b7006] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/file_bd/file_bd.c
r15f3c3f r47b7006 45 45 #include <as.h> 46 46 #include <fibril_synch.h> 47 #include < loc.h>47 #include <devmap.h> 48 48 #include <sys/types.h> 49 49 #include <sys/typefmt.h> … … 61 61 static FILE *img; 62 62 63 static service_id_t service_id;63 static devmap_handle_t devmap_handle; 64 64 static fibril_mutex_t dev_lock; 65 65 66 66 static void print_usage(void); 67 67 static int file_bd_init(const char *fname); 68 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall , void *);68 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall); 69 69 static int file_bd_read_blocks(uint64_t ba, size_t cnt, void *buf); 70 70 static int file_bd_write_blocks(uint64_t ba, size_t cnt, const void *buf); … … 117 117 return -1; 118 118 119 rc = loc_service_register(device_name, &service_id);119 rc = devmap_device_register(device_name, &devmap_handle); 120 120 if (rc != EOK) { 121 121 printf(NAME ": Unable to register device '%s'.\n", … … 142 142 long img_size; 143 143 144 rc = loc_server_register(NAME, file_bd_connection);144 rc = devmap_driver_register(NAME, file_bd_connection); 145 145 if (rc < 0) { 146 146 printf(NAME ": Unable to register driver.\n"); … … 170 170 } 171 171 172 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall , void *arg)172 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall) 173 173 { 174 174 void *fs_va = NULL; … … 198 198 (void) async_share_out_finalize(callid, fs_va); 199 199 200 while ( true) {200 while (1) { 201 201 callid = async_get_call(&call); 202 202 method = IPC_GET_IMETHOD(call); 203 204 if (!method) {203 switch (method) { 204 case IPC_M_PHONE_HUNGUP: 205 205 /* The other side has hung up. */ 206 206 async_answer_0(callid, EOK); 207 207 return; 208 }209 210 switch (method) {211 208 case BD_READ_BLOCKS: 212 209 ba = MERGE_LOUP32(IPC_GET_ARG1(call),
Note:
See TracChangeset
for help on using the changeset viewer.