Ignore:
Timestamp:
2011-05-12T16:49:44Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f36787d7
Parents:
e80329d6 (diff), 750636a (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:

Merge mainline changes.

File:
1 edited

Legend:

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

    re80329d6 rb5e68c8  
    5757#include <stdlib.h>
    5858#include <unistd.h>
    59 #include <ipc/ipc.h>
    6059#include <ipc/bd.h>
    6160#include <async.h>
     
    101100        aoff64_t length;
    102101        /** Device representing the partition (outbound device) */
    103         dev_handle_t dev;
     102        devmap_handle_t dev;
    104103        /** Points to next partition structure. */
    105104        struct part *next;
     
    142141
    143142/** Partitioned device (inbound device) */
    144 static dev_handle_t indev_handle;
     143static devmap_handle_t indev_handle;
    145144
    146145/** List of partitions. This structure is an empty head. */
     
    181180        int i;
    182181        char *name;
    183         dev_handle_t dev;
     182        devmap_handle_t dev;
    184183        uint64_t size_mb;
    185184        part_t *part;
     
    206205
    207206        if (block_size < 512 || (block_size % 512) != 0) {
    208                 printf(NAME ": invalid block size %d.\n");
     207                printf(NAME ": invalid block size %zu.\n", block_size);
    209208                return ENOTSUP;
    210209        }
     
    242241                rc = devmap_device_register(name, &dev);
    243242                if (rc != EOK) {
    244                         devmap_hangup_phone(DEVMAP_DRIVER);
    245243                        printf(NAME ": Unable to register device %s.\n", name);
    246244                        return rc;
     
    393391        ipc_callid_t callid;
    394392        ipc_call_t call;
    395         ipcarg_t method;
    396         dev_handle_t dh;
    397         int flags;
     393        sysarg_t method;
     394        devmap_handle_t dh;
     395        unsigned int flags;
    398396        int retval;
    399397        uint64_t ba;
     
    414412
    415413        if (part == NULL) {
    416                 ipc_answer_0(iid, EINVAL);
     414                async_answer_0(iid, EINVAL);
    417415                return;
    418416        }
     
    421419
    422420        /* Answer the IPC_M_CONNECT_ME_TO call. */
    423         ipc_answer_0(iid, EOK);
     421        async_answer_0(iid, EOK);
    424422
    425423        if (!async_share_out_receive(&callid, &comm_size, &flags)) {
    426                 ipc_answer_0(callid, EHANGUP);
     424                async_answer_0(callid, EHANGUP);
    427425                return;
    428426        }
     
    430428        fs_va = as_get_mappable_page(comm_size);
    431429        if (fs_va == NULL) {
    432                 ipc_answer_0(callid, EHANGUP);
     430                async_answer_0(callid, EHANGUP);
    433431                return;
    434432        }
     
    438436        while (1) {
    439437                callid = async_get_call(&call);
    440                 method = IPC_GET_METHOD(call);
     438                method = IPC_GET_IMETHOD(call);
    441439                switch (method) {
    442440                case IPC_M_PHONE_HUNGUP:
    443441                        /* The other side has hung up. */
    444                         ipc_answer_0(callid, EOK);
     442                        async_answer_0(callid, EOK);
    445443                        return;
    446444                case BD_READ_BLOCKS:
     
    465463                        break;
    466464                case BD_GET_BLOCK_SIZE:
    467                         ipc_answer_1(callid, EOK, block_size);
     465                        async_answer_1(callid, EOK, block_size);
    468466                        continue;
    469467                case BD_GET_NUM_BLOCKS:
    470                         ipc_answer_2(callid, EOK, LOWER32(part->length),
     468                        async_answer_2(callid, EOK, LOWER32(part->length),
    471469                            UPPER32(part->length));
    472470                        continue;
     
    475473                        break;
    476474                }
    477                 ipc_answer_0(callid, retval);
     475                async_answer_0(callid, retval);
    478476        }
    479477}
Note: See TracChangeset for help on using the changeset viewer.