Subversion Repositories shark

Rev

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

/*
 * Project: S.Ha.R.K.
 *
 * Coordinators:
 *   Giorgio Buttazzo    <giorgio@sssup.it>
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *
 * Authors     :
 *   Mauro Marinoni      <mauro.marinoni@unipv.it>
 *   (see the web pages for full authors list)
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://shark.sssup.it
 */


/*
 * Copyright (C) 2000 Paolo Gai
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */


#define __MOUSE_DEBUG__

#include <kernel/kern.h>

#include "../include/drivers/shark_input26.h"
#include "../include/drivers/shark_mouse26.h"

/* Devices */
extern int psmouse_init(void);
extern int psmouse_exit(void);

/* Handlers */
extern int  mouse_init(void);
extern void mouse_exit(void);

extern int input_installed;

/* Mouse driver currently installed */
static int mouse_installed = FALSE;

/*static short int mouse_lim_x1 = 0;
static short int mouse_lim_y1 = 0;
static short int mouse_lim_x2 = 79;
static short int mouse_lim_y2 = 24;
static short int mouse_x = 40;
static short int mouse_x_mick = 0;
static short int mouse_y = 12;
static short int mouse_y_mick = 0;
static short int mouse_buttons = 0;
static short int mouse_thresholdlim = 5;

static MOUSE_HANDLER mouse_handler = NULL;
static MOUSE_HANDLER user_mouse_handler = NULL;

static int autocursormode=DISABLE;

static PID mouse_pid = NIL;*/



/*
 * Start mouseProc Task
 */

void shark_mouse_task(void)
{
        //task_activate(mousebpid);
}


/* Init the Linux Speaker Driver */
/*int MOUSE26_init(MOUSE_PARMS *s)*/
int MOUSE26_init(void)
{
        /*MOUSE_PARMS mparms=BASE_MOUSE;
        TASK_MODEL *m;
        SOFT_TASK_MODEL base_m;*/

        int status = 0;

        if (mouse_installed == TRUE) return 0;

        /* if a NULL is passed */
        /*if (s == NULL)
                s = &mparms;

        if (s->tm == (TASK_MODEL *)MOUSE_DEFAULT) {
                soft_task_default_model(base_m);
                soft_task_def_wcet(base_m,2000);
                soft_task_def_met(base_m,500);
                soft_task_def_period(base_m,8000);
                soft_task_def_system(base_m);
                soft_task_def_nokill(base_m);
                soft_task_def_aperiodic(base_m);
                m = (TASK_MODEL *)&base_m;
        } else
                m = parms->tm;*/


        if (input_installed == FALSE) {
                status = INPUT26_init();
                if (status) {
                        printk(KERN_ERR "shark_mouse.c: Unable to open Input SubSystem.\n");
                        return -1;
                }
        }

        status = psmouse_init();
        if (status) {
                printk(KERN_ERR "shark_mouse.c: PsMouse_Init return: %d\n", status);
                return -1;
        }

        status = mouse_init();
        if (status) {
                printk(KERN_ERR "shark_mouse.c: Mouse_Init return: %d\n", status);
                return -1;
        }
       
        mouse_installed = TRUE;
       
        return status;
}

int MOUSE26_close()
{
        if (!mouse_installed)
                return -1;

        mouse_exit();
        psmouse_exit();
       
        mouse_installed = FALSE;
       
        return 0;
}