Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 894 → Rev 895

/kernel/trunk/arch/sparc64/include/interrupt.h
34,6 → 34,13
#define IVT_ITEMS 15
#define IVT_FIRST 1
 
/* Dummy macros. */
#define IRQ_KBD 2
#define VECTOR_KBD IRQ_KBD
 
#define trap_virtual_enable_irqs(x)
#define trap_virtual_eoi()
 
extern void interrupt_register(int n, const char *name, iroutine f);
 
#endif
/kernel/trunk/arch/sparc64/include/console.h
30,6 → 30,7
#define __sparc64_CONSOLE_H__
 
extern void kofwinput(void *arg);
extern void kkbdpoll(void *arg);
extern void ofw_sparc64_console_init(void);
extern void standalone_sparc64_console_init(void);
 
/kernel/trunk/arch/sparc64/include/drivers/keyboard.h
File deleted
/kernel/trunk/arch/sparc64/include/drivers/i8042.h
0,0 → 1,61
/*
* Copyright (C) 2006 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __sparc64_I8042_H__
#define __sparc64_I8042_H__
 
#include <arch/types.h>
 
#define KBD_PHYS_ADDRESS 0x1fff8904000ULL
#define KBD_VIRT_ADDRESS 0x00000d00000ULL
 
#define STATUS_REG 4
#define COMMAND_REG 4
#define DATA_REG 6
 
static inline void i8042_data_write(__u8 data)
{
((__u8 *)(KBD_VIRT_ADDRESS))[DATA_REG] = data;
}
 
static inline __u8 i8042_data_read(void)
{
return ((volatile __u8 *)(KBD_VIRT_ADDRESS))[DATA_REG];
}
 
static inline __u8 i8042_status_read(void)
{
return ((volatile __u8 *)(KBD_VIRT_ADDRESS))[STATUS_REG];
}
 
static inline void i8042_command_write(__u8 command)
{
((__u8 *)(KBD_VIRT_ADDRESS))[COMMAND_REG] = command;
}
 
#endif
/kernel/trunk/arch/sparc64/Makefile.inc
57,8 → 57,16
CONFIG_ASID = y
CONFIG_ASID_FIFO = y
 
## Compile with support for framebuffer.
#
 
CONFIG_FB = y
 
## Compile with support for i8042 controller.
#
 
CONFIG_I8042 = y
 
ARCH_SOURCES = \
arch/$(ARCH)/src/cpu/cpu.c \
arch/$(ARCH)/src/asm.S \
/kernel/trunk/arch/sparc64/src/console.c
31,7 → 31,8
#include <typedefs.h>
#include <genarch/fb/fb.h>
#include <arch/drivers/fb.h>
#include <arch/drivers/keyboard.h>
#include <arch/drivers/i8042.h>
#include <genarch/i8042/i8042.h>
#include <genarch/ofw/ofw.h>
#include <console/chardev.h>
#include <console/console.h>
40,6 → 41,8
#include <proc/thread.h>
#include <synch/mutex.h>
 
#define KEYBOARD_POLL_PAUSE 50000 /* 50ms */
 
static void ofw_sparc64_putchar(chardev_t *d, const char ch);
static char ofw_sparc64_getchar(chardev_t *d);
static void ofw_sparc64_suspend(chardev_t *d);
73,6 → 76,7
ofw_console_active = 0;
stdin = NULL;
fb_init(FB_VIRT_ADDRESS, FB_X_RES, FB_Y_RES, FB_COLOR_DEPTH/8);
i8042_init();
}
 
/** Write one character using OpenFirmware.
155,6 → 159,18
ch = '\n';
chardev_push_character(&ofw_sparc64_console, ch);
}
thread_usleep(25000);
thread_usleep(KEYBOARD_POLL_PAUSE);
}
}
 
/** Kernel thread for polling keyboard.
*
* @param arg Ignored.
*/
void kkbdpoll(void *arg)
{
while (1) {
i8042_poll();
thread_usleep(KEYBOARD_POLL_PAUSE);
}
}
/kernel/trunk/arch/sparc64/src/sparc64.c
61,6 → 61,14
if (!t)
panic("cannot create kofwinput\n");
thread_ready(t);
 
/*
* Create thread that polls keyboard.
*/
t = thread_create(kkbdpoll, NULL, TASK, 0);
if (!t)
panic("cannot create kkbdpoll\n");
thread_ready(t);
}
 
void calibrate_delay_loop(void)
/kernel/trunk/arch/sparc64/src/mm/tlb.c
42,7 → 42,7
#include <symtab.h>
 
#include <arch/drivers/fb.h>
#include <arch/drivers/keyboard.h>
#include <arch/drivers/i8042.h>
 
char *context_encoding[] = {
"Primary",
/kernel/trunk/arch/sparc64/src/start.S
101,6 → 101,8
call ofw_init_memmap
nop
 
wrpr %r0, 0, %pil
 
call main_bsp
nop