Commit 1225fb90 authored by David S. Miller's avatar David S. Miller

SPARC: More keyboard/mouse/serial layer cleanups and build fixes.

parent db7bfefd
......@@ -740,10 +740,8 @@ void handler_irq(int irq, struct pt_regs *regs)
irq_enter();
kstat.irqs[cpu][irq]++;
#ifdef CONFIG_PCI
if (irq == 9)
kbd_pt_regs = regs;
#endif
/* Sliiiick... */
#ifndef CONFIG_SMP
......
......@@ -29,6 +29,7 @@
#include <linux/inet.h>
#include <linux/console.h>
#include <linux/root_dev.h>
#include <linux/interrupt.h>
#include <asm/segment.h>
#include <asm/system.h>
......@@ -691,6 +692,8 @@ struct seq_operations cpuinfo_op = {
.show = show_cpuinfo,
};
extern int stop_a_enabled;
void sun_do_break(void)
{
if (!stop_a_enabled)
......@@ -701,3 +704,20 @@ void sun_do_break(void)
prom_cmdline();
}
#ifdef CONFIG_MAGIC_SYSRQ
/* Because we use the generic input layer keyboard drivers for
* everything, this PC sysrq translation table is all we need.
*/
unsigned char kbd_sysrq_xlate[128] =
"\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
"qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
"dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
"bnm,./\000*\000 \000\201\202\203\204\205" /* 0x30 - 0x3f */
"\206\207\210\211\212\000\000789-456+1" /* 0x40 - 0x4f */
"230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
"\r\000/"; /* 0x60 - 0x6f */
#endif
int serial_console;
int stop_a_enabled = 1;
......@@ -364,6 +364,9 @@ EXPORT_SYMBOL_NOVERS(VISenter);
/* for input/keybdev */
EXPORT_SYMBOL(sun_do_break);
EXPORT_SYMBOL(serial_console);
EXPORT_SYMBOL(stop_a_enabled);
EXPORT_SYMBOL(kbd_pt_regs);
#ifdef CONFIG_DEBUG_BUGVERBOSE
EXPORT_SYMBOL(do_BUG);
......
......@@ -108,14 +108,18 @@ ifeq ($(CONFIG_QTRONIX_KEYBOARD),y)
KEYMAP = qtronixmap.o
endif
ifeq ($(CONFIG_SPARC32),y)
KEYBD =
endif
ifeq ($(CONFIG_SPARC64),y)
KEYBD =
endif
obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o
#obj-$(CONFIG_SERIAL) += $(SERIAL) # Fix for decserial.o
ifndef CONFIG_SUN_KEYBOARD
obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
else
obj-$(CONFIG_PCI) += keyboard.o $(KEYMAP)
endif
obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
......
......@@ -23,12 +23,8 @@
#include "suncore.h"
int serial_console;
int stop_a_enabled = 1;
int sunserial_current_minor = 64;
EXPORT_SYMBOL(serial_console);
EXPORT_SYMBOL(stop_a_enabled);
EXPORT_SYMBOL(sunserial_current_minor);
void
......
......@@ -22,17 +22,8 @@
extern unsigned int suncore_mouse_baud_cflag_next(unsigned int, int *);
extern int suncore_mouse_baud_detection(unsigned char, int);
extern struct pt_regs *kbd_pt_regs;
extern int serial_console;
extern int stop_a_enabled;
extern int sunserial_current_minor;
static __inline__ int con_is_present(void)
{
return serial_console ? 0 : 1;
}
extern void sunserial_console_termios(struct console *);
#endif /* !(_SERIAL_SUN_H) */
......@@ -86,10 +86,6 @@ static struct tty_struct *sab82532_table[NR_PORTS];
static struct termios *sab82532_termios[NR_PORTS];
static struct termios *sab82532_termios_locked[NR_PORTS];
#ifdef MODULE
#undef CONFIG_SERIAL_CONSOLE
#endif
#ifdef CONFIG_SERIAL_CONSOLE
extern int serial_console;
static struct console sab82532_console;
......@@ -465,7 +461,7 @@ static void check_status(struct sab82532 *info,
if (stat->sreg.isr1 & SAB82532_ISR1_BRK) {
#ifdef CONFIG_SERIAL_CONSOLE
if (info->is_console) {
batten_down_hatches(info);
sun_do_break(info);
return;
}
#endif
......@@ -874,7 +870,6 @@ static void shutdown(struct sab82532 *info)
info->xmit.buf = 0;
}
#ifdef CONFIG_SERIAL_CONSOLE
if (info->is_console) {
info->interrupt_mask0 = SAB82532_IMR0_PERR | SAB82532_IMR0_FERR |
SAB82532_IMR0_PLLA | SAB82532_IMR0_CDSC;
......@@ -890,7 +885,6 @@ static void shutdown(struct sab82532 *info)
restore_flags(flags);
return;
}
#endif
/* Disable Interrupts */
info->interrupt_mask0 = 0xff;
......@@ -2460,48 +2454,6 @@ void cleanup_module(void)
#endif /* MODULE */
#ifdef CONFIG_SERIAL_CONSOLE
static void
batten_down_hatches(struct sab82532 *info)
{
unsigned char saved_rfc, tmp;
if (!stop_a_enabled)
return;
/* If we are doing kadb, we call the debugger
* else we just drop into the boot monitor.
* Note that we must flush the user windows
* first before giving up control.
*/
printk("\n");
flush_user_windows();
/*
* Set FIFO to single character mode.
*/
saved_rfc = readb(&info->regs->r.rfc);
tmp = readb(&info->regs->rw.rfc);
tmp &= ~(SAB82532_RFC_RFDF);
writeb(tmp, &info->regs->rw.rfc);
sab82532_cec_wait(info);
writeb(SAB82532_CMDR_RRES, &info->regs->w.cmdr);
#ifndef __sparc_v9__
if ((((unsigned long)linux_dbvec) >= DEBUG_FIRSTVADDR) &&
(((unsigned long)linux_dbvec) <= DEBUG_LASTVADDR))
sp_enter_debugger();
else
#endif
prom_cmdline();
/*
* Reset FIFO to character + status mode.
*/
writeb(saved_rfc, &info->regs->w.rfc);
sab82532_cec_wait(info);
writeb(SAB82532_CMDR_RRES, &info->regs->w.cmdr);
}
static __inline__ void
sab82532_console_putchar(struct sab82532 *info, char c)
{
......
......@@ -13,38 +13,21 @@
#ifdef __KERNEL__
#include <linux/kernel.h>
#include <linux/kd.h>
#define KEYBOARD_IRQ 1
#define DISABLE_KBD_DURING_INTERRUPTS 0
extern int pcikbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int pcikbd_getkeycode(unsigned int scancode);
extern int pcikbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char pcikbd_unexpected_up(unsigned char keycode);
extern void pcikbd_leds(unsigned char leds);
extern void pcikbd_init_hw(void);
extern unsigned char pcikbd_sysrq_xlate[128];
#define kbd_setkeycode pcikbd_setkeycode
#define kbd_getkeycode pcikbd_getkeycode
#define kbd_translate pcikbd_translate
#define kbd_unexpected_up pcikbd_unexpected_up
#define kbd_leds pcikbd_leds
#define kbd_init_hw pcikbd_init_hw
#define kbd_sysrq_xlate pcikbd_sysrq_xlate
#define kbd_init pcikbd_init
#define compute_shiftstate pci_compute_shiftstate
#define getkeycode pci_getkeycode
#define setkeycode pci_setkeycode
#define getledstate pci_getledstate
#define setledstate pci_setledstate
#define register_leds pci_register_leds
/* We use the generic input layer for keyboard handling, thus
* some of this stuff should never be invoked.
*/
#define kbd_setkeycode(scancode, keycode) (BUG(), 0)
#define kbd_getkeycode(scancode) (BUG(), 0)
#define kbd_translate(keycode, keycodep, raw_mode) \
({ *(keycodep) = scancode; 1; })
#define kbd_unexpected_up(keycode) (0200)
#define kbd_leds(leds) do { } while (0)
#define kbd_init_hw() do { } while (0)
#define SYSRQ_KEY 0x54
extern unsigned char kbd_sysrq_xlate[128];
#endif /* __KERNEL__ */
......
......@@ -121,6 +121,15 @@ enum sparc_cpu {
#ifndef __ASSEMBLY__
extern void sun_do_break(void);
extern int serial_console;
extern int stop_a_enabled;
static __inline__ int con_is_present(void)
{
return serial_console ? 0 : 1;
}
extern struct pt_regs *kbd_pt_regs;
extern void synchronize_user_stack(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment