Changeset 28a5ebd in mainline for kernel/arch/amd64/src/asm.S


Ignore:
Timestamp:
2020-06-18T15:39:50Z (4 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ce52c333
Parents:
4f663f3e
Message:

Use char32_t instead of wchat_t to represent UTF-32 strings

The intention of the native HelenOS string API has been always to
support Unicode in the UTF-8 and UTF-32 encodings as the sole character
representations and ignore the obsolete mess of older single-byte and
multibyte character encodings. Before C11, the wchar_t type has been
slightly misused for the purpose of the UTF-32 strings. The newer
char32_t type is obviously a much more suitable option. The standard
defines char32_t as uint_least32_t, thus we can take the liberty to fix
it to uint32_t.

To maintain compatilibity with the C Standard, the putwchar(wchar_t)
functions has been replaced by our custom putuchar(char32_t) functions
where appropriate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/asm.S

    r4f663f3e r28a5ebd  
    409409 *
    410410 */
    411 FUNCTION_BEGIN(early_putwchar)
     411FUNCTION_BEGIN(early_putuchar)
    412412
    413413#if (defined(CONFIG_L4RE_UVMM_EARLY_PRINT))
     
    447447        /* Sanity check for the cursor on screen */
    448448        cmp $2000, %ax
    449         jb early_putwchar_cursor_ok
     449        jb early_putuchar_cursor_ok
    450450
    451451                movw $1998, %ax
    452452
    453         early_putwchar_cursor_ok:
     453        early_putuchar_cursor_ok:
    454454
    455455        movw %ax, %bx
     
    460460
    461461        cmp $0x0a, %al
    462         jne early_putwchar_backspace
     462        jne early_putuchar_backspace
    463463
    464464                /* Interpret newline */
     
    474474                subw %dx, %bx
    475475
    476                 jmp early_putwchar_skip
    477 
    478         early_putwchar_backspace:
     476                jmp early_putuchar_skip
     477
     478        early_putuchar_backspace:
    479479
    480480                cmp $0x08, %al
    481                 jne early_putwchar_print
     481                jne early_putuchar_print
    482482
    483483                /* Interpret backspace */
    484484
    485485                cmp $0x0000, %bx
    486                 je early_putwchar_skip
     486                je early_putuchar_skip
    487487
    488488                dec %bx
    489                 jmp early_putwchar_skip
    490 
    491         early_putwchar_print:
     489                jmp early_putuchar_skip
     490
     491        early_putuchar_print:
    492492
    493493                /* Print character */
     
    497497                inc %bx
    498498
    499         early_putwchar_skip:
     499        early_putuchar_skip:
    500500
    501501        /* Sanity check for the cursor on the last line */
    502502        cmp $2000, %bx
    503         jb early_putwchar_no_scroll
     503        jb early_putuchar_no_scroll
    504504
    505505                /* Scroll the screen (24 rows) */
     
    517517                movw $1920, %bx
    518518
    519         early_putwchar_no_scroll:
     519        early_putuchar_no_scroll:
    520520
    521521        /* Write bits 8 - 15 of the cursor address */
     
    544544
    545545        ret
    546 FUNCTION_END(early_putwchar)
     546FUNCTION_END(early_putuchar)
Note: See TracChangeset for help on using the changeset viewer.