Subversion Repositories HelenOS-historic

Rev

Rev 1702 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1702 Rev 1780
Line 42... Line 42...
42
chardev_t ski_uconsole;
42
chardev_t ski_uconsole;
43
static bool kb_disable;
43
static bool kb_disable;
44
int kbd_uspace=0;
44
int kbd_uspace=0;
45
 
45
 
46
static void ski_putchar(chardev_t *d, const char ch);
46
static void ski_putchar(chardev_t *d, const char ch);
47
static __s32 ski_getchar(void);
47
static int32_t ski_getchar(void);
48
 
48
 
49
/** Display character on debug console
49
/** Display character on debug console
50
 *
50
 *
51
 * Use SSC (Simulator System Call) to
51
 * Use SSC (Simulator System Call) to
52
 * display character on debug console.
52
 * display character on debug console.
Line 76... Line 76...
76
 *
76
 *
77
 * This call is non-blocking.
77
 * This call is non-blocking.
78
 *
78
 *
79
 * @return ASCII code of pressed key or 0 if no key pressed.
79
 * @return ASCII code of pressed key or 0 if no key pressed.
80
 */
80
 */
81
__s32 ski_getchar(void)
81
int32_t ski_getchar(void)
82
{
82
{
83
    __u64 ch;
83
    uint64_t ch;
84
   
84
   
85
    __asm__ volatile (
85
    __asm__ volatile (
86
        "mov r15=%1\n"
86
        "mov r15=%1\n"
87
        "break 0x80000;;\n" /* modifies r8 */
87
        "break 0x80000;;\n" /* modifies r8 */
88
        "mov %0=r8;;\n"    
88
        "mov %0=r8;;\n"    
Line 90... Line 90...
90
        : "=r" (ch)
90
        : "=r" (ch)
91
        : "i" (SKI_GETCHAR)
91
        : "i" (SKI_GETCHAR)
92
        : "r15",  "r8"
92
        : "r15",  "r8"
93
    );
93
    );
94
 
94
 
95
    return (__s32) ch;
95
    return (int32_t) ch;
96
}
96
}
97
 
97
 
98
/**
98
/**
99
 * This is a blocking wrapper for ski_getchar().
99
 * This is a blocking wrapper for ski_getchar().
100
 * To be used when the kernel crashes.
100
 * To be used when the kernel crashes.