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 21:07:57 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* We need constants.h for:
|
|
|
|
* VMA_VM_MM
|
|
|
|
* VMA_VM_FLAGS
|
|
|
|
* VM_EXEC
|
|
|
|
*/
|
2005-09-10 02:08:59 +07:00
|
|
|
#include <asm/asm-offsets.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
#include <asm/thread_info.h>
|
|
|
|
|
2016-08-30 23:30:02 +07:00
|
|
|
#ifdef CONFIG_CPU_V7M
|
|
|
|
#include <asm/v7m.h>
|
|
|
|
#endif
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* vma_vm_mm - get mm pointer from vma pointer (vma->vm_mm)
|
|
|
|
*/
|
|
|
|
.macro vma_vm_mm, rd, rn
|
|
|
|
ldr \rd, [\rn, #VMA_VM_MM]
|
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
* vma_vm_flags - get vma->vm_flags
|
|
|
|
*/
|
|
|
|
.macro vma_vm_flags, rd, rn
|
|
|
|
ldr \rd, [\rn, #VMA_VM_FLAGS]
|
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
* act_mm - get current->active_mm
|
|
|
|
*/
|
|
|
|
.macro act_mm, rd
|
|
|
|
bic \rd, sp, #8128
|
|
|
|
bic \rd, \rd, #63
|
|
|
|
ldr \rd, [\rd, #TI_TASK]
|
2017-06-30 23:03:59 +07:00
|
|
|
.if (TSK_ACTIVE_MM > IMM12_MASK)
|
|
|
|
add \rd, \rd, #TSK_ACTIVE_MM & ~IMM12_MASK
|
|
|
|
.endif
|
|
|
|
ldr \rd, [\rd, #TSK_ACTIVE_MM & IMM12_MASK]
|
2005-04-17 05:20:36 +07:00
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
* mmid - get context id from mm pointer (mm->context.id)
|
2013-02-11 18:25:06 +07:00
|
|
|
* note, this field is 64bit, so in big-endian the two words are swapped too.
|
2005-04-17 05:20:36 +07:00
|
|
|
*/
|
|
|
|
.macro mmid, rd, rn
|
2013-02-11 18:25:06 +07:00
|
|
|
#ifdef __ARMEB__
|
|
|
|
ldr \rd, [\rn, #MM_CONTEXT_ID + 4 ]
|
|
|
|
#else
|
2005-04-17 05:20:36 +07:00
|
|
|
ldr \rd, [\rn, #MM_CONTEXT_ID]
|
2013-02-11 18:25:06 +07:00
|
|
|
#endif
|
2005-04-17 05:20:36 +07:00
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
* mask_asid - mask the ASID from the context ID
|
|
|
|
*/
|
|
|
|
.macro asid, rd, rn
|
|
|
|
and \rd, \rn, #255
|
|
|
|
.endm
|
2006-06-29 21:09:57 +07:00
|
|
|
|
|
|
|
.macro crval, clear, mmuset, ucset
|
|
|
|
#ifdef CONFIG_MMU
|
|
|
|
.word \clear
|
|
|
|
.word \mmuset
|
|
|
|
#else
|
|
|
|
.word \clear
|
|
|
|
.word \ucset
|
|
|
|
#endif
|
|
|
|
.endm
|
2007-05-09 04:27:46 +07:00
|
|
|
|
|
|
|
/*
|
2010-12-07 22:52:04 +07:00
|
|
|
* dcache_line_size - get the minimum D-cache line size from the CTR register
|
|
|
|
* on ARMv7.
|
2007-05-09 04:27:46 +07:00
|
|
|
*/
|
|
|
|
.macro dcache_line_size, reg, tmp
|
2016-08-30 23:30:02 +07:00
|
|
|
#ifdef CONFIG_CPU_V7M
|
|
|
|
movw \tmp, #:lower16:BASEADDR_V7M_SCB + V7M_SCB_CTR
|
|
|
|
movt \tmp, #:upper16:BASEADDR_V7M_SCB + V7M_SCB_CTR
|
|
|
|
ldr \tmp, [\tmp]
|
|
|
|
#else
|
2010-12-07 22:52:04 +07:00
|
|
|
mrc p15, 0, \tmp, c0, c0, 1 @ read ctr
|
2016-08-30 23:30:02 +07:00
|
|
|
#endif
|
2010-12-07 22:52:04 +07:00
|
|
|
lsr \tmp, \tmp, #16
|
|
|
|
and \tmp, \tmp, #0xf @ cache line size encoding
|
|
|
|
mov \reg, #4 @ bytes per word
|
2007-05-09 04:27:46 +07:00
|
|
|
mov \reg, \reg, lsl \tmp @ actual cache line size
|
|
|
|
.endm
|
2008-09-06 23:19:08 +07:00
|
|
|
|
2010-12-07 22:56:29 +07:00
|
|
|
/*
|
|
|
|
* icache_line_size - get the minimum I-cache line size from the CTR register
|
|
|
|
* on ARMv7.
|
|
|
|
*/
|
|
|
|
.macro icache_line_size, reg, tmp
|
2016-08-30 23:30:02 +07:00
|
|
|
#ifdef CONFIG_CPU_V7M
|
|
|
|
movw \tmp, #:lower16:BASEADDR_V7M_SCB + V7M_SCB_CTR
|
|
|
|
movt \tmp, #:upper16:BASEADDR_V7M_SCB + V7M_SCB_CTR
|
|
|
|
ldr \tmp, [\tmp]
|
|
|
|
#else
|
2010-12-07 22:56:29 +07:00
|
|
|
mrc p15, 0, \tmp, c0, c0, 1 @ read ctr
|
2016-08-30 23:30:02 +07:00
|
|
|
#endif
|
2010-12-07 22:56:29 +07:00
|
|
|
and \tmp, \tmp, #0xf @ cache line size encoding
|
|
|
|
mov \reg, #4 @ bytes per word
|
|
|
|
mov \reg, \reg, lsl \tmp @ actual cache line size
|
|
|
|
.endm
|
2008-09-06 23:19:08 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Sanity check the PTE configuration for the code below - which makes
|
2011-03-31 08:57:33 +07:00
|
|
|
* certain assumptions about how these bits are laid out.
|
2008-09-06 23:19:08 +07:00
|
|
|
*/
|
2009-07-24 18:35:04 +07:00
|
|
|
#ifdef CONFIG_MMU
|
2008-09-06 23:19:08 +07:00
|
|
|
#if L_PTE_SHARED != PTE_EXT_SHARED
|
|
|
|
#error PTE shared bit mismatch
|
|
|
|
#endif
|
2011-11-23 00:30:29 +07:00
|
|
|
#if !defined (CONFIG_ARM_LPAE) && \
|
|
|
|
(L_PTE_XN+L_PTE_USER+L_PTE_RDONLY+L_PTE_DIRTY+L_PTE_YOUNG+\
|
2015-02-11 05:10:17 +07:00
|
|
|
L_PTE_PRESENT) > L_PTE_SHARED
|
2008-09-06 23:19:08 +07:00
|
|
|
#error Invalid Linux PTE bit settings
|
|
|
|
#endif
|
2009-07-24 18:35:04 +07:00
|
|
|
#endif /* CONFIG_MMU */
|
2008-09-06 23:19:08 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The ARMv6 and ARMv7 set_pte_ext translation function.
|
|
|
|
*
|
|
|
|
* Permission translation:
|
|
|
|
* YUWD APX AP1 AP0 SVC User
|
|
|
|
* 0xxx 0 0 0 no acc no acc
|
|
|
|
* 100x 1 0 1 r/o no acc
|
|
|
|
* 10x0 1 0 1 r/o no acc
|
|
|
|
* 1011 0 0 1 r/w no acc
|
2010-09-13 22:03:21 +07:00
|
|
|
* 110x 1 1 1 r/o r/o
|
|
|
|
* 11x0 1 1 1 r/o r/o
|
2014-02-08 01:12:27 +07:00
|
|
|
* 1111 0 1 1 r/w r/w
|
2008-09-06 23:19:08 +07:00
|
|
|
*/
|
2008-09-07 03:07:45 +07:00
|
|
|
.macro armv6_mt_table pfx
|
|
|
|
\pfx\()_mt_table:
|
|
|
|
.long 0x00 @ L_PTE_MT_UNCACHED
|
|
|
|
.long PTE_EXT_TEX(1) @ L_PTE_MT_BUFFERABLE
|
|
|
|
.long PTE_CACHEABLE @ L_PTE_MT_WRITETHROUGH
|
|
|
|
.long PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_WRITEBACK
|
|
|
|
.long PTE_BUFFERABLE @ L_PTE_MT_DEV_SHARED
|
|
|
|
.long 0x00 @ unused
|
|
|
|
.long 0x00 @ L_PTE_MT_MINICACHE (not present)
|
|
|
|
.long PTE_EXT_TEX(1) | PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_WRITEALLOC
|
|
|
|
.long 0x00 @ unused
|
|
|
|
.long PTE_EXT_TEX(1) @ L_PTE_MT_DEV_WC
|
|
|
|
.long 0x00 @ unused
|
|
|
|
.long PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_DEV_CACHED
|
|
|
|
.long PTE_EXT_TEX(2) @ L_PTE_MT_DEV_NONSHARED
|
2008-09-07 18:42:51 +07:00
|
|
|
.long 0x00 @ unused
|
2008-09-07 03:07:45 +07:00
|
|
|
.long 0x00 @ unused
|
2014-02-08 01:12:27 +07:00
|
|
|
.long PTE_CACHEABLE | PTE_BUFFERABLE | PTE_EXT_APX @ L_PTE_MT_VECTORS
|
2008-09-07 03:07:45 +07:00
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro armv6_set_pte_ext pfx
|
2010-11-16 07:16:01 +07:00
|
|
|
str r1, [r0], #2048 @ linux version
|
2008-09-06 23:19:08 +07:00
|
|
|
|
2008-09-07 03:07:45 +07:00
|
|
|
bic r3, r1, #0x000003fc
|
2008-09-06 23:19:08 +07:00
|
|
|
bic r3, r3, #PTE_TYPE_MASK
|
|
|
|
orr r3, r3, r2
|
|
|
|
orr r3, r3, #PTE_EXT_AP0 | 2
|
|
|
|
|
2008-09-07 03:07:45 +07:00
|
|
|
adr ip, \pfx\()_mt_table
|
|
|
|
and r2, r1, #L_PTE_MT_MASK
|
|
|
|
ldr r2, [ip, r2]
|
|
|
|
|
2010-11-16 15:40:36 +07:00
|
|
|
eor r1, r1, #L_PTE_DIRTY
|
|
|
|
tst r1, #L_PTE_DIRTY|L_PTE_RDONLY
|
|
|
|
orrne r3, r3, #PTE_EXT_APX
|
2008-09-06 23:19:08 +07:00
|
|
|
|
|
|
|
tst r1, #L_PTE_USER
|
|
|
|
orrne r3, r3, #PTE_EXT_AP1
|
|
|
|
tstne r3, #PTE_EXT_APX
|
2014-02-08 01:12:27 +07:00
|
|
|
|
|
|
|
@ user read-only -> kernel read-only
|
|
|
|
bicne r3, r3, #PTE_EXT_AP0
|
2008-09-06 23:19:08 +07:00
|
|
|
|
2010-11-16 07:23:31 +07:00
|
|
|
tst r1, #L_PTE_XN
|
|
|
|
orrne r3, r3, #PTE_EXT_XN
|
2008-09-06 23:19:08 +07:00
|
|
|
|
2014-02-08 01:12:27 +07:00
|
|
|
eor r3, r3, r2
|
2008-09-07 03:07:45 +07:00
|
|
|
|
2008-09-06 23:19:08 +07:00
|
|
|
tst r1, #L_PTE_YOUNG
|
|
|
|
tstne r1, #L_PTE_PRESENT
|
|
|
|
moveq r3, #0
|
2012-09-01 11:22:12 +07:00
|
|
|
tstne r1, #L_PTE_NONE
|
|
|
|
movne r3, #0
|
2008-09-06 23:19:08 +07:00
|
|
|
|
|
|
|
str r3, [r0]
|
|
|
|
mcr p15, 0, r0, c7, c10, 1 @ flush_pte
|
|
|
|
.endm
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The ARMv3, ARMv4 and ARMv5 set_pte_ext translation function,
|
|
|
|
* covering most CPUs except Xscale and Xscale 3.
|
|
|
|
*
|
|
|
|
* Permission translation:
|
|
|
|
* YUWD AP SVC User
|
|
|
|
* 0xxx 0x00 no acc no acc
|
|
|
|
* 100x 0x00 r/o no acc
|
|
|
|
* 10x0 0x00 r/o no acc
|
|
|
|
* 1011 0x55 r/w no acc
|
|
|
|
* 110x 0xaa r/w r/o
|
|
|
|
* 11x0 0xaa r/w r/o
|
|
|
|
* 1111 0xff r/w r/w
|
|
|
|
*/
|
|
|
|
.macro armv3_set_pte_ext wc_disable=1
|
2010-11-16 07:16:01 +07:00
|
|
|
str r1, [r0], #2048 @ linux version
|
2008-09-06 23:19:08 +07:00
|
|
|
|
2010-11-16 15:40:36 +07:00
|
|
|
eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY
|
2008-09-06 23:19:08 +07:00
|
|
|
|
|
|
|
bic r2, r1, #PTE_SMALL_AP_MASK @ keep C, B bits
|
|
|
|
bic r2, r2, #PTE_TYPE_MASK
|
|
|
|
orr r2, r2, #PTE_TYPE_SMALL
|
|
|
|
|
|
|
|
tst r3, #L_PTE_USER @ user?
|
|
|
|
orrne r2, r2, #PTE_SMALL_AP_URO_SRW
|
|
|
|
|
2010-11-16 15:40:36 +07:00
|
|
|
tst r3, #L_PTE_RDONLY | L_PTE_DIRTY @ write and dirty?
|
2008-09-06 23:19:08 +07:00
|
|
|
orreq r2, r2, #PTE_SMALL_AP_UNO_SRW
|
|
|
|
|
|
|
|
tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ present and young?
|
|
|
|
movne r2, #0
|
|
|
|
|
|
|
|
.if \wc_disable
|
|
|
|
#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
|
|
|
|
tst r2, #PTE_CACHEABLE
|
|
|
|
bicne r2, r2, #PTE_BUFFERABLE
|
|
|
|
#endif
|
|
|
|
.endif
|
2010-11-16 07:16:01 +07:00
|
|
|
str r2, [r0] @ hardware version
|
2008-09-06 23:19:08 +07:00
|
|
|
.endm
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Xscale set_pte_ext translation, split into two halves to cope
|
|
|
|
* with work-arounds. r3 must be preserved by code between these
|
|
|
|
* two macros.
|
|
|
|
*
|
|
|
|
* Permission translation:
|
|
|
|
* YUWD AP SVC User
|
|
|
|
* 0xxx 00 no acc no acc
|
|
|
|
* 100x 00 r/o no acc
|
|
|
|
* 10x0 00 r/o no acc
|
|
|
|
* 1011 01 r/w no acc
|
|
|
|
* 110x 10 r/w r/o
|
|
|
|
* 11x0 10 r/w r/o
|
|
|
|
* 1111 11 r/w r/w
|
|
|
|
*/
|
|
|
|
.macro xscale_set_pte_ext_prologue
|
2010-11-16 07:16:01 +07:00
|
|
|
str r1, [r0] @ linux version
|
2008-09-06 23:19:08 +07:00
|
|
|
|
2010-11-16 15:40:36 +07:00
|
|
|
eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY
|
2008-09-06 23:19:08 +07:00
|
|
|
|
|
|
|
bic r2, r1, #PTE_SMALL_AP_MASK @ keep C, B bits
|
|
|
|
orr r2, r2, #PTE_TYPE_EXT @ extended page
|
|
|
|
|
|
|
|
tst r3, #L_PTE_USER @ user?
|
|
|
|
orrne r2, r2, #PTE_EXT_AP_URO_SRW @ yes -> user r/o, system r/w
|
|
|
|
|
2010-11-16 15:40:36 +07:00
|
|
|
tst r3, #L_PTE_RDONLY | L_PTE_DIRTY @ write and dirty?
|
2008-09-06 23:19:08 +07:00
|
|
|
orreq r2, r2, #PTE_EXT_AP_UNO_SRW @ yes -> user n/a, system r/w
|
|
|
|
@ combined with user -> user r/w
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro xscale_set_pte_ext_epilogue
|
|
|
|
tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ present and young?
|
|
|
|
movne r2, #0 @ no -> fault
|
|
|
|
|
2010-11-16 07:16:01 +07:00
|
|
|
str r2, [r0, #2048]! @ hardware version
|
2008-09-06 23:19:08 +07:00
|
|
|
mov ip, #0
|
|
|
|
mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line
|
|
|
|
mcr p15, 0, ip, c7, c10, 4 @ data write barrier
|
|
|
|
.endm
|
2011-06-23 23:07:40 +07:00
|
|
|
|
2018-05-10 19:07:29 +07:00
|
|
|
.macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0, bugs=0
|
2018-12-06 23:36:38 +07:00
|
|
|
/*
|
|
|
|
* If we are building for big.Little with branch predictor hardening,
|
|
|
|
* we need the processor function tables to remain available after boot.
|
|
|
|
*/
|
2018-12-07 20:11:15 +07:00
|
|
|
#if defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR)
|
2018-12-06 23:36:38 +07:00
|
|
|
.section ".rodata"
|
|
|
|
#endif
|
2011-06-23 23:07:40 +07:00
|
|
|
.type \name\()_processor_functions, #object
|
|
|
|
.align 2
|
|
|
|
ENTRY(\name\()_processor_functions)
|
|
|
|
.word \dabort
|
|
|
|
.word \pabort
|
|
|
|
.word cpu_\name\()_proc_init
|
2018-05-10 19:07:29 +07:00
|
|
|
.word \bugs
|
2011-06-23 23:07:40 +07:00
|
|
|
.word cpu_\name\()_proc_fin
|
|
|
|
.word cpu_\name\()_reset
|
|
|
|
.word cpu_\name\()_do_idle
|
|
|
|
.word cpu_\name\()_dcache_clean_area
|
|
|
|
.word cpu_\name\()_switch_mm
|
|
|
|
|
|
|
|
.if \nommu
|
|
|
|
.word 0
|
|
|
|
.else
|
|
|
|
.word cpu_\name\()_set_pte_ext
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if \suspend
|
|
|
|
.word cpu_\name\()_suspend_size
|
2014-09-24 00:18:32 +07:00
|
|
|
#ifdef CONFIG_ARM_CPU_SUSPEND
|
2011-06-23 23:07:40 +07:00
|
|
|
.word cpu_\name\()_do_suspend
|
|
|
|
.word cpu_\name\()_do_resume
|
2011-07-21 20:42:40 +07:00
|
|
|
#else
|
|
|
|
.word 0
|
|
|
|
.word 0
|
|
|
|
#endif
|
2011-06-23 23:07:40 +07:00
|
|
|
.else
|
|
|
|
.word 0
|
|
|
|
.word 0
|
|
|
|
.word 0
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.size \name\()_processor_functions, . - \name\()_processor_functions
|
2018-12-07 20:11:15 +07:00
|
|
|
#if defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR)
|
2018-12-06 23:36:38 +07:00
|
|
|
.previous
|
|
|
|
#endif
|
2011-06-23 23:07:40 +07:00
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro define_cache_functions name:req
|
|
|
|
.align 2
|
|
|
|
.type \name\()_cache_fns, #object
|
|
|
|
ENTRY(\name\()_cache_fns)
|
|
|
|
.long \name\()_flush_icache_all
|
|
|
|
.long \name\()_flush_kern_cache_all
|
2012-09-06 20:05:13 +07:00
|
|
|
.long \name\()_flush_kern_cache_louis
|
2011-06-23 23:07:40 +07:00
|
|
|
.long \name\()_flush_user_cache_all
|
|
|
|
.long \name\()_flush_user_cache_range
|
|
|
|
.long \name\()_coherent_kern_range
|
|
|
|
.long \name\()_coherent_user_range
|
|
|
|
.long \name\()_flush_kern_dcache_area
|
|
|
|
.long \name\()_dma_map_area
|
|
|
|
.long \name\()_dma_unmap_area
|
|
|
|
.long \name\()_dma_flush_range
|
|
|
|
.size \name\()_cache_fns, . - \name\()_cache_fns
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro define_tlb_functions name:req, flags_up:req, flags_smp
|
|
|
|
.type \name\()_tlb_fns, #object
|
|
|
|
ENTRY(\name\()_tlb_fns)
|
|
|
|
.long \name\()_flush_user_tlb_range
|
|
|
|
.long \name\()_flush_kern_tlb_range
|
|
|
|
.ifnb \flags_smp
|
|
|
|
ALT_SMP(.long \flags_smp )
|
|
|
|
ALT_UP(.long \flags_up )
|
|
|
|
.else
|
|
|
|
.long \flags_up
|
|
|
|
.endif
|
|
|
|
.size \name\()_tlb_fns, . - \name\()_tlb_fns
|
|
|
|
.endm
|
2013-06-23 16:17:11 +07:00
|
|
|
|
|
|
|
.macro globl_equ x, y
|
|
|
|
.globl \x
|
|
|
|
.equ \x, \y
|
|
|
|
.endm
|
2015-03-18 13:29:32 +07:00
|
|
|
|
|
|
|
.macro initfn, func, base
|
|
|
|
.long \func - \base
|
|
|
|
.endm
|
2015-04-15 04:28:25 +07:00
|
|
|
|
2015-04-05 05:22:07 +07:00
|
|
|
/*
|
|
|
|
* Macro to calculate the log2 size for the protection region
|
|
|
|
* registers. This calculates rd = log2(size) - 1. tmp must
|
|
|
|
* not be the same register as rd.
|
|
|
|
*/
|
|
|
|
.macro pr_sz, rd, size, tmp
|
|
|
|
mov \tmp, \size, lsr #12
|
|
|
|
mov \rd, #11
|
|
|
|
1: movs \tmp, \tmp, lsr #1
|
|
|
|
addne \rd, \rd, #1
|
|
|
|
bne 1b
|
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Macro to generate a protection region register value
|
|
|
|
* given a pre-masked address, size, and enable bit.
|
|
|
|
* Corrupts size.
|
|
|
|
*/
|
|
|
|
.macro pr_val, dest, addr, size, enable
|
|
|
|
pr_sz \dest, \size, \size @ calculate log2(size) - 1
|
|
|
|
orr \dest, \addr, \dest, lsl #1 @ mask in the region size
|
|
|
|
orr \dest, \dest, \enable
|
|
|
|
.endm
|