processor.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * include/asm-cris/processor.h
  4. *
  5. * Copyright (C) 2000, 2001 Axis Communications AB
  6. *
  7. * Authors: Bjorn Wesen Initial version
  8. *
  9. */
  10. #ifndef __ASM_CRIS_PROCESSOR_H
  11. #define __ASM_CRIS_PROCESSOR_H
  12. #include <asm/page.h>
  13. #include <asm/ptrace.h>
  14. #include <arch/processor.h>
  15. #include <arch/system.h>
  16. struct task_struct;
  17. #define STACK_TOP TASK_SIZE
  18. #define STACK_TOP_MAX STACK_TOP
  19. /* This decides where the kernel will search for a free chunk of vm
  20. * space during mmap's.
  21. */
  22. #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
  23. /*
  24. * At user->kernel entry, the pt_regs struct is stacked on the top of the kernel-stack.
  25. * This macro allows us to find those regs for a task.
  26. * Notice that subsequent pt_regs stackings, like recursive interrupts occurring while
  27. * we're in the kernel, won't affect this - only the first user->kernel transition
  28. * registers are reached by this.
  29. */
  30. #define user_regs(thread_info) (((struct pt_regs *)((unsigned long)(thread_info) + THREAD_SIZE)) - 1)
  31. /*
  32. * Dito but for the currently running task
  33. */
  34. #define task_pt_regs(task) user_regs(task_thread_info(task))
  35. unsigned long get_wchan(struct task_struct *p);
  36. #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
  37. /* Free all resources held by a thread. */
  38. static inline void release_thread(struct task_struct *dead_task)
  39. {
  40. /* Nothing needs to be done. */
  41. }
  42. #define cpu_relax() barrier()
  43. void default_idle(void);
  44. #endif /* __ASM_CRIS_PROCESSOR_H */