i am being tortured by a crush issue
1)there are two interrupts, in the low priority interrupt, i call a assemble code in the c code , but this asm code crushed when it was interrupted by another interrupt and the asm code will run good without being interrupted.
it seems relating with mode1 regester ,because after removing the mode1 regester operate code , it worked fine.
below is my code
2)if the codes marked red removed , there will be no crush issue, even being interrupted by another interrupt
3)the background is that i am moving some sharc code(21479) to sharc+ core (21565),and found this issue
////////////////////////////////////////////////////////////////////////////////
// includes
////////////////////////////////////////////////////////////////////////////////
#include <platform_include.h>
#include <asm_sprt.h>
.global _calcTest;
.type _calcTest,STT_FUNC;
#if defined(__SHORT_WORD_CODE__)
.segment /sw seg_swco;
#else
.segment /pm seg_pmco;
#endif
_calcTest:
entry;
// save temporary mode1 settings
r0 = mode1;
// switch to secondary register file, except R; set alternate register
bit set mode1 BITM_REGF_MODE1_SRCU|BITM_REGF_MODE1_SRD1L|BITM_REGF_MODE1_SRD1H|BITM_REGF_MODE1_SRD2H|BITM_REGF_MODE1_SRD2L|BITM_REGF_MODE1_ALUSAT|BITM_REGF_MODE1_CBUFEN;
bit clr mode1 BITM_REGF_MODE1_BR8|BITM_REGF_MODE1_BR0|BITM_REGF_MODE1_RND32;
nop;
b0 = r4; // handover pointer to param array
i13 = r0; // save mode1
// switch complete + SIMD
bit set mode1 BITM_REGF_MODE1_PEYEN|BITM_REGF_MODE1_SRCU|BITM_REGF_MODE1_SRD1L|BITM_REGF_MODE1_SRD1H|BITM_REGF_MODE1_SRD2H|BITM_REGF_MODE1_SRD2L|BITM_REGF_MODE1_SRRFL|BITM_REGF_MODE1_SRRFH|BITM_REGF_MODE1_ALUSAT|BITM_REGF_MODE1_CBUFEN;
nop;
nop;
r12 = 0x10000;
dm(i7,m7) = r12;
lcntr = r12, do(pc,.doTest) until lce;
nop;
nop;
nop;
.doTest: nop;
r12 = dm(1,i7);
r0 = m0; // zero return value
// switch to first register file (two machine cycle latency)
mode1 = i13;
nop;
nop;
exit;
_calcTest.end: