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-07-28 02:44:44 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2004 Axis Communications AB
|
|
|
|
*
|
|
|
|
* Code for handling break 8, hardware breakpoint, single step, and serial
|
|
|
|
* port exceptions for kernel debugging purposes.
|
|
|
|
*/
|
|
|
|
|
2010-08-03 20:17:20 +08:00
|
|
|
#include <hwregs/intr_vect.h>
|
2005-07-28 02:44:44 +08:00
|
|
|
|
|
|
|
;; Exported functions.
|
|
|
|
.globl kgdb_handle_exception
|
|
|
|
|
|
|
|
kgdb_handle_exception:
|
|
|
|
|
|
|
|
;; Create a register image of the caller.
|
|
|
|
;;
|
|
|
|
;; First of all, save the ACR on the stack since we need it for address calculations.
|
|
|
|
;; We put it into the register struct later.
|
|
|
|
|
|
|
|
subq 4, $sp
|
|
|
|
move.d $acr, [$sp]
|
|
|
|
|
|
|
|
;; Now we are free to use ACR all we want.
|
|
|
|
;; If we were running this handler with interrupts on, we would have to be careful
|
|
|
|
;; to save and restore CCS manually, but since we aren't we treat it like every other
|
|
|
|
;; register.
|
|
|
|
|
|
|
|
move.d reg, $acr
|
|
|
|
move.d $r0, [$acr] ; Save R0 (start of register struct)
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r1, [$acr] ; Save R1
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r2, [$acr] ; Save R2
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r3, [$acr] ; Save R3
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r4, [$acr] ; Save R4
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r5, [$acr] ; Save R5
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r6, [$acr] ; Save R6
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r7, [$acr] ; Save R7
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r8, [$acr] ; Save R8
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r9, [$acr] ; Save R9
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r10, [$acr] ; Save R10
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r11, [$acr] ; Save R11
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r12, [$acr] ; Save R12
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $r13, [$acr] ; Save R13
|
|
|
|
addq 4, $acr
|
|
|
|
move.d $sp, [$acr] ; Save SP (R14)
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; The ACR register is already saved on the stack, so pop it from there.
|
|
|
|
move.d [$sp],$r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
move $bz, [$acr]
|
|
|
|
addq 1, $acr
|
|
|
|
move $vr, [$acr]
|
|
|
|
addq 1, $acr
|
|
|
|
move $pid, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $srs, [$acr]
|
|
|
|
addq 1, $acr
|
|
|
|
move $wz, [$acr]
|
|
|
|
addq 2, $acr
|
|
|
|
move $exs, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $eda, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $mof, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $dz, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $ebp, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $erp, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $srp, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $nrp, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $ccs, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $usp, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $spc, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Skip the pseudo-PC.
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Save the support registers in bank 0 - 3.
|
|
|
|
clear.d $r1 ; Bank counter
|
|
|
|
move.d sreg, $acr
|
|
|
|
|
|
|
|
;; Bank 0
|
|
|
|
move $r1, $srs
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
move $s0, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s1, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s2, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s3, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s4, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s5, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s6, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s7, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s8, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s9, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s10, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s11, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s12, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Nothing in S13 - S15, bank 0
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Bank 1 and bank 2 have the same layout, hence the loop.
|
|
|
|
addq 1, $r1
|
|
|
|
1:
|
|
|
|
move $r1, $srs
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
move $s0, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s1, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s2, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s3, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s4, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s5, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s6, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Nothing in S7 - S15, bank 1 and 2
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
addq 1, $r1
|
|
|
|
cmpq 3, $r1
|
|
|
|
bne 1b
|
|
|
|
nop
|
|
|
|
|
|
|
|
;; Bank 3
|
|
|
|
move $r1, $srs
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
move $s0, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s1, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s2, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s3, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s4, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s5, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s6, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s7, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s8, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s9, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s10, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s11, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s12, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s13, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
move $s14, $r0
|
|
|
|
move.d $r0, [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
;; Nothing in S15, bank 3
|
|
|
|
clear.d [$acr]
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Check what got us here: get IDX field of EXS.
|
|
|
|
move $exs, $r10
|
|
|
|
and.d 0xff00, $r10
|
|
|
|
lsrq 8, $r10
|
|
|
|
#if defined(CONFIG_ETRAX_KGDB_PORT0)
|
|
|
|
cmp.d SER0_INTR_VECT, $r10 ; IRQ for serial port 0
|
|
|
|
beq sigint
|
|
|
|
nop
|
|
|
|
#elif defined(CONFIG_ETRAX_KGDB_PORT1)
|
|
|
|
cmp.d SER1_INTR_VECT, $r10 ; IRQ for serial port 1
|
|
|
|
beq sigint
|
|
|
|
nop
|
|
|
|
#elif defined(CONFIG_ETRAX_KGDB_PORT2)
|
|
|
|
cmp.d SER2_INTR_VECT, $r10 ; IRQ for serial port 2
|
|
|
|
beq sigint
|
|
|
|
nop
|
|
|
|
#elif defined(CONFIG_ETRAX_KGDB_PORT3)
|
|
|
|
cmp.d SER3_INTR_VECT, $r10 ; IRQ for serial port 3
|
|
|
|
beq sigint
|
|
|
|
nop
|
|
|
|
#endif
|
|
|
|
;; Multiple interrupt must be due to serial break.
|
|
|
|
cmp.d 0x30, $r10 ; Multiple interrupt
|
|
|
|
beq sigint
|
|
|
|
nop
|
|
|
|
;; Neither of those? Then it's a sigtrap.
|
|
|
|
ba handle_comm
|
|
|
|
moveq 5, $r10 ; Set SIGTRAP (delay slot)
|
|
|
|
|
|
|
|
sigint:
|
|
|
|
;; Serial interrupt; get character
|
|
|
|
jsr getDebugChar
|
|
|
|
nop ; Delay slot
|
|
|
|
cmp.b 3, $r10 ; \003 (Ctrl-C)?
|
|
|
|
bne return ; No, get out of here
|
|
|
|
nop
|
|
|
|
moveq 2, $r10 ; Set SIGINT
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Handle the communication
|
|
|
|
;;
|
|
|
|
handle_comm:
|
|
|
|
move.d internal_stack+1020, $sp ; Use the internal stack which grows upwards
|
|
|
|
jsr handle_exception ; Interactive routine
|
|
|
|
nop
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; Return to the caller
|
|
|
|
;;
|
|
|
|
return:
|
|
|
|
|
|
|
|
;; First of all, write the support registers.
|
|
|
|
clear.d $r1 ; Bank counter
|
|
|
|
move.d sreg, $acr
|
|
|
|
|
|
|
|
;; Bank 0
|
|
|
|
move $r1, $srs
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s0
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s1
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s2
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s3
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s4
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s5
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Nothing in S6 - S7, bank 0.
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s8
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s9
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s10
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s11
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s12
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Nothing in S13 - S15, bank 0
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Bank 1 and bank 2 have the same layout, hence the loop.
|
|
|
|
addq 1, $r1
|
|
|
|
2:
|
|
|
|
move $r1, $srs
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s0
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s1
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s2
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; S3 (MM_CAUSE) is read-only.
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s4
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; FIXME: Actually write S5/S6? (Affects MM_CAUSE.)
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Nothing in S7 - S15, bank 1 and 2
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
addq 1, $r1
|
|
|
|
cmpq 3, $r1
|
|
|
|
bne 2b
|
|
|
|
nop
|
|
|
|
|
|
|
|
;; Bank 3
|
|
|
|
move $r1, $srs
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s0
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s1
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s2
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s3
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s4
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s5
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s6
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s7
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s8
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s9
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s10
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s11
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s12
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s13
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r0
|
|
|
|
move $r0, $s14
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Nothing in S15, bank 3
|
|
|
|
addq 4, $acr
|
|
|
|
|
|
|
|
;; Now, move on to the regular register restoration process.
|
|
|
|
|
|
|
|
move.d reg, $acr ; Reset ACR to point at the beginning of the register image
|
|
|
|
move.d [$acr], $r0 ; Restore R0
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r1 ; Restore R1
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r2 ; Restore R2
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r3 ; Restore R3
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r4 ; Restore R4
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r5 ; Restore R5
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r6 ; Restore R6
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r7 ; Restore R7
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r8 ; Restore R8
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r9 ; Restore R9
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r10 ; Restore R10
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r11 ; Restore R11
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r12 ; Restore R12
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $r13 ; Restore R13
|
|
|
|
|
|
|
|
;;
|
|
|
|
;; We restore all registers, even though some of them probably haven't changed.
|
|
|
|
;;
|
|
|
|
|
|
|
|
addq 4, $acr
|
|
|
|
move.d [$acr], $sp ; Restore SP (R14)
|
|
|
|
|
|
|
|
;; ACR cannot be restored just yet.
|
|
|
|
addq 8, $acr
|
|
|
|
|
|
|
|
;; Skip BZ, VR.
|
|
|
|
addq 2, $acr
|
|
|
|
|
|
|
|
move [$acr], $pid ; Restore PID
|
|
|
|
addq 4, $acr
|
|
|
|
move [$acr], $srs ; Restore SRS
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
addq 1, $acr
|
|
|
|
|
|
|
|
;; Skip WZ.
|
|
|
|
addq 2, $acr
|
|
|
|
|
|
|
|
move [$acr], $exs ; Restore EXS.
|
|
|
|
addq 4, $acr
|
|
|
|
move [$acr], $eda ; Restore EDA.
|
|
|
|
addq 4, $acr
|
|
|
|
move [$acr], $mof ; Restore MOF.
|
|
|
|
|
|
|
|
;; Skip DZ.
|
|
|
|
addq 8, $acr
|
|
|
|
|
|
|
|
move [$acr], $ebp ; Restore EBP.
|
|
|
|
addq 4, $acr
|
|
|
|
move [$acr], $erp ; Restore ERP.
|
|
|
|
addq 4, $acr
|
|
|
|
move [$acr], $srp ; Restore SRP.
|
|
|
|
addq 4, $acr
|
|
|
|
move [$acr], $nrp ; Restore NRP.
|
|
|
|
addq 4, $acr
|
|
|
|
move [$acr], $ccs ; Restore CCS like an ordinary register.
|
|
|
|
addq 4, $acr
|
|
|
|
move [$acr], $usp ; Restore USP
|
|
|
|
addq 4, $acr
|
|
|
|
move [$acr], $spc ; Restore SPC
|
|
|
|
; No restoration of pseudo-PC of course.
|
|
|
|
|
|
|
|
move.d reg, $acr ; Reset ACR to point at the beginning of the register image
|
|
|
|
add.d 15*4, $acr
|
|
|
|
move.d [$acr], $acr ; Finally, restore ACR.
|
|
|
|
rete ; Same as jump ERP
|
|
|
|
rfe ; Shifts CCS
|