Subversion Repositories HelenOS-historic

Rev

Rev 577 | Rev 584 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 577 Rev 583
Line 31... Line 31...
31
#include <console/chardev.h>
31
#include <console/chardev.h>
32
 
32
 
33
static chardev_t ski_console;
33
static chardev_t ski_console;
34
static bool kb_disable;
34
static bool kb_disable;
35
 
35
 
-
 
36
static void ski_write(chardev_t *d, const char ch);
-
 
37
static __s32 ski_getchar(void);
-
 
38
 
36
/** Display character on debug console
39
/** Display character on debug console
37
 *
40
 *
38
 * Use SSC (Simulator System Call) to
41
 * Use SSC (Simulator System Call) to
39
 * display character on debug console.
42
 * display character on debug console.
40
 *
43
 *
-
 
44
 * @param d Character device.
41
 * @param ch   Character to be printed.
45
 * @param ch Character to be printed.
42
 */
46
 */
43
void ski_write(chardev_t *d, const char ch)
47
void ski_write(chardev_t *d, const char ch)
44
{
48
{
45
    __asm__ (
49
    __asm__ (
46
        "mov r15=%0\n"
50
        "mov r15=%0\n"
Line 49... Line 53...
49
        :
53
        :
50
        : "i" (SKI_PUTCHAR), "r" (ch)
54
        : "i" (SKI_PUTCHAR), "r" (ch)
51
        : "r15", "in0", "r8"
55
        : "r15", "in0", "r8"
52
    );
56
    );
53
   
57
   
54
    if (ch == '\n') ski_putchar('\r');
58
    if (ch == '\n')
-
 
59
        ski_write(d, '\r');
55
}
60
}
56
 
61
 
57
/** Ask debug console if a key was pressed.
62
/** Ask debug console if a key was pressed.
58
 *
63
 *
59
 * Use SSC (Simulator System Call) to
64
 * Use SSC (Simulator System Call) to
Line 94... Line 99...
94
    if (ch)
99
    if (ch)
95
        chardev_push_character(&ski_console, ch);
100
        chardev_push_character(&ski_console, ch);
96
}
101
}
97
 
102
 
98
/* Called from getc(). */
103
/* Called from getc(). */
99
static void ski_kb_enable(chardev_t *)
104
static void ski_kb_enable(chardev_t *d)
100
{
105
{
101
    kb_disable = false;
106
    kb_disable = false;
102
}
107
}
103
 
108
 
104
/* Called from getc(). */
109
/* Called from getc(). */