scvesactl.c (def802441f777c1283984bef358b7d8339004388) scvesactl.c (f1d19042b082d95f07a0027e596ba2405aa8a9a5)
1/*-
2 * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1998 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $Id: scvesactl.c,v 1.5 1998/09/26 03:38:40 yokota Exp $
26 * $Id: scvesactl.c,v 1.6 1998/10/01 11:39:17 yokota Exp $
27 */
28
29#include "sc.h"
30#include "opt_vesa.h"
31#include "opt_vm86.h"
32
33#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(VESA_MODULE)
34

--- 12 unchanged lines hidden (view full) ---

47
48static d_ioctl_t *prev_user_ioctl;
49
50static int
51vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
52{
53 scr_stat *scp;
54 struct tty *tp;
27 */
28
29#include "sc.h"
30#include "opt_vesa.h"
31#include "opt_vm86.h"
32
33#if (NSC > 0 && defined(VESA) && defined(VM86)) || defined(VESA_MODULE)
34

--- 12 unchanged lines hidden (view full) ---

47
48static d_ioctl_t *prev_user_ioctl;
49
50static int
51vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
52{
53 scr_stat *scp;
54 struct tty *tp;
55 video_info_t info;
56 video_adapter_t *adp;
57 int mode;
55 video_adapter_t *adp;
56 int mode;
58 int error;
59 int s;
60
61 tp = scdevtotty(dev);
62 if (!tp)
63 return ENXIO;
64 scp = sc_get_scr_stat(tp->t_dev);
65
66 switch (cmd) {
67

--- 11 unchanged lines hidden (view full) ---

79 case SW_VESA_C132x25:
80 case SW_VESA_C132x43:
81 case SW_VESA_C132x50:
82 case SW_VESA_C132x60:
83 adp = get_adapter(scp);
84 if (!(adp->va_flags & V_ADP_MODECHANGE))
85 return ENODEV;
86 mode = (cmd & 0xff) + M_VESA_BASE;
57
58 tp = scdevtotty(dev);
59 if (!tp)
60 return ENXIO;
61 scp = sc_get_scr_stat(tp->t_dev);
62
63 switch (cmd) {
64

--- 11 unchanged lines hidden (view full) ---

76 case SW_VESA_C132x25:
77 case SW_VESA_C132x43:
78 case SW_VESA_C132x50:
79 case SW_VESA_C132x60:
80 adp = get_adapter(scp);
81 if (!(adp->va_flags & V_ADP_MODECHANGE))
82 return ENODEV;
83 mode = (cmd & 0xff) + M_VESA_BASE;
87vesa_text:
88 return sc_set_text_mode(scp, tp, mode, 0, 0, 0);
89
90 /* graphics modes */
91 case SW_VESA_32K_320: case SW_VESA_64K_320:
92 case SW_VESA_FULL_320:
93
94 case SW_VESA_CG640x400:
95

--- 11 unchanged lines hidden (view full) ---

107
108 case SW_VESA_1280x1024: case SW_VESA_CG1280x1024:
109 case SW_VESA_32K_1280: case SW_VESA_64K_1280:
110 case SW_VESA_FULL_1280:
111 adp = get_adapter(scp);
112 if (!(adp->va_flags & V_ADP_MODECHANGE))
113 return ENODEV;
114 mode = (cmd & 0xff) + M_VESA_BASE;
84 return sc_set_text_mode(scp, tp, mode, 0, 0, 0);
85
86 /* graphics modes */
87 case SW_VESA_32K_320: case SW_VESA_64K_320:
88 case SW_VESA_FULL_320:
89
90 case SW_VESA_CG640x400:
91

--- 11 unchanged lines hidden (view full) ---

103
104 case SW_VESA_1280x1024: case SW_VESA_CG1280x1024:
105 case SW_VESA_32K_1280: case SW_VESA_64K_1280:
106 case SW_VESA_FULL_1280:
107 adp = get_adapter(scp);
108 if (!(adp->va_flags & V_ADP_MODECHANGE))
109 return ENODEV;
110 mode = (cmd & 0xff) + M_VESA_BASE;
115vesa_graphics:
116 return sc_set_graphics_mode(scp, tp, mode);
117 }
118
119 if (prev_user_ioctl)
120 return (*prev_user_ioctl)(dev, cmd, data, flag, p);
121 else
122 return ENOIOCTL;
123}

--- 22 unchanged lines hidden ---
111 return sc_set_graphics_mode(scp, tp, mode);
112 }
113
114 if (prev_user_ioctl)
115 return (*prev_user_ioctl)(dev, cmd, data, flag, p);
116 else
117 return ENOIOCTL;
118}

--- 22 unchanged lines hidden ---