vmap_stack.h 641 B

12345678910111213141516171819202122232425
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. // Copyright (C) 2017 Arm Ltd.
  3. #ifndef __ASM_VMAP_STACK_H
  4. #define __ASM_VMAP_STACK_H
  5. #include <linux/gfp.h>
  6. #include <linux/vmalloc.h>
  7. #include <linux/pgtable.h>
  8. #include <asm/memory.h>
  9. #include <asm/thread_info.h>
  10. /*
  11. * To ensure that VMAP'd stack overflow detection works correctly, all VMAP'd
  12. * stacks need to have the same alignment.
  13. */
  14. static inline unsigned long *arch_alloc_vmap_stack(size_t stack_size, int node)
  15. {
  16. void *p;
  17. p = __vmalloc_node(stack_size, THREAD_ALIGN, THREADINFO_GFP, node,
  18. __builtin_return_address(0));
  19. return kasan_reset_tag(p);
  20. }
  21. #endif /* __ASM_VMAP_STACK_H */