Changeset 171f9a1 in mainline for kernel/generic/src/console/console.c


Ignore:
Timestamp:
2009-04-03T20:39:33Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cb01e1e
Parents:
7a2c479
Message:

Character encoding/decoding un uspace. Partially fix klog application.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/console.c

    r7a2c479 r171f9a1  
    5454
    5555#define KLOG_SIZE     PAGE_SIZE
     56#define KLOG_LENGTH   (KLOG_SIZE / sizeof(wchar_t))
    5657#define KLOG_LATENCY  8
    5758
    5859/** Kernel log cyclic buffer */
    59 static wchar_t klog[KLOG_SIZE] __attribute__ ((aligned (PAGE_SIZE)));
     60static wchar_t klog[KLOG_LENGTH] __attribute__ ((aligned (PAGE_SIZE)));
    6061
    6162/** Kernel log initialized */
     
    258259                index_t i;
    259260                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);
    261262                klog_stored = 0;
    262263        }
    263264       
    264265        /* 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)
    267268                klog_len++;
    268269        else
    269                 klog_start = (klog_start + 1) % KLOG_SIZE;
     270                klog_start = (klog_start + 1) % KLOG_LENGTH;
    270271       
    271272        if ((stdout) && (stdout->op->write))
Note: See TracChangeset for help on using the changeset viewer.