1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells #ifndef _UAPI_LINUX_VT_H 3607ca46eSDavid Howells #define _UAPI_LINUX_VT_H 4607ca46eSDavid Howells 5607ca46eSDavid Howells 6607ca46eSDavid Howells /* 7607ca46eSDavid Howells * These constants are also useful for user-level apps (e.g., VC 8607ca46eSDavid Howells * resizing). 9607ca46eSDavid Howells */ 10607ca46eSDavid Howells #define MIN_NR_CONSOLES 1 /* must be at least 1 */ 11607ca46eSDavid Howells #define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ 12607ca46eSDavid Howells /* Note: the ioctl VT_GETSTATE does not work for 13607ca46eSDavid Howells consoles 16 and higher (since it returns a short) */ 14607ca46eSDavid Howells 15607ca46eSDavid Howells /* 0x56 is 'V', to avoid collision with termios and kd */ 16607ca46eSDavid Howells 17607ca46eSDavid Howells #define VT_OPENQRY 0x5600 /* find available vt */ 18607ca46eSDavid Howells 19607ca46eSDavid Howells struct vt_mode { 20607ca46eSDavid Howells char mode; /* vt mode */ 21607ca46eSDavid Howells char waitv; /* if set, hang on writes if not active */ 22607ca46eSDavid Howells short relsig; /* signal to raise on release req */ 23607ca46eSDavid Howells short acqsig; /* signal to raise on acquisition */ 24607ca46eSDavid Howells short frsig; /* unused (set to 0) */ 25607ca46eSDavid Howells }; 26607ca46eSDavid Howells #define VT_GETMODE 0x5601 /* get mode of active vt */ 27607ca46eSDavid Howells #define VT_SETMODE 0x5602 /* set mode of active vt */ 28607ca46eSDavid Howells #define VT_AUTO 0x00 /* auto vt switching */ 29607ca46eSDavid Howells #define VT_PROCESS 0x01 /* process controls switching */ 30607ca46eSDavid Howells #define VT_ACKACQ 0x02 /* acknowledge switch */ 31607ca46eSDavid Howells 32607ca46eSDavid Howells struct vt_stat { 33607ca46eSDavid Howells unsigned short v_active; /* active vt */ 34607ca46eSDavid Howells unsigned short v_signal; /* signal to send */ 35607ca46eSDavid Howells unsigned short v_state; /* vt bitmask */ 36607ca46eSDavid Howells }; 37607ca46eSDavid Howells #define VT_GETSTATE 0x5603 /* get global vt state info */ 38607ca46eSDavid Howells #define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */ 39607ca46eSDavid Howells 40607ca46eSDavid Howells #define VT_RELDISP 0x5605 /* release display */ 41607ca46eSDavid Howells 42607ca46eSDavid Howells #define VT_ACTIVATE 0x5606 /* make vt active */ 43607ca46eSDavid Howells #define VT_WAITACTIVE 0x5607 /* wait for vt active */ 44607ca46eSDavid Howells #define VT_DISALLOCATE 0x5608 /* free memory associated to vt */ 45607ca46eSDavid Howells 46607ca46eSDavid Howells struct vt_sizes { 47607ca46eSDavid Howells unsigned short v_rows; /* number of rows */ 48607ca46eSDavid Howells unsigned short v_cols; /* number of columns */ 49607ca46eSDavid Howells unsigned short v_scrollsize; /* number of lines of scrollback */ 50607ca46eSDavid Howells }; 51607ca46eSDavid Howells #define VT_RESIZE 0x5609 /* set kernel's idea of screensize */ 52607ca46eSDavid Howells 53607ca46eSDavid Howells struct vt_consize { 54607ca46eSDavid Howells unsigned short v_rows; /* number of rows */ 55607ca46eSDavid Howells unsigned short v_cols; /* number of columns */ 56607ca46eSDavid Howells unsigned short v_vlin; /* number of pixel rows on screen */ 57607ca46eSDavid Howells unsigned short v_clin; /* number of pixel rows per character */ 58607ca46eSDavid Howells unsigned short v_vcol; /* number of pixel columns on screen */ 59607ca46eSDavid Howells unsigned short v_ccol; /* number of pixel columns per character */ 60607ca46eSDavid Howells }; 61607ca46eSDavid Howells #define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */ 62607ca46eSDavid Howells #define VT_LOCKSWITCH 0x560B /* disallow vt switching */ 63607ca46eSDavid Howells #define VT_UNLOCKSWITCH 0x560C /* allow vt switching */ 64607ca46eSDavid Howells #define VT_GETHIFONTMASK 0x560D /* return hi font mask */ 65607ca46eSDavid Howells 66607ca46eSDavid Howells struct vt_event { 67607ca46eSDavid Howells unsigned int event; 68607ca46eSDavid Howells #define VT_EVENT_SWITCH 0x0001 /* Console switch */ 69607ca46eSDavid Howells #define VT_EVENT_BLANK 0x0002 /* Screen blank */ 70607ca46eSDavid Howells #define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */ 71607ca46eSDavid Howells #define VT_EVENT_RESIZE 0x0008 /* Resize display */ 72607ca46eSDavid Howells #define VT_MAX_EVENT 0x000F 73607ca46eSDavid Howells unsigned int oldev; /* Old console */ 74607ca46eSDavid Howells unsigned int newev; /* New console (if changing) */ 75607ca46eSDavid Howells unsigned int pad[4]; /* Padding for expansion */ 76607ca46eSDavid Howells }; 77607ca46eSDavid Howells 78607ca46eSDavid Howells #define VT_WAITEVENT 0x560E /* Wait for an event */ 79607ca46eSDavid Howells 80607ca46eSDavid Howells struct vt_setactivate { 81607ca46eSDavid Howells unsigned int console; 82607ca46eSDavid Howells struct vt_mode mode; 83607ca46eSDavid Howells }; 84607ca46eSDavid Howells 85607ca46eSDavid Howells #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ 86607ca46eSDavid Howells 87607ca46eSDavid Howells #endif /* _UAPI_LINUX_VT_H */ 88