Commit 2fcb1358 authored by Dimitris Lampridis's avatar Dimitris Lampridis

sw:fw: properly implement trtl_get_core_id(), using wbgen offsets and masks

parent 36e000e4
......@@ -331,11 +331,15 @@ static inline void trtl_notify_user(unsigned int id)
/**
* It returns the core ID on which the firmware is running
* @return the core ID
* @todo implement me
*/
static inline uint32_t trtl_get_core_id(void)
{
return lr_readl(0);
uint32_t core_id = lr_readl(MT_CPU_LR_REG_STAT);
core_id &= MT_CPU_LR_STAT_CORE_ID_MASK;
core_id >>= MT_CPU_LR_STAT_CORE_ID_SHIFT;
return core_id;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment