1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef _ASM_RISCV_IRQ_STACK_H
4 #define _ASM_RISCV_IRQ_STACK_H
8 #include <linux/kconfig.h>
9 #include <linux/vmalloc.h>
10 #include <linux/pgtable.h>
11 #include <asm/thread_info.h>
13 DECLARE_PER_CPU(ulong
*, irq_stack_ptr
);
15 asmlinkage
void call_on_irq_stack(struct pt_regs
*regs
,
16 void (*func
)(struct pt_regs
*));
18 #ifdef CONFIG_VMAP_STACK
20 * To ensure that VMAP'd stack overflow detection works correctly, all VMAP'd
21 * stacks need to have the same alignment.
23 static inline unsigned long *arch_alloc_vmap_stack(size_t stack_size
, int node
)
27 p
= __vmalloc_node(stack_size
, THREAD_ALIGN
, THREADINFO_GFP
, node
,
28 __builtin_return_address(0));
29 return kasan_reset_tag(p
);
31 #endif /* CONFIG_VMAP_STACK */
33 #endif /* _ASM_RISCV_IRQ_STACK_H */