Changeset a4f959b in mainline


Ignore:
Timestamp:
2012-12-14T00:02:30Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7633928c
Parents:
14febed9
Message:

Use the YAMON print_count subroutine to implement putchar.

Location:
boot/arch/mips32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/mips32/include/arch.h

    r14febed9 ra4f959b  
    5151#define LOADER_OFFSET    0x00103000
    5252
    53 #define MALTA_SERIAL     0xb80003f8
     53#define YAMON_SUBR_BASE         PA2KA(0x1fc00500)
     54#define YAMON_SUBR_PRINT_COUNT  (YAMON_SUBR_BASE + 0x4)
    5455#endif
    5556
  • boot/arch/mips32/src/putchar.c

    r14febed9 ra4f959b  
    3737
    3838#if defined(MACHINE_msim)
    39 #define PUTCHAR_ADDRESS MSIM_VIDEORAM_ADDRESS
     39#define _putchar(ch)    msim_putchar((ch))
     40static void msim_putchar(const wchar_t ch)
     41{
     42        *((char *) MSIM_VIDEORAM_ADDRESS) = ch;
     43}
    4044#endif
    4145
    4246#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
    43 #define PUTCHAR_ADDRESS MALTA_SERIAL
     47#define _putchar(ch)    yamon_putchar((ch))
     48typedef void (**yamon_print_count_ptr_t)(uint32_t, const char *, uint32_t);
     49yamon_print_count_ptr_t yamon_print_count =
     50    (yamon_print_count_ptr_t) YAMON_SUBR_PRINT_COUNT;
     51
     52static void yamon_putchar(const wchar_t wch)
     53{
     54        const char ch = (char) wch;
     55
     56        (*yamon_print_count)(0, &ch, 1);
     57}
    4458#endif
    4559
     
    4761{
    4862        if (ascii_check(ch))
    49                 *((char *) PUTCHAR_ADDRESS) = ch;
     63                _putchar(ch);
    5064        else
    51                 *((char *) PUTCHAR_ADDRESS) = U_SPECIAL;
     65                _putchar(U_SPECIAL);
    5266}
    5367
Note: See TracChangeset for help on using the changeset viewer.