Please sign in to comment.
target-arm: Clear thumb state bit when popping PC during ARMV7M inter…
…rupt exit An operating system (e.g. FreeRTOS) may create a task by setting up a stack with a "simulated" stack frame containing the start address of the task. The OS will then start the task by switching to the stack and doing an interrupt return from within the service handler. If the start address is a function pointer, its thumb state bit (bit 0) will contain a 1 to indicate the first instruction is a thumb instruction (and in the ARMV7M architecture, all instructions are thumb instructions). When the interrupt returns, QEMU will pop the start address into the PC register. QEMU expects the PC register to be half-word aligned (which is enforced when branching), and will not run properly when the PC is odd. This patch clears bit 0 when restoring the PC during the ARMV7M interrupt exit. Note that there is a bug open against QEMU for this problem: https://bugs.launchpad.net/qemu/+bug/657006
- Loading branch information...