processor.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright (C) 2008 Michal Simek
  3. * Copyright (C) 2008 PetaLogix
  4. * Copyright (C) 2006 Atmark Techno, Inc.
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #ifndef _ASM_MICROBLAZE_PROCESSOR_H
  11. #define _ASM_MICROBLAZE_PROCESSOR_H
  12. #include <asm/ptrace.h>
  13. #include <asm/setup.h>
  14. #include <asm/registers.h>
  15. #include <asm/segment.h>
  16. #include <asm/entry.h>
  17. #include <asm/current.h>
  18. # ifndef __ASSEMBLY__
  19. /* from kernel/cpu/mb.c */
  20. extern const struct seq_operations cpuinfo_op;
  21. # define cpu_relax() barrier()
  22. # define cpu_sleep() do {} while (0)
  23. # define prepare_to_copy(tsk) do {} while (0)
  24. # endif /* __ASSEMBLY__ */
  25. #define task_pt_regs(tsk) \
  26. (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
  27. /* Do necessary setup to start up a newly executed thread. */
  28. void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp);
  29. /*
  30. * User space process size: memory size
  31. *
  32. * TASK_SIZE on MMU cpu is usually 1GB. However, on no-MMU arch, both
  33. * user processes and the kernel is on the same memory region. They
  34. * both share the memory space and that is limited by the amount of
  35. * physical memory. thus, we set TASK_SIZE == amount of total memory.
  36. */
  37. # define TASK_SIZE (0x81000000 - 0x80000000)
  38. /*
  39. * Default implementation of macro that returns current
  40. * instruction pointer ("program counter").
  41. */
  42. # define current_text_addr() ({ __label__ _l; _l: &&_l; })
  43. /*
  44. * This decides where the kernel will search for a free chunk of vm
  45. * space during mmap's. We won't be using it
  46. */
  47. # define TASK_UNMAPPED_BASE 0
  48. /* definition in include/linux/sched.h */
  49. struct task_struct;
  50. /* thread_struct is gone. use thread_info instead. */
  51. struct thread_struct { };
  52. # define INIT_THREAD { }
  53. /* Free all resources held by a thread. */
  54. static inline void release_thread(struct task_struct *dead_task)
  55. {
  56. }
  57. /* Free all resources held by a thread. */
  58. static inline void exit_thread(void)
  59. {
  60. }
  61. extern unsigned long thread_saved_pc(struct task_struct *t);
  62. extern unsigned long get_wchan(struct task_struct *p);
  63. /*
  64. * create a kernel thread without removing it from tasklists
  65. */
  66. extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
  67. # define KSTK_EIP(tsk) (0)
  68. # define KSTK_ESP(tsk) (0)
  69. #endif /* _ASM_MICROBLAZE_PROCESSOR_H */