Subversion Repositories HelenOS

Rev

Rev 4055 | Rev 4537 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4055 Rev 4420
Line 35... Line 35...
35
 * @brief
35
 * @brief
36
 */
36
 */
37
 
37
 
38
#include "libblock.h"
38
#include "libblock.h"
39
#include "../../srv/vfs/vfs.h"
39
#include "../../srv/vfs/vfs.h"
40
#include "../../srv/rd/rd.h"
-
 
41
#include <ipc/devmap.h>
40
#include <ipc/devmap.h>
-
 
41
#include <ipc/bd.h>
42
#include <ipc/services.h>
42
#include <ipc/services.h>
43
#include <errno.h>
43
#include <errno.h>
44
#include <sys/mman.h>
44
#include <sys/mman.h>
45
#include <async.h>
45
#include <async.h>
46
#include <ipc/ipc.h>
46
#include <ipc/ipc.h>
Line 144... Line 144...
144
    com_area = mmap(NULL, com_size, PROTO_READ | PROTO_WRITE,
144
    com_area = mmap(NULL, com_size, PROTO_READ | PROTO_WRITE,
145
        MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
145
        MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
146
    if (!com_area) {
146
    if (!com_area) {
147
        return ENOMEM;
147
        return ENOMEM;
148
    }
148
    }
149
    dev_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAP,
-
 
150
        DEVMAP_CONNECT_TO_DEVICE, dev_handle);
-
 
151
 
149
 
-
 
150
    dev_phone = devmap_device_connect(dev_handle, IPC_FLAG_BLOCKING);
152
    if (dev_phone < 0) {
151
    if (dev_phone < 0) {
153
        munmap(com_area, com_size);
152
        munmap(com_area, com_size);
154
        return dev_phone;
153
        return dev_phone;
155
    }
154
    }
156
 
155
 
Line 475... Line 474...
475
        }
474
        }
476
       
475
       
477
        if (*bufpos == *buflen) {
476
        if (*bufpos == *buflen) {
478
            /* Refill the communication buffer with a new block. */
477
            /* Refill the communication buffer with a new block. */
479
            ipcarg_t retval;
478
            ipcarg_t retval;
480
            int rc = async_req_2_1(devcon->dev_phone, RD_READ_BLOCK,
479
            int rc = async_req_2_1(devcon->dev_phone, BD_READ_BLOCK,
481
                *pos / block_size, block_size, &retval);
480
                *pos / block_size, block_size, &retval);
482
            if ((rc != EOK) || (retval != EOK))
481
            if ((rc != EOK) || (retval != EOK))
483
                return (rc != EOK ? rc : retval);
482
                return (rc != EOK ? rc : retval);
484
           
483
           
485
            *bufpos = 0;
484
            *bufpos = 0;