Changeset 28a5ebd in mainline for kernel/generic/src/console/console.c
- Timestamp:
- 2020-06-18T15:39:50Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ce52c333
- Parents:
- 4f663f3e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/console.c
r4f663f3e r28a5ebd 59 59 60 60 #define KIO_PAGES 8 61 #define KIO_LENGTH (KIO_PAGES * PAGE_SIZE / sizeof( wchar_t))61 #define KIO_LENGTH (KIO_PAGES * PAGE_SIZE / sizeof(char32_t)) 62 62 63 63 /** Kernel log cyclic buffer */ 64 wchar_t kio[KIO_LENGTH] __attribute__((aligned(PAGE_SIZE)));64 char32_t kio[KIO_LENGTH] __attribute__((aligned(PAGE_SIZE))); 65 65 66 66 /** Kernel log initialized */ … … 95 95 }; 96 96 97 static void stdout_write(outdev_t *, wchar_t);97 static void stdout_write(outdev_t *, char32_t); 98 98 static void stdout_redraw(outdev_t *); 99 99 static void stdout_scroll_up(outdev_t *); … … 148 148 } 149 149 150 static void stdout_write(outdev_t *dev, wchar_t ch)150 static void stdout_write(outdev_t *dev, char32_t ch) 151 151 { 152 152 list_foreach(dev->list, link, outdev_t, sink) { … … 261 261 buf[offset] = 0; 262 262 263 wchar_t ch;263 char32_t ch; 264 264 while ((ch = indev_pop_character(indev)) != '\n') { 265 265 if (ch == '\b') { 266 266 if (count > 0) { 267 267 /* Space, backspace, space */ 268 put wchar('\b');269 put wchar(' ');270 put wchar('\b');268 putuchar('\b'); 269 putuchar(' '); 270 putuchar('\b'); 271 271 272 272 count--; … … 277 277 278 278 if (chr_encode(ch, buf, &offset, buflen - 1) == EOK) { 279 put wchar(ch);279 putuchar(ch); 280 280 count++; 281 281 buf[offset] = 0; … … 287 287 288 288 /** Get character from input device & echo it to screen */ 289 wchar_t getc(indev_t *indev)290 { 291 wchar_t ch = indev_pop_character(indev);292 put wchar(ch);289 char32_t getc(indev_t *indev) 290 { 291 char32_t ch = indev_pop_character(indev); 292 putuchar(ch); 293 293 return ch; 294 294 } … … 324 324 /* Print characters that weren't printed earlier */ 325 325 while (kio_stored > 0) { 326 wchar_t tmp = kio[(kio_start + kio_len - kio_stored) % KIO_LENGTH];326 char32_t tmp = kio[(kio_start + kio_len - kio_stored) % KIO_LENGTH]; 327 327 kio_stored--; 328 328 … … 344 344 * The caller is required to hold kio_lock 345 345 */ 346 void kio_push_char(const wchar_t ch)346 void kio_push_char(const char32_t ch) 347 347 { 348 348 kio[(kio_start + kio_len) % KIO_LENGTH] = ch; … … 360 360 } 361 361 362 void put wchar(const wchar_t ch)362 void putuchar(const char32_t ch) 363 363 { 364 364 bool ordy = ((stdout) && (stdout->op->write)); … … 377 377 * for possible future output. 378 378 * 379 * The early_put wchar() function is used to output379 * The early_putuchar() function is used to output 380 380 * the character for low-level debugging purposes. 381 381 * Note that the early_putc() function might be 382 382 * a no-op on certain hardware configurations. 383 383 */ 384 early_put wchar(ch);384 early_putuchar(ch); 385 385 } 386 386
Note:
See TracChangeset
for help on using the changeset viewer.