Changeset 3636964 in mainline
- Timestamp:
- 2009-04-06T19:32:58Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2845930
- Parents:
- 13a638d
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/klog/klog.c
r13a638d r3636964 48 48 #define NAME "klog" 49 49 50 #define KLOG_SIZE PAGE_SIZE51 #define KLOG_LENGTH (KLOG_SIZE / sizeof(wchar_t))52 53 50 /* Pointer to klog area */ 54 51 static wchar_t *klog; 52 static count_t klog_length; 55 53 56 54 static void interrupt_received(ipc_callid_t callid, ipc_call_t *call) … … 58 56 async_serialize_start(); 59 57 60 size_t klog_start = (size_t) IPC_GET_ARG1(*call); 61 size_t klog_len = (size_t) IPC_GET_ARG2(*call); 62 size_t klog_stored = (size_t) IPC_GET_ARG3(*call); 63 size_t i; 58 count_t klog_start = (count_t) IPC_GET_ARG1(*call); 59 count_t klog_len = (count_t) IPC_GET_ARG2(*call); 60 count_t klog_stored = (count_t) IPC_GET_ARG3(*call); 61 count_t i; 62 64 63 for (i = klog_len - klog_stored; i < klog_len; i++) 65 putchar(klog[(klog_start + i) % KLOG_LENGTH]);64 putchar(klog[(klog_start + i) % klog_length]); 66 65 67 66 async_serialize_end(); … … 72 71 console_wait(); 73 72 74 klog = (char *) as_get_mappable_page(KLOG_SIZE); 73 count_t klog_pages = sysinfo_value("klog.pages"); 74 size_t klog_size = klog_pages * PAGE_SIZE; 75 klog_length = klog_size / sizeof(wchar_t); 76 77 klog = (char *) as_get_mappable_page(klog_pages); 75 78 if (klog == NULL) { 76 79 printf(NAME ": Error allocating memory area\n"); … … 78 81 } 79 82 80 int res = ipc_share_in_start_1_0(PHONE_NS, (void *) klog, KLOG_SIZE,81 SERVICE_MEM_KLOG);83 int res = ipc_share_in_start_1_0(PHONE_NS, (void *) klog, 84 klog_size, SERVICE_MEM_KLOG); 82 85 if (res != EOK) { 83 86 printf(NAME ": Error initializing memory area\n"); … … 93 96 klog_update(); 94 97 async_manager(); 95 98 96 99 return 0; 97 100 } -
uspace/lib/libc/generic/event.c
r13a638d r3636964 39 39 #include <libc.h> 40 40 #include <event.h> 41 #include <kernel/ event/event_types.h>41 #include <kernel/ipc/event_types.h> 42 42 #include <ipc/ipc.h> 43 43 44 44 /** Subscribe for event notifications. 45 45 * 46 * @param e 47 * @param method 46 * @param evno Event number. 47 * @param method Use this method for notifying me. 48 48 * 49 * @return 49 * @return Value returned by the kernel. 50 50 */ 51 51 int event_subscribe(event_type_t e, ipcarg_t method) -
uspace/lib/libc/include/event.h
r13a638d r3636964 36 36 #define LIBC_EVENT_H_ 37 37 38 #include <kernel/ event/event_types.h>38 #include <kernel/ipc/event_types.h> 39 39 #include <ipc/ipc.h> 40 40 -
uspace/srv/ns/ns.c
r13a638d r3636964 121 121 } 122 122 123 static void get_as_area(ipc_callid_t callid, ipc_call_t *call, char *name, void **addr) 124 { 125 void *ph_addr; 126 127 if (!*addr) { 128 ph_addr = (void *) sysinfo_value(name); 129 if (!ph_addr) { 123 static void get_as_area(ipc_callid_t callid, ipc_call_t *call, void *ph_addr, count_t pages, void **addr) 124 { 125 if (ph_addr == NULL) { 126 ipc_answer_0(callid, ENOENT); 127 return; 128 } 129 130 if (*addr == NULL) { 131 *addr = as_get_mappable_page(pages * PAGE_SIZE); 132 133 if (*addr == NULL) { 130 134 ipc_answer_0(callid, ENOENT); 131 135 return; 132 136 } 133 *addr = as_get_mappable_page(PAGE_SIZE);134 if (physmem_map(ph_addr, *addr, 1,137 138 if (physmem_map(ph_addr, *addr, pages, 135 139 AS_AREA_READ | AS_AREA_CACHEABLE) != 0) { 136 140 ipc_answer_0(callid, ENOENT); … … 138 142 } 139 143 } 144 140 145 ipc_answer_2(callid, EOK, (ipcarg_t) *addr, AS_AREA_READ); 141 146 } … … 198 203 switch (IPC_GET_ARG3(call)) { 199 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 206 break; 202 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 209 break; 205 210 default:
Note:
See TracChangeset
for help on using the changeset viewer.