OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [armnommu/] [drivers/] [char/] [mouse_rpc.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1622 jcastillo
#include <linux/module.h>
2
#include <linux/ptrace.h>
3
#include <linux/interrupt.h>
4
#include <linux/sched.h>
5
 
6
#include <asm/hardware.h>
7
#include <asm/irq.h>
8
#include <asm/io.h>
9
 
10
#include "mouse.h"
11
 
12
static short old_x, old_y, old_b;
13
 
14
void mouse_rpc_irq (int irq, void *dev_id, struct pt_regs *regs)
15
{
16
        short x, y, b, dx, dy, db;
17
 
18
        x = (short)inl(IOMD_MOUSEX);
19
        y = (short)inl(IOMD_MOUSEY);
20
        b = (inl (0x800C4000) >> 4) & 7;
21
 
22
        dx = x - old_x;
23
        old_x = x;
24
        dy = y - old_y;
25
        old_y = y;
26
        db = b ^ old_b;
27
        old_b = b;
28
 
29
        if (dx || dy)
30
                add_mouse_movement(dx, dy);
31
        if (db)
32
                add_mouse_buttonchange(7, b);
33
}
34
 
35
void mouse_rpc_init(void)
36
{
37
        old_x = (short)inl(IOMD_MOUSEX);
38
        old_y = (short)inl(IOMD_MOUSEY);
39
        old_b = (inl (0x800C4000) >> 4) & 7;
40
        request_irq (IRQ_VSYNCPULSE, mouse_rpc_irq, SA_SHIRQ, "mouse", NULL);
41
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.