processor.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * include/asm-cris/processor.h
  3. *
  4. * Copyright (C) 2000, 2001 Axis Communications AB
  5. *
  6. * Authors: Bjorn Wesen Initial version
  7. *
  8. */
  9. #ifndef __ASM_CRIS_PROCESSOR_H
  10. #define __ASM_CRIS_PROCESSOR_H
  11. #include <linux/config.h>
  12. #include <asm/system.h>
  13. #include <asm/page.h>
  14. #include <asm/ptrace.h>
  15. #include <asm/arch/processor.h>
  16. /* This decides where the kernel will search for a free chunk of vm
  17. * space during mmap's.
  18. */
  19. #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
  20. /* THREAD_SIZE is the size of the task_struct/kernel_stack combo.
  21. * normally, the stack is found by doing something like p + THREAD_SIZE
  22. * in CRIS, a page is 8192 bytes, which seems like a sane size
  23. */
  24. #define THREAD_SIZE PAGE_SIZE
  25. #define KERNEL_STACK_SIZE PAGE_SIZE
  26. /*
  27. * At user->kernel entry, the pt_regs struct is stacked on the top of the kernel-stack.
  28. * This macro allows us to find those regs for a task.
  29. * Notice that subsequent pt_regs stackings, like recursive interrupts occurring while
  30. * we're in the kernel, won't affect this - only the first user->kernel transition
  31. * registers are reached by this.
  32. */
  33. #define user_regs(thread_info) (((struct pt_regs *)((unsigned long)(thread_info) + THREAD_SIZE)) - 1)
  34. /*
  35. * Dito but for the currently running task
  36. */
  37. #define current_regs() user_regs(current->thread_info)
  38. extern inline void prepare_to_copy(struct task_struct *tsk)
  39. {
  40. }
  41. extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
  42. unsigned long get_wchan(struct task_struct *p);
  43. #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
  44. extern unsigned long thread_saved_pc(struct task_struct *tsk);
  45. /* Free all resources held by a thread. */
  46. extern inline void release_thread(struct task_struct *dead_task)
  47. {
  48. /* Nothing needs to be done. */
  49. }
  50. #define init_stack (init_thread_union.stack)
  51. #define cpu_relax() barrier()
  52. #endif /* __ASM_CRIS_PROCESSOR_H */