History

tty: vt: use sane types for userspace API

As discussed earlier (see the Link below), use the preferred ioctl types in vt.h (__u8, __u16, ...). These types are already used for the new VT_GETCONSIZECSRPOS. Therefore, the necessary includes are already present. Since now, the types are used for every structure defined in the header now. Note the kernel is built with -funsigned-char, therefore 'char' becomes '__u8' in here.

Jiri Slaby (SUSE) committed 1 year ago

Commit 866380b1 parent 8d4207f1 file · +22 −22Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/vt.h+22−22
@@ -19,11 +19,11 @@ · 18 unmodified lines
1919 #define VT_OPENQRY 0x5600 /* find available vt */
2020
2121 struct vt_mode {
22− char mode; /* vt mode */
23− char waitv; /* if set, hang on writes if not active */
24− short relsig; /* signal to raise on release req */
25− short acqsig; /* signal to raise on acquisition */
26− short frsig; /* unused (set to 0) */
22+ __u8 mode; /* vt mode */
23+ __u8 waitv; /* if set, hang on writes if not active */
24+ __s16 relsig; /* signal to raise on release req */
25+ __s16 acqsig; /* signal to raise on acquisition */
26+ __s16 frsig; /* unused (set to 0) */
2727 };
2828 #define VT_GETMODE 0x5601 /* get mode of active vt */
2929 #define VT_SETMODE 0x5602 /* set mode of active vt */
@@ -32,9 +32,9 @@ struct vt_mode { · 2 unmodified lines
3232 #define VT_ACKACQ 0x02 /* acknowledge switch */
3333
3434 struct vt_stat {
35− unsigned short v_active; /* active vt */
36− unsigned short v_signal; /* signal to send */
37− unsigned short v_state; /* vt bitmask */
35+ __u16 v_active; /* active vt */
36+ __u16 v_signal; /* signal to send */
37+ __u16 v_state; /* vt bitmask */
3838 };
3939 #define VT_GETSTATE 0x5603 /* get global vt state info */
4040 #define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */
@@ -46,19 +46,19 @@ struct vt_stat { · 5 unmodified lines
4646 #define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
4747
4848 struct vt_sizes {
49− unsigned short v_rows; /* number of rows */
50− unsigned short v_cols; /* number of columns */
51− unsigned short v_scrollsize; /* number of lines of scrollback */
49+ __u16 v_rows; /* number of rows */
50+ __u16 v_cols; /* number of columns */
51+ __u16 v_scrollsize; /* number of lines of scrollback */
5252 };
5353 #define VT_RESIZE 0x5609 /* set kernel's idea of screensize */
5454
5555 struct vt_consize {
56− unsigned short v_rows; /* number of rows */
57− unsigned short v_cols; /* number of columns */
58− unsigned short v_vlin; /* number of pixel rows on screen */
59− unsigned short v_clin; /* number of pixel rows per character */
60− unsigned short v_vcol; /* number of pixel columns on screen */
61− unsigned short v_ccol; /* number of pixel columns per character */
56+ __u16 v_rows; /* number of rows */
57+ __u16 v_cols; /* number of columns */
58+ __u16 v_vlin; /* number of pixel rows on screen */
59+ __u16 v_clin; /* number of pixel rows per character */
60+ __u16 v_vcol; /* number of pixel columns on screen */
61+ __u16 v_ccol; /* number of pixel columns per character */
6262 };
6363 #define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */
6464 #define VT_LOCKSWITCH 0x560B /* disallow vt switching */
@@ -66,21 +66,21 @@ struct vt_consize { · 1 unmodified line
6666 #define VT_GETHIFONTMASK 0x560D /* return hi font mask */
6767
6868 struct vt_event {
69− unsigned int event;
69+ __u32 event;
7070 #define VT_EVENT_SWITCH 0x0001 /* Console switch */
7171 #define VT_EVENT_BLANK 0x0002 /* Screen blank */
7272 #define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */
7373 #define VT_EVENT_RESIZE 0x0008 /* Resize display */
7474 #define VT_MAX_EVENT 0x000F
75− unsigned int oldev; /* Old console */
76− unsigned int newev; /* New console (if changing) */
77− unsigned int pad[4]; /* Padding for expansion */
75+ __u32 oldev; /* Old console */
76+ __u32 newev; /* New console (if changing) */
77+ __u32 pad[4]; /* Padding for expansion */
7878 };
7979
8080 #define VT_WAITEVENT 0x560E /* Wait for an event */
8181
8282 struct vt_setactivate {
83− unsigned int console;
83+ __u32 console;
8484 struct vt_mode mode;
8585 };
8686

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t