Changes in uspace/srv/vfs/vfs.c [6afc9d7:a481d81] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.c
r6afc9d7 ra481d81 37 37 38 38 #include <vfs/vfs.h> 39 #include <stdlib.h> 39 40 #include <ipc/services.h> 41 #include <abi/ipc/methods.h> 42 #include <libarch/config.h> 40 43 #include <ns.h> 41 44 #include <async.h> … … 51 54 #define NAME "vfs" 52 55 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 else 77 async_answer_0(callid, ENOMEM); 78 break; 79 80 default: 81 async_answer_0(callid, ENOTSUP); 82 break; 83 } 84 } 85 } 86 53 87 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 54 88 { … … 150 184 int main(int argc, char **argv) 151 185 { 186 int rc; 187 152 188 printf("%s: HelenOS VFS server\n", NAME); 153 189 … … 165 201 */ 166 202 plb = as_area_create(AS_AREA_ANY, PLB_SIZE, 167 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE );203 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE, AS_AREA_UNPAGED); 168 204 if (plb == AS_MAP_FAILED) { 169 205 printf("%s: Cannot create address space area\n", NAME); … … 179 215 180 216 /* 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 /* 181 225 * Set a connection handling function/fibril. 182 226 */ … … 192 236 * Register at the naming service. 193 237 */ 194 intrc = service_register(SERVICE_VFS);238 rc = service_register(SERVICE_VFS); 195 239 if (rc != EOK) { 196 240 printf("%s: Cannot register VFS service\n", NAME);
Note:
See TracChangeset
for help on using the changeset viewer.