Ignore:
Timestamp:
2011-06-01T08:43:42Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
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.
Message:

Huuuuuge merge from development - all the work actually :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/part/guid_part/guid_part.c

    r9e2e715 reb522e8  
    4747#include <stdlib.h>
    4848#include <unistd.h>
    49 #include <ipc/ipc.h>
    5049#include <ipc/bd.h>
    5150#include <async.h>
     
    8382        aoff64_t length;
    8483        /** Device representing the partition (outbound device) */
    85         dev_handle_t dev;
     84        devmap_handle_t dev;
    8685        /** Points to next partition structure. */
    8786        struct part *next;
     
    9190
    9291/** Partitioned device (inbound device) */
    93 static dev_handle_t indev_handle;
     92static devmap_handle_t indev_handle;
    9493
    9594/** List of partitions. This structure is an empty head. */
     
    130129        int i;
    131130        char *name;
    132         dev_handle_t dev;
     131        devmap_handle_t dev;
    133132        uint64_t size_mb;
    134133        part_t *part;
     
    155154
    156155        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);
    158157                return ENOTSUP;
    159158        }
     
    191190                rc = devmap_device_register(name, &dev);
    192191                if (rc != EOK) {
    193                         devmap_hangup_phone(DEVMAP_DRIVER);
    194192                        printf(NAME ": Unable to register device %s.\n", name);
    195193                        return rc;
     
    315313        ipc_callid_t callid;
    316314        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;
    320318        int retval;
    321319        aoff64_t ba;
     
    336334
    337335        if (part == NULL) {
    338                 ipc_answer_0(iid, EINVAL);
     336                async_answer_0(iid, EINVAL);
    339337                return;
    340338        }
     
    343341
    344342        /* Answer the IPC_M_CONNECT_ME_TO call. */
    345         ipc_answer_0(iid, EOK);
     343        async_answer_0(iid, EOK);
    346344
    347345        if (!async_share_out_receive(&callid, &comm_size, &flags)) {
    348                 ipc_answer_0(callid, EHANGUP);
     346                async_answer_0(callid, EHANGUP);
    349347                return;
    350348        }
     
    352350        fs_va = as_get_mappable_page(comm_size);
    353351        if (fs_va == NULL) {
    354                 ipc_answer_0(callid, EHANGUP);
     352                async_answer_0(callid, EHANGUP);
    355353                return;
    356354        }
     
    360358        while (1) {
    361359                callid = async_get_call(&call);
    362                 method = IPC_GET_METHOD(call);
     360                method = IPC_GET_IMETHOD(call);
    363361                switch (method) {
    364362                case IPC_M_PHONE_HUNGUP:
    365363                        /* The other side has hung up. */
    366                         ipc_answer_0(callid, EOK);
     364                        async_answer_0(callid, EOK);
    367365                        return;
    368366                case BD_READ_BLOCKS:
     
    387385                        break;
    388386                case BD_GET_BLOCK_SIZE:
    389                         ipc_answer_1(callid, EOK, block_size);
     387                        async_answer_1(callid, EOK, block_size);
    390388                        continue;
    391389                case BD_GET_NUM_BLOCKS:
    392                         ipc_answer_2(callid, EOK, LOWER32(part->length),
     390                        async_answer_2(callid, EOK, LOWER32(part->length),
    393391                            UPPER32(part->length));
    394392                        continue;
     
    397395                        break;
    398396                }
    399                 ipc_answer_0(callid, retval);
     397                async_answer_0(callid, retval);
    400398        }
    401399}
Note: See TracChangeset for help on using the changeset viewer.