Rev 2131 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2131 | Rev 2292 | ||
---|---|---|---|
Line 81... | Line 81... | ||
81 | } hashed_service_t; |
81 | } hashed_service_t; |
82 | 82 | ||
83 | static void *clockaddr = NULL; |
83 | static void *clockaddr = NULL; |
84 | static void *klogaddr = NULL; |
84 | static void *klogaddr = NULL; |
85 | 85 | ||
86 | static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name, char *colstr, void **addr) |
86 | static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name, void **addr) |
87 | { |
87 | { |
88 | void *ph_addr; |
88 | void *ph_addr; |
89 | int ph_color; |
- | |
90 | 89 | ||
91 | if (!*addr) { |
90 | if (!*addr) { |
92 | ph_addr = (void *) sysinfo_value(name); |
91 | ph_addr = (void *) sysinfo_value(name); |
93 | if (!ph_addr) { |
92 | if (!ph_addr) { |
94 | ipc_answer_fast(callid, ENOENT, 0, 0); |
93 | ipc_answer_fast(callid, ENOENT, 0, 0); |
95 | return; |
94 | return; |
96 | } |
95 | } |
97 | ph_color = (int) sysinfo_value(colstr); |
- | |
98 | *addr = as_get_mappable_page(PAGE_SIZE, ph_color); |
96 | *addr = as_get_mappable_page(PAGE_SIZE); |
99 | physmem_map(ph_addr, *addr, 1, AS_AREA_READ | AS_AREA_CACHEABLE); |
97 | physmem_map(ph_addr, *addr, 1, AS_AREA_READ | AS_AREA_CACHEABLE); |
100 | } |
98 | } |
101 | ipc_answer_fast(callid, 0, (ipcarg_t) *addr, AS_AREA_READ); |
99 | ipc_answer_fast(callid, 0, (ipcarg_t) *addr, AS_AREA_READ); |
102 | } |
100 | } |
103 | 101 | ||
Line 117... | Line 115... | ||
117 | switch (IPC_GET_METHOD(call)) { |
115 | switch (IPC_GET_METHOD(call)) { |
118 | case IPC_M_AS_AREA_RECV: |
116 | case IPC_M_AS_AREA_RECV: |
119 | switch (IPC_GET_ARG3(call)) { |
117 | switch (IPC_GET_ARG3(call)) { |
120 | case SERVICE_MEM_REALTIME: |
118 | case SERVICE_MEM_REALTIME: |
121 | get_as_area(callid, &call, "clock.faddr", |
119 | get_as_area(callid, &call, "clock.faddr", |
122 | "clock.fcolor", &clockaddr); |
120 | &clockaddr); |
123 | break; |
121 | break; |
124 | case SERVICE_MEM_KLOG: |
122 | case SERVICE_MEM_KLOG: |
125 | get_as_area(callid, &call, "klog.faddr", |
123 | get_as_area(callid, &call, "klog.faddr", |
126 | "klog.fcolor", &klogaddr); |
124 | &klogaddr); |
127 | break; |
125 | break; |
128 | default: |
126 | default: |
129 | ipc_answer_fast(callid, ENOENT, 0, 0); |
127 | ipc_answer_fast(callid, ENOENT, 0, 0); |
130 | } |
128 | } |
131 | continue; |
129 | continue; |