diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-12-18 09:12:32 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-12-18 09:12:32 +0100 |
| commit | 356340ad098ddc06140c8b4262e0c5331e2c26c9 (patch) | |
| tree | 690fad69c6ad9ff8172a7da2034955b9ef799045 /src/libtools | |
| parent | 986bff1c2211b1ab29118ed8c339ff92b95334f1 (diff) | |
| download | box64-356340ad098ddc06140c8b4262e0c5331e2c26c9.tar.gz box64-356340ad098ddc06140c8b4262e0c5331e2c26c9.zip | |
[ARM64] Added a new case of device memory unaligned write
Diffstat (limited to 'src/libtools')
| -rw-r--r-- | src/libtools/signals.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libtools/signals.c b/src/libtools/signals.c index e5d0d7e9..40d86d9b 100644 --- a/src/libtools/signals.c +++ b/src/libtools/signals.c @@ -752,6 +752,20 @@ int sigbus_specialcases(siginfo_t* info, void * ucntx, void* pc, void* _fpsimd) p->uc_mcontext.pc+=4; // go to next opcode return 1; } + if((opcode&0b11111111111000000000110000000000)==0b01111000000000000000000000000000) { + // this is STURH + int val = opcode&31; + int dest = (opcode>>5)&31; + int64_t offset = (opcode>>12)&0b111111111; + if((offset>>(9-1))&1) + offset |= (0xffffffffffffffffll<<9); + uint8_t* addr = (uint8_t*)(p->uc_mcontext.regs[dest] + offset); + uint64_t value = p->uc_mcontext.regs[val]; + for(int i=0; i<2; ++i) + addr[i] = (value>>(i*8))&0xff; + p->uc_mcontext.pc+=4; // go to next opcode + return 1; + } if((opcode&0b11111111111000000000110000000000)==0b01111000001000000000100000000000) { // this is STRH reg, reg int scale = (opcode>>30)&3; |