arch/risc-v: Move __XSTR, FLOAD/FSTORE and REGLOAD/REGSTORE to the right place

1.Move __XSTR from include/arch.h to include/irq.h
2.Move  FLOAD/FSTORE and REGLOAD/REGSTORE from include/arch.h to src/common/riscv_internal.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-07-02 11:26:26 +08:00 committed by Petro Karashchenko
parent c20ed58879
commit 9ab3417882
6 changed files with 30 additions and 33 deletions

View File

@ -40,32 +40,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
/* Provide the maximum amount of page table levels per MMU type */
#ifdef CONFIG_ARCH_MMU_TYPE_SV39

View File

@ -33,9 +33,8 @@
#include <nuttx/config.h>
#include <arch/types.h>
#include <sys/types.h>
#include <arch/arch.h>
#include <arch/csr.h>
#include <arch/chip/irq.h>
#include <arch/mode.h>
@ -44,6 +43,13 @@
* Pre-processor Definitions
****************************************************************************/
#ifdef __ASSEMBLY__
# define __STR(s) s
#else
# define __STR(s) #s
#endif
#define __XSTR(s) __STR(s)
/* Map RISC-V exception code to NuttX IRQ */
/* IRQ 0-15 : (exception:interrupt=0) */

View File

@ -31,8 +31,6 @@
#include <nuttx/config.h>
#include <arch/arch.h>
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif

View File

@ -34,8 +34,6 @@
#include "riscv_macros.S"
#include "riscv_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

View File

@ -29,18 +29,38 @@
#ifndef __ASSEMBLY__
# include <nuttx/compiler.h>
# include <nuttx/arch.h>
# include <sys/types.h>
# include <stdint.h>
# include <syscall.h>
#endif
#include <nuttx/irq.h>
#include "riscv_common_memorymap.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#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

@ -29,6 +29,7 @@
#include "mpfs_memorymap.h"
#include "riscv_internal.h"
#include "riscv_percpu.h"
/****************************************************************************