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


Ignore:
Timestamp:
2011-11-06T22:21:05Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
898e847
Parents:
2bdf8313 (diff), 7b5f4c9 (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/rd/rd.c

    r2bdf8313 rb0f00a9  
    5252#include <fibril_synch.h>
    5353#include <stdio.h>
    54 #include <devmap.h>
     54#include <loc.h>
    5555#include <ipc/bd.h>
    5656#include <macros.h>
     
    8484 * @param icall Call data of the request that opened the connection.
    8585 */
    86 static void rd_connection(ipc_callid_t iid, ipc_call_t *icall)
     86static void rd_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    8787{
    8888        ipc_callid_t callid;
     
    123123        while (true) {
    124124                callid = async_get_call(&call);
    125                 switch (IPC_GET_IMETHOD(call)) {
    126                 case IPC_M_PHONE_HUNGUP:
     125               
     126                if (!IPC_GET_IMETHOD(call)) {
    127127                        /*
    128128                         * The other side has hung up.
    129                          * Answer the message and exit the fibril.
     129                         * Exit the fibril.
    130130                         */
    131131                        async_answer_0(callid, EOK);
    132132                        return;
     133                }
     134               
     135                switch (IPC_GET_IMETHOD(call)) {
    133136                case BD_READ_BLOCKS:
    134137                        ba = MERGE_LOUP32(IPC_GET_ARG1(call),
     
    232235            (void *) rd_ph_addr, rd_size);
    233236       
    234         int rc = devmap_driver_register(NAME, rd_connection);
     237        int rc = loc_server_register(NAME, rd_connection);
    235238        if (rc < 0) {
    236239                printf("%s: Unable to register driver (%d)\n", NAME, rc);
     
    238241        }
    239242       
    240         devmap_handle_t devmap_handle;
    241         if (devmap_device_register("bd/initrd", &devmap_handle) != EOK) {
    242                 printf("%s: Unable to register device\n", NAME);
    243                 return false;
    244         }
    245 
     243        service_id_t service_id;
     244        if (loc_service_register("bd/initrd", &service_id) != EOK) {
     245                printf("%s: Unable to register device service\n", NAME);
     246                return false;
     247        }
     248       
    246249        fibril_rwlock_initialize(&rd_lock);
    247250       
     
    258261        printf("%s: Accepting connections\n", NAME);
    259262        async_manager();
    260 
     263       
    261264        /* Never reached */
    262265        return 0;
Note: See TracChangeset for help on using the changeset viewer.