Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 1895 → Rev 1896

/trunk/kernel/arch/sparc64/src/console.c
53,7 → 53,10
#include <proc/thread.h>
#include <arch/mm/tlb.h>
#include <arch/boot/boot.h>
#include <genarch/ofw/ofw_tree.h>
#include <arch.h>
#include <panic.h>
#include <print.h>
 
#define KEYBOARD_POLL_PAUSE 50000 /* 50ms */
 
62,16 → 65,37
{
stdin = NULL;
ofw_tree_node_t *aliases;
ofw_tree_property_t *prop;
ofw_tree_node_t *screen;
ofw_tree_node_t *keyboard;
aliases = ofw_tree_lookup("/aliases");
if (!aliases)
panic("Can't find /aliases.\n");
prop = ofw_tree_getprop(aliases, "screen");
if (!prop)
panic("Can't find property \"screen\".\n");
if (!prop->value)
panic("Can't find screen alias.\n");
screen = ofw_tree_lookup(prop->value);
if (!screen)
panic("Can't find %s\n", prop->value);
 
fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height,
bootinfo.screen.bpp, bootinfo.screen.scanline, true);
 
#ifdef KBD_ADDR_OVRD
if (!bootinfo.keyboard.addr)
bootinfo.keyboard.addr = KBD_ADDR_OVRD;
#endif
prop = ofw_tree_getprop(aliases, "keyboard");
if (!prop)
panic("Can't find property \"keyboard\".\n");
if (!prop->value)
panic("Can't find keyboard alias.\n");
keyboard = ofw_tree_lookup(prop->value);
if (!keyboard)
panic("Can't find %s\n", prop->value);
 
if (bootinfo.keyboard.addr)
kbd_init();
kbd_init(keyboard);
}
 
/** Kernel thread for polling keyboard.
82,14 → 106,14
{
thread_detach(THREAD);
 
if (!bootinfo.keyboard.addr)
#ifdef CONFIG_Z8530
if (kbd_type == KBD_Z8530)
return;
#endif
while (1) {
#ifdef CONFIG_Z8530
return;
#endif
#ifdef CONFIG_NS16550
if (kbd_type == KBD_NS16550)
ns16550_poll();
#endif
thread_usleep(KEYBOARD_POLL_PAUSE);
102,6 → 126,7
void arch_grab_console(void)
{
#ifdef CONFIG_Z8530
if (kbd_type == KBD_Z8530)
z8530_grab();
#endif
}
112,6 → 137,7
void arch_release_console(void)
{
#ifdef CONFIG_Z8530
if (kbd_type == KBD_Z8530)
z8530_release();
#endif
}