smallworld-re 1.0.2__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smallworld/analyses/__init__.py +8 -0
- smallworld/analyses/analysis.py +8 -67
- smallworld/analyses/code_coverage.py +1 -2
- smallworld/analyses/colorizer.py +301 -534
- smallworld/analyses/colorizer_def_use.py +217 -0
- smallworld/analyses/colorizer_summary.py +173 -83
- smallworld/analyses/field_detection/field_analysis.py +7 -8
- smallworld/analyses/field_detection/hints.py +1 -1
- smallworld/analyses/field_detection/malloc.py +2 -2
- smallworld/analyses/trace_execution.py +160 -0
- smallworld/analyses/trace_execution_types.py +42 -0
- smallworld/analyses/unstable/angr/divergence.py +1 -2
- smallworld/analyses/unstable/angr/model.py +5 -6
- smallworld/analyses/unstable/angr_nwbt.py +3 -4
- smallworld/analyses/unstable/code_coverage.py +2 -3
- smallworld/analyses/unstable/code_reachable.py +2 -3
- smallworld/analyses/unstable/control_flow_tracer.py +2 -3
- smallworld/analyses/unstable/pointer_finder.py +2 -3
- smallworld/analyses/unstable/utils/tui.py +71 -0
- smallworld/emulators/__init__.py +3 -1
- smallworld/emulators/angr/angr.py +30 -9
- smallworld/emulators/angr/machdefs/__init__.py +2 -0
- smallworld/emulators/angr/machdefs/aarch64.py +1 -1
- smallworld/emulators/angr/machdefs/amd64.py +0 -4
- smallworld/emulators/angr/machdefs/arm.py +0 -2
- smallworld/emulators/angr/machdefs/i386.py +0 -2
- smallworld/emulators/angr/machdefs/loongarch.py +340 -0
- smallworld/emulators/angr/machdefs/machdef.py +1 -8
- smallworld/emulators/angr/machdefs/mips.py +0 -2
- smallworld/emulators/angr/machdefs/mips64.py +0 -2
- smallworld/emulators/angr/machdefs/ppc.py +1 -2
- smallworld/emulators/angr/machdefs/riscv.py +8 -10
- smallworld/emulators/angr/machdefs/xtensa.py +7 -4
- smallworld/emulators/emulator.py +22 -0
- smallworld/emulators/ghidra/__init__.py +37 -0
- smallworld/emulators/ghidra/ghidra.py +513 -0
- smallworld/emulators/ghidra/machdefs/__init__.py +31 -0
- smallworld/emulators/ghidra/machdefs/aarch64.py +289 -0
- smallworld/emulators/ghidra/machdefs/amd64.py +185 -0
- smallworld/emulators/ghidra/machdefs/arm.py +370 -0
- smallworld/emulators/ghidra/machdefs/i386.py +109 -0
- smallworld/emulators/ghidra/machdefs/loongarch.py +162 -0
- smallworld/emulators/ghidra/machdefs/machdef.py +81 -0
- smallworld/emulators/ghidra/machdefs/mips.py +163 -0
- smallworld/emulators/ghidra/machdefs/mips64.py +186 -0
- smallworld/emulators/ghidra/machdefs/ppc.py +98 -0
- smallworld/emulators/ghidra/machdefs/riscv.py +208 -0
- smallworld/emulators/ghidra/machdefs/xtensa.py +21 -0
- smallworld/emulators/ghidra/typing.py +28 -0
- smallworld/emulators/hookable.py +18 -4
- smallworld/emulators/panda/machdefs/__init__.py +2 -2
- smallworld/emulators/panda/machdefs/aarch64.py +186 -11
- smallworld/emulators/panda/machdefs/amd64.py +103 -11
- smallworld/emulators/panda/machdefs/arm.py +216 -20
- smallworld/emulators/panda/machdefs/i386.py +30 -7
- smallworld/emulators/panda/machdefs/machdef.py +9 -16
- smallworld/emulators/panda/machdefs/mips.py +49 -5
- smallworld/emulators/panda/machdefs/mips64.py +57 -5
- smallworld/emulators/panda/machdefs/ppc.py +38 -13
- smallworld/emulators/panda/panda.py +146 -44
- smallworld/emulators/unicorn/__init__.py +2 -0
- smallworld/emulators/unicorn/machdefs/aarch64.py +253 -264
- smallworld/emulators/unicorn/machdefs/amd64.py +254 -259
- smallworld/emulators/unicorn/machdefs/arm.py +200 -212
- smallworld/emulators/unicorn/machdefs/i386.py +84 -90
- smallworld/emulators/unicorn/machdefs/machdef.py +2 -23
- smallworld/emulators/unicorn/machdefs/mips.py +127 -135
- smallworld/emulators/unicorn/unicorn.py +52 -13
- smallworld/helpers.py +4 -19
- smallworld/hinting/hinting.py +22 -192
- smallworld/hinting/hints.py +50 -18
- smallworld/instructions/bsid.py +8 -8
- smallworld/logging.py +4 -2
- smallworld/platforms/__init__.py +12 -0
- smallworld/platforms/defs/__init__.py +36 -0
- smallworld/platforms/defs/aarch64.py +450 -0
- smallworld/platforms/defs/amd64.py +463 -0
- smallworld/platforms/defs/arm.py +519 -0
- smallworld/platforms/defs/i386.py +258 -0
- smallworld/platforms/defs/loongarch.py +270 -0
- smallworld/platforms/defs/mips.py +321 -0
- smallworld/platforms/defs/mips64.py +313 -0
- smallworld/platforms/defs/platformdef.py +97 -0
- smallworld/platforms/defs/powerpc.py +259 -0
- smallworld/platforms/defs/riscv.py +257 -0
- smallworld/platforms/defs/xtensa.py +96 -0
- smallworld/{platforms.py → platforms/platforms.py} +3 -0
- smallworld/state/cpus/__init__.py +2 -0
- smallworld/state/cpus/aarch64.py +0 -9
- smallworld/state/cpus/amd64.py +6 -28
- smallworld/state/cpus/arm.py +0 -11
- smallworld/state/cpus/cpu.py +0 -11
- smallworld/state/cpus/i386.py +0 -7
- smallworld/state/cpus/loongarch.py +299 -0
- smallworld/state/cpus/mips.py +4 -47
- smallworld/state/cpus/mips64.py +18 -58
- smallworld/state/cpus/powerpc.py +2 -9
- smallworld/state/cpus/riscv.py +1 -11
- smallworld/state/cpus/xtensa.py +0 -5
- smallworld/state/memory/code.py +44 -2
- smallworld/state/memory/elf/__init__.py +5 -1
- smallworld/state/memory/elf/coredump/__init__.py +3 -0
- smallworld/state/memory/elf/coredump/coredump.py +46 -0
- smallworld/state/memory/elf/coredump/prstatus/__init__.py +27 -0
- smallworld/state/memory/elf/coredump/prstatus/aarch64.py +46 -0
- smallworld/state/memory/elf/coredump/prstatus/amd64.py +40 -0
- smallworld/state/memory/elf/coredump/prstatus/arm.py +53 -0
- smallworld/state/memory/elf/coredump/prstatus/i386.py +30 -0
- smallworld/state/memory/elf/coredump/prstatus/mips.py +55 -0
- smallworld/state/memory/elf/coredump/prstatus/mips64.py +57 -0
- smallworld/state/memory/elf/coredump/prstatus/ppc.py +82 -0
- smallworld/state/memory/elf/coredump/prstatus/prstatus.py +129 -0
- smallworld/state/memory/elf/elf.py +225 -61
- smallworld/state/memory/elf/register_state.py +36 -0
- smallworld/state/memory/elf/rela/__init__.py +2 -0
- smallworld/state/memory/elf/rela/aarch64.py +3 -1
- smallworld/state/memory/elf/rela/amd64.py +4 -2
- smallworld/state/memory/elf/rela/arm.py +4 -2
- smallworld/state/memory/elf/rela/i386.py +4 -2
- smallworld/state/memory/elf/rela/loongarch.py +32 -0
- smallworld/state/memory/elf/rela/mips.py +39 -18
- smallworld/state/memory/elf/rela/ppc.py +31 -14
- smallworld/state/memory/elf/structs.py +3 -0
- smallworld/state/memory/heap.py +2 -2
- smallworld/state/memory/memory.py +18 -0
- smallworld/state/memory/pe/__init__.py +3 -0
- smallworld/state/memory/pe/pe.py +361 -0
- smallworld/state/memory/pe/structs.py +60 -0
- smallworld/state/memory/stack/__init__.py +2 -0
- smallworld/state/memory/stack/loongarch.py +26 -0
- smallworld/state/models/__init__.py +29 -2
- smallworld/state/models/aarch64/__init__.py +1 -0
- smallworld/state/models/aarch64/systemv/__init__.py +6 -0
- smallworld/state/models/aarch64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/aarch64/systemv/c99/signal.py +16 -0
- smallworld/state/models/aarch64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/aarch64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/aarch64/systemv/c99/string.py +139 -0
- smallworld/state/models/aarch64/systemv/c99/time.py +61 -0
- smallworld/state/models/aarch64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/aarch64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/aarch64/systemv/posix/signal.py +157 -0
- smallworld/state/models/aarch64/systemv/systemv.py +80 -0
- smallworld/state/models/amd64/__init__.py +1 -0
- smallworld/state/models/amd64/systemv/__init__.py +6 -0
- smallworld/state/models/amd64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/amd64/systemv/c99/signal.py +16 -0
- smallworld/state/models/amd64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/amd64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/amd64/systemv/c99/string.py +139 -0
- smallworld/state/models/amd64/systemv/c99/time.py +61 -0
- smallworld/state/models/amd64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/amd64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/amd64/systemv/posix/signal.py +157 -0
- smallworld/state/models/amd64/systemv/systemv.py +78 -0
- smallworld/state/models/armel/__init__.py +1 -0
- smallworld/state/models/armel/systemv/__init__.py +6 -0
- smallworld/state/models/armel/systemv/c99/__init__.py +12 -0
- smallworld/state/models/armel/systemv/c99/signal.py +16 -0
- smallworld/state/models/armel/systemv/c99/stdio.py +265 -0
- smallworld/state/models/armel/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/armel/systemv/c99/string.py +139 -0
- smallworld/state/models/armel/systemv/c99/time.py +61 -0
- smallworld/state/models/armel/systemv/posix/__init__.py +6 -0
- smallworld/state/models/armel/systemv/posix/libgen.py +16 -0
- smallworld/state/models/armel/systemv/posix/signal.py +157 -0
- smallworld/state/models/armel/systemv/systemv.py +82 -0
- smallworld/state/models/armhf/__init__.py +1 -0
- smallworld/state/models/armhf/systemv/__init__.py +6 -0
- smallworld/state/models/armhf/systemv/c99/__init__.py +12 -0
- smallworld/state/models/armhf/systemv/c99/signal.py +16 -0
- smallworld/state/models/armhf/systemv/c99/stdio.py +265 -0
- smallworld/state/models/armhf/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/armhf/systemv/c99/string.py +139 -0
- smallworld/state/models/armhf/systemv/c99/time.py +61 -0
- smallworld/state/models/armhf/systemv/posix/__init__.py +6 -0
- smallworld/state/models/armhf/systemv/posix/libgen.py +16 -0
- smallworld/state/models/armhf/systemv/posix/signal.py +157 -0
- smallworld/state/models/armhf/systemv/systemv.py +77 -0
- smallworld/state/models/c99/__init__.py +12 -0
- smallworld/state/models/c99/fmt_print.py +915 -0
- smallworld/state/models/c99/fmt_scan.py +864 -0
- smallworld/state/models/c99/math.py +362 -0
- smallworld/state/models/c99/signal.py +71 -0
- smallworld/state/models/c99/stdio.py +1305 -0
- smallworld/state/models/c99/stdlib.py +595 -0
- smallworld/state/models/c99/string.py +674 -0
- smallworld/state/models/c99/time.py +340 -0
- smallworld/state/models/c99/utils.py +89 -0
- smallworld/state/models/cstd.py +759 -0
- smallworld/state/models/errno.py +581 -0
- smallworld/state/models/filedesc.py +515 -0
- smallworld/state/models/i386/__init__.py +1 -0
- smallworld/state/models/i386/systemv/__init__.py +6 -0
- smallworld/state/models/i386/systemv/c99/__init__.py +12 -0
- smallworld/state/models/i386/systemv/c99/signal.py +16 -0
- smallworld/state/models/i386/systemv/c99/stdio.py +265 -0
- smallworld/state/models/i386/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/i386/systemv/c99/string.py +139 -0
- smallworld/state/models/i386/systemv/c99/time.py +61 -0
- smallworld/state/models/i386/systemv/posix/__init__.py +6 -0
- smallworld/state/models/i386/systemv/posix/libgen.py +16 -0
- smallworld/state/models/i386/systemv/posix/signal.py +157 -0
- smallworld/state/models/i386/systemv/systemv.py +71 -0
- smallworld/state/models/loongarch64/__init__.py +1 -0
- smallworld/state/models/loongarch64/systemv/__init__.py +6 -0
- smallworld/state/models/loongarch64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/loongarch64/systemv/c99/signal.py +16 -0
- smallworld/state/models/loongarch64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/loongarch64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/loongarch64/systemv/c99/string.py +139 -0
- smallworld/state/models/loongarch64/systemv/c99/time.py +61 -0
- smallworld/state/models/loongarch64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/loongarch64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/loongarch64/systemv/posix/signal.py +157 -0
- smallworld/state/models/loongarch64/systemv/systemv.py +83 -0
- smallworld/state/models/mips/__init__.py +1 -0
- smallworld/state/models/mips/systemv/__init__.py +6 -0
- smallworld/state/models/mips/systemv/c99/__init__.py +12 -0
- smallworld/state/models/mips/systemv/c99/signal.py +16 -0
- smallworld/state/models/mips/systemv/c99/stdio.py +265 -0
- smallworld/state/models/mips/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/mips/systemv/c99/string.py +139 -0
- smallworld/state/models/mips/systemv/c99/time.py +61 -0
- smallworld/state/models/mips/systemv/posix/__init__.py +6 -0
- smallworld/state/models/mips/systemv/posix/libgen.py +16 -0
- smallworld/state/models/mips/systemv/posix/signal.py +157 -0
- smallworld/state/models/mips/systemv/systemv.py +78 -0
- smallworld/state/models/mips64/__init__.py +1 -0
- smallworld/state/models/mips64/systemv/__init__.py +6 -0
- smallworld/state/models/mips64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/mips64/systemv/c99/signal.py +16 -0
- smallworld/state/models/mips64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/mips64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/mips64/systemv/c99/string.py +139 -0
- smallworld/state/models/mips64/systemv/c99/time.py +61 -0
- smallworld/state/models/mips64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/mips64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/mips64/systemv/posix/signal.py +157 -0
- smallworld/state/models/mips64/systemv/systemv.py +98 -0
- smallworld/state/models/mips64el/__init__.py +1 -0
- smallworld/state/models/mips64el/systemv/__init__.py +6 -0
- smallworld/state/models/mips64el/systemv/c99/__init__.py +12 -0
- smallworld/state/models/mips64el/systemv/c99/signal.py +16 -0
- smallworld/state/models/mips64el/systemv/c99/stdio.py +265 -0
- smallworld/state/models/mips64el/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/mips64el/systemv/c99/string.py +139 -0
- smallworld/state/models/mips64el/systemv/c99/time.py +61 -0
- smallworld/state/models/mips64el/systemv/posix/__init__.py +6 -0
- smallworld/state/models/mips64el/systemv/posix/libgen.py +16 -0
- smallworld/state/models/mips64el/systemv/posix/signal.py +157 -0
- smallworld/state/models/mips64el/systemv/systemv.py +96 -0
- smallworld/state/models/mipsel/__init__.py +1 -0
- smallworld/state/models/mipsel/systemv/__init__.py +6 -0
- smallworld/state/models/mipsel/systemv/c99/__init__.py +12 -0
- smallworld/state/models/mipsel/systemv/c99/signal.py +16 -0
- smallworld/state/models/mipsel/systemv/c99/stdio.py +265 -0
- smallworld/state/models/mipsel/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/mipsel/systemv/c99/string.py +139 -0
- smallworld/state/models/mipsel/systemv/c99/time.py +61 -0
- smallworld/state/models/mipsel/systemv/posix/__init__.py +6 -0
- smallworld/state/models/mipsel/systemv/posix/libgen.py +16 -0
- smallworld/state/models/mipsel/systemv/posix/signal.py +157 -0
- smallworld/state/models/mipsel/systemv/systemv.py +78 -0
- smallworld/state/models/model.py +27 -2
- smallworld/state/models/posix/__init__.py +6 -0
- smallworld/state/models/posix/libgen.py +123 -0
- smallworld/state/models/posix/signal.py +690 -0
- smallworld/state/models/powerpc/__init__.py +1 -0
- smallworld/state/models/powerpc/systemv/__init__.py +6 -0
- smallworld/state/models/powerpc/systemv/c99/__init__.py +12 -0
- smallworld/state/models/powerpc/systemv/c99/signal.py +16 -0
- smallworld/state/models/powerpc/systemv/c99/stdio.py +265 -0
- smallworld/state/models/powerpc/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/powerpc/systemv/c99/string.py +139 -0
- smallworld/state/models/powerpc/systemv/c99/time.py +61 -0
- smallworld/state/models/powerpc/systemv/posix/__init__.py +6 -0
- smallworld/state/models/powerpc/systemv/posix/libgen.py +16 -0
- smallworld/state/models/powerpc/systemv/posix/signal.py +157 -0
- smallworld/state/models/powerpc/systemv/systemv.py +93 -0
- smallworld/state/models/riscv64/__init__.py +1 -0
- smallworld/state/models/riscv64/systemv/__init__.py +6 -0
- smallworld/state/models/riscv64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/riscv64/systemv/c99/signal.py +16 -0
- smallworld/state/models/riscv64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/riscv64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/riscv64/systemv/c99/string.py +139 -0
- smallworld/state/models/riscv64/systemv/c99/time.py +61 -0
- smallworld/state/models/riscv64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/riscv64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/riscv64/systemv/posix/signal.py +157 -0
- smallworld/state/models/riscv64/systemv/systemv.py +85 -0
- smallworld/state/state.py +65 -24
- smallworld/state/unstable/elf.py +16 -31
- smallworld/utils.py +6 -1
- {smallworld_re-1.0.2.dist-info → smallworld_re-2.0.0.dist-info}/METADATA +76 -43
- smallworld_re-2.0.0.dist-info/RECORD +374 -0
- {smallworld_re-1.0.2.dist-info → smallworld_re-2.0.0.dist-info}/WHEEL +1 -1
- smallworld/state/models/x86/__init__.py +0 -2
- smallworld/state/models/x86/microsoftcdecl.py +0 -35
- smallworld/state/models/x86/systemv.py +0 -240
- smallworld_re-1.0.2.dist-info/RECORD +0 -166
- /smallworld/state/models/{posix.py → _posix.py} +0 -0
- {smallworld_re-1.0.2.dist-info → smallworld_re-2.0.0.dist-info}/entry_points.txt +0 -0
- {smallworld_re-1.0.2.dist-info → smallworld_re-2.0.0.dist-info/licenses}/LICENSE.txt +0 -0
- {smallworld_re-1.0.2.dist-info → smallworld_re-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,519 @@
|
|
1
|
+
import typing
|
2
|
+
|
3
|
+
import capstone
|
4
|
+
|
5
|
+
from ..platforms import Architecture, Byteorder
|
6
|
+
from .platformdef import PlatformDef, RegisterAliasDef, RegisterDef
|
7
|
+
|
8
|
+
|
9
|
+
class ARMPlatformDef(PlatformDef):
|
10
|
+
"""Base class for ARM 32-bit platform definitions
|
11
|
+
|
12
|
+
All ARM CPUs share the same basic registers,
|
13
|
+
but there are at least two dimensions of difference:
|
14
|
+
M-series vs A/R series, and FPU model.
|
15
|
+
"""
|
16
|
+
|
17
|
+
byteorder = Byteorder.LITTLE
|
18
|
+
|
19
|
+
address_size = 4
|
20
|
+
|
21
|
+
capstone_arch = capstone.CS_ARCH_ARM
|
22
|
+
capstone_mode = capstone.CS_MODE_ARM
|
23
|
+
|
24
|
+
conditional_branch_mnemonics = {
|
25
|
+
# Conditional branch
|
26
|
+
"beq",
|
27
|
+
"bne",
|
28
|
+
"bcs",
|
29
|
+
"bhs",
|
30
|
+
"bcc",
|
31
|
+
"blo",
|
32
|
+
"bmi",
|
33
|
+
"bpl",
|
34
|
+
"bvs",
|
35
|
+
"bvc",
|
36
|
+
"bhi",
|
37
|
+
"bls",
|
38
|
+
"bge",
|
39
|
+
"blt",
|
40
|
+
"bgt",
|
41
|
+
"ble",
|
42
|
+
# Compare and branch on zero/non-zero
|
43
|
+
"cbz",
|
44
|
+
"cbnz",
|
45
|
+
}
|
46
|
+
|
47
|
+
pc_register = "pc"
|
48
|
+
sp_register = "sp"
|
49
|
+
|
50
|
+
# NOTE: r9, r10, r11, and r12 technically have special purposes,
|
51
|
+
# but they're optional.
|
52
|
+
general_purpose_registers = [f"r{i}" for i in range(0, 13)]
|
53
|
+
|
54
|
+
@property
|
55
|
+
def registers(self) -> typing.Dict[str, RegisterDef]:
|
56
|
+
return self._registers
|
57
|
+
|
58
|
+
@property
|
59
|
+
def compare_mnemonics(self) -> typing.Set[str]:
|
60
|
+
return self._compare_mnemonics
|
61
|
+
|
62
|
+
def __init__(self):
|
63
|
+
super().__init__()
|
64
|
+
self._compare_mnemonics = {
|
65
|
+
# Integer comparison
|
66
|
+
"cmp",
|
67
|
+
"cmn",
|
68
|
+
"tst",
|
69
|
+
# Conditional integer comparison
|
70
|
+
"cmpeq",
|
71
|
+
"cmpne",
|
72
|
+
"cmpcs",
|
73
|
+
"cmphs",
|
74
|
+
"cmpcc",
|
75
|
+
"cmplo",
|
76
|
+
"cmpmi",
|
77
|
+
"cmppl",
|
78
|
+
"cmpvs",
|
79
|
+
"cmpvc",
|
80
|
+
"cmphi",
|
81
|
+
"cmpls",
|
82
|
+
"cmpge",
|
83
|
+
"cmplt",
|
84
|
+
"cmpgt",
|
85
|
+
"cmple",
|
86
|
+
"cmneq",
|
87
|
+
"cmnne",
|
88
|
+
"cmncs",
|
89
|
+
"cmnhs",
|
90
|
+
"cmncc",
|
91
|
+
"cmnlo",
|
92
|
+
"cmnmi",
|
93
|
+
"cmnpl",
|
94
|
+
"cmnvs",
|
95
|
+
"cmnvc",
|
96
|
+
"cmnhi",
|
97
|
+
"cmnls",
|
98
|
+
"cmnge",
|
99
|
+
"cmnlt",
|
100
|
+
"cmngt",
|
101
|
+
"cmnle",
|
102
|
+
"tsteq",
|
103
|
+
"tstne",
|
104
|
+
"tstcs",
|
105
|
+
"tsths",
|
106
|
+
"tstcc",
|
107
|
+
"tstlo",
|
108
|
+
"tstmi",
|
109
|
+
"tstpl",
|
110
|
+
"tstvs",
|
111
|
+
"tstvc",
|
112
|
+
"tsthi",
|
113
|
+
"tstls",
|
114
|
+
"tstge",
|
115
|
+
"tstlt",
|
116
|
+
"tstgt",
|
117
|
+
"tstle",
|
118
|
+
}
|
119
|
+
self._registers = {
|
120
|
+
# *** General-purpose registers ***
|
121
|
+
"r0": RegisterDef(name="r0", size=4),
|
122
|
+
"r1": RegisterDef(name="r1", size=4),
|
123
|
+
"r2": RegisterDef(name="r2", size=4),
|
124
|
+
"r3": RegisterDef(name="r3", size=4),
|
125
|
+
"r4": RegisterDef(name="r4", size=4),
|
126
|
+
"r5": RegisterDef(name="r5", size=4),
|
127
|
+
"r6": RegisterDef(name="r6", size=4),
|
128
|
+
"r7": RegisterDef(name="r7", size=4),
|
129
|
+
"r8": RegisterDef(name="r8", size=4),
|
130
|
+
# r9 doubles as the Static base pointer
|
131
|
+
"r9": RegisterDef(name="r9", size=4),
|
132
|
+
"sb": RegisterAliasDef(name="sb", parent="r9", size=4, offset=0),
|
133
|
+
# r10 doubles as the Stack Limit pointer
|
134
|
+
"r10": RegisterDef(name="r10", size=4),
|
135
|
+
"sl": RegisterAliasDef(name="sl", parent="r10", size=4, offset=0),
|
136
|
+
# r11 doubles as the Frame Pointer, if desired.
|
137
|
+
"r11": RegisterDef(name="r11", size=4),
|
138
|
+
"fp": RegisterAliasDef(name="fp", parent="r11", size=4, offset=0),
|
139
|
+
# r12 doubles as the Intra-call scratch register
|
140
|
+
"r12": RegisterDef(name="r12", size=4),
|
141
|
+
"ip": RegisterAliasDef(name="ip", parent="r12", size=4, offset=0),
|
142
|
+
# sp is technically also r13, but is never aliased as such
|
143
|
+
"sp": RegisterDef(name="sp", size=4),
|
144
|
+
# lr is technically also r14, but is never aliased as such
|
145
|
+
"lr": RegisterDef(name="lr", size=4),
|
146
|
+
# pc is technically also r15, but is never aliased as such
|
147
|
+
"pc": RegisterDef(name="pc", size=4),
|
148
|
+
}
|
149
|
+
|
150
|
+
|
151
|
+
class ARMPlatformMixinM:
|
152
|
+
"""Abstract class for M-series CPUs.
|
153
|
+
|
154
|
+
The M-series CPUs are built for embedded applications,
|
155
|
+
and have an extremely simplified privilege model,
|
156
|
+
and don't often have an MMU.
|
157
|
+
"""
|
158
|
+
|
159
|
+
def __init__(self):
|
160
|
+
super().__init__()
|
161
|
+
self._registers |= {
|
162
|
+
# *** Special Registers ***
|
163
|
+
# Program Status Register
|
164
|
+
# NOTE: PSR can be accessed through several masked aliases.
|
165
|
+
# These are read-only, so I'm not including them.
|
166
|
+
# - apsr: Just the condition flags
|
167
|
+
# - ipsr: Just exception information
|
168
|
+
# - epsr: Just execution state info
|
169
|
+
# - iapsr: apsr | ipsr
|
170
|
+
# - eapsr: apsr | epsr
|
171
|
+
# - iepsr: ipsr | epsr
|
172
|
+
# - xpsr: apsr | ipsr | epsr
|
173
|
+
"psr": RegisterDef(name="psr", size=4),
|
174
|
+
# Exception Mask Register
|
175
|
+
"primask": RegisterDef(name="primask", size=4),
|
176
|
+
# Base Priority Mask Register
|
177
|
+
"basepri": RegisterDef(name="basepri", size=4),
|
178
|
+
# Fault Mask Register
|
179
|
+
"faultmask": RegisterDef(name="faultmask", size=4),
|
180
|
+
# Control register; includes a lot of flags.
|
181
|
+
"control": RegisterDef(name="control", size=4),
|
182
|
+
# *** Stack Pointer Bank ***
|
183
|
+
# sp is actually an alias to one of these two.
|
184
|
+
# Exactly which one depends on a bit in control.
|
185
|
+
# Emulators that care should be careful when loading state.
|
186
|
+
# Main Stack Pointer
|
187
|
+
"msp": RegisterDef(name="msp", size=4),
|
188
|
+
# Process Stack Pointer
|
189
|
+
"psp": RegisterDef(name="psp", size=4),
|
190
|
+
}
|
191
|
+
|
192
|
+
|
193
|
+
class ARMPlatformMixinRA:
|
194
|
+
"""Abstract class for R- or A-series CPUs.
|
195
|
+
|
196
|
+
The A- series supports full application-style multi-tasking,
|
197
|
+
and thus needs a much more complicated privileged model
|
198
|
+
than the M-series.
|
199
|
+
|
200
|
+
The R- series uses the same privilege model as the A- series,
|
201
|
+
but it's designed for real-time operations.
|
202
|
+
The major differences are in the MMU semantics, which don't impact registers.
|
203
|
+
"""
|
204
|
+
|
205
|
+
def __init__(self):
|
206
|
+
super().__init__()
|
207
|
+
self._registers |= {
|
208
|
+
# *** Special Registers ***
|
209
|
+
# Current Program Status Register
|
210
|
+
# NOTE: CPSR can be accessed through several masked aliases.
|
211
|
+
# These are read-only, so I'm not including them.
|
212
|
+
# - isetstate: Just includes instruction set control bits
|
213
|
+
# - itstate: Just includes state bits for Thumb IT instruction
|
214
|
+
"cpsr": RegisterDef(name="cpsr", size=4),
|
215
|
+
# Saved Program Status Register
|
216
|
+
"spsr": RegisterDef(name="spsr", size=4),
|
217
|
+
# *** Register Banks ***
|
218
|
+
# sp, lr, and spsr are actually aliases to one of these.
|
219
|
+
# Which one they reference depends on execution mode.
|
220
|
+
# Emulators that care should be careful when loading state.
|
221
|
+
# NOTE: Use User-mode copies of registers unless the mode has its own.
|
222
|
+
# NOTE: The user-mode bank is only used if you're in a different privilege mode.
|
223
|
+
# User-mode Stack Pointer
|
224
|
+
"sp_usr": RegisterDef(name="sp_usr", size=4),
|
225
|
+
# User-mode Link Register
|
226
|
+
"lr_usr": RegisterDef(name="lr_usr", size=4),
|
227
|
+
# User-mode r8
|
228
|
+
"r8_usr": RegisterDef(name="r8_usr", size=4),
|
229
|
+
# User-mode r9
|
230
|
+
"r9_usr": RegisterDef(name="r9_usr", size=4),
|
231
|
+
# User-mode r10
|
232
|
+
"r10_usr": RegisterDef(name="r10_usr", size=4),
|
233
|
+
# User-mode r11
|
234
|
+
"r11_usr": RegisterDef(name="r11_usr", size=4),
|
235
|
+
# User-mode r12
|
236
|
+
"r12_usr": RegisterDef(name="r12_usr", size=4),
|
237
|
+
# Hypervisor Stack Pointer
|
238
|
+
"sp_hyp": RegisterDef(name="sp_hyp", size=4),
|
239
|
+
# Hypervisor Saved PSR
|
240
|
+
"spsr_hyp": RegisterDef(name="spsr_hyp", size=4),
|
241
|
+
# Hypervisor Exception Link Register
|
242
|
+
# NOTE: This isn't so much banked, as it only exists in hypervisor mode.
|
243
|
+
"elr_hyp": RegisterDef(name="elr_hyp", size=4),
|
244
|
+
# Supervisor Stack Pointer
|
245
|
+
"sp_svc": RegisterDef(name="sp_svc", size=4),
|
246
|
+
# Supervisor Link Register
|
247
|
+
"lr_svc": RegisterDef(name="lr_svc", size=4),
|
248
|
+
# Supervisor Saved PSR
|
249
|
+
"spsr_svc": RegisterDef(name="spsr_svc", size=4),
|
250
|
+
# Abort-state Stack Pointer
|
251
|
+
"sp_abt": RegisterDef(name="sp_abt", size=4),
|
252
|
+
# Abort-state Link Register
|
253
|
+
"lr_abt": RegisterDef(name="lr_abt", size=4),
|
254
|
+
# Abort-state Saved PSR
|
255
|
+
"spsr_abt": RegisterDef(name="spsr_abt", size=4),
|
256
|
+
# Undefined-mode Stack Pointer
|
257
|
+
"sp_und": RegisterDef(name="sp_und", size=4),
|
258
|
+
# Undefined-mode Link Register
|
259
|
+
"lr_und": RegisterDef(name="lr_und", size=4),
|
260
|
+
# Undefined-mode Saved PSR
|
261
|
+
"spsr_und": RegisterDef(name="spsr_und", size=4),
|
262
|
+
# Monitor-mode Stack Pointer
|
263
|
+
"sp_mon": RegisterDef(name="sp_mon", size=4),
|
264
|
+
# Monitor-mode Link Register
|
265
|
+
"lr_mon": RegisterDef(name="lr_mon", size=4),
|
266
|
+
# Monitor-mode Saved PSR
|
267
|
+
"spsr_mon": RegisterDef(name="spsr_mon", size=4),
|
268
|
+
# IRQ-mode Stack Pointer
|
269
|
+
"sp_irq": RegisterDef(name="sp_irq", size=4),
|
270
|
+
# IRQ-mode Link Register
|
271
|
+
"lr_irq": RegisterDef(name="lr_irq", size=4),
|
272
|
+
# IRQ-mode Saved PSR
|
273
|
+
"spsr_irq": RegisterDef(name="spsr_irq", size=4),
|
274
|
+
# FIQ-mode Stack Pointer
|
275
|
+
"sp_fiq": RegisterDef(name="sp_fiq", size=4),
|
276
|
+
# FIQ-mode Link Register
|
277
|
+
"lr_fiq": RegisterDef(name="lr_fiq", size=4),
|
278
|
+
# FIQ-mode Saved PSR
|
279
|
+
"spsr_fiq": RegisterDef(name="spsr_fiq", size=4),
|
280
|
+
# FIQ-mode r8
|
281
|
+
"r8_fiq": RegisterDef(name="r8_fiq", size=4),
|
282
|
+
# FIQ-mode r9
|
283
|
+
"r9_fiq": RegisterDef(name="r9_fiq", size=4),
|
284
|
+
# FIQ-mode r10
|
285
|
+
"r10_fiq": RegisterDef(name="r10_fiq", size=4),
|
286
|
+
# FIQ-mode r11
|
287
|
+
"r11_fiq": RegisterDef(name="r11_fiq", size=4),
|
288
|
+
# FIQ-mode r12
|
289
|
+
"r12_fiq": RegisterDef(name="r12_fiq", size=4),
|
290
|
+
}
|
291
|
+
|
292
|
+
|
293
|
+
class ARMPlatformMixinFPEL:
|
294
|
+
"""Mixin for little-endian ARM CPUs with FP extensions
|
295
|
+
|
296
|
+
This is a simpler floating-point extension
|
297
|
+
which offers 64-bit scalar operations
|
298
|
+
"""
|
299
|
+
|
300
|
+
def __init__(self):
|
301
|
+
super().__init__()
|
302
|
+
# TODO: What do the FP floating-point instructions look like?
|
303
|
+
# I only have docs for VFP.
|
304
|
+
self._registers |= {
|
305
|
+
# *** Floating point control registers ***
|
306
|
+
# Floating-point Status and Control Register
|
307
|
+
"fpscr": RegisterDef(name="fpscr", size=4),
|
308
|
+
# Floating-point Exception Control Register
|
309
|
+
"fpexc": RegisterDef(name="fpexc", size=4),
|
310
|
+
# Floating-point System ID Register
|
311
|
+
"fpsid": RegisterDef(name="fpsid", size=4),
|
312
|
+
# Media and VFP Feature Register 0
|
313
|
+
"mvfr0": RegisterDef(name="mvfr0", size=4),
|
314
|
+
# Media and VFP Feature Register 1
|
315
|
+
"mvfr1": RegisterDef(name="mvfr1", size=4),
|
316
|
+
# *** Floating point registers ***
|
317
|
+
"d0": RegisterDef(name="d0", size=8),
|
318
|
+
"s0": RegisterAliasDef(name="s0", parent="d0", size=4, offset=0),
|
319
|
+
"s1": RegisterAliasDef(name="s1", parent="d0", size=4, offset=4),
|
320
|
+
"d1": RegisterDef(name="d1", size=8),
|
321
|
+
"s2": RegisterAliasDef(name="s2", parent="d1", size=4, offset=0),
|
322
|
+
"s3": RegisterAliasDef(name="s3", parent="d1", size=4, offset=4),
|
323
|
+
"d2": RegisterDef(name="d2", size=8),
|
324
|
+
"s4": RegisterAliasDef(name="s4", parent="d2", size=4, offset=0),
|
325
|
+
"s5": RegisterAliasDef(name="s5", parent="d2", size=4, offset=4),
|
326
|
+
"d3": RegisterDef(name="d3", size=8),
|
327
|
+
"s6": RegisterAliasDef(name="s6", parent="d3", size=4, offset=0),
|
328
|
+
"s7": RegisterAliasDef(name="s7", parent="d3", size=4, offset=4),
|
329
|
+
"d4": RegisterDef(name="d4", size=8),
|
330
|
+
"s8": RegisterAliasDef(name="s8", parent="d4", size=4, offset=0),
|
331
|
+
"s9": RegisterAliasDef(name="s9", parent="d4", size=4, offset=4),
|
332
|
+
"d5": RegisterDef(name="d5", size=8),
|
333
|
+
"s10": RegisterAliasDef(name="s10", parent="d5", size=4, offset=0),
|
334
|
+
"s11": RegisterAliasDef(name="s11", parent="d5", size=4, offset=4),
|
335
|
+
"d6": RegisterDef(name="d6", size=8),
|
336
|
+
"s12": RegisterAliasDef(name="s12", parent="d6", size=4, offset=0),
|
337
|
+
"s13": RegisterAliasDef(name="s13", parent="d6", size=4, offset=4),
|
338
|
+
"d7": RegisterDef(name="d7", size=8),
|
339
|
+
"s14": RegisterAliasDef(name="s14", parent="d7", size=4, offset=0),
|
340
|
+
"s15": RegisterAliasDef(name="s15", parent="d7", size=4, offset=4),
|
341
|
+
"d8": RegisterDef(name="d8", size=8),
|
342
|
+
"s16": RegisterAliasDef(name="s16", parent="d8", size=4, offset=0),
|
343
|
+
"s17": RegisterAliasDef(name="s17", parent="d8", size=4, offset=4),
|
344
|
+
"d9": RegisterDef(name="d9", size=8),
|
345
|
+
"s18": RegisterAliasDef(name="s18", parent="d9", size=4, offset=0),
|
346
|
+
"s19": RegisterAliasDef(name="s19", parent="d9", size=4, offset=4),
|
347
|
+
"d10": RegisterDef(name="d10", size=8),
|
348
|
+
"s20": RegisterAliasDef(name="s20", parent="d10", size=4, offset=0),
|
349
|
+
"s21": RegisterAliasDef(name="s21", parent="d10", size=4, offset=4),
|
350
|
+
"d11": RegisterDef(name="d11", size=8),
|
351
|
+
"s22": RegisterAliasDef(name="s22", parent="d11", size=4, offset=0),
|
352
|
+
"s23": RegisterAliasDef(name="s23", parent="d11", size=4, offset=4),
|
353
|
+
"d12": RegisterDef(name="d12", size=8),
|
354
|
+
"s24": RegisterAliasDef(name="s24", parent="d12", size=4, offset=0),
|
355
|
+
"s25": RegisterAliasDef(name="s25", parent="d12", size=4, offset=4),
|
356
|
+
"d13": RegisterDef(name="d13", size=8),
|
357
|
+
"s26": RegisterAliasDef(name="s26", parent="d13", size=4, offset=0),
|
358
|
+
"s27": RegisterAliasDef(name="s27", parent="d13", size=4, offset=4),
|
359
|
+
"d14": RegisterDef(name="d14", size=8),
|
360
|
+
"s28": RegisterAliasDef(name="s28", parent="d14", size=4, offset=0),
|
361
|
+
"s29": RegisterAliasDef(name="s29", parent="d14", size=4, offset=4),
|
362
|
+
"d15": RegisterDef(name="d15", size=8),
|
363
|
+
"s30": RegisterAliasDef(name="s30", parent="d15", size=4, offset=0),
|
364
|
+
"s31": RegisterAliasDef(name="s31", parent="d15", size=4, offset=4),
|
365
|
+
}
|
366
|
+
|
367
|
+
|
368
|
+
class ARMPlatformMixinVFPEL:
|
369
|
+
"""Mixin for little-endian ARM CPUs with VFP/NEON extensions
|
370
|
+
|
371
|
+
This is a newer floating-point extension
|
372
|
+
which supports up to 128-bit scalar and SIMD vector operations.
|
373
|
+
|
374
|
+
VFP and NEON are always optional extensions;
|
375
|
+
the two can exist independently, and VFP can support 16 or 32 double registers.
|
376
|
+
This is the maximal set of registers, assuming both are supported.
|
377
|
+
"""
|
378
|
+
|
379
|
+
def __init__(self):
|
380
|
+
super().__init__()
|
381
|
+
# TODO: Add the floating-point conditionals
|
382
|
+
self._registers |= {
|
383
|
+
# *** Floating-point Control Registers ***
|
384
|
+
# Floating-point Status and Control Register
|
385
|
+
"fpscr": RegisterDef(name="fpscr", size=4),
|
386
|
+
# Floating-point Exception Control Register
|
387
|
+
"fpexc": RegisterDef(name="fpexc", size=4),
|
388
|
+
# Floating-point System ID Register
|
389
|
+
"fpsid": RegisterDef(name="fpsid", size=4),
|
390
|
+
# Media and VFP Feature Register 0
|
391
|
+
"mvfr0": RegisterDef(name="mvfr0", size=4),
|
392
|
+
# Media and VFP Feature Register 1
|
393
|
+
"mvfr1": RegisterDef(name="mvfr1", size=4),
|
394
|
+
# *** Floating-point Registers ****
|
395
|
+
"q0": RegisterDef(name="q0", size=16),
|
396
|
+
"d0": RegisterAliasDef(name="d0", parent="q0", size=8, offset=0),
|
397
|
+
"s0": RegisterAliasDef(name="s0", parent="q0", size=4, offset=0),
|
398
|
+
"s1": RegisterAliasDef(name="s1", parent="q0", size=4, offset=4),
|
399
|
+
"d1": RegisterAliasDef(name="d1", parent="q0", size=8, offset=8),
|
400
|
+
"s2": RegisterAliasDef(name="s2", parent="q0", size=4, offset=8),
|
401
|
+
"s3": RegisterAliasDef(name="s3", parent="q0", size=4, offset=12),
|
402
|
+
"q1": RegisterDef(name="q1", size=16),
|
403
|
+
"d2": RegisterAliasDef(name="d2", parent="q1", size=8, offset=0),
|
404
|
+
"s4": RegisterAliasDef(name="s4", parent="q1", size=4, offset=0),
|
405
|
+
"s5": RegisterAliasDef(name="s5", parent="q1", size=4, offset=4),
|
406
|
+
"d3": RegisterAliasDef(name="d3", parent="q1", size=8, offset=8),
|
407
|
+
"s6": RegisterAliasDef(name="s6", parent="q1", size=4, offset=8),
|
408
|
+
"s7": RegisterAliasDef(name="s7", parent="q1", size=4, offset=12),
|
409
|
+
"q2": RegisterDef(name="q2", size=16),
|
410
|
+
"d4": RegisterAliasDef(name="d4", parent="q2", size=8, offset=0),
|
411
|
+
"s8": RegisterAliasDef(name="s8", parent="q2", size=4, offset=0),
|
412
|
+
"s9": RegisterAliasDef(name="s9", parent="q2", size=4, offset=4),
|
413
|
+
"d5": RegisterAliasDef(name="d5", parent="q2", size=8, offset=8),
|
414
|
+
"s10": RegisterAliasDef(name="s10", parent="q2", size=4, offset=8),
|
415
|
+
"s11": RegisterAliasDef(name="s11", parent="q2", size=4, offset=12),
|
416
|
+
"q3": RegisterDef(name="q3", size=16),
|
417
|
+
"d6": RegisterAliasDef(name="d6", parent="q3", size=8, offset=0),
|
418
|
+
"s12": RegisterAliasDef(name="s12", parent="q3", size=4, offset=0),
|
419
|
+
"s13": RegisterAliasDef(name="s13", parent="q3", size=4, offset=4),
|
420
|
+
"d7": RegisterAliasDef(name="d7", parent="q3", size=8, offset=8),
|
421
|
+
"s14": RegisterAliasDef(name="s14", parent="q3", size=4, offset=8),
|
422
|
+
"s15": RegisterAliasDef(name="s15", parent="q3", size=4, offset=12),
|
423
|
+
"q4": RegisterDef(name="q4", size=16),
|
424
|
+
"d8": RegisterAliasDef(name="d8", parent="q4", size=8, offset=0),
|
425
|
+
"s16": RegisterAliasDef(name="s16", parent="q4", size=4, offset=0),
|
426
|
+
"s17": RegisterAliasDef(name="s17", parent="q4", size=4, offset=4),
|
427
|
+
"d9": RegisterAliasDef(name="d9", parent="q4", size=8, offset=8),
|
428
|
+
"s18": RegisterAliasDef(name="s18", parent="q4", size=4, offset=8),
|
429
|
+
"s19": RegisterAliasDef(name="s19", parent="q4", size=4, offset=12),
|
430
|
+
"q5": RegisterDef(name="q5", size=16),
|
431
|
+
"d10": RegisterAliasDef(name="d10", parent="q5", size=8, offset=0),
|
432
|
+
"s20": RegisterAliasDef(name="s20", parent="q5", size=4, offset=0),
|
433
|
+
"s21": RegisterAliasDef(name="s21", parent="q5", size=4, offset=4),
|
434
|
+
"d11": RegisterAliasDef(name="d11", parent="q5", size=8, offset=8),
|
435
|
+
"s22": RegisterAliasDef(name="s22", parent="q5", size=4, offset=8),
|
436
|
+
"s23": RegisterAliasDef(name="s23", parent="q5", size=4, offset=12),
|
437
|
+
"q6": RegisterDef(name="q6", size=16),
|
438
|
+
"d12": RegisterAliasDef(name="d12", parent="q6", size=8, offset=0),
|
439
|
+
"s24": RegisterAliasDef(name="s24", parent="q6", size=4, offset=0),
|
440
|
+
"s25": RegisterAliasDef(name="s25", parent="q6", size=4, offset=4),
|
441
|
+
"d13": RegisterAliasDef(name="d13", parent="q6", size=8, offset=8),
|
442
|
+
"s26": RegisterAliasDef(name="s26", parent="q6", size=4, offset=8),
|
443
|
+
"s27": RegisterAliasDef(name="s27", parent="q6", size=4, offset=12),
|
444
|
+
"q7": RegisterDef(name="q7", size=16),
|
445
|
+
"d14": RegisterAliasDef(name="d14", parent="q7", size=8, offset=0),
|
446
|
+
"s28": RegisterAliasDef(name="s28", parent="q7", size=4, offset=0),
|
447
|
+
"s29": RegisterAliasDef(name="s29", parent="q7", size=4, offset=4),
|
448
|
+
"d15": RegisterAliasDef(name="d15", parent="q7", size=8, offset=8),
|
449
|
+
"s30": RegisterAliasDef(name="s30", parent="q7", size=4, offset=8),
|
450
|
+
"s31": RegisterAliasDef(name="s31", parent="q7", size=4, offset=12),
|
451
|
+
# NOTE: This isn't a typo; there are only 32 single-precision sX registers
|
452
|
+
# This does mean that only half the VFP register space can be used
|
453
|
+
# for single-precision arithmetic.
|
454
|
+
"q8": RegisterDef(name="q8", size=16),
|
455
|
+
"d16": RegisterAliasDef(name="d16", parent="q8", size=8, offset=0),
|
456
|
+
"d17": RegisterAliasDef(name="d17", parent="q8", size=8, offset=8),
|
457
|
+
"q9": RegisterDef(name="q9", size=16),
|
458
|
+
"d18": RegisterAliasDef(name="d18", parent="q9", size=8, offset=0),
|
459
|
+
"d19": RegisterAliasDef(name="d19", parent="q9", size=8, offset=8),
|
460
|
+
"q10": RegisterDef(name="q10", size=16),
|
461
|
+
"d20": RegisterAliasDef(name="d20", parent="q10", size=8, offset=0),
|
462
|
+
"d21": RegisterAliasDef(name="d21", parent="q10", size=8, offset=8),
|
463
|
+
"q11": RegisterDef(name="q11", size=16),
|
464
|
+
"d22": RegisterAliasDef(name="d22", parent="q11", size=8, offset=0),
|
465
|
+
"d23": RegisterAliasDef(name="d23", parent="q11", size=8, offset=8),
|
466
|
+
"q12": RegisterDef(name="q12", size=16),
|
467
|
+
"d24": RegisterAliasDef(name="d24", parent="q12", size=8, offset=0),
|
468
|
+
"d25": RegisterAliasDef(name="d25", parent="q12", size=8, offset=8),
|
469
|
+
"q13": RegisterDef(name="q13", size=16),
|
470
|
+
"d26": RegisterAliasDef(name="d26", parent="q13", size=8, offset=0),
|
471
|
+
"d27": RegisterAliasDef(name="d27", parent="q13", size=8, offset=8),
|
472
|
+
"q14": RegisterDef(name="q14", size=16),
|
473
|
+
"d28": RegisterAliasDef(name="d28", parent="q14", size=8, offset=0),
|
474
|
+
"d29": RegisterAliasDef(name="d29", parent="q14", size=8, offset=8),
|
475
|
+
"q15": RegisterDef(name="q15", size=16),
|
476
|
+
"d30": RegisterAliasDef(name="d30", parent="q15", size=8, offset=0),
|
477
|
+
"d31": RegisterAliasDef(name="d31", parent="q15", size=8, offset=8),
|
478
|
+
}
|
479
|
+
|
480
|
+
|
481
|
+
class ARMv5T(ARMPlatformMixinM, ARMPlatformDef):
|
482
|
+
"""Platform definition for ARMv5t little-endian."""
|
483
|
+
|
484
|
+
architecture = Architecture.ARM_V5T
|
485
|
+
|
486
|
+
|
487
|
+
class ARMv6M(ARMPlatformMixinFPEL, ARMPlatformMixinM, ARMPlatformDef):
|
488
|
+
"""Platform definition for ARMv6m little-endian."""
|
489
|
+
|
490
|
+
architecture = Architecture.ARM_V6M
|
491
|
+
|
492
|
+
|
493
|
+
class ARMv6MThumb(ARMv6M):
|
494
|
+
"""Platform definition for ARMv6m little-endian in thumb mode.
|
495
|
+
|
496
|
+
Thumb is annoying; most emulators have a very hard time
|
497
|
+
switching between arm and thumb instructions,
|
498
|
+
despite it being a key feature of many CPUs.
|
499
|
+
"""
|
500
|
+
|
501
|
+
architecture = Architecture.ARM_V6M_THUMB
|
502
|
+
|
503
|
+
|
504
|
+
class ARMv7M(ARMPlatformMixinFPEL, ARMPlatformMixinM, ARMPlatformDef):
|
505
|
+
"""Platform definition for ARMv7m little-endian"""
|
506
|
+
|
507
|
+
architecture = Architecture.ARM_V7M
|
508
|
+
|
509
|
+
|
510
|
+
class ARMv7R(ARMPlatformMixinVFPEL, ARMPlatformMixinRA, ARMPlatformDef):
|
511
|
+
"""Platform definition for ARMv7r little-endian"""
|
512
|
+
|
513
|
+
architecture = Architecture.ARM_V7R
|
514
|
+
|
515
|
+
|
516
|
+
class ARMv7A(ARMPlatformMixinVFPEL, ARMPlatformMixinRA, ARMPlatformDef):
|
517
|
+
"""Platform definition for ARMv7a little-endian"""
|
518
|
+
|
519
|
+
architecture = Architecture.ARM_V7A
|