Subversion Repositories HelenOS

Rev

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

Rev 2536 Rev 2543
Line 40... Line 40...
40
#include <ipc/services.h>
40
#include <ipc/services.h>
41
#include <async.h>
41
#include <async.h>
42
#include <errno.h>
42
#include <errno.h>
43
#include <unistd.h>
43
#include <unistd.h>
44
#include <stdio.h>
44
#include <stdio.h>
-
 
45
#include <as.h>>
45
#include "../../vfs/vfs.h"
46
#include "../../vfs/vfs.h"
46
 
47
 
47
#define dprintf(...)    printf(__VA_ARGS__)
48
#define dprintf(...)    printf(__VA_ARGS__)
48
 
49
 
49
vfs_info_t fat_vfs_info = {
50
vfs_info_t fat_vfs_info = {
Line 60... Line 61...
60
        [IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_NULL,
61
        [IPC_METHOD_TO_VFS_OP(VFS_WRITE)] = VFS_OP_NULL,
61
        [IPC_METHOD_TO_VFS_OP(VFS_SEEK)] = VFS_OP_DEFAULT
62
        [IPC_METHOD_TO_VFS_OP(VFS_SEEK)] = VFS_OP_DEFAULT
62
    }
63
    }
63
};
64
};
64
 
65
 
-
 
66
uint8_t *plb_ro = NULL;
-
 
67
 
65
/**
68
/**
66
 * This connection fibril processes VFS requests from VFS.
69
 * This connection fibril processes VFS requests from VFS.
67
 *
70
 *
68
 * In order to support simultaneous VFS requests, our design is as follows.
71
 * In order to support simultaneous VFS requests, our design is as follows.
69
 * The connection fibril accepts VFS requests from VFS. If there is only one
72
 * The connection fibril accepts VFS requests from VFS. If there is only one
Line 139... Line 142...
139
     */
142
     */
140
    ipcarg_t phonehash;
143
    ipcarg_t phonehash;
141
    ipc_connect_to_me(vfs_phone, 0, 0, &phonehash);
144
    ipc_connect_to_me(vfs_phone, 0, 0, &phonehash);
142
 
145
 
143
    /*
146
    /*
-
 
147
     * Allocate piece of address space for PLB.
-
 
148
     */
-
 
149
    plb_ro = as_get_mappable_page(PLB_SIZE);
-
 
150
    if (!plb_ro) {
-
 
151
        async_wait_for(req, NULL);
-
 
152
        return ENOMEM;
-
 
153
    }
-
 
154
 
-
 
155
    /*
-
 
156
     * Request sharing the Path Lookup Buffer with VFS.
-
 
157
     */
-
 
158
    rc = ipc_call_sync_3(vfs_phone, IPC_M_AS_AREA_RECV, plb_ro, PLB_SIZE, 0,
-
 
159
        NULL, NULL, NULL);
-
 
160
    if (rc) {
-
 
161
        async_wait_for(req, NULL);
-
 
162
        return rc;
-
 
163
    }
-
 
164
     
-
 
165
    /*
144
     * Create a connection fibril to handle the callback connection.
166
     * Create a connection fibril to handle the callback connection.
145
     */
167
     */
146
    async_new_connection(phonehash, 0, NULL, fat_connection);
168
    async_new_connection(phonehash, 0, NULL, fat_connection);
147
   
169
   
148
    /*
170
    /*