On 5/8/2018 5:05 PM, Marcin Maka wrote:
On 5/8/2018 9:38 AM, Liam Girdwood wrote:
On Tue, 2018-05-08 at 14:23 +0800, Rander Wang wrote:
diff --git a/src/platform/cannonlake/include/platform/platform.h b/src/platform/cannonlake/include/platform/platform.h index dc9a963..d157daa 100644 --- a/src/platform/cannonlake/include/platform/platform.h +++ b/src/platform/cannonlake/include/platform/platform.h @@ -43,6 +43,8 @@ struct sof; #define PLATFORM_SSP_COUNT 3 #define MAX_GPDMA_COUNT 2 +#define MAX_CORE_COUNT 4
/* Host page size */ #define HOST_PAGE_SIZE 4096 #define PLATFORM_PAGE_TABLE_SIZE 256 @@ -126,6 +128,14 @@ struct sof; extern struct timer *platform_timer; +static inline int platform_get_core_id(void) +{ + int prid;
+ __asm__("rsr.prid %0" : "=a"(prid)); + return prid; +}
There is a HAL function xthal_get_prid() as well as XTHAL_GET_PRID() macro already provided by the HAL.
Hi Maka, you can search my first version of this patch, xthal_get_prid is used. i change this for Liam
advised me not to call this function in generic code
Best to put this in src/arch/xtensa/include/arch/cpu.h
and rename to cpu_get_id()
Liam