Changes in uspace/srv/ns/ns.c [d9fae235:0315679] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ns/ns.c
rd9fae235 r0315679 55 55 static void *klogaddr = NULL; 56 56 57 static void get_as_area(ipc_callid_t callid, ipc_call_t *call, void * faddr,57 static void get_as_area(ipc_callid_t callid, ipc_call_t *call, void *ph_addr, 58 58 size_t pages, void **addr) 59 59 { 60 if ( (faddr == NULL) || (pages == 0)) {60 if (ph_addr == NULL) { 61 61 ipc_answer_0(callid, ENOENT); 62 62 return; … … 71 71 } 72 72 73 if (physmem_map( faddr, *addr, pages,73 if (physmem_map(ph_addr, *addr, pages, 74 74 AS_AREA_READ | AS_AREA_CACHEABLE) != 0) { 75 75 ipc_answer_0(callid, ENOENT); … … 79 79 80 80 ipc_answer_2(callid, EOK, (ipcarg_t) *addr, AS_AREA_READ); 81 }82 83 static void setup_clock_area(ipc_callid_t callid, ipc_call_t *call, void **addr)84 {85 uintptr_t faddr;86 int err = sysinfo_get_value("clock.faddr", &faddr);87 88 if (err != EOK)89 ipc_answer_0(callid, err);90 91 get_as_area(callid, call, (void *) faddr, 1, addr);92 }93 94 static void setup_klog_area(ipc_callid_t callid, ipc_call_t *call, void **addr)95 {96 uintptr_t faddr;97 int err = sysinfo_get_value("klog.faddr", &faddr);98 99 if (err != EOK)100 ipc_answer_0(callid, err);101 102 size_t pages;103 err = sysinfo_get_value("klog.pages", &pages);104 105 if (err != EOK)106 ipc_answer_0(callid, err);107 108 get_as_area(callid, call, (void *) faddr, pages, addr);109 81 } 110 82 … … 125 97 return rc; 126 98 127 printf( "%s: Accepting connections\n", NAME);99 printf(NAME ": Accepting connections\n"); 128 100 129 101 while (true) { … … 141 113 switch (IPC_GET_ARG3(call)) { 142 114 case SERVICE_MEM_REALTIME: 143 setup_clock_area(callid, &call, &clockaddr); 115 get_as_area(callid, &call, 116 (void *) sysinfo_value("clock.faddr"), 117 1, &clockaddr); 144 118 break; 145 119 case SERVICE_MEM_KLOG: 146 setup_klog_area(callid, &call, &klogaddr); 120 get_as_area(callid, &call, 121 (void *) sysinfo_value("klog.faddr"), 122 sysinfo_value("klog.pages"), &klogaddr); 147 123 break; 148 124 default:
Note:
See TracChangeset
for help on using the changeset viewer.