Changeset 171f9a1 in mainline for kernel/generic/src/console/console.c
- Timestamp:
- 2009-04-03T20:39:33Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- cb01e1e
- Parents:
- 7a2c479
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/console.c
r7a2c479 r171f9a1 54 54 55 55 #define KLOG_SIZE PAGE_SIZE 56 #define KLOG_LENGTH (KLOG_SIZE / sizeof(wchar_t)) 56 57 #define KLOG_LATENCY 8 57 58 58 59 /** Kernel log cyclic buffer */ 59 static wchar_t klog[KLOG_ SIZE] __attribute__ ((aligned (PAGE_SIZE)));60 static wchar_t klog[KLOG_LENGTH] __attribute__ ((aligned (PAGE_SIZE))); 60 61 61 62 /** Kernel log initialized */ … … 258 259 index_t i; 259 260 for (i = klog_len - klog_stored; i < klog_len; i++) 260 stdout->op->write(stdout, klog[(klog_start + i) % KLOG_ SIZE], silent);261 stdout->op->write(stdout, klog[(klog_start + i) % KLOG_LENGTH], silent); 261 262 klog_stored = 0; 262 263 } 263 264 264 265 /* Store character in the cyclic kernel log */ 265 klog[(klog_start + klog_len) % KLOG_ SIZE] = ch;266 if (klog_len < KLOG_ SIZE)266 klog[(klog_start + klog_len) % KLOG_LENGTH] = ch; 267 if (klog_len < KLOG_LENGTH) 267 268 klog_len++; 268 269 else 269 klog_start = (klog_start + 1) % KLOG_ SIZE;270 klog_start = (klog_start + 1) % KLOG_LENGTH; 270 271 271 272 if ((stdout) && (stdout->op->write))
Note:
See TracChangeset
for help on using the changeset viewer.