Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 577 → Rev 576

/kernel/trunk/arch/ia64/src/ski/ski.c
27,11 → 27,22
*/
 
#include <arch/ski/ski.h>
#include <console/console.h>
#include <console/chardev.h>
 
static chardev_t ski_console;
static bool kb_disable;
/** Initialize debug console
*
* Issue SSC (Simulator System Call) to
* to open debug console.
*/
void ski_init_console(void)
{
__asm__ (
"mov r15=%0\n"
"break 0x80000\n"
:
: "i" (SKI_INIT_CONSOLE)
: "r15", "r8"
);
}
 
/** Display character on debug console
*
40,7 → 51,7
*
* @param ch Character to be printed.
*/
void ski_write(chardev_t *d, const char ch)
void ski_putchar(const char ch)
{
__asm__ (
"mov r15=%0\n"
79,58 → 90,3
 
return (__s32)ch;
}
 
/** Ask keyboard if a key was pressed. */
void poll_keyboard(void)
{
char ch;
 
if (kb_disable)
return;
 
ch = ski_getchar();
if(ch == '\r')
ch = '\n';
if (ch)
chardev_push_character(&ski_console, ch);
}
 
/* Called from getc(). */
static void ski_kb_enable(chardev_t *)
{
kb_disable = false;
}
 
/* Called from getc(). */
static void ski_kb_disable(chardev_t *d)
{
kb_disable = true;
}
 
 
static chardev_operations_t ski_ops = {
.resume = ski_kb_enable,
.suspend = ski_kb_disable,
.write = ski_write
};
 
 
/** Initialize debug console
*
* Issue SSC (Simulator System Call) to
* to open debug console.
*/
void ski_init_console(void)
{
__asm__ (
"mov r15=%0\n"
"break 0x80000\n"
:
: "i" (SKI_INIT_CONSOLE)
: "r15", "r8"
);
 
chardev_initialize("ski_console", &ski_console, &ski_ops);
stdin = &ski_console;
stdout = &ski_console;
}