Changeset eb522e8 in mainline for uspace/srv/bd/rd/rd.c


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/rd/rd.c

    r9e2e715 reb522e8  
    3939 */
    4040
    41 #include <ipc/ipc.h>
    4241#include <ipc/services.h>
    4342#include <ipc/ns.h>
     
    9897         * Answer the first IPC_M_CONNECT_ME_TO call.
    9998         */
    100         ipc_answer_0(iid, EOK);
     99        async_answer_0(iid, EOK);
    101100       
    102101        /*
    103102         * Now we wait for the client to send us its communication as_area.
    104103         */
    105         int flags;
     104        unsigned int flags;
    106105        if (async_share_out_receive(&callid, &comm_size, &flags)) {
    107106                fs_va = as_get_mappable_page(comm_size);
     
    109108                        (void) async_share_out_finalize(callid, fs_va);
    110109                } else {
    111                         ipc_answer_0(callid, EHANGUP);
     110                        async_answer_0(callid, EHANGUP);
    112111                        return;
    113112                }
     
    118117                 * Close the connection.
    119118                 */
    120                 ipc_answer_0(callid, EHANGUP);
     119                async_answer_0(callid, EHANGUP);
    121120                return;
    122121        }
     
    124123        while (true) {
    125124                callid = async_get_call(&call);
    126                 switch (IPC_GET_METHOD(call)) {
     125                switch (IPC_GET_IMETHOD(call)) {
    127126                case IPC_M_PHONE_HUNGUP:
    128127                        /*
     
    130129                         * Answer the message and exit the fibril.
    131130                         */
    132                         ipc_answer_0(callid, EOK);
     131                        async_answer_0(callid, EOK);
    133132                        return;
    134133                case BD_READ_BLOCKS:
     
    153152                        break;
    154153                case BD_GET_BLOCK_SIZE:
    155                         ipc_answer_1(callid, EOK, block_size);
     154                        async_answer_1(callid, EOK, block_size);
    156155                        continue;
    157156                case BD_GET_NUM_BLOCKS:
    158                         ipc_answer_2(callid, EOK, LOWER32(rd_size / block_size),
     157                        async_answer_2(callid, EOK, LOWER32(rd_size / block_size),
    159158                            UPPER32(rd_size / block_size));
    160159                        continue;
     
    169168                        break;
    170169                }
    171                 ipc_answer_0(callid, retval);
     170                async_answer_0(callid, retval);
    172171        }
    173172}
     
    230229        }
    231230       
    232         printf("%s: Found RAM disk at %p, %d bytes\n", NAME, rd_ph_addr, rd_size);
     231        printf("%s: Found RAM disk at %p, %zu bytes\n", NAME,
     232            (void *) rd_ph_addr, rd_size);
    233233       
    234234        int rc = devmap_driver_register(NAME, rd_connection);
     
    238238        }
    239239       
    240         dev_handle_t dev_handle;
    241         if (devmap_device_register("bd/initrd", &dev_handle) != EOK) {
    242                 devmap_hangup_phone(DEVMAP_DRIVER);
     240        devmap_handle_t devmap_handle;
     241        if (devmap_device_register("bd/initrd", &devmap_handle) != EOK) {
    243242                printf("%s: Unable to register device\n", NAME);
    244243                return false;
Note: See TracChangeset for help on using the changeset viewer.