Changeset 3636964 in mainline for uspace/app/klog/klog.c
- Timestamp:
- 2009-04-06T19:32:58Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2845930
- Parents:
- 13a638d
- File:
-
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.