1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2*4882a593Smuzhiyun #ifndef _UAPI_LINUX_VT_H 3*4882a593Smuzhiyun #define _UAPI_LINUX_VT_H 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun /* 7*4882a593Smuzhiyun * These constants are also useful for user-level apps (e.g., VC 8*4882a593Smuzhiyun * resizing). 9*4882a593Smuzhiyun */ 10*4882a593Smuzhiyun #define MIN_NR_CONSOLES 1 /* must be at least 1 */ 11*4882a593Smuzhiyun #define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ 12*4882a593Smuzhiyun /* Note: the ioctl VT_GETSTATE does not work for 13*4882a593Smuzhiyun consoles 16 and higher (since it returns a short) */ 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun /* 0x56 is 'V', to avoid collision with termios and kd */ 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun #define VT_OPENQRY 0x5600 /* find available vt */ 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun struct vt_mode { 20*4882a593Smuzhiyun char mode; /* vt mode */ 21*4882a593Smuzhiyun char waitv; /* if set, hang on writes if not active */ 22*4882a593Smuzhiyun short relsig; /* signal to raise on release req */ 23*4882a593Smuzhiyun short acqsig; /* signal to raise on acquisition */ 24*4882a593Smuzhiyun short frsig; /* unused (set to 0) */ 25*4882a593Smuzhiyun }; 26*4882a593Smuzhiyun #define VT_GETMODE 0x5601 /* get mode of active vt */ 27*4882a593Smuzhiyun #define VT_SETMODE 0x5602 /* set mode of active vt */ 28*4882a593Smuzhiyun #define VT_AUTO 0x00 /* auto vt switching */ 29*4882a593Smuzhiyun #define VT_PROCESS 0x01 /* process controls switching */ 30*4882a593Smuzhiyun #define VT_ACKACQ 0x02 /* acknowledge switch */ 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun struct vt_stat { 33*4882a593Smuzhiyun unsigned short v_active; /* active vt */ 34*4882a593Smuzhiyun unsigned short v_signal; /* signal to send */ 35*4882a593Smuzhiyun unsigned short v_state; /* vt bitmask */ 36*4882a593Smuzhiyun }; 37*4882a593Smuzhiyun #define VT_GETSTATE 0x5603 /* get global vt state info */ 38*4882a593Smuzhiyun #define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */ 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun #define VT_RELDISP 0x5605 /* release display */ 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun #define VT_ACTIVATE 0x5606 /* make vt active */ 43*4882a593Smuzhiyun #define VT_WAITACTIVE 0x5607 /* wait for vt active */ 44*4882a593Smuzhiyun #define VT_DISALLOCATE 0x5608 /* free memory associated to vt */ 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun struct vt_sizes { 47*4882a593Smuzhiyun unsigned short v_rows; /* number of rows */ 48*4882a593Smuzhiyun unsigned short v_cols; /* number of columns */ 49*4882a593Smuzhiyun unsigned short v_scrollsize; /* number of lines of scrollback */ 50*4882a593Smuzhiyun }; 51*4882a593Smuzhiyun #define VT_RESIZE 0x5609 /* set kernel's idea of screensize */ 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun struct vt_consize { 54*4882a593Smuzhiyun unsigned short v_rows; /* number of rows */ 55*4882a593Smuzhiyun unsigned short v_cols; /* number of columns */ 56*4882a593Smuzhiyun unsigned short v_vlin; /* number of pixel rows on screen */ 57*4882a593Smuzhiyun unsigned short v_clin; /* number of pixel rows per character */ 58*4882a593Smuzhiyun unsigned short v_vcol; /* number of pixel columns on screen */ 59*4882a593Smuzhiyun unsigned short v_ccol; /* number of pixel columns per character */ 60*4882a593Smuzhiyun }; 61*4882a593Smuzhiyun #define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */ 62*4882a593Smuzhiyun #define VT_LOCKSWITCH 0x560B /* disallow vt switching */ 63*4882a593Smuzhiyun #define VT_UNLOCKSWITCH 0x560C /* allow vt switching */ 64*4882a593Smuzhiyun #define VT_GETHIFONTMASK 0x560D /* return hi font mask */ 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun struct vt_event { 67*4882a593Smuzhiyun unsigned int event; 68*4882a593Smuzhiyun #define VT_EVENT_SWITCH 0x0001 /* Console switch */ 69*4882a593Smuzhiyun #define VT_EVENT_BLANK 0x0002 /* Screen blank */ 70*4882a593Smuzhiyun #define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */ 71*4882a593Smuzhiyun #define VT_EVENT_RESIZE 0x0008 /* Resize display */ 72*4882a593Smuzhiyun #define VT_MAX_EVENT 0x000F 73*4882a593Smuzhiyun unsigned int oldev; /* Old console */ 74*4882a593Smuzhiyun unsigned int newev; /* New console (if changing) */ 75*4882a593Smuzhiyun unsigned int pad[4]; /* Padding for expansion */ 76*4882a593Smuzhiyun }; 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun #define VT_WAITEVENT 0x560E /* Wait for an event */ 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun struct vt_setactivate { 81*4882a593Smuzhiyun unsigned int console; 82*4882a593Smuzhiyun struct vt_mode mode; 83*4882a593Smuzhiyun }; 84*4882a593Smuzhiyun 85*4882a593Smuzhiyun #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ 86*4882a593Smuzhiyun 87*4882a593Smuzhiyun #endif /* _UAPI_LINUX_VT_H */ 88