processor.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. # ifndef __ASSEMBLY__
  17. /* from kernel/cpu/mb.c */
  18. extern const struct seq_operations cpuinfo_op;
  19. # define cpu_relax() barrier()
  20. # define cpu_sleep() do {} while (0)
  21. # define prepare_to_copy(tsk) do {} while (0)
  22. # endif /* __ASSEMBLY__ */
  23. /*
  24. * User space process size: memory size
  25. *
  26. * TASK_SIZE on MMU cpu is usually 1GB. However, on no-MMU arch, both
  27. * user processes and the kernel is on the same memory region. They
  28. * both share the memory space and that is limited by the amount of
  29. * physical memory. thus, we set TASK_SIZE == amount of total memory.
  30. */
  31. # define TASK_SIZE (0x81000000 - 0x80000000)
  32. /*
  33. * Default implementation of macro that returns current
  34. * instruction pointer ("program counter").
  35. */
  36. # define current_text_addr() ({ __label__ _l; _l: &&_l; })
  37. /*
  38. * This decides where the kernel will search for a free chunk of vm
  39. * space during mmap's. We won't be using it
  40. */
  41. # define TASK_UNMAPPED_BASE 0
  42. /* definition in include/linux/sched.h */
  43. struct task_struct;
  44. /* thread_struct is gone. use thread_info instead. */
  45. struct thread_struct { };
  46. # define INIT_THREAD { }
  47. /* Do necessary setup to start up a newly executed thread. */
  48. static inline void start_thread(struct pt_regs *regs,
  49. unsigned long pc,
  50. unsigned long usp)
  51. {
  52. regs->pc = pc;
  53. regs->r1 = usp;
  54. regs->kernel_mode = 0;
  55. }
  56. /* Free all resources held by a thread. */
  57. static inline void release_thread(struct task_struct *dead_task)
  58. {
  59. }
  60. /* Free all resources held by a thread. */
  61. static inline void exit_thread(void)
  62. {
  63. }
  64. extern unsigned long thread_saved_pc(struct task_struct *t);
  65. extern unsigned long get_wchan(struct task_struct *p);
  66. /*
  67. * create a kernel thread without removing it from tasklists
  68. */
  69. extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
  70. # define task_pt_regs(tsk) \
  71. (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
  72. # define KSTK_EIP(tsk) (0)
  73. # define KSTK_ESP(tsk) (0)
  74. #endif /* _ASM_MICROBLAZE_PROCESSOR_H */