mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
Xtensa/ESP32: Move some ESP32-specific macros from xtensa_macros.h to chip_macros.h
This commit is contained in:
@@ -38,29 +38,13 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
#include chip_macros.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Assembly Language Macros
|
* Assembly Language Macros
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef __ASSEMBLY__
|
#ifdef __ASSEMBLY__
|
||||||
|
|
||||||
/* 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
|
|
||||||
* processor and 0xabab on the APP CPU. We distinguish between the two by
|
|
||||||
* simply checking bit 1: it's 1 on the APP and 0 on the PRO processor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
.macro getcoreid reg
|
|
||||||
rsr.prid \reg
|
|
||||||
bbci \reg,1,1f
|
|
||||||
movi \reg,1
|
|
||||||
j 2f
|
|
||||||
1:
|
|
||||||
movi \reg,0
|
|
||||||
2:
|
|
||||||
.endm
|
|
||||||
|
|
||||||
/* Macros to handle ABI specifics of function entry and return.
|
/* Macros to handle ABI specifics of function entry and return.
|
||||||
*
|
*
|
||||||
* Convenient where the frame size requirements are the same for both ABIs.
|
* Convenient where the frame size requirements are the same for both ABIs.
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* arch/xtensa/src/esp32/chip_macros.h
|
||||||
|
*
|
||||||
|
* Adapted from use in NuttX by:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
*
|
||||||
|
* Derives from logic originally provided by Cadence Design Systems Inc.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2006-2015 Cadence Design Systems Inc.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included
|
||||||
|
* in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __ARCH_XTENSA_SRC_ESP32_CHIP_MACROS_H
|
||||||
|
#define __ARCH_XTENSA_SRC_ESP32_CHIP_MACROS_H 1
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Assembly Language Macros
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef __ASSEMBLY__
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
* processor and 0xabab on the APP CPU. We distinguish between the two by
|
||||||
|
* simply checking bit 1: it's 1 on the APP and 0 on the PRO processor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.macro getcoreid reg
|
||||||
|
rsr.prid \reg
|
||||||
|
bbci \reg, 1, 1f
|
||||||
|
movi \reg, 1
|
||||||
|
j 2f
|
||||||
|
1:
|
||||||
|
movi \reg, 0
|
||||||
|
2:
|
||||||
|
.endm
|
||||||
|
|
||||||
|
#endif /* __ASSEMBLY */
|
||||||
|
#endif /* __ARCH_XTENSA_SRC_ESP32_CHIP_MACROS_H */
|
||||||
Reference in New Issue
Block a user