mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-12 17:14:36 +02:00
freertos: implement get core id with cpu abstraction
This commit is contained in:
@@ -86,7 +86,6 @@ specific constants has been moved into the deprecated_definitions.h header
|
|||||||
file. */
|
file. */
|
||||||
#include "deprecated_definitions.h"
|
#include "deprecated_definitions.h"
|
||||||
|
|
||||||
#include "soc/cpu.h"
|
|
||||||
|
|
||||||
/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
|
/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
|
||||||
did not result in a portmacro.h header file being included - and it should be
|
did not result in a portmacro.h header file being included - and it should be
|
||||||
@@ -127,6 +126,9 @@ extern "C" {
|
|||||||
#include "mpu_wrappers.h"
|
#include "mpu_wrappers.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
|
|
||||||
|
#include "hal/cpu_hal.h"
|
||||||
|
#include "xt_instr_macros.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup the stack of a new task so it is ready to be placed under the
|
* Setup the stack of a new task so it is ready to be placed under the
|
||||||
* scheduler control. The registers have to be placed on the stack in
|
* scheduler control. The registers have to be placed on the stack in
|
||||||
@@ -200,12 +202,7 @@ BaseType_t xPortInterruptedFromISRContext(void);
|
|||||||
|
|
||||||
/* Multi-core: get current core ID */
|
/* Multi-core: get current core ID */
|
||||||
static inline uint32_t IRAM_ATTR xPortGetCoreID(void) {
|
static inline uint32_t IRAM_ATTR xPortGetCoreID(void) {
|
||||||
uint32_t id;
|
return cpu_hal_get_core_id();
|
||||||
__asm__ __volatile__ (
|
|
||||||
"rsr.prid %0\n"
|
|
||||||
" extui %0,%0,13,1"
|
|
||||||
:"=r"(id));
|
|
||||||
return id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get tick rate per second */
|
/* Get tick rate per second */
|
||||||
|
Reference in New Issue
Block a user