Skip to content

[codex] fix MicroBlaze stack protection context layout#1442

Open
Old-Ding wants to merge 1 commit into
FreeRTOS:mainfrom
Old-Ding:codex/fix-microblaze-stack-protection-context
Open

[codex] fix MicroBlaze stack protection context layout#1442
Old-Ding wants to merge 1 commit into
FreeRTOS:mainfrom
Old-Ding:codex/fix-microblaze-stack-protection-context

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 1, 2026

Copy link
Copy Markdown

Summary

Fixes #1416.

This updates the MicroBlazeV9 assembly context layout so XPAR_MICROBLAZE_USE_STACK_PROTECTION has valid save/restore slots for the stack limit registers:

  • adds portSLR_OFFSET and portSHR_OFFSET for 32-bit and __arch64__ layouts
  • grows portCONTEXT_SIZE / portMINUS_CONTEXT_SIZE when stack protection is enabled
  • keeps existing FPU/no-FPU layouts unchanged when stack protection is disabled

Root cause

portSAVE_CONTEXT and portRESTORE_CONTEXT already save and restore rslr / rshr under XPAR_MICROBLAZE_USE_STACK_PROTECTION, but the offsets were not defined and the task context frame size did not include those fields.

Validation

  • Local red check confirmed portSLR_OFFSET / portSHR_OFFSET were missing before the patch.
  • Local static layout check passed for the 32-bit and __arch64__ FPU/no-FPU stack-protection combinations.
  • git diff --check

I could not run the full MicroBlaze compile locally because mb-gcc is not installed in this Windows environment. The repository GitHub Actions workflow has a dedicated MicroBlazeV9 compile step that should cover this path.

@Old-Ding Old-Ding marked this pull request as ready for review July 1, 2026 01:52
@Old-Ding Old-Ding force-pushed the codex/fix-microblaze-stack-protection-context branch from 1ca0d4b to e84e83c Compare July 2, 2026 03:43
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Undefined stack protection symbols in MicroBlaze portasm.S

2 participants