Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-1062 Doctored default calling convention to be compatible with CALL0 in most cases. minor comment fixes

emteere5edfc517d84f
diff --git a/Ghidra/Processors/Xtensa/data/languages/flix.sinc b/Ghidra/Processors/Xtensa/data/languages/flix.sinc
index 5a017ca640..f012f83992 100644
--- a/Ghidra/Processors/Xtensa/data/languages/flix.sinc
+++ b/Ghidra/Processors/Xtensa/data/languages/flix.sinc
@@ -1,7 +1,7 @@
# FLIX (Flexible Length Instruction eXtension) is a Xtensa processor extension
# that allows for variable-length, multi-op instructions with support from 4
-# 16 bytes. Customizable, if if found they should be flagged.
+# 16 bytes. Customizable, if found they should be flagged.
define pcodeop flix;
:FLIX u_4_23 is op0=0xe & u_4_23 {
diff --git a/Ghidra/Processors/Xtensa/data/languages/xtensa.cspec b/Ghidra/Processors/Xtensa/data/languages/xtensa.cspec
index f502e71cce..e4a40899e8 100644
--- a/Ghidra/Processors/Xtensa/data/languages/xtensa.cspec
+++ b/Ghidra/Processors/Xtensa/data/languages/xtensa.cspec
@@ -72,12 +72,18 @@
<unaffected>
<register name="a1"/>
<register name="a0"/>
- <register name="a2"/>
- <register name="a3"/>
- <register name="a4"/>
- <register name="a5"/>
- <register name="a6"/>
- <register name="a7"/>
+ <!--
+ These are commented out, because they get preserved by the current
+ windowing mechanism swapX, callX, restorX
+ Removing them here makes the default calling convention
+ generally compatible with the CALL0 convention in most cases
+ <register name="a2"/>
+ <register name="a3"/>
+ <register name="a4"/>
+ <register name="a5"/>
+ <register name="a6"/>
+ <register name="a7"/>
+ -->
<register name="a8"/>
<register name="a9"/>
<register name="a10"/>
diff --git a/Ghidra/Processors/Xtensa/data/languages/xtensa_be.slaspec b/Ghidra/Processors/Xtensa/data/languages/xtensa_be.slaspec
index e3d7f63a38..ba7d290dfb 100644
--- a/Ghidra/Processors/Xtensa/data/languages/xtensa_be.slaspec
+++ b/Ghidra/Processors/Xtensa/data/languages/xtensa_be.slaspec
@@ -5,7 +5,7 @@
with : phase=1 {
@include "xtensaInstructions.sinc"
-#@include "xtensa_depbits.sinc" #comment floating-point and uncomment this to use depbits
+#@include "xtensa_depbits.sinc" #uncomment this to use depbits instruction, collides with floating point
@include "cust.sinc"
@include "flix.sinc"
diff --git a/Ghidra/Processors/Xtensa/data/languages/xtensa_le.slaspec b/Ghidra/Processors/Xtensa/data/languages/xtensa_le.slaspec
index dab1dac032..44e7d6354e 100644
--- a/Ghidra/Processors/Xtensa/data/languages/xtensa_le.slaspec
+++ b/Ghidra/Processors/Xtensa/data/languages/xtensa_le.slaspec
@@ -5,7 +5,7 @@
with : phase=1 {
@include "xtensaInstructions.sinc"
-#@include "xtensa_depbits.sinc" #comment floating-point and uncomment this to use depbits
+@include "xtensa_depbits.sinc" #uncomment this to use depbits, collides with floating point
@include "cust.sinc"
@include "flix.sinc"