Subversion Repositories shark

Rev

Rev 519 | Rev 523 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
519 mauro 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Mauro Marinoni      <mauro.marinoni@unipv.it>
10
 *   (see the web pages for full authors list)
11
 *
12
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
13
 *
14
 * http://www.sssup.it
15
 * http://retis.sssup.it
16
 * http://shark.sssup.it
17
 */
18
 
19
/*
20
 * Copyright (C) 2000 Paolo Gai
21
 *
22
 * This program is free software; you can redistribute it and/or modify
23
 * it under the terms of the GNU General Public License as published by
24
 * the Free Software Foundation; either version 2 of the License, or
25
 * (at your option) any later version.
26
 *
27
 * This program is distributed in the hope that it will be useful,
28
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
 * GNU General Public License for more details.
31
 *
32
 * You should have received a copy of the GNU General Public License
33
 * along with this program; if not, write to the Free Software
34
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
35
 *
36
 */
37
 
38
#define __MOUSE_DEBUG__
39
 
40
#include <kernel/kern.h>
41
 
42
#include "../include/drivers/shark_input26.h"
43
#include "../include/drivers/shark_mouse26.h"
44
 
45
/* Devices */
46
extern int psmouse_init(void);
47
extern int psmouse_exit(void);
48
 
49
/* Handlers */
50
extern int  mouse_init(void);
51
extern void mouse_exit(void);
52
 
53
extern int input_installed;
54
 
55
/* Mouse driver currently installed */
56
static int mouse_installed = FALSE;
57
 
522 mauro 58
/*static short int mouse_lim_x1 = 0;
59
static short int mouse_lim_y1 = 0;
60
static short int mouse_lim_x2 = 79;
61
static short int mouse_lim_y2 = 24;
62
static short int mouse_x = 40;
63
static short int mouse_x_mick = 0;
64
static short int mouse_y = 12;
65
static short int mouse_y_mick = 0;
66
static short int mouse_buttons = 0;
67
static short int mouse_thresholdlim = 5;
519 mauro 68
 
522 mauro 69
static MOUSE_HANDLER mouse_handler = NULL;
70
static MOUSE_HANDLER user_mouse_handler = NULL;
519 mauro 71
 
522 mauro 72
static int autocursormode=DISABLE;
73
 
74
static PID mouse_pid = NIL;*/
75
 
76
 
519 mauro 77
/*
78
 * Start mouseProc Task
79
 */
80
void shark_mouse_task(void)
81
{
82
        //task_activate(mousebpid);
83
}
84
 
85
 
86
/* Init the Linux Speaker Driver */
522 mauro 87
/*int MOUSE26_init(MOUSE_PARMS *s)*/
519 mauro 88
int MOUSE26_init(void)
89
{
522 mauro 90
        /*MOUSE_PARMS mparms=BASE_MOUSE;
91
        TASK_MODEL *m;
92
        SOFT_TASK_MODEL base_m;*/
519 mauro 93
        int status = 0;
94
 
95
        if (mouse_installed == TRUE) return 0;
96
 
522 mauro 97
        /* if a NULL is passed */
98
        /*if (s == NULL)
99
                s = &mparms;
100
 
101
        if (s->tm == (TASK_MODEL *)MOUSE_DEFAULT) {
102
                soft_task_default_model(base_m);
103
                soft_task_def_wcet(base_m,2000);
104
                soft_task_def_met(base_m,500);
105
                soft_task_def_period(base_m,8000);
106
                soft_task_def_system(base_m);
107
                soft_task_def_nokill(base_m);
108
                soft_task_def_aperiodic(base_m);
109
                m = (TASK_MODEL *)&base_m;
110
        } else
111
                m = parms->tm;*/
112
 
519 mauro 113
        if (input_installed == FALSE) {
114
                status = INPUT26_init();
115
                if (status) {
116
                        printk(KERN_ERR "shark_mouse.c: Unable to open Input SubSystem.\n");
117
                        return -1;
118
                }
119
        }
120
 
121
        status = psmouse_init();
122
        if (status) {
123
                printk(KERN_ERR "shark_mouse.c: PsMouse_Init return: %d\n", status);
124
                return -1;
125
        }
126
 
127
        status = mouse_init();
128
        if (status) {
129
                printk(KERN_ERR "shark_mouse.c: Mouse_Init return: %d\n", status);
130
                return -1;
131
        }
132
 
133
        mouse_installed = TRUE;
134
 
135
        return status;
136
}
137
 
138
int MOUSE26_close()
139
{
140
        if (!mouse_installed)
141
                return -1;
142
 
143
        mouse_exit();
144
        psmouse_exit();
145
 
146
        mouse_installed = FALSE;
147
 
148
        return 0;
149
}
150