License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* console_struct.h
|
|
|
|
*
|
|
|
|
* Data structure describing single virtual console except for data
|
|
|
|
* used by vt.c.
|
|
|
|
*
|
|
|
|
* Fields marked with [#] must be set by the low-level driver.
|
|
|
|
* Fields marked with [!] can be changed by the low-level driver
|
|
|
|
* to achieve effects such as fast scrolling by changing the origin.
|
|
|
|
*/
|
|
|
|
|
2007-06-09 04:47:07 +08:00
|
|
|
#ifndef _LINUX_CONSOLE_STRUCT_H
|
|
|
|
#define _LINUX_CONSOLE_STRUCT_H
|
|
|
|
|
2006-07-10 19:44:12 +08:00
|
|
|
#include <linux/wait.h>
|
2005-11-07 17:00:51 +08:00
|
|
|
#include <linux/vt.h>
|
2007-02-10 17:44:34 +08:00
|
|
|
#include <linux/workqueue.h>
|
2005-11-07 17:00:51 +08:00
|
|
|
|
2014-05-13 18:09:28 +08:00
|
|
|
struct uni_pagedir;
|
2018-06-27 11:56:40 +08:00
|
|
|
struct uni_screen;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#define NPAR 16
|
|
|
|
|
2016-06-23 19:34:24 +08:00
|
|
|
/*
|
|
|
|
* Example: vc_data of a console that was scrolled 3 lines down.
|
|
|
|
*
|
|
|
|
* Console buffer
|
|
|
|
* vc_screenbuf ---------> +----------------------+-.
|
|
|
|
* | initializing W | \
|
|
|
|
* | initializing X | |
|
|
|
|
* | initializing Y | > scroll-back area
|
|
|
|
* | initializing Z | |
|
|
|
|
* | | /
|
|
|
|
* vc_visible_origin ---> ^+----------------------+-:
|
|
|
|
* (changes by scroll) || Welcome to linux | \
|
|
|
|
* || | |
|
|
|
|
* vc_rows --->< | login: root | | visible on console
|
|
|
|
* || password: | > (vc_screenbuf_size is
|
|
|
|
* vc_origin -----------> || | | vc_size_row * vc_rows)
|
|
|
|
* (start when no scroll) || Last login: 12:28 | /
|
|
|
|
* v+----------------------+-:
|
|
|
|
* | Have a lot of fun... | \
|
|
|
|
* vc_pos -----------------|--------v | > scroll-front area
|
|
|
|
* | ~ # cat_ | /
|
|
|
|
* vc_scr_end -----------> +----------------------+-:
|
|
|
|
* (vc_origin + | | \ EMPTY, to be filled by
|
|
|
|
* vc_screenbuf_size) | | / vc_video_erase_char
|
|
|
|
* +----------------------+-'
|
|
|
|
* <---- 2 * vc_cols ----->
|
|
|
|
* <---- vc_size_row ----->
|
|
|
|
*
|
|
|
|
* Note that every character in the console buffer is accompanied with an
|
|
|
|
* attribute in the buffer right after the character. This is not depicted
|
|
|
|
* in the figure.
|
|
|
|
*/
|
2005-04-17 06:20:36 +08:00
|
|
|
struct vc_data {
|
2010-06-02 04:52:55 +08:00
|
|
|
struct tty_port port; /* Upper level data */
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned short vc_num; /* Console number */
|
|
|
|
unsigned int vc_cols; /* [#] Console size */
|
|
|
|
unsigned int vc_rows;
|
|
|
|
unsigned int vc_size_row; /* Bytes per row */
|
|
|
|
unsigned int vc_scan_lines; /* # of scan lines */
|
|
|
|
unsigned long vc_origin; /* [!] Start of real screen */
|
|
|
|
unsigned long vc_scr_end; /* [!] End of real screen */
|
|
|
|
unsigned long vc_visible_origin; /* [!] Top of visible window */
|
|
|
|
unsigned int vc_top, vc_bottom; /* Scrolling region */
|
|
|
|
const struct consw *vc_sw;
|
|
|
|
unsigned short *vc_screenbuf; /* In-memory character/attribute buffer */
|
|
|
|
unsigned int vc_screenbuf_size;
|
|
|
|
unsigned char vc_mode; /* KD_TEXT, ... */
|
|
|
|
/* attributes for all characters on screen */
|
|
|
|
unsigned char vc_attr; /* Current attributes */
|
|
|
|
unsigned char vc_def_color; /* Default colors */
|
|
|
|
unsigned char vc_color; /* Foreground & background */
|
|
|
|
unsigned char vc_s_color; /* Saved foreground & background */
|
|
|
|
unsigned char vc_ulcolor; /* Color for underline mode */
|
2007-05-08 15:38:04 +08:00
|
|
|
unsigned char vc_itcolor;
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned char vc_halfcolor; /* Color for half intensity mode */
|
|
|
|
/* cursor */
|
|
|
|
unsigned int vc_cursor_type;
|
|
|
|
unsigned short vc_complement_mask; /* [#] Xor mask for mouse pointer */
|
|
|
|
unsigned short vc_s_complement_mask; /* Saved mouse pointer mask */
|
|
|
|
unsigned int vc_x, vc_y; /* Cursor position */
|
|
|
|
unsigned int vc_saved_x, vc_saved_y;
|
|
|
|
unsigned long vc_pos; /* Cursor address */
|
|
|
|
/* fonts */
|
|
|
|
unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */
|
|
|
|
struct console_font vc_font; /* Current VC font set */
|
|
|
|
unsigned short vc_video_erase_char; /* Background erase character */
|
|
|
|
/* VT terminal data */
|
|
|
|
unsigned int vc_state; /* Escape sequence parser state */
|
|
|
|
unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */
|
|
|
|
/* data for manual vt switching */
|
|
|
|
struct vt_mode vt_mode;
|
2006-10-02 17:17:14 +08:00
|
|
|
struct pid *vt_pid;
|
2005-04-17 06:20:36 +08:00
|
|
|
int vt_newvt;
|
|
|
|
wait_queue_head_t paste_wait;
|
|
|
|
/* mode flags */
|
|
|
|
unsigned int vc_charset : 1; /* Character set G0 / G1 */
|
|
|
|
unsigned int vc_s_charset : 1; /* Saved character set */
|
|
|
|
unsigned int vc_disp_ctrl : 1; /* Display chars < 32? */
|
|
|
|
unsigned int vc_toggle_meta : 1; /* Toggle high bit? */
|
|
|
|
unsigned int vc_decscnm : 1; /* Screen Mode */
|
|
|
|
unsigned int vc_decom : 1; /* Origin Mode */
|
|
|
|
unsigned int vc_decawm : 1; /* Autowrap Mode */
|
|
|
|
unsigned int vc_deccm : 1; /* Cursor Visible */
|
|
|
|
unsigned int vc_decim : 1; /* Insert Mode */
|
|
|
|
/* attribute flags */
|
|
|
|
unsigned int vc_intensity : 2; /* 0=half-bright, 1=normal, 2=bold */
|
2007-05-08 15:38:04 +08:00
|
|
|
unsigned int vc_italic:1;
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned int vc_underline : 1;
|
|
|
|
unsigned int vc_blink : 1;
|
|
|
|
unsigned int vc_reverse : 1;
|
|
|
|
unsigned int vc_s_intensity : 2; /* saved rendition */
|
2007-05-08 15:38:04 +08:00
|
|
|
unsigned int vc_s_italic:1;
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned int vc_s_underline : 1;
|
|
|
|
unsigned int vc_s_blink : 1;
|
|
|
|
unsigned int vc_s_reverse : 1;
|
|
|
|
/* misc */
|
2018-12-15 22:34:20 +08:00
|
|
|
unsigned int vc_priv : 3;
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned int vc_need_wrap : 1;
|
|
|
|
unsigned int vc_can_do_color : 1;
|
|
|
|
unsigned int vc_report_mouse : 2;
|
|
|
|
unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */
|
|
|
|
unsigned char vc_utf_count;
|
|
|
|
int vc_utf_char;
|
|
|
|
unsigned int vc_tab_stop[8]; /* Tab stops. 256 columns. */
|
|
|
|
unsigned char vc_palette[16*3]; /* Colour palette for VGA+ */
|
|
|
|
unsigned short * vc_translate;
|
|
|
|
unsigned char vc_G0_charset;
|
|
|
|
unsigned char vc_G1_charset;
|
|
|
|
unsigned char vc_saved_G0;
|
|
|
|
unsigned char vc_saved_G1;
|
vt/vgacon: Check if screen resize request comes from userspace
Various console drivers are able to resize the screen via the con_resize()
hook. This hook is also visible in userspace via the TIOCWINSZ, VT_RESIZE and
VT_RESIZEX ioctl's. One particular utility, SVGATextMode, expects that
con_resize() of the VGA console will always return success even if the
resulting screen is not compatible with the hardware. However, this
particular behavior of the VGA console, as reported in Kernel Bugzilla Bug
7513, can cause undefined behavior if the user starts with a console size
larger than 80x25.
To work around this problem, add an extra parameter to con_resize(). This
parameter is ignored by drivers except for vgacon. If this parameter is
non-zero, then the resize request came from a VT_RESIZE or VT_RESIZEX ioctl
and vgacon will always return success. If this parameter is zero, vgacon will
return -EINVAL if the requested size is not compatible with the hardware. The
latter is the more correct behavior.
With this change, SVGATextMode should still work correctly while in-kernel and
stty resize calls can expect correct behavior from vgacon.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 16:29:35 +08:00
|
|
|
unsigned int vc_resize_user; /* resize request from user */
|
2005-04-17 06:20:36 +08:00
|
|
|
unsigned int vc_bell_pitch; /* Console bell pitch */
|
|
|
|
unsigned int vc_bell_duration; /* Console bell duration */
|
2015-03-26 21:54:39 +08:00
|
|
|
unsigned short vc_cur_blink_ms; /* Cursor blink duration */
|
2005-04-17 06:20:36 +08:00
|
|
|
struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
|
2014-05-13 18:09:28 +08:00
|
|
|
struct uni_pagedir *vc_uni_pagedir;
|
|
|
|
struct uni_pagedir **vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
|
2018-06-27 11:56:40 +08:00
|
|
|
struct uni_screen *vc_uni_screen; /* unicode screen content */
|
2005-04-17 06:20:36 +08:00
|
|
|
/* additional information is in vt_kern.h */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct vc {
|
|
|
|
struct vc_data *d;
|
2007-02-10 17:44:34 +08:00
|
|
|
struct work_struct SAK_work;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2018-07-18 11:03:22 +08:00
|
|
|
/* might add scrmem, kbd at some time,
|
2005-04-17 06:20:36 +08:00
|
|
|
to have everything in one place - the disadvantage
|
|
|
|
would be that vc_cons etc can no longer be static */
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct vc vc_cons [MAX_NR_CONSOLES];
|
2007-02-10 17:44:34 +08:00
|
|
|
extern void vc_SAK(struct work_struct *work);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#define CUR_DEF 0
|
|
|
|
#define CUR_NONE 1
|
|
|
|
#define CUR_UNDERLINE 2
|
|
|
|
#define CUR_LOWER_THIRD 3
|
|
|
|
#define CUR_LOWER_HALF 4
|
|
|
|
#define CUR_TWO_THIRDS 5
|
|
|
|
#define CUR_BLOCK 6
|
|
|
|
#define CUR_HWMASK 0x0f
|
|
|
|
#define CUR_SWMASK 0xfff0
|
|
|
|
|
|
|
|
#define CUR_DEFAULT CUR_UNDERLINE
|
|
|
|
|
2016-06-23 19:34:35 +08:00
|
|
|
static inline bool con_is_visible(const struct vc_data *vc)
|
|
|
|
{
|
|
|
|
return *vc->vc_display_fg == vc;
|
|
|
|
}
|
2007-06-09 04:47:07 +08:00
|
|
|
|
|
|
|
#endif /* _LINUX_CONSOLE_STRUCT_H */
|