Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/file_bd/file_bd.c

    r47b7006 r15f3c3f  
    4545#include <as.h>
    4646#include <fibril_synch.h>
    47 #include <devmap.h>
     47#include <loc.h>
    4848#include <sys/types.h>
    4949#include <sys/typefmt.h>
     
    6161static FILE *img;
    6262
    63 static devmap_handle_t devmap_handle;
     63static service_id_t service_id;
    6464static fibril_mutex_t dev_lock;
    6565
    6666static void print_usage(void);
    6767static int file_bd_init(const char *fname);
    68 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall);
     68static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *);
    6969static int file_bd_read_blocks(uint64_t ba, size_t cnt, void *buf);
    7070static int file_bd_write_blocks(uint64_t ba, size_t cnt, const void *buf);
     
    117117                return -1;
    118118
    119         rc = devmap_device_register(device_name, &devmap_handle);
     119        rc = loc_service_register(device_name, &service_id);
    120120        if (rc != EOK) {
    121121                printf(NAME ": Unable to register device '%s'.\n",
     
    142142        long img_size;
    143143
    144         rc = devmap_driver_register(NAME, file_bd_connection);
     144        rc = loc_server_register(NAME, file_bd_connection);
    145145        if (rc < 0) {
    146146                printf(NAME ": Unable to register driver.\n");
     
    170170}
    171171
    172 static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall)
     172static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    173173{
    174174        void *fs_va = NULL;
     
    198198        (void) async_share_out_finalize(callid, fs_va);
    199199
    200         while (1) {
     200        while (true) {
    201201                callid = async_get_call(&call);
    202202                method = IPC_GET_IMETHOD(call);
    203                 switch (method) {
    204                 case IPC_M_PHONE_HUNGUP:
     203               
     204                if (!method) {
    205205                        /* The other side has hung up. */
    206206                        async_answer_0(callid, EOK);
    207207                        return;
     208                }
     209               
     210                switch (method) {
    208211                case BD_READ_BLOCKS:
    209212                        ba = MERGE_LOUP32(IPC_GET_ARG1(call),
Note: See TracChangeset for help on using the changeset viewer.