Changeset ed88c8e in mainline for kernel/arch


Ignore:
Timestamp:
2018-05-29T13:25:07Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fc0b2a8
Parents:
a57fa32
git-author:
Jiri Svoboda <jiri@…> (2018-05-28 17:24:17)
git-committer:
Jiri Svoboda <jiri@…> (2018-05-29 13:25:07)
Message:

fputc, putchar vs. fputwc, putwchar.

Location:
kernel/arch
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/src/abs32le.c

    ra57fa32 red88c8e  
    136136}
    137137
    138 void early_putchar(wchar_t ch)
     138void early_putwchar(wchar_t ch)
    139139{
    140140}
  • kernel/arch/amd64/src/asm.S

    ra57fa32 red88c8e  
    412412 *
    413413 */
    414 FUNCTION_BEGIN(early_putchar)
     414FUNCTION_BEGIN(early_putwchar)
    415415#if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB)))
    416416
     
    443443        /* Sanity check for the cursor on screen */
    444444        cmp $2000, %ax
    445         jb early_putchar_cursor_ok
     445        jb early_putwchar_cursor_ok
    446446
    447447                movw $1998, %ax
    448448
    449         early_putchar_cursor_ok:
     449        early_putwchar_cursor_ok:
    450450
    451451        movw %ax, %bx
     
    456456
    457457        cmp $0x0a, %al
    458         jne early_putchar_backspace
     458        jne early_putwchar_backspace
    459459
    460460                /* Interpret newline */
     
    470470                subw %dx, %bx
    471471
    472                 jmp early_putchar_skip
    473 
    474         early_putchar_backspace:
     472                jmp early_putwchar_skip
     473
     474        early_putwchar_backspace:
    475475
    476476                cmp $0x08, %al
    477                 jne early_putchar_print
     477                jne early_putwchar_print
    478478
    479479                /* Interpret backspace */
    480480
    481481                cmp $0x0000, %bx
    482                 je early_putchar_skip
     482                je early_putwchar_skip
    483483
    484484                dec %bx
    485                 jmp early_putchar_skip
    486 
    487         early_putchar_print:
     485                jmp early_putwchar_skip
     486
     487        early_putwchar_print:
    488488
    489489                /* Print character */
     
    493493                inc %bx
    494494
    495         early_putchar_skip:
     495        early_putwchar_skip:
    496496
    497497        /* Sanity check for the cursor on the last line */
    498498        cmp $2000, %bx
    499         jb early_putchar_no_scroll
     499        jb early_putwchar_no_scroll
    500500
    501501                /* Scroll the screen (24 rows) */
     
    513513                movw $1920, %bx
    514514
    515         early_putchar_no_scroll:
     515        early_putwchar_no_scroll:
    516516
    517517        /* Write bits 8 - 15 of the cursor address */
     
    540540
    541541        ret
    542 FUNCTION_END(early_putchar)
     542FUNCTION_END(early_putwchar)
  • kernel/arch/arm32/src/asm.S

    ra57fa32 red88c8e  
    9898        ldmia sp!, {r4, r5, pc}
    9999
    100 FUNCTION_BEGIN(early_putchar)
     100FUNCTION_BEGIN(early_putwchar)
    101101        mov pc, lr
    102 FUNCTION_END(early_putchar)
     102FUNCTION_END(early_putwchar)
  • kernel/arch/ia32/src/asm.S

    ra57fa32 red88c8e  
    451451 *
    452452 */
    453 FUNCTION_BEGIN(early_putchar)
     453FUNCTION_BEGIN(early_putwchar)
    454454
    455455#if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB)))
     
    484484        /* Sanity check for the cursor on screen */
    485485        cmp $2000, %ax
    486         jb early_putchar_cursor_ok
     486        jb early_putwchar_cursor_ok
    487487
    488488                movw $1998, %ax
    489489
    490         early_putchar_cursor_ok:
     490        early_putwchar_cursor_ok:
    491491
    492492        movw %ax, %bx
     
    497497
    498498        cmp $0x0a, %al
    499         jne early_putchar_backspace
     499        jne early_putwchar_backspace
    500500
    501501                /* Interpret newline */
     
    511511                subw %dx, %bx
    512512
    513                 jmp early_putchar_skip
    514 
    515         early_putchar_backspace:
     513                jmp early_putwchar_skip
     514
     515        early_putwchar_backspace:
    516516
    517517                cmp $0x08, %al
    518                 jne early_putchar_print
     518                jne early_putwchar_print
    519519
    520520                /* Interpret backspace */
    521521
    522522                cmp $0x0000, %bx
    523                 je early_putchar_skip
     523                je early_putwchar_skip
    524524
    525525                dec %bx
    526                 jmp early_putchar_skip
    527 
    528         early_putchar_print:
     526                jmp early_putwchar_skip
     527
     528        early_putwchar_print:
    529529
    530530                /* Print character */
     
    534534                inc %bx
    535535
    536         early_putchar_skip:
     536        early_putwchar_skip:
    537537
    538538        /* Sanity check for the cursor on the last line */
    539539        cmp $2000, %bx
    540         jb early_putchar_no_scroll
     540        jb early_putwchar_no_scroll
    541541
    542542                /* Scroll the screen (24 rows) */
     
    554554                movw $1920, %bx
    555555
    556         early_putchar_no_scroll:
     556        early_putwchar_no_scroll:
    557557
    558558        /* Write bits 8 - 15 of the cursor address */
     
    583583
    584584        ret
    585 FUNCTION_END(early_putchar)
    586 
     585FUNCTION_END(early_putwchar)
     586
  • kernel/arch/ia64/src/asm.S

    ra57fa32 red88c8e  
    191191FUNCTION_END(switch_to_userspace)
    192192
    193 FUNCTION_BEGIN(early_putchar)
     193FUNCTION_BEGIN(early_putwchar)
    194194        br.ret.sptk.many b0
    195 FUNCTION_END(early_putchar)
     195FUNCTION_END(early_putwchar)
  • kernel/arch/ia64/src/drivers/ski.c

    ra57fa32 red88c8e  
    5858};
    5959
    60 static void ski_putchar(outdev_t *, const wchar_t);
     60static void ski_putwchar(outdev_t *, const wchar_t);
    6161
    6262static outdev_operations_t skidev_ops = {
    63         .write = ski_putchar,
     63        .write = ski_putwchar,
    6464        .redraw = NULL,
    6565        .scroll_up = NULL,
     
    166166}
    167167
    168 static void ski_do_putchar(const wchar_t ch)
     168static void ski_do_putchar(char ch)
    169169{
    170170        asm volatile (
     
    187187 *
    188188 */
    189 static void ski_putchar(outdev_t *dev, const wchar_t ch)
     189static void ski_putwchar(outdev_t *dev, wchar_t ch)
    190190{
    191191        // TODO FIXME:
     
    198198
    199199                        ski_do_putchar(ch);
    200                 } else
    201                         ski_do_putchar(U_SPECIAL);
     200                } else {
     201                        ski_do_putchar('?');
     202                }
    202203        }
    203204}
  • kernel/arch/mips32/src/asm.S

    ra57fa32 red88c8e  
    296296FUNCTION_END(fpu_context_restore)
    297297
    298 FUNCTION_BEGIN(early_putchar)
     298FUNCTION_BEGIN(early_putwchar)
    299299        j $ra
    300300        nop
    301 FUNCTION_END(early_putchar)
     301FUNCTION_END(early_putwchar)
  • kernel/arch/mips32/src/mach/malta/malta.c

    ra57fa32 red88c8e  
    8181    (yamon_print_count_ptr_t) YAMON_SUBR_PRINT_COUNT;
    8282
    83 static void yamon_putchar(outdev_t *dev, const wchar_t wch)
     83static void yamon_putwchar(outdev_t *dev, const wchar_t wch)
    8484{
    8585
     
    9191static outdev_t yamon_outdev;
    9292static outdev_operations_t yamon_outdev_ops = {
    93         .write = yamon_putchar,
     93        .write = yamon_putwchar,
    9494        .redraw = NULL,
    9595        .scroll_up = NULL,
  • kernel/arch/ppc32/src/asm.S

    ra57fa32 red88c8e  
    265265        blr
    266266
    267 FUNCTION_BEGIN(early_putchar)
     267FUNCTION_BEGIN(early_putwchar)
    268268        blr
    269 FUNCTION_END(early_putchar)
     269FUNCTION_END(early_putwchar)
  • kernel/arch/riscv64/include/arch/drivers/ucb.h

    ra57fa32 red88c8e  
    4242extern void htif_init(volatile uint64_t *, volatile uint64_t *);
    4343extern outdev_t *htifout_init(void);
    44 extern void htif_putchar(outdev_t *, const wchar_t);
     44extern void htif_putwchar(outdev_t *, const wchar_t);
    4545
    4646#endif
  • kernel/arch/riscv64/src/asm.S

    ra57fa32 red88c8e  
    3535FUNCTION_END(asm_delay_loop)
    3636
    37 FUNCTION_BEGIN(early_putchar)
     37FUNCTION_BEGIN(early_putwchar)
    3838        ret
    39 FUNCTION_END(early_putchar)
     39FUNCTION_END(early_putwchar)
    4040
    4141FUNCTION_BEGIN(cpu_halt)
  • kernel/arch/riscv64/src/drivers/ucb.c

    ra57fa32 red88c8e  
    4242
    4343static outdev_operations_t htifdev_ops = {
    44         .write = htif_putchar,
     44        .write = htif_putwchar,
    4545        .redraw = NULL,
    4646        .scroll_up = NULL,
     
    8585}
    8686
    87 void htif_putchar(outdev_t *dev, const wchar_t ch)
     87void htif_putwchar(outdev_t *dev, const wchar_t ch)
    8888{
    8989        if (ascii_check(ch))
  • kernel/arch/sparc64/src/asm.S

    ra57fa32 red88c8e  
    189189        mov %g0, %o0  /* return 0 on failure */
    190190
    191 FUNCTION_BEGIN(early_putchar)
     191FUNCTION_BEGIN(early_putwchar)
    192192        retl
    193193        nop
    194 FUNCTION_END(early_putchar)
     194FUNCTION_END(early_putwchar)
  • kernel/arch/sparc64/src/drivers/niagara.c

    ra57fa32 red88c8e  
    5858static niagara_instance_t *instance = NULL;
    5959
    60 static void niagara_putchar(outdev_t *, const wchar_t);
     60static void niagara_putwchar(outdev_t *, const wchar_t);
    6161
    6262/** Character device operations */
    6363static outdev_operations_t niagara_ops = {
    64         .write = niagara_putchar,
     64        .write = niagara_putwchar,
    6565        .redraw = NULL,
    6666        .scroll_up = NULL,
     
    9696
    9797/** Write a single character to the standard output. */
    98 static inline void do_putchar(const char c)
     98static inline void do_putchar(char c)
    9999{
    100100        /* Repeat until the buffer is non-full */
     
    104104
    105105/** Write a single character to the standard output. */
    106 static void niagara_putchar(outdev_t *dev, const wchar_t ch)
     106static void niagara_putwchar(outdev_t *dev, wchar_t ch)
    107107{
    108108        if ((!outbuf_parea.mapped) || (console_override)) {
    109                 do_putchar(ch);
    110                 if (ch == '\n')
    111                         do_putchar('\r');
     109                if (ascii_check(ch)) {
     110                        do_putchar(ch);
     111                        if (ch == '\n')
     112                                do_putchar('\r');
     113                } else {
     114                        do_putchar('?');
     115                }
    112116        }
    113117}
Note: See TracChangeset for help on using the changeset viewer.