Subversion Repositories shark

Rev

Rev 617 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
471 giacomo 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
 *   Giacomo Guidi       <giacomo@gandalf.sssup.it>
10
 *
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
 
1063 tullio 19
/*
20
 * This program is free software; you can redistribute it and/or modify
21
 * it under the terms of the GNU General Public License as published by
22
 * the Free Software Foundation; either version 2 of the License, or
23
 * (at your option) any later version.
24
 *
25
 * This program is distributed in the hope that it will be useful,
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28
 * GNU General Public License for more details.
29
 *
30
 * You should have received a copy of the GNU General Public License
31
 * along with this program; if not, write to the Free Software
32
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
33
 *
34
 */
35
 
471 giacomo 36
/* Glue Layer for Frame Buffer 2.6 Driver */
37
 
38
#include <kernel/kern.h>
39
 
473 giacomo 40
extern void fbmem_init(void);
471 giacomo 41
extern int fb_open_inode(int num);
42
extern int fb_close_inode(int num);
484 giacomo 43
extern int fb_set_mode_inode(int num, unsigned char *modeopt);
471 giacomo 44
 
617 giacomo 45
int FB_installed = FALSE;
46
 
471 giacomo 47
/* Init the Linux PCI 2.6 Driver */
48
int FB26_init() {
49
 
473 giacomo 50
  fbmem_init();
471 giacomo 51
 
52
  return 0;
53
 
54
}
55
 
56
int FB26_open(int num) {
57
 
472 giacomo 58
  if (fb_open_inode(num)) {
59
    printk("FB ERROR: Cannot open the FrameBuffer driver\n");
60
    return -1;
61
  }
471 giacomo 62
 
617 giacomo 63
  FB_installed = TRUE;
64
 
471 giacomo 65
  return 0;
66
 
67
}
68
 
484 giacomo 69
int FB26_setmode(int num, unsigned char *modeopt) {
472 giacomo 70
 
617 giacomo 71
  if (FB_installed == FALSE) return -1;
72
 
484 giacomo 73
  if (fb_set_mode_inode(num,modeopt)) {
472 giacomo 74
    printk("FB ERROR: Cannot set mode for FrameBuffer driver\n");
75
    return -1;
76
  }
77
 
78
  return 0;
79
 
80
}
81
 
471 giacomo 82
int FB26_close(int num) {
83
 
617 giacomo 84
  if (FB_installed == FALSE) return -1;
85
 
472 giacomo 86
  if (fb_close_inode(num)) {
87
    printk("FB ERROR: Cannot close the FrameBuffer driver\n");
88
    return -1;
89
  }
90
 
471 giacomo 91
  return 0;
92
 
93
}