Xilinx / Xilinx/embeddedsw

Misplaced ifdef guard in xil_cache leads to endless loop

Open
#254 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.2k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/Xilinx/embeddedsw/blob/8fca1ac929453ba06613b5417141483b4c2d8cf3/lib/bsp/standalone/src/arm/cortexa9/xil_cache.c#L352-L359

there is the #ifdef USE_AMP inside the while loop which means, that it is an endless loop.
My suggestion would be to include the while "header" inside the #ifdef guard as well.

#ifndef USE_AMP
while (tempadr < endaddr) {
    /* Invalidate L2 cache line */
    *L2CCOffset = tempadr;
    Xil_L2CacheSync();
    tempadr += cacheline;
}
#endif

Would that be correct?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open lib/bsp/standalone/src/arm/cortexa9/xil_cache.c around lines 352-359 and inspect the USE_AMP guard surrounding the cache-invalidation while loop. Verify the preprocessor behavior and affected loop conditions; done means the USE_AMP configuration no longer enters an endless loop while the other configuration retains the intended cache handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.