Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XEmacPs_BdGetBufAddr doesn't mask with XEMACPS_RXBUF_ADD_MASK #292

Open
mazhenke opened this issue Mar 18, 2024 · 1 comment
Open

XEmacPs_BdGetBufAddr doesn't mask with XEMACPS_RXBUF_ADD_MASK #292

mazhenke opened this issue Mar 18, 2024 · 1 comment

Comments

@mazhenke
Copy link

See file https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/emacps/src/xemacps_bd.h line 242

/**

  • Get the address (bits 0..31) of the BD's buffer address (word 0)
  • @param BdPtr is the BD pointer to operate on
  • @note
  • C-style signature:
  • UINTPTR XEmacPs_BdGetBufAddr(XEmacPs_Bd* BdPtr)

*****************************************************************************/
#if defined(aarch64) || defined(arch64)
#define XEmacPs_BdGetBufAddr(BdPtr)
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) |
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_HI_OFFSET)) << 32U)
#else
#define XEmacPs_BdGetBufAddr(BdPtr)
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET))
#endif

The XEmacPs_BdGetBufAddr shall mask with XEMACPS_RXBUF_ADD_MASK to get the correct address, like this:

#if defined(aarch64) || defined(arch64)
#define XEmacPs_BdGetBufAddr(BdPtr)
((XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) & XEMACPS_RXBUF_ADD_MASK) |
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_HI_OFFSET)) << 32U)
#else
#define XEmacPs_BdGetBufAddr(BdPtr)
(XEmacPs_BdRead((BdPtr), XEMACPS_BD_ADDR_OFFSET) & XEMACPS_RXBUF_ADD_MASK )
#endif

@HariniKatakamX
Copy link
Contributor

Thanks for reporting @mazhenke This will be fixed in the next release.

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

No branches or pull requests

2 participants