With the upcoming riscv64 support, it is best to use "riscv" as the subdirectory name and common symbols as riscv32 and riscv64 support code is almost identical. Then later decide whether 32-bit or 64-bit compilation is wanted. Redirects for the web documentation are also included. Then zephyrbot complained about this: " New files added that are not covered in CODEOWNERS: dts/riscv/microsemi-miv.dtsi dts/riscv/riscv32-fe310.dtsi Please add one or more entries in the CODEOWNERS file to cover those files " So I assigned them to those who created them. Feel free to readjust as necessary. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
47 lines
909 B
C
47 lines
909 B
C
/*
|
|
* Copyright (c) 2018 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <ztest.h>
|
|
#include <irq_offload.h>
|
|
#include <kernel_structs.h>
|
|
|
|
|
|
#if defined(CONFIG_ARM)
|
|
#include <arch/arm/cortex_m/cmsis.h>
|
|
static void trigger_irq(int irq)
|
|
{
|
|
printk("Triggering irq : %d\n", irq);
|
|
#if defined(CONFIG_SOC_TI_LM3S6965_QEMU) || defined(CONFIG_CPU_CORTEX_M0) \
|
|
|| defined(CONFIG_CPU_CORTEX_M0PLUS)
|
|
NVIC_SetPendingIRQ(irq);
|
|
#else
|
|
NVIC->STIR = irq;
|
|
#endif
|
|
}
|
|
|
|
#elif defined(CONFIG_RISCV)
|
|
static void trigger_irq(int irq)
|
|
{
|
|
u32_t mip;
|
|
|
|
printk("Triggering irq : %d\n", irq);
|
|
__asm__ volatile ("csrrs %0, mip, %1\n"
|
|
: "=r" (mip)
|
|
: "r" (1 << irq));
|
|
}
|
|
|
|
#elif defined(CONFIG_CPU_ARCV2)
|
|
static void trigger_irq(int irq)
|
|
{
|
|
printk("Triggering irq : %d\n", irq);
|
|
z_arc_v2_aux_reg_write(_ARC_V2_AUX_IRQ_HINT, irq);
|
|
}
|
|
#else
|
|
/* for not supported architecture */
|
|
#define NO_TRIGGER_FROM_SW
|
|
#endif
|
|
|