zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.44k stars 6.4k forks source link

Enhancements to the Cortex-A/R AArch32 architecture #63082

Open SgrrZhf opened 11 months ago

SgrrZhf commented 11 months ago

Is your enhancement proposal related to a problem? Please describe. When I separated the Cortex-M and Cortex-A/R aarch32 architecture code, I found some improvements that can be made. So I list them here for me or other interested people.

Describe the solution you'd like

  1. SMP support for Cortex-A/R
  2. Refine the exception entry and exit code
  3. Distinguish interrupt nested count and exception nested count.

Additional context

More details for the list above.

  1. SMP support for Cortex-A/R

  2. [x] Refine the exception entry and exit code. https://github.com/zephyrproject-rtos/zephyr/pull/61206 Cortex-A/R arch32 has 5 exceptions. svc, fiq, irq, abt, und. The exception entry and exit code can be unified.

  3. [x] Distinguish interrupt nested count and exception nested count. For now, The Cortex-A/R code doesn't distinguish interrupt nested count and exception nested count. It will cause some issues with the context switch. For example, when IRQ occurred in an SVC handler routing, a context switch could happen after handling IRQ, but now it cannot occur because of nested count >= 1.

o7-machinehum commented 11 months ago

Awesome! I would like to help with this, I'm currently working on a project using the RP2040, one of the only duel core M's around. If I give the PR a spin with my hardware would be helpful?

If there is any other way I can be of assistance I'm all ears.

SgrrZhf commented 11 months ago

Awesome! I would like to help with this, I'm currently working on a project using the RP2040, one of the only duel core M's around. If I give the PR a spin with my hardware would be helpful?

So, I guess you must be interested in this https://github.com/zephyrproject-rtos/zephyr/issues/59826 @o7-machinehum

microbuilder commented 9 months ago

@SgrrZhf The linked issues in the description here have all been merged. Is there remaining work, or can this issue be closed?

SgrrZhf commented 9 months ago

Yes, most of these have been finished. But there is something left, I marked them out in the description.