Deleted Added
full compact
vt_core.c (259727) vt_core.c (259777)
1/*-
2 * Copyright (c) 2009, 2013 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Ed Schouten under sponsorship from the
6 * FreeBSD Foundation.
7 *
8 * Portions of this software were developed by Oleksandr Rybalko

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

26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009, 2013 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Ed Schouten under sponsorship from the
6 * FreeBSD Foundation.
7 *
8 * Portions of this software were developed by Oleksandr Rybalko

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

26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/vt/vt_core.c 259727 2013-12-22 15:33:15Z ray $");
34__FBSDID("$FreeBSD: head/sys/dev/vt/vt_core.c 259777 2013-12-23 18:09:10Z ray $");
35
36#include "opt_compat.h"
37
38#include <sys/param.h>
39#include <sys/consio.h>
40#include <sys/eventhandler.h>
41#include <sys/fbio.h>
42#include <sys/kbio.h>

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

67static tc_param_t vtterm_param;
68static tc_done_t vtterm_done;
69
70static tc_cnprobe_t vtterm_cnprobe;
71static tc_cngetc_t vtterm_cngetc;
72
73static tc_opened_t vtterm_opened;
74static tc_ioctl_t vtterm_ioctl;
35
36#include "opt_compat.h"
37
38#include <sys/param.h>
39#include <sys/consio.h>
40#include <sys/eventhandler.h>
41#include <sys/fbio.h>
42#include <sys/kbio.h>

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

67static tc_param_t vtterm_param;
68static tc_done_t vtterm_done;
69
70static tc_cnprobe_t vtterm_cnprobe;
71static tc_cngetc_t vtterm_cngetc;
72
73static tc_opened_t vtterm_opened;
74static tc_ioctl_t vtterm_ioctl;
75static tc_mmap_t vtterm_mmap;
75
76const struct terminal_class vt_termclass = {
77 .tc_bell = vtterm_bell,
78 .tc_cursor = vtterm_cursor,
79 .tc_putchar = vtterm_putchar,
80 .tc_fill = vtterm_fill,
81 .tc_copy = vtterm_copy,
82 .tc_param = vtterm_param,
83 .tc_done = vtterm_done,
84
85 .tc_cnprobe = vtterm_cnprobe,
86 .tc_cngetc = vtterm_cngetc,
87
88 .tc_opened = vtterm_opened,
89 .tc_ioctl = vtterm_ioctl,
76
77const struct terminal_class vt_termclass = {
78 .tc_bell = vtterm_bell,
79 .tc_cursor = vtterm_cursor,
80 .tc_putchar = vtterm_putchar,
81 .tc_fill = vtterm_fill,
82 .tc_copy = vtterm_copy,
83 .tc_param = vtterm_param,
84 .tc_done = vtterm_done,
85
86 .tc_cnprobe = vtterm_cnprobe,
87 .tc_cngetc = vtterm_cngetc,
88
89 .tc_opened = vtterm_opened,
90 .tc_ioctl = vtterm_ioctl,
91 .tc_mmap = vtterm_mmap,
90};
91
92/*
93 * Use a constant timer of 25 Hz to redraw the screen.
94 *
95 * XXX: In theory we should only fire up the timer when there is really
96 * activity. Unfortunately we cannot always start timers. We really
97 * don't want to process kernel messages synchronously, because it

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

1343 case VT_MOUSE_SHOW:
1344 vw->vw_flags &= ~VWF_MOUSE_HIDE;
1345 break;
1346 }
1347}
1348#endif
1349
1350static int
92};
93
94/*
95 * Use a constant timer of 25 Hz to redraw the screen.
96 *
97 * XXX: In theory we should only fire up the timer when there is really
98 * activity. Unfortunately we cannot always start timers. We really
99 * don't want to process kernel messages synchronously, because it

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

1345 case VT_MOUSE_SHOW:
1346 vw->vw_flags &= ~VWF_MOUSE_HIDE;
1347 break;
1348 }
1349}
1350#endif
1351
1352static int
1353vtterm_mmap(struct terminal *tm, vm_ooffset_t offset, vm_paddr_t * paddr,
1354 int nprot, vm_memattr_t *memattr)
1355{
1356 struct vt_window *vw = tm->tm_softc;
1357 struct vt_device *vd = vw->vw_device;
1358
1359 if (vd->vd_driver->vd_fb_mmap)
1360 return (vd->vd_driver->vd_fb_mmap(vd, offset, paddr, nprot,
1361 memattr));
1362
1363 return (ENXIO);
1364}
1365
1366static int
1351vtterm_ioctl(struct terminal *tm, u_long cmd, caddr_t data,
1352 struct thread *td)
1353{
1354 struct vt_window *vw = tm->tm_softc;
1355 struct vt_device *vd = vw->vw_device;
1356 keyboard_t *kbd;
1357 int error, i, s;
1358#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \

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

1469 }
1470 mtx_unlock(&Giant);
1471 }
1472 return (0);
1473 default:
1474 return (EINVAL);
1475 }
1476 }
1367vtterm_ioctl(struct terminal *tm, u_long cmd, caddr_t data,
1368 struct thread *td)
1369{
1370 struct vt_window *vw = tm->tm_softc;
1371 struct vt_device *vd = vw->vw_device;
1372 keyboard_t *kbd;
1373 int error, i, s;
1374#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \

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

1485 }
1486 mtx_unlock(&Giant);
1487 }
1488 return (0);
1489 default:
1490 return (EINVAL);
1491 }
1492 }
1493 case FBIOGTYPE:
1494 case FBIO_GETWINORG: /* get frame buffer window origin */
1495 case FBIO_GETDISPSTART: /* get display start address */
1496 case FBIO_GETLINEWIDTH: /* get scan line width in bytes */
1497 case FBIO_BLANK: /* blank display */
1498 if (vd->vd_driver->vd_fb_ioctl)
1499 return (vd->vd_driver->vd_fb_ioctl(vd, cmd, data, td));
1500 break;
1477 case CONS_BLANKTIME:
1478 /* XXX */
1479 return (0);
1480 case CONS_GET:
1481 /* XXX */
1482 *(int *)data = M_CG640x480;
1483 return (0);
1484 case CONS_GETINFO: {

--- 432 unchanged lines hidden ---
1501 case CONS_BLANKTIME:
1502 /* XXX */
1503 return (0);
1504 case CONS_GET:
1505 /* XXX */
1506 *(int *)data = M_CG640x480;
1507 return (0);
1508 case CONS_GETINFO: {

--- 432 unchanged lines hidden ---