Subversion Repositories HelenOS

Rev

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

Rev 2543 Rev 2546
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 <as.h>
46
#include "../../vfs/vfs.h"
46
#include "../../vfs/vfs.h"
47
 
47
 
48
#define dprintf(...)    printf(__VA_ARGS__)
48
#define dprintf(...)    printf(__VA_ARGS__)
49
 
49
 
50
vfs_info_t fat_vfs_info = {
50
vfs_info_t fat_vfs_info = {
Line 63... Line 63...
63
    }
63
    }
64
};
64
};
65
 
65
 
66
uint8_t *plb_ro = NULL;
66
uint8_t *plb_ro = NULL;
67
 
67
 
-
 
68
int fs_handle = 0;
-
 
69
 
68
/**
70
/**
69
 * This connection fibril processes VFS requests from VFS.
71
 * This connection fibril processes VFS requests from VFS.
70
 *
72
 *
71
 * In order to support simultaneous VFS requests, our design is as follows.
73
 * In order to support simultaneous VFS requests, our design is as follows.
72
 * The connection fibril accepts VFS requests from VFS. If there is only one
74
 * The connection fibril accepts VFS requests from VFS. If there is only one
Line 153... Line 155...
153
    }
155
    }
154
 
156
 
155
    /*
157
    /*
156
     * Request sharing the Path Lookup Buffer with VFS.
158
     * Request sharing the Path Lookup Buffer with VFS.
157
     */
159
     */
158
    rc = ipc_call_sync_3(vfs_phone, IPC_M_AS_AREA_RECV, plb_ro, PLB_SIZE, 0,
160
    rc = ipc_call_sync_3(vfs_phone, IPC_M_AS_AREA_RECV, (ipcarg_t) plb_ro,
159
        NULL, NULL, NULL);
161
        PLB_SIZE, 0, NULL, NULL, NULL);
160
    if (rc) {
162
    if (rc) {
161
        async_wait_for(req, NULL);
163
        async_wait_for(req, NULL);
162
        return rc;
164
        return rc;
163
    }
165
    }
164
     
166
     
165
    /*
167
    /*
-
 
168
     * Pick up the answer for the request to the VFS_REQUEST call.
-
 
169
     */
-
 
170
    async_wait_for(req, NULL);
-
 
171
    fs_handle = (int) IPC_GET_ARG1(answer);
-
 
172
    dprintf("FAT filesystem registered, fs_handle=%d.\n", fs_handle);
-
 
173
 
-
 
174
    /*
166
     * Create a connection fibril to handle the callback connection.
175
     * Create a connection fibril to handle the callback connection.
167
     */
176
     */
168
    async_new_connection(phonehash, 0, NULL, fat_connection);
177
    async_new_connection(phonehash, 0, NULL, fat_connection);
169
   
178
   
170
    /*
179
    /*
171
     * Tell the async framework that other connections are to be handled by
180
     * Tell the async framework that other connections are to be handled by
172
     * the same connection fibril as well.
181
     * the same connection fibril as well.
173
     */
182
     */
174
    async_set_client_connection(fat_connection);
183
    async_set_client_connection(fat_connection);
175
 
184
 
176
    /*
-
 
177
     * Pick up the answer for the request to the VFS_REQUEST call.
-
 
178
     */
-
 
179
    async_wait_for(req, NULL);
-
 
180
    dprintf("FAT filesystem registered.\n");
-
 
181
 
-
 
182
    async_create_manager();
185
    async_create_manager();
183
 
186
 
184
    /*
187
    /*
185
     * TODO: Interestingly, if we merely return, the only thread dies.
188
     * TODO: Interestingly, if we merely return, the only thread dies.
186
     *   If the only thread dies, the whole task is destroyed.
189
     *   If the only thread dies, the whole task is destroyed.