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 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; |
75static tc_mmap_t vtterm_mmap; |
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, |
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 |
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; |
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 --- |