Subversion Repositories shark

Rev

Rev 484 | Go to most recent revision | 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
 
19
/* Glue Layer for Frame Buffer 2.6 Driver */
20
 
21
#include <kernel/kern.h>
22
 
473 giacomo 23
extern void fbmem_init(void);
471 giacomo 24
extern int fb_open_inode(int num);
25
extern int fb_close_inode(int num);
484 giacomo 26
extern int fb_set_mode_inode(int num, unsigned char *modeopt);
471 giacomo 27
 
617 giacomo 28
int FB_installed = FALSE;
29
 
471 giacomo 30
/* Init the Linux PCI 2.6 Driver */
31
int FB26_init() {
32
 
473 giacomo 33
  fbmem_init();
471 giacomo 34
 
35
  return 0;
36
 
37
}
38
 
39
int FB26_open(int num) {
40
 
472 giacomo 41
  if (fb_open_inode(num)) {
42
    printk("FB ERROR: Cannot open the FrameBuffer driver\n");
43
    return -1;
44
  }
471 giacomo 45
 
617 giacomo 46
  FB_installed = TRUE;
47
 
471 giacomo 48
  return 0;
49
 
50
}
51
 
484 giacomo 52
int FB26_setmode(int num, unsigned char *modeopt) {
472 giacomo 53
 
617 giacomo 54
  if (FB_installed == FALSE) return -1;
55
 
484 giacomo 56
  if (fb_set_mode_inode(num,modeopt)) {
472 giacomo 57
    printk("FB ERROR: Cannot set mode for FrameBuffer driver\n");
58
    return -1;
59
  }
60
 
61
  return 0;
62
 
63
}
64
 
471 giacomo 65
int FB26_close(int num) {
66
 
617 giacomo 67
  if (FB_installed == FALSE) return -1;
68
 
472 giacomo 69
  if (fb_close_inode(num)) {
70
    printk("FB ERROR: Cannot close the FrameBuffer driver\n");
71
    return -1;
72
  }
73
 
471 giacomo 74
  return 0;
75
 
76
}