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 14:07:57 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <linux/init.h>
|
2009-07-04 02:22:08 +00:00
|
|
|
#include <linux/io.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <linux/mm.h>
|
2009-07-04 02:22:08 +00:00
|
|
|
|
2007-07-22 09:12:38 +00:00
|
|
|
#include <asm/processor-cyrix.h>
|
2008-01-30 12:30:39 +00:00
|
|
|
#include <asm/processor-flags.h>
|
2009-07-04 02:22:08 +00:00
|
|
|
#include <asm/mtrr.h>
|
|
|
|
#include <asm/msr.h>
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#include "mtrr.h"
|
|
|
|
|
|
|
|
static void
|
|
|
|
cyrix_get_arr(unsigned int reg, unsigned long *base,
|
[PATCH] i386: fix MTRR code
Until not so long ago, there were system log messages pointing to
inconsistent MTRR setup of the video frame buffer caused by the way vesafb
and X worked. While vesafb was fixed meanwhile, I believe fixing it there
only hides a shortcoming in the MTRR code itself, in that that code is not
symmetric with respect to the ordering of attempts to set up two (or more)
regions where one contains the other. In the current shape, it permits
only setting up sub-regions of pre-exisiting ones. The patch below makes
this symmetric.
While working on that I noticed a few more inconsistencies in that code,
namely
- use of 'unsigned int' for sizes in many, but not all places (the patch
is converting this to use 'unsigned long' everywhere, which specifically
might be necessary for x86-64 once a processor supporting more than 44
physical address bits would become available)
- the code to correct inconsistent settings during secondary processor
startup tried (if necessary) to correct, among other things, the value
in IA32_MTRR_DEF_TYPE, however the newly computed value would never get
used (i.e. stored in the respective MSR)
- the generic range validation code checked that the end of the
to-be-added range would be above 1MB; the value checked should have been
the start of the range
- when contained regions are detected, previously this was allowed only
when the old region was uncacheable; this can be symmetric (i.e. the new
region can also be uncacheable) and even further as per Intel's
documentation write-trough and write-back for either region is also
compatible with the respective opposite in the other
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
2006-12-07 01:14:09 +00:00
|
|
|
unsigned long *size, mtrr_type * type)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
unsigned char arr, ccr3, rcr, shift;
|
2009-07-04 02:22:08 +00:00
|
|
|
unsigned long flags;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
arr = CX86_ARR_BASE + (reg << 1) + reg; /* avoid multiplication by 3 */
|
|
|
|
|
|
|
|
local_irq_save(flags);
|
|
|
|
|
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
|
|
|
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */
|
2009-07-04 02:22:08 +00:00
|
|
|
((unsigned char *)base)[3] = getCx86(arr);
|
|
|
|
((unsigned char *)base)[2] = getCx86(arr + 1);
|
|
|
|
((unsigned char *)base)[1] = getCx86(arr + 2);
|
2005-04-16 22:20:36 +00:00
|
|
|
rcr = getCx86(CX86_RCR_BASE + reg);
|
2009-07-04 02:22:08 +00:00
|
|
|
setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
local_irq_restore(flags);
|
2009-07-04 02:22:08 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
shift = ((unsigned char *) base)[1] & 0x0f;
|
|
|
|
*base >>= PAGE_SHIFT;
|
|
|
|
|
2009-07-04 02:22:08 +00:00
|
|
|
/*
|
|
|
|
* Power of two, at least 4K on ARR0-ARR6, 256K on ARR7
|
2005-04-16 22:20:36 +00:00
|
|
|
* Note: shift==0xf means 4G, this is unsupported.
|
|
|
|
*/
|
|
|
|
if (shift)
|
|
|
|
*size = (reg < 7 ? 0x1UL : 0x40UL) << (shift - 1);
|
|
|
|
else
|
|
|
|
*size = 0;
|
|
|
|
|
|
|
|
/* Bit 0 is Cache Enable on ARR7, Cache Disable on ARR0-ARR6 */
|
|
|
|
if (reg < 7) {
|
|
|
|
switch (rcr) {
|
|
|
|
case 1:
|
|
|
|
*type = MTRR_TYPE_UNCACHABLE;
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
*type = MTRR_TYPE_WRBACK;
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
*type = MTRR_TYPE_WRCOMB;
|
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
default:
|
|
|
|
*type = MTRR_TYPE_WRTHROUGH;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (rcr) {
|
|
|
|
case 0:
|
|
|
|
*type = MTRR_TYPE_UNCACHABLE;
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
*type = MTRR_TYPE_WRCOMB;
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
*type = MTRR_TYPE_WRBACK;
|
|
|
|
break;
|
|
|
|
case 25:
|
|
|
|
default:
|
|
|
|
*type = MTRR_TYPE_WRTHROUGH;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-04 02:22:08 +00:00
|
|
|
/*
|
|
|
|
* cyrix_get_free_region - get a free ARR.
|
|
|
|
*
|
|
|
|
* @base: the starting (base) address of the region.
|
|
|
|
* @size: the size (in bytes) of the region.
|
|
|
|
*
|
|
|
|
* Returns: the index of the region on success, else -1 on error.
|
|
|
|
*/
|
2005-04-16 22:20:36 +00:00
|
|
|
static int
|
[PATCH] i386: fix MTRR code
Until not so long ago, there were system log messages pointing to
inconsistent MTRR setup of the video frame buffer caused by the way vesafb
and X worked. While vesafb was fixed meanwhile, I believe fixing it there
only hides a shortcoming in the MTRR code itself, in that that code is not
symmetric with respect to the ordering of attempts to set up two (or more)
regions where one contains the other. In the current shape, it permits
only setting up sub-regions of pre-exisiting ones. The patch below makes
this symmetric.
While working on that I noticed a few more inconsistencies in that code,
namely
- use of 'unsigned int' for sizes in many, but not all places (the patch
is converting this to use 'unsigned long' everywhere, which specifically
might be necessary for x86-64 once a processor supporting more than 44
physical address bits would become available)
- the code to correct inconsistent settings during secondary processor
startup tried (if necessary) to correct, among other things, the value
in IA32_MTRR_DEF_TYPE, however the newly computed value would never get
used (i.e. stored in the respective MSR)
- the generic range validation code checked that the end of the
to-be-added range would be above 1MB; the value checked should have been
the start of the range
- when contained regions are detected, previously this was allowed only
when the old region was uncacheable; this can be symmetric (i.e. the new
region can also be uncacheable) and even further as per Intel's
documentation write-trough and write-back for either region is also
compatible with the respective opposite in the other
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
2006-12-07 01:14:09 +00:00
|
|
|
cyrix_get_free_region(unsigned long base, unsigned long size, int replace_reg)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
[PATCH] i386: fix MTRR code
Until not so long ago, there were system log messages pointing to
inconsistent MTRR setup of the video frame buffer caused by the way vesafb
and X worked. While vesafb was fixed meanwhile, I believe fixing it there
only hides a shortcoming in the MTRR code itself, in that that code is not
symmetric with respect to the ordering of attempts to set up two (or more)
regions where one contains the other. In the current shape, it permits
only setting up sub-regions of pre-exisiting ones. The patch below makes
this symmetric.
While working on that I noticed a few more inconsistencies in that code,
namely
- use of 'unsigned int' for sizes in many, but not all places (the patch
is converting this to use 'unsigned long' everywhere, which specifically
might be necessary for x86-64 once a processor supporting more than 44
physical address bits would become available)
- the code to correct inconsistent settings during secondary processor
startup tried (if necessary) to correct, among other things, the value
in IA32_MTRR_DEF_TYPE, however the newly computed value would never get
used (i.e. stored in the respective MSR)
- the generic range validation code checked that the end of the
to-be-added range would be above 1MB; the value checked should have been
the start of the range
- when contained regions are detected, previously this was allowed only
when the old region was uncacheable; this can be symmetric (i.e. the new
region can also be uncacheable) and even further as per Intel's
documentation write-trough and write-back for either region is also
compatible with the respective opposite in the other
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
2006-12-07 01:14:09 +00:00
|
|
|
unsigned long lbase, lsize;
|
2009-07-04 02:22:08 +00:00
|
|
|
mtrr_type ltype;
|
|
|
|
int i;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
[PATCH] i386: fix MTRR code
Until not so long ago, there were system log messages pointing to
inconsistent MTRR setup of the video frame buffer caused by the way vesafb
and X worked. While vesafb was fixed meanwhile, I believe fixing it there
only hides a shortcoming in the MTRR code itself, in that that code is not
symmetric with respect to the ordering of attempts to set up two (or more)
regions where one contains the other. In the current shape, it permits
only setting up sub-regions of pre-exisiting ones. The patch below makes
this symmetric.
While working on that I noticed a few more inconsistencies in that code,
namely
- use of 'unsigned int' for sizes in many, but not all places (the patch
is converting this to use 'unsigned long' everywhere, which specifically
might be necessary for x86-64 once a processor supporting more than 44
physical address bits would become available)
- the code to correct inconsistent settings during secondary processor
startup tried (if necessary) to correct, among other things, the value
in IA32_MTRR_DEF_TYPE, however the newly computed value would never get
used (i.e. stored in the respective MSR)
- the generic range validation code checked that the end of the
to-be-added range would be above 1MB; the value checked should have been
the start of the range
- when contained regions are detected, previously this was allowed only
when the old region was uncacheable; this can be symmetric (i.e. the new
region can also be uncacheable) and even further as per Intel's
documentation write-trough and write-back for either region is also
compatible with the respective opposite in the other
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
2006-12-07 01:14:09 +00:00
|
|
|
switch (replace_reg) {
|
|
|
|
case 7:
|
|
|
|
if (size < 0x40)
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
case 5:
|
|
|
|
case 4:
|
|
|
|
return replace_reg;
|
|
|
|
case 3:
|
|
|
|
case 2:
|
|
|
|
case 1:
|
|
|
|
case 0:
|
|
|
|
return replace_reg;
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
/* If we are to set up a region >32M then look at ARR7 immediately */
|
|
|
|
if (size > 0x2000) {
|
|
|
|
cyrix_get_arr(7, &lbase, &lsize, <ype);
|
|
|
|
if (lsize == 0)
|
|
|
|
return 7;
|
2009-07-04 02:22:08 +00:00
|
|
|
/* Else try ARR0-ARR6 first */
|
2005-04-16 22:20:36 +00:00
|
|
|
} else {
|
|
|
|
for (i = 0; i < 7; i++) {
|
|
|
|
cyrix_get_arr(i, &lbase, &lsize, <ype);
|
|
|
|
if (lsize == 0)
|
|
|
|
return i;
|
|
|
|
}
|
2009-07-04 02:22:08 +00:00
|
|
|
/*
|
|
|
|
* ARR0-ARR6 isn't free
|
|
|
|
* try ARR7 but its size must be at least 256K
|
|
|
|
*/
|
2005-04-16 22:20:36 +00:00
|
|
|
cyrix_get_arr(i, &lbase, &lsize, <ype);
|
|
|
|
if ((lsize == 0) && (size >= 0x40))
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
return -ENOSPC;
|
|
|
|
}
|
|
|
|
|
2009-07-04 02:22:08 +00:00
|
|
|
static u32 cr4, ccr3;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
static void prepare_set(void)
|
|
|
|
{
|
|
|
|
u32 cr0;
|
|
|
|
|
|
|
|
/* Save value of CR4 and clear Page Global Enable (bit 7) */
|
2016-03-29 15:42:02 +00:00
|
|
|
if (boot_cpu_has(X86_FEATURE_PGE)) {
|
2014-10-24 22:58:08 +00:00
|
|
|
cr4 = __read_cr4();
|
|
|
|
__write_cr4(cr4 & ~X86_CR4_PGE);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2009-07-04 02:22:08 +00:00
|
|
|
/*
|
|
|
|
* Disable and flush caches.
|
|
|
|
* Note that wbinvd flushes the TLBs as a side-effect
|
|
|
|
*/
|
2008-01-30 12:30:39 +00:00
|
|
|
cr0 = read_cr0() | X86_CR0_CD;
|
2005-04-16 22:20:36 +00:00
|
|
|
wbinvd();
|
|
|
|
write_cr0(cr0);
|
|
|
|
wbinvd();
|
|
|
|
|
2007-10-19 23:13:56 +00:00
|
|
|
/* Cyrix ARRs - everything else was excluded at the top */
|
2005-04-16 22:20:36 +00:00
|
|
|
ccr3 = getCx86(CX86_CCR3);
|
|
|
|
|
2007-10-19 23:13:56 +00:00
|
|
|
/* Cyrix ARRs - everything else was excluded at the top */
|
2005-04-16 22:20:36 +00:00
|
|
|
setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void post_set(void)
|
|
|
|
{
|
2009-07-04 02:22:08 +00:00
|
|
|
/* Flush caches and TLBs */
|
2005-04-16 22:20:36 +00:00
|
|
|
wbinvd();
|
|
|
|
|
|
|
|
/* Cyrix ARRs - everything else was excluded at the top */
|
|
|
|
setCx86(CX86_CCR3, ccr3);
|
2009-07-04 02:22:08 +00:00
|
|
|
|
|
|
|
/* Enable caches */
|
2013-04-27 23:22:32 +00:00
|
|
|
write_cr0(read_cr0() & ~X86_CR0_CD);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-07-04 02:22:08 +00:00
|
|
|
/* Restore value of CR4 */
|
2016-03-29 15:42:02 +00:00
|
|
|
if (boot_cpu_has(X86_FEATURE_PGE))
|
2014-10-24 22:58:08 +00:00
|
|
|
__write_cr4(cr4);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void cyrix_set_arr(unsigned int reg, unsigned long base,
|
|
|
|
unsigned long size, mtrr_type type)
|
|
|
|
{
|
|
|
|
unsigned char arr, arr_type, arr_size;
|
|
|
|
|
|
|
|
arr = CX86_ARR_BASE + (reg << 1) + reg; /* avoid multiplication by 3 */
|
|
|
|
|
|
|
|
/* count down from 32M (ARR0-ARR6) or from 2G (ARR7) */
|
|
|
|
if (reg >= 7)
|
|
|
|
size >>= 6;
|
|
|
|
|
|
|
|
size &= 0x7fff; /* make sure arr_size <= 14 */
|
2009-07-04 02:22:08 +00:00
|
|
|
for (arr_size = 0; size; arr_size++, size >>= 1)
|
|
|
|
;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (reg < 7) {
|
|
|
|
switch (type) {
|
|
|
|
case MTRR_TYPE_UNCACHABLE:
|
|
|
|
arr_type = 1;
|
|
|
|
break;
|
|
|
|
case MTRR_TYPE_WRCOMB:
|
|
|
|
arr_type = 9;
|
|
|
|
break;
|
|
|
|
case MTRR_TYPE_WRTHROUGH:
|
|
|
|
arr_type = 24;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
arr_type = 8;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (type) {
|
|
|
|
case MTRR_TYPE_UNCACHABLE:
|
|
|
|
arr_type = 0;
|
|
|
|
break;
|
|
|
|
case MTRR_TYPE_WRCOMB:
|
|
|
|
arr_type = 8;
|
|
|
|
break;
|
|
|
|
case MTRR_TYPE_WRTHROUGH:
|
|
|
|
arr_type = 25;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
arr_type = 9;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
prepare_set();
|
|
|
|
|
|
|
|
base <<= PAGE_SHIFT;
|
2009-07-04 02:22:08 +00:00
|
|
|
setCx86(arr + 0, ((unsigned char *)&base)[3]);
|
|
|
|
setCx86(arr + 1, ((unsigned char *)&base)[2]);
|
|
|
|
setCx86(arr + 2, (((unsigned char *)&base)[1]) | arr_size);
|
2005-04-16 22:20:36 +00:00
|
|
|
setCx86(CX86_RCR_BASE + reg, arr_type);
|
|
|
|
|
|
|
|
post_set();
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct {
|
2009-07-04 02:22:08 +00:00
|
|
|
unsigned long base;
|
|
|
|
unsigned long size;
|
|
|
|
mtrr_type type;
|
2005-04-16 22:20:36 +00:00
|
|
|
} arr_state_t;
|
|
|
|
|
2007-06-27 21:09:49 +00:00
|
|
|
static arr_state_t arr_state[8] = {
|
2005-04-16 22:20:36 +00:00
|
|
|
{0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL},
|
|
|
|
{0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}
|
|
|
|
};
|
|
|
|
|
2007-06-27 21:09:49 +00:00
|
|
|
static unsigned char ccr_state[7] = { 0, 0, 0, 0, 0, 0, 0 };
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
static void cyrix_set_all(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
prepare_set();
|
|
|
|
|
|
|
|
/* the CCRs are not contiguous */
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
setCx86(CX86_CCR0 + i, ccr_state[i]);
|
|
|
|
for (; i < 7; i++)
|
|
|
|
setCx86(CX86_CCR4 + i, ccr_state[i]);
|
2009-07-04 02:22:08 +00:00
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
cyrix_set_arr(i, arr_state[i].base,
|
2005-04-16 22:20:36 +00:00
|
|
|
arr_state[i].size, arr_state[i].type);
|
2009-07-04 02:22:08 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
post_set();
|
|
|
|
}
|
|
|
|
|
2010-01-31 19:16:34 +00:00
|
|
|
static const struct mtrr_ops cyrix_mtrr_ops = {
|
2005-04-16 22:20:36 +00:00
|
|
|
.vendor = X86_VENDOR_CYRIX,
|
|
|
|
.set_all = cyrix_set_all,
|
|
|
|
.set = cyrix_set_arr,
|
|
|
|
.get = cyrix_get_arr,
|
|
|
|
.get_free_region = cyrix_get_free_region,
|
|
|
|
.validate_add_page = generic_validate_add_page,
|
|
|
|
.have_wrcomb = positive_have_wrcomb,
|
|
|
|
};
|
|
|
|
|
|
|
|
int __init cyrix_init_mtrr(void)
|
|
|
|
{
|
|
|
|
set_mtrr_ops(&cyrix_mtrr_ops);
|
|
|
|
return 0;
|
|
|
|
}
|