Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions arch/riscv/core/pmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ static bool set_pmp_entry(unsigned int *index_p, uint8_t perm,
return ok;
}

#ifdef CONFIG_PMP_STACK_GUARD
static inline bool set_pmp_mprv_catchall(unsigned int *index_p,
unsigned long *pmp_addr, unsigned long *pmp_cfg,
unsigned int index_limit)
Expand Down Expand Up @@ -231,6 +232,7 @@ static inline bool set_pmp_mprv_catchall(unsigned int *index_p,

return ok;
}
#endif /* CONFIG_PMP_STACK_GUARD */

/**
* @brief Write a range of PMP entries to corresponding PMP registers
Expand Down Expand Up @@ -447,6 +449,7 @@ void z_riscv_pmp_init(void)
/**
* @Brief Initialize the per-thread PMP register copy with global values.
*/
#if (defined(CONFIG_PMP_STACK_GUARD) && defined(CONFIG_MULTITHREADING)) || defined(CONFIG_USERSPACE)
static inline unsigned int z_riscv_pmp_thread_init(unsigned long *pmp_addr,
unsigned long *pmp_cfg,
unsigned int index_limit)
Expand All @@ -466,6 +469,7 @@ static inline unsigned int z_riscv_pmp_thread_init(unsigned long *pmp_addr,

return global_pmp_end_index;
}
#endif

#ifdef CONFIG_PMP_STACK_GUARD

Expand Down
14 changes: 7 additions & 7 deletions drivers/interrupt_controller/intc_plic.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,6 @@ static inline mem_addr_t get_threshold_priority_addr(const struct device *dev, u
return config->reg + (get_hart_context(dev, hartid) * CONTEXT_SIZE);
}

static ALWAYS_INLINE uint32_t local_irq_to_irq(const struct device *dev, uint32_t local_irq)
{
const struct plic_config *config = dev->config;

return irq_to_level_2(local_irq) | config->irq;
}

#ifdef CONFIG_PLIC_SUPPORTS_SOFT_INTERRUPT
static inline mem_addr_t get_pending_reg(const struct device *dev, uint32_t local_irq)
{
Expand Down Expand Up @@ -718,6 +711,13 @@ static int cmd_stats_clear(const struct shell *sh, size_t argc, char *argv[])
#endif /* CONFIG_PLIC_SHELL_IRQ_COUNT */

#ifdef CONFIG_PLIC_SHELL_IRQ_AFFINITY
static ALWAYS_INLINE uint32_t local_irq_to_irq(const struct device *dev, uint32_t local_irq)
{
const struct plic_config *config = dev->config;

return irq_to_level_2(local_irq) | config->irq;
}

static int cmd_affinity_set(const struct shell *sh, size_t argc, char **argv)
{
ARG_UNUSED(argc);
Expand Down