mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Initial SuperH SH-1/SH-2 Processor Support
This commit is contained in:
21
Ghidra/Processors/SuperH/LICENSE
Normal file
21
Ghidra/Processors/SuperH/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2019 VGKintsugi
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
1
Ghidra/Processors/SuperH/Module.manifest
Normal file
1
Ghidra/Processors/SuperH/Module.manifest
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
4
Ghidra/Processors/SuperH/data/languages/sh-1.slaspec
Normal file
4
Ghidra/Processors/SuperH/data/languages/sh-1.slaspec
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
@define SH_VERSION "1"
|
||||||
|
|
||||||
|
@include "superh.sinc"
|
||||||
3
Ghidra/Processors/SuperH/data/languages/sh-2.slaspec
Normal file
3
Ghidra/Processors/SuperH/data/languages/sh-2.slaspec
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@define SH_VERSION "2"
|
||||||
|
|
||||||
|
@include "superh.sinc"
|
||||||
72
Ghidra/Processors/SuperH/data/languages/superh.cspec
Normal file
72
Ghidra/Processors/SuperH/data/languages/superh.cspec
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<compiler_spec>
|
||||||
|
<data_organization> <!-- These tags were taken from https://gcc-renesas.com/manuals/SH-ABI-Specification.html-->
|
||||||
|
<absolute_max_alignment value="0" />
|
||||||
|
<machine_alignment value="2" />
|
||||||
|
<default_alignment value="1" />
|
||||||
|
<default_pointer_alignment value="4" />
|
||||||
|
<pointer_size value="4" />
|
||||||
|
<wchar_size value="4" />
|
||||||
|
<short_size value="2" />
|
||||||
|
<integer_size value="4" />
|
||||||
|
<long_size value="4" />
|
||||||
|
<long_long_size value="8" />
|
||||||
|
<float_size value="4" />
|
||||||
|
<double_size value="8" />
|
||||||
|
<long_double_size value="8" />
|
||||||
|
<size_alignment_map>
|
||||||
|
<entry size="1" alignment="1" />
|
||||||
|
<entry size="2" alignment="2" />
|
||||||
|
<entry size="4" alignment="4" />
|
||||||
|
<entry size="8" alignment="8" />
|
||||||
|
</size_alignment_map>
|
||||||
|
</data_organization>
|
||||||
|
<global>
|
||||||
|
<range space="ram"/>
|
||||||
|
</global>
|
||||||
|
<stackpointer register="r15" space="ram"/>
|
||||||
|
<default_proto>
|
||||||
|
<prototype name="__stdcall" extrapop="0" stackshift="0">
|
||||||
|
<input>
|
||||||
|
<pentry minsize="1" maxsize="4" extension="inttype">
|
||||||
|
<register name="r4"/>
|
||||||
|
</pentry>
|
||||||
|
<pentry minsize="1" maxsize="4" extension="inttype">
|
||||||
|
<register name="r5"/>
|
||||||
|
</pentry>
|
||||||
|
<pentry minsize="1" maxsize="4" extension="inttype">
|
||||||
|
<register name="r6"/>
|
||||||
|
</pentry>
|
||||||
|
<pentry minsize="1" maxsize="4" extension="inttype">
|
||||||
|
<register name="r7"/>
|
||||||
|
</pentry>
|
||||||
|
<pentry minsize="1" maxsize="500" align="4">
|
||||||
|
<addr offset="0" space="stack"/>
|
||||||
|
</pentry>
|
||||||
|
</input>
|
||||||
|
<output killedbycall="true">
|
||||||
|
<pentry minsize="1" maxsize="4" extension="inttype">
|
||||||
|
<register name="r0"/>
|
||||||
|
</pentry>
|
||||||
|
<pentry minsize="5" maxsize="8">
|
||||||
|
<addr space="join" piece1="r1" piece2="r0"/>
|
||||||
|
</pentry>
|
||||||
|
</output>
|
||||||
|
<unaffected>
|
||||||
|
<register name="r8"/>
|
||||||
|
<register name="r9"/>
|
||||||
|
<register name="r10"/>
|
||||||
|
<register name="r11"/>
|
||||||
|
<register name="r12"/>
|
||||||
|
<register name="r13"/>
|
||||||
|
<register name="r14"/>
|
||||||
|
<register name="r15"/>
|
||||||
|
</unaffected>
|
||||||
|
<killedbycall>
|
||||||
|
<register name="r2"/>
|
||||||
|
<register name="r3"/>
|
||||||
|
</killedbycall>
|
||||||
|
</prototype>
|
||||||
|
</default_proto>
|
||||||
|
</compiler_spec>
|
||||||
26
Ghidra/Processors/SuperH/data/languages/superh.ldefs
Normal file
26
Ghidra/Processors/SuperH/data/languages/superh.ldefs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<language_definitions>
|
||||||
|
<language processor="SuperH"
|
||||||
|
endian="big"
|
||||||
|
size="32"
|
||||||
|
variant="SH-2"
|
||||||
|
version="1.0"
|
||||||
|
slafile="sh-2.sla"
|
||||||
|
processorspec="superh.pspec"
|
||||||
|
id="SuperH:BE:32:SH-2">
|
||||||
|
<description>SuperH SH-2 processor 32-bit big-endian</description>
|
||||||
|
<compiler name="default" spec="superh.cspec" id="default"/>
|
||||||
|
</language>
|
||||||
|
<language processor="SuperH"
|
||||||
|
endian="big"
|
||||||
|
size="32"
|
||||||
|
variant="SH-1"
|
||||||
|
version="1.0"
|
||||||
|
slafile="sh-1.sla"
|
||||||
|
processorspec="superh.pspec"
|
||||||
|
id="SuperH:BE:32:SH-1">
|
||||||
|
<description>SuperH SH-1 processor 32-bit big-endian</description>
|
||||||
|
<compiler name="default" spec="superh.cspec" id="default"/>
|
||||||
|
</language>
|
||||||
|
</language_definitions>
|
||||||
5
Ghidra/Processors/SuperH/data/languages/superh.pspec
Normal file
5
Ghidra/Processors/SuperH/data/languages/superh.pspec
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<processor_spec>
|
||||||
|
<programcounter register="pc"/>
|
||||||
|
</processor_spec>
|
||||||
1410
Ghidra/Processors/SuperH/data/languages/superh.sinc
Normal file
1410
Ghidra/Processors/SuperH/data/languages/superh.sinc
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user