aboutsummaryrefslogtreecommitdiffstats
path: root/fbtools.c
diff options
context:
space:
mode:
Diffstat (limited to 'fbtools.c')
-rw-r--r--fbtools.c74
1 files changed, 1 insertions, 73 deletions
diff --git a/fbtools.c b/fbtools.c
index 1518711..08ac41f 100644
--- a/fbtools.c
+++ b/fbtools.c
@@ -32,11 +32,6 @@ static const char *strsignal(int signr)
#endif
/* -------------------------------------------------------------------- */
-/* exported stuff */
-
-int fb_switch_state = FB_ACTIVE;
-
-/* -------------------------------------------------------------------- */
/* internal variables */
static struct fb_fix_screeninfo fb_fix;
@@ -47,7 +42,6 @@ static int fb_mem_offset = 0;
static int fb,tty;
static int orig_vt_no = 0;
-static struct vt_mode vt_mode;
static int kd_mode;
static struct vt_mode vt_omode;
@@ -118,73 +112,6 @@ static void fb_set_palette(void)
}
/* -------------------------------------------------------------------- */
-/* console switching */
-
-extern int debug;
-
-static void
-fb_switch_signal(int signal)
-{
- if (signal == SIGUSR1) {
- /* release */
- fb_switch_state = FB_REL_REQ;
- if (debug)
- write(2,"vt: SIGUSR1\n",12);
- }
- if (signal == SIGUSR2) {
- /* acquisition */
- fb_switch_state = FB_ACQ_REQ;
- if (debug)
- write(2,"vt: SIGUSR2\n",12);
- }
-}
-
-void
-fb_switch_release()
-{
- ioctl(tty, VT_RELDISP, 1);
- fb_switch_state = FB_INACTIVE;
- if (debug)
- write(2,"vt: release\n",12);
-}
-
-void
-fb_switch_acquire()
-{
- ioctl(tty, VT_RELDISP, VT_ACKACQ);
- fb_switch_state = FB_ACTIVE;
- if (debug)
- write(2,"vt: acquire\n",12);
-}
-
-int
-fb_switch_init()
-{
- struct sigaction act,old;
-
- memset(&act,0,sizeof(act));
- act.sa_handler = fb_switch_signal;
- sigemptyset(&act.sa_mask);
- sigaction(SIGUSR1,&act,&old);
- sigaction(SIGUSR2,&act,&old);
-
- if (-1 == ioctl(tty,VT_GETMODE, &vt_mode)) {
- perror("ioctl VT_GETMODE");
- exit(1);
- }
- vt_mode.mode = VT_PROCESS;
- vt_mode.waitv = 0;
- vt_mode.relsig = SIGUSR1;
- vt_mode.acqsig = SIGUSR2;
-
- if (-1 == ioctl(tty,VT_SETMODE, &vt_mode)) {
- perror("ioctl VT_SETMODE");
- exit(1);
- }
- return 0;
-}
-
-/* -------------------------------------------------------------------- */
/* initialisation & cleanup */
static void
@@ -534,6 +461,7 @@ gfxstate* fb_init(char *device, char *mode, int vt)
gfx->cleanup_display = fb_cleanup_display;
gfx->fb_fd = fb;
+ gfx->tty_fd = tty;
return gfx;
err: