#include <linux/module.h>
|
#include <linux/module.h>
|
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
#include <linux/sched.h>
|
#include <linux/sched.h>
|
|
|
#include <asm/hardware.h>
|
#include <asm/hardware.h>
|
#include <asm/irq.h>
|
#include <asm/irq.h>
|
#include <asm/io.h>
|
#include <asm/io.h>
|
|
|
#include "mouse.h"
|
#include "mouse.h"
|
|
|
static short old_x, old_y, old_b;
|
static short old_x, old_y, old_b;
|
|
|
void mouse_rpc_irq (int irq, void *dev_id, struct pt_regs *regs)
|
void mouse_rpc_irq (int irq, void *dev_id, struct pt_regs *regs)
|
{
|
{
|
short x, y, b, dx, dy, db;
|
short x, y, b, dx, dy, db;
|
|
|
x = (short)inl(IOMD_MOUSEX);
|
x = (short)inl(IOMD_MOUSEX);
|
y = (short)inl(IOMD_MOUSEY);
|
y = (short)inl(IOMD_MOUSEY);
|
b = (inl (0x800C4000) >> 4) & 7;
|
b = (inl (0x800C4000) >> 4) & 7;
|
|
|
dx = x - old_x;
|
dx = x - old_x;
|
old_x = x;
|
old_x = x;
|
dy = y - old_y;
|
dy = y - old_y;
|
old_y = y;
|
old_y = y;
|
db = b ^ old_b;
|
db = b ^ old_b;
|
old_b = b;
|
old_b = b;
|
|
|
if (dx || dy)
|
if (dx || dy)
|
add_mouse_movement(dx, dy);
|
add_mouse_movement(dx, dy);
|
if (db)
|
if (db)
|
add_mouse_buttonchange(7, b);
|
add_mouse_buttonchange(7, b);
|
}
|
}
|
|
|
void mouse_rpc_init(void)
|
void mouse_rpc_init(void)
|
{
|
{
|
old_x = (short)inl(IOMD_MOUSEX);
|
old_x = (short)inl(IOMD_MOUSEX);
|
old_y = (short)inl(IOMD_MOUSEY);
|
old_y = (short)inl(IOMD_MOUSEY);
|
old_b = (inl (0x800C4000) >> 4) & 7;
|
old_b = (inl (0x800C4000) >> 4) & 7;
|
request_irq (IRQ_VSYNCPULSE, mouse_rpc_irq, SA_SHIRQ, "mouse", NULL);
|
request_irq (IRQ_VSYNCPULSE, mouse_rpc_irq, SA_SHIRQ, "mouse", NULL);
|
}
|
}
|
|
|