diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2025-01-12 00:07:59 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-11 17:07:59 +0100 |
| commit | e533cd0ea1a5385fb9c4e0f4126c6684c46578f6 (patch) | |
| tree | 3809f665f74897f7bb4ca161551d6f458b86641e /src/libtools | |
| parent | 9b7e5d69b242f45553f5ff36a14c3caf5539ba7f (diff) | |
| download | box64-e533cd0ea1a5385fb9c4e0f4126c6684c46578f6.tar.gz box64-e533cd0ea1a5385fb9c4e0f4126c6684c46578f6.zip | |
[SIGNAL][RV64] Supported more opcodes for special cases (#2253)
Diffstat (limited to 'src/libtools')
| -rw-r--r-- | src/libtools/signals.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libtools/signals.c b/src/libtools/signals.c index ebe58e88..1f28dbaf 100644 --- a/src/libtools/signals.c +++ b/src/libtools/signals.c @@ -1000,13 +1000,13 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd, uint32_t funct3 = GET_FIELD(inst, 14, 12); uint32_t opcode = GET_FIELD(inst, 6, 0); - if (opcode == 0b0100011 && (funct3 == 0b010 /* SW */ || funct3 == 0b011 /* SD */)) { + if ((opcode == 0b0100011 || opcode == 0b0100111 /* F */) && (funct3 == 0b010 /* (F)SW */ || funct3 == 0b011 /* (F)SD */)) { int val = (inst >> 20) & 0x1f; int dest = (inst >> 15) & 0x1f; int64_t imm = (GET_FIELD(inst, 31, 25) << 5) | (GET_FIELD(inst, 11, 7)); imm = SIGN_EXT(imm, 12); volatile uint8_t *addr = (void *)(p->uc_mcontext.__gregs[dest] + imm); - uint64_t value = p->uc_mcontext.__gregs[val]; + uint64_t value = opcode == 0b0100011 ? p->uc_mcontext.__gregs[val] : p->uc_mcontext.__fpregs.__d.__f[val<<1]; for(int i = 0; i < (funct3 == 0b010 ? 4 : 8); ++i) { addr[i] = (value >> (i * 8)) & 0xff; } |