Skip to content

The definition and use of [UC_ARM_REG_OTHER_SP, UC_ARM_REG_SPSEL, UC_ARM_REG_CURR_SP_MODE_IS_PSP] registers are unnecessary. #3

Open
@shandianchengzi

Description

@shandianchengzi

Dear team,

I wanted to bring to your attention an issue I encountered while studying your code. I noticed that you have defined three additional registers that seem to have the same function as those in the original unicorn. However, these registers do not conform to ARM register definitions.

After further investigation, I realized that these registers are only used for stack swapping during interrupts. In order to properly change the stack during ARM interrupts, the value of UCARMREGCONTROL [1] should be modified to determine the current process stack being used. This is also mentioned in The Definitive Guide to ARM Cortex M3 and Cortex M4 Processors, as shown in the attached figure.
Snipaste_2023-01-02_19-50-58

I tried making this change in the code and the running results showed that unicorn was able to correctly handle the stack change request. I would like to submit my changes for your review so that you can see the specific location of the modification.

Thank you for your attention to this matter.

Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions