diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2020-04-06 20:59:54 -0700 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2020-04-07 16:08:11 -0700 |
commit | fde557ad25ff3370ef1dd0587d299a86e060bb23 (patch) | |
tree | 03efe47629182bac2fd9f54ab1942a8f22753591 /target/xtensa/cpu.h | |
parent | 1a03362b14affa4d8ddede55df6e21d7a07b87c2 (diff) |
target/xtensa: statically allocate xtensa_insnbufs in DisasContext
Rather than dynamically allocate, and risk failing to free
when we longjmp out of the translator, allocate the maximum
buffer size based on the maximum supported instruction length.
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/xtensa/cpu.h')
-rw-r--r-- | target/xtensa/cpu.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index c0d69fad96..7a46dccbe1 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -213,6 +213,9 @@ enum { #define MEMCTL_IL0EN 0x1 #define MAX_INSN_LENGTH 64 +#define MAX_INSNBUF_LENGTH \ + ((MAX_INSN_LENGTH + sizeof(xtensa_insnbuf_word) - 1) / \ + sizeof(xtensa_insnbuf_word)) #define MAX_INSN_SLOTS 32 #define MAX_OPCODE_ARGS 16 #define MAX_NAREG 64 |