Rev 4241 | Rev 4459 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4241 | Rev 4253 | ||
---|---|---|---|
Line 118... | Line 118... | ||
118 | static bool service_clonable(int service) |
118 | static bool service_clonable(int service) |
119 | { |
119 | { |
120 | return (service == SERVICE_LOAD); |
120 | return (service == SERVICE_LOAD); |
121 | } |
121 | } |
122 | 122 | ||
123 | static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name, void **addr) |
123 | static void get_as_area(ipc_callid_t callid, ipc_call_t *call, void *ph_addr, count_t pages, void **addr) |
124 | { |
124 | { |
125 | void *ph_addr; |
125 | if (ph_addr == NULL) { |
- | 126 | ipc_answer_0(callid, ENOENT); |
|
- | 127 | return; |
|
- | 128 | } |
|
126 | 129 | ||
127 | if (!*addr) { |
130 | if (*addr == NULL) { |
128 | ph_addr = (void *) sysinfo_value(name); |
131 | *addr = as_get_mappable_page(pages * PAGE_SIZE); |
- | 132 | ||
129 | if (!ph_addr) { |
133 | if (*addr == NULL) { |
130 | ipc_answer_0(callid, ENOENT); |
134 | ipc_answer_0(callid, ENOENT); |
131 | return; |
135 | return; |
132 | } |
136 | } |
133 | *addr = as_get_mappable_page(PAGE_SIZE); |
- | |
- | 137 | ||
134 | if (physmem_map(ph_addr, *addr, 1, |
138 | if (physmem_map(ph_addr, *addr, pages, |
135 | AS_AREA_READ | AS_AREA_CACHEABLE) != 0) { |
139 | AS_AREA_READ | AS_AREA_CACHEABLE) != 0) { |
136 | ipc_answer_0(callid, ENOENT); |
140 | ipc_answer_0(callid, ENOENT); |
137 | return; |
141 | return; |
138 | } |
142 | } |
139 | } |
143 | } |
- | 144 | ||
140 | ipc_answer_2(callid, EOK, (ipcarg_t) *addr, AS_AREA_READ); |
145 | ipc_answer_2(callid, EOK, (ipcarg_t) *addr, AS_AREA_READ); |
141 | } |
146 | } |
142 | 147 | ||
143 | /** Process pending connection requests */ |
148 | /** Process pending connection requests */ |
144 | static void process_pending_req() |
149 | static void process_pending_req() |
Line 195... | Line 200... | ||
195 | 200 | ||
196 | switch (IPC_GET_METHOD(call)) { |
201 | switch (IPC_GET_METHOD(call)) { |
197 | case IPC_M_SHARE_IN: |
202 | case IPC_M_SHARE_IN: |
198 | switch (IPC_GET_ARG3(call)) { |
203 | switch (IPC_GET_ARG3(call)) { |
199 | case SERVICE_MEM_REALTIME: |
204 | case SERVICE_MEM_REALTIME: |
200 | get_as_area(callid, &call, "clock.faddr", &clockaddr); |
205 | get_as_area(callid, &call, sysinfo_value("clock.faddr"), 1, &clockaddr); |
201 | break; |
206 | break; |
202 | case SERVICE_MEM_KLOG: |
207 | case SERVICE_MEM_KLOG: |
203 | get_as_area(callid, &call, "klog.faddr", &klogaddr); |
208 | get_as_area(callid, &call, sysinfo_value("klog.faddr"), sysinfo_value("klog.pages"), &klogaddr); |
204 | break; |
209 | break; |
205 | default: |
210 | default: |
206 | ipc_answer_0(callid, ENOENT); |
211 | ipc_answer_0(callid, ENOENT); |
207 | } |
212 | } |
208 | continue; |
213 | continue; |