arch/risc-v: get wider visibility for arch instruction macros

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko 2022-03-31 17:31:35 +03:00 committed by Xiang Xiao
parent e6d6734db2
commit 870ca12146
7 changed files with 36 additions and 31 deletions

View File

@ -39,10 +39,38 @@
* Pre-processor Definitions
****************************************************************************/
#ifdef __ASSEMBLY__
# define __STR(s) s
#else
# define __STR(s) #s
#endif
#define __XSTR(s) __STR(s)
#if defined(CONFIG_ARCH_QPFPU)
# define FLOAD __STR(flq)
# define FSTORE __STR(fsq)
#elif defined(CONFIG_ARCH_DPFPU)
# define FLOAD __STR(fld)
# define FSTORE __STR(fsd)
#else
# define FLOAD __STR(flw)
# define FSTORE __STR(fsw)
#endif
#ifdef CONFIG_ARCH_RV32
# define REGLOAD __STR(lw)
# define REGSTORE __STR(sw)
#else
# define REGLOAD __STR(ld)
# define REGSTORE __STR(sd)
#endif
/****************************************************************************
* Inline functions
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Name: up_getsp
****************************************************************************/
@ -58,6 +86,8 @@ static inline uintptr_t up_getsp(void)
return sp;
}
#endif
/****************************************************************************
* Public Types
****************************************************************************/

View File

@ -35,7 +35,6 @@
#include <arch/types.h>
#include <nuttx/irq.h>
#include <arch/csr.h>
#include <arch/chip/irq.h>

View File

@ -23,9 +23,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <arch/irq.h>
#include "riscv_internal.h"
#include <arch/arch.h>
#include <arch/irq.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -24,10 +24,9 @@
#include <nuttx/config.h>
#include <arch/arch.h>
#include <arch/irq.h>
#include "riscv_internal.h"
#ifdef CONFIG_ARCH_FPU
/************************************************************************************

View File

@ -38,32 +38,6 @@
* Pre-processor Definitions
****************************************************************************/
#ifdef __ASSEMBLY__
# define __STR(s) s
#else
# define __STR(s) #s
#endif
#define __XSTR(s) __STR(s)
#if defined(CONFIG_ARCH_QPFPU)
# define FLOAD __STR(flq)
# define FSTORE __STR(fsq)
#elif defined(CONFIG_ARCH_DPFPU)
# define FLOAD __STR(fld)
# define FSTORE __STR(fsd)
#else
# define FLOAD __STR(flw)
# define FSTORE __STR(fsw)
#endif
#ifdef CONFIG_ARCH_RV32
# define REGLOAD __STR(lw)
# define REGSTORE __STR(sw)
#else
# define REGLOAD __STR(ld)
# define REGSTORE __STR(sd)
#endif
/* This is the value used to mark the stack for subsequent stack monitoring
* logic.
*/

View File

@ -24,6 +24,7 @@
#include <nuttx/config.h>
#include <arch/arch.h>
#include <arch/syscall.h>
#include "riscv_internal.h"

View File

@ -23,6 +23,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <arch/arch.h>
#include <arch/irq.h>
#include "chip.h"