Changes in uspace/srv/vfs/vfs.c [a481d81:6afc9d7] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.c
ra481d81 r6afc9d7 37 37 38 38 #include <vfs/vfs.h> 39 #include <stdlib.h>40 39 #include <ipc/services.h> 41 #include <abi/ipc/methods.h>42 #include <libarch/config.h>43 40 #include <ns.h> 44 41 #include <async.h> … … 54 51 #define NAME "vfs" 55 52 56 static void vfs_pager(ipc_callid_t iid, ipc_call_t *icall, void *arg)57 {58 async_answer_0(iid, EOK);59 60 char *buf = memalign(PAGE_SIZE, 1);61 const char hello[] = "Hello world!";62 63 memcpy(buf, hello, sizeof(hello));64 65 while (true) {66 ipc_call_t call;67 ipc_callid_t callid = async_get_call(&call);68 69 if (!IPC_GET_IMETHOD(call))70 break;71 72 switch (IPC_GET_IMETHOD(call)) {73 case IPC_M_PAGE_IN:74 if (buf)75 async_answer_1(callid, EOK, (sysarg_t) buf);76 else77 async_answer_0(callid, ENOMEM);78 break;79 80 default:81 async_answer_0(callid, ENOTSUP);82 break;83 }84 }85 }86 87 53 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 88 54 { … … 184 150 int main(int argc, char **argv) 185 151 { 186 int rc;187 188 152 printf("%s: HelenOS VFS server\n", NAME); 189 153 … … 201 165 */ 202 166 plb = as_area_create(AS_AREA_ANY, PLB_SIZE, 203 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE , AS_AREA_UNPAGED);167 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 204 168 if (plb == AS_MAP_FAILED) { 205 169 printf("%s: Cannot create address space area\n", NAME); … … 215 179 216 180 /* 217 * Create a port for the pager.218 */219 port_id_t port;220 rc = async_create_port(INTERFACE_PAGER, vfs_pager, NULL, &port);221 if (rc != EOK)222 return rc;223 224 /*225 181 * Set a connection handling function/fibril. 226 182 */ … … 236 192 * Register at the naming service. 237 193 */ 238 rc = service_register(SERVICE_VFS);194 int rc = service_register(SERVICE_VFS); 239 195 if (rc != EOK) { 240 196 printf("%s: Cannot register VFS service\n", NAME);
Note:
See TracChangeset
for help on using the changeset viewer.