Changeset c4cfe4c in mainline for kernel/genarch/src/fb/fb.c
- Timestamp:
- 2025-04-17T16:01:16Z (5 days ago)
- Branches:
- master
- Children:
- 888c06e
- Parents:
- 1db4e2ae (diff), 250a435 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-04-17 15:51:11)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-04-17 16:01:16)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/fb/fb.c
r1db4e2ae rc4cfe4c 121 121 /** Current backbuffer position */ 122 122 unsigned int position; 123 124 /** Partial character between writes */ 125 mbstate_t mbstate; 123 126 } fb_instance_t; 124 127 125 static void fb_ putuchar(outdev_t *, char32_t);128 static void fb_write(outdev_t *, const char *, size_t); 126 129 static void fb_redraw(outdev_t *); 127 130 static void fb_scroll_up(outdev_t *); … … 129 132 130 133 static outdev_operations_t fbdev_ops = { 131 .write = fb_ putuchar,134 .write = fb_write, 132 135 .redraw = fb_redraw, 133 136 .scroll_up = fb_scroll_up, … … 418 421 * 419 422 */ 420 static void fb_putuchar(outdev_t *dev, char32_t ch) 421 { 422 fb_instance_t *instance = (fb_instance_t *) dev->data; 423 spinlock_lock(&instance->lock); 424 423 static void _putuchar(fb_instance_t *instance, char32_t ch) 424 { 425 425 switch (ch) { 426 426 case '\n': 427 cursor_remove(instance);428 427 instance->position += instance->cols; 429 428 instance->position -= instance->position % instance->cols; 430 429 break; 431 430 case '\r': 432 cursor_remove(instance);433 431 instance->position -= instance->position % instance->cols; 434 432 break; 435 433 case '\b': 436 cursor_remove(instance);437 434 if (instance->position % instance->cols) 438 435 instance->position--; 439 436 break; 440 437 case '\t': 441 cursor_remove(instance);442 438 do { 443 439 glyph_draw(instance, fb_font_glyph(' '), … … 459 455 screen_scroll(instance); 460 456 } 457 } 458 459 static void fb_write(outdev_t *dev, const char *s, size_t n) 460 { 461 fb_instance_t *instance = (fb_instance_t *) dev->data; 462 463 spinlock_lock(&instance->lock); 464 cursor_remove(instance); 465 466 size_t offset = 0; 467 char32_t ch; 468 469 while ((ch = str_decode_r(s, &offset, n, U_SPECIAL, &instance->mbstate))) 470 _putuchar(instance, ch); 461 471 462 472 cursor_put(instance); 463 464 473 spinlock_unlock(&instance->lock); 465 474 }
Note:
See TracChangeset
for help on using the changeset viewer.