source: mainline/contrib/arch/uspace/srv/vfs/vfs.adl@ 0bbef9b

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 0bbef9b was afe34be, checked in by Martin Decky <martin@…>, 16 years ago

finally all interfaces are correctly bound

  • Property mode set to 100644
File size: 3.9 KB
RevLine 
[ea5f46d]1interface vfs extends service {
[1993f9a]2 /* Register a filesystem driver */
3 ipcarg_t register(in_copy string name);
4
5 /* Mount filesystem */
6 ipcarg_t mount(in ipcarg_t device, in ipcarg_t flags, in_copy string point, in_copy string opts, in_copy string fs);
7
8 /* Open file */
9 ipcarg_t open(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, in_copy string path, out ipcarg_t fd);
10
11 /* Open file using node */
12 ipcarg_t open_node(in ipcarg_t fs_handle, in ipcarg_t dev_handle, in ipcarg_t index, in ipcarg_t oflag, out ipcarg_t fd);
13
14 /* Read data from file */
15 ipcarg_t read(in ipcarg_t fd, out_copy stream data);
16
17 /* Write data to file */
18 ipcarg_t write(in ipcarg_t fd, in_copy stream data);
19
20 /* Seek in file */
21 ipcarg_t seek(in ipcarg_t fd, in ipcarg_t offset, in ipcarg_t whence);
22
23 /* Truncate file */
24 ipcarg_t truncate(in ipcarg_t fd, in ipcarg_t size);
25
26 /* Get file metadata */
27 ipcarg_t fstat(in ipcarg_t fd, out_copy stream stat);
28
29 /* Get directory entry metadata */
30 ipcarg_t stat(in_copy string path, out_copy stream stat);
31
32 /* Create directory */
33 ipcarg_t mkdir(in ipcarg_t mode, in_copy string path);
34
35 /* Delete directory entry */
36 ipcarg_t unlink(in ipcarg_t lflag, in_copy string path);
37
38 /* Rename directory entry */
39 ipcarg_t rename(in_copy string old, in_copy string new);
40
41 /* Flush file buffers */
42 ipcarg_t sync(in ipcarg_t fd);
43
44 /* In-protocol status value */
45 ipcarg_t ipc_m_ping(void);
46
47 /* Close connection */
48 ipcarg_t ipc_m_phone_hungup(void);
49 protocol:
[ea5f46d]50 [vfs.bp]
[1993f9a]51};
52
[ea5f46d]53interface fs extends service {
54 /* Notify filesystem that it was mounted */
55 ipcarg_t mounted(in ipcarg_t dev_handle, in_copy string opts);
56
57 /* Mount filesystem */
58 ipcarg_t mount(in ipcarg_t device, in ipcarg_t flags, in_copy string point, in_copy string opts, ...);
59
60 /* Open file by node */
61 ipcarg_t open_node(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, ...);
62
63 /* Lookup file */
64 ipcarg_t lookup(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, ...);
65
66 /* Read data from file */
67 ipcarg_t read(in ipcarg_t dev_handle, in ipcarg_t fs_index, in ipcarg_t offset, out_copy stream data);
68
69 /* Write data to file */
[810860a]70 ipcarg_t write(in ipcarg_t dev_handle, in ipcarg_t fs_index, in ipcarg_t offset, in_copy stream data);
[ea5f46d]71
72 /* Truncate file */
73 ipcarg_t truncate(in ipcarg_t dev_handle, in ipcarg_t fs_index, in ipcarg_t size);
74
75 /* Get directory entry metadata */
76 ipcarg_t stat(in ipcarg_t dev_handle, in ipcarg_t fs_index, out_copy stream stat);
77
78 /* Flush file buffers */
79 ipcarg_t sync(in ipcarg_t dev_handle, in ipcarg_t fs_index);
80
81 /* Notify on file close */
82 ipcarg_t close(in ipcarg_t dev_handle, in ipcarg_t fs_index);
83};
84
[810860a]85frame io_dispatcher {
[1993f9a]86 provides:
87 vfs vfs;
88 requires:
[2a70672]89 [/uspace/lib/libc/requires]
[afe34be]90 ns ns;
[cf7b3e0]91 tmpfs tmpfs;
92 fat fat;
93 devfs devfs;
[6d4c549]94 initialization:
95 !ns.ipc_m_connect_to_me /* vfs */
[1993f9a]96 protocol:
[6d4c549]97 [/uspace/lib/libc/protocol]
[ea5f46d]98};
99
100architecture vfs {
[810860a]101 inst io_dispatcher io_dispatcher;
[ea5f46d]102 inst tmpfs tmpfs;
103 inst fat fat;
104 inst devfs devfs;
105
[810860a]106 bind io_dispatcher:tmpfs to tmpfs:tmpfs;
107 bind io_dispatcher:fat to fat:fat;
108 bind io_dispatcher:devfs to devfs:devfs;
[ea5f46d]109
[810860a]110 bind tmpfs:vfs to io_dispatcher:vfs;
111 bind fat:vfs to io_dispatcher:vfs;
112 bind devfs:vfs to io_dispatcher:vfs;
[ea5f46d]113
[afe34be]114 bind tmpfs:tmpfs_nested to tmpfs:tmpfs;
115 bind tmpfs:fat_nested to fat:fat;
116 bind tmpfs:devfs_nested to devfs:devfs;
117
118 bind fat:tmpfs_nested to tmpfs:tmpfs;
119 bind fat:fat_nested to fat:fat;
120 bind fat:devfs_nested to devfs:devfs;
121
[810860a]122 delegate vfs to io_dispatcher:vfs;
[ea5f46d]123
[810860a]124 [/uspace/lib/libc/subsume%io_dispatcher]
[ea5f46d]125 [/uspace/lib/libc/subsume%tmpfs]
126 [/uspace/lib/libc/subsume%fat]
127 [/uspace/lib/libc/subsume%devfs]
128
[810860a]129 subsume io_dispatcher:ns to ns;
[ea5f46d]130 subsume tmpfs:ns to ns;
131 subsume fat:ns to ns;
132 subsume devfs:ns to ns;
133
[cf7b3e0]134 subsume tmpfs:rd to rd;
135 subsume fat:rd to rd;
[ea5f46d]136
137 subsume devfs:devmap_client to devmap_client;
138 subsume devfs:device to device;
[1993f9a]139};
Note: See TracBrowser for help on using the repository browser.