arch: esp32: Replace getcoreid with the latest esp-idf's

Summary:
- I noticed that the getcoreid macro in the latest esp-idf
  is much simpler than the current NuttX's.
- This commit replaces the macro with the latest esp-idf's

Impact:
- SMP only

Testing:
- Tested with esp32-devkitc:wapi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2021-06-21 17:23:33 +09:00 committed by Xiang Xiao
parent f7c8875fd7
commit 841fb02ac0

View File

@ -68,19 +68,14 @@
#ifdef __ASSEMBLY__ #ifdef __ASSEMBLY__
/* Macro to get the current core ID. Only uses the reg given as an argument. /* Macro to get the current core ID. Only uses the reg given as an argument.
* Reading PRID on the ESP108 architecture gives us 0xcdcd on the PRO * Reading PRID on the ESP32 gives us 0xCDCD on the PRO processor (0)
* processor and 0xabab on the APP CPU. We distinguish between the two by * and 0xABAB on the APP CPU (1). We can distinguish between the two by
* simply checking bit 1: it's 1 on the APP and 0 on the PRO processor. * checking bit 13: it's 1 on the APP and 0 on the PRO processor.
*/ */
.macro getcoreid reg .macro getcoreid reg
rsr.prid \reg rsr.prid \reg
bbci \reg, 1, 1f extui \reg,\reg,13,1
movi \reg, 1
j 2f
1:
movi \reg, 0
2:
.endm .endm
/**************************************************************************** /****************************************************************************