processor-generic.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*
  2. * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __UM_PROCESSOR_GENERIC_H
  6. #define __UM_PROCESSOR_GENERIC_H
  7. struct pt_regs;
  8. struct task_struct;
  9. #include "linux/config.h"
  10. #include "asm/ptrace.h"
  11. #include "choose-mode.h"
  12. struct mm_struct;
  13. struct thread_struct {
  14. /* This flag is set to 1 before calling do_fork (and analyzed in
  15. * copy_thread) to mark that we are begin called from userspace (fork /
  16. * vfork / clone), and reset to 0 after. It is left to 0 when called
  17. * from kernelspace (i.e. kernel_thread() or fork_idle(), as of 2.6.11). */
  18. int forking;
  19. int nsyscalls;
  20. struct pt_regs regs;
  21. unsigned long cr2;
  22. int err;
  23. unsigned long trap_no;
  24. int singlestep_syscall;
  25. void *fault_addr;
  26. void *fault_catcher;
  27. struct task_struct *prev_sched;
  28. unsigned long temp_stack;
  29. void *exec_buf;
  30. struct arch_thread arch;
  31. union {
  32. #ifdef CONFIG_MODE_TT
  33. struct {
  34. int extern_pid;
  35. int tracing;
  36. int switch_pipe[2];
  37. int vm_seq;
  38. } tt;
  39. #endif
  40. #ifdef CONFIG_MODE_SKAS
  41. struct {
  42. void *switch_buf;
  43. void *fork_buf;
  44. int mm_count;
  45. } skas;
  46. #endif
  47. } mode;
  48. struct {
  49. int op;
  50. union {
  51. struct {
  52. int pid;
  53. } fork, exec;
  54. struct {
  55. int (*proc)(void *);
  56. void *arg;
  57. } thread;
  58. struct {
  59. void (*proc)(void *);
  60. void *arg;
  61. } cb;
  62. } u;
  63. } request;
  64. };
  65. #define INIT_THREAD \
  66. { \
  67. .forking = 0, \
  68. .nsyscalls = 0, \
  69. .regs = EMPTY_REGS, \
  70. .cr2 = 0, \
  71. .err = 0, \
  72. .fault_addr = NULL, \
  73. .prev_sched = NULL, \
  74. .temp_stack = 0, \
  75. .exec_buf = NULL, \
  76. .arch = INIT_ARCH_THREAD, \
  77. .request = { 0 } \
  78. }
  79. typedef struct {
  80. unsigned long seg;
  81. } mm_segment_t;
  82. extern struct task_struct *alloc_task_struct(void);
  83. extern void release_thread(struct task_struct *);
  84. extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
  85. extern void dump_thread(struct pt_regs *regs, struct user *u);
  86. static inline void prepare_to_copy(struct task_struct *tsk)
  87. {
  88. }
  89. extern unsigned long thread_saved_pc(struct task_struct *t);
  90. static inline void mm_copy_segments(struct mm_struct *from_mm,
  91. struct mm_struct *new_mm)
  92. {
  93. }
  94. #define init_stack (init_thread_union.stack)
  95. /*
  96. * User space process size: 3GB (default).
  97. */
  98. extern unsigned long task_size;
  99. #define TASK_SIZE (task_size)
  100. /* This decides where the kernel will search for a free chunk of vm
  101. * space during mmap's.
  102. */
  103. #define TASK_UNMAPPED_BASE (0x40000000)
  104. extern void start_thread(struct pt_regs *regs, unsigned long entry,
  105. unsigned long stack);
  106. struct cpuinfo_um {
  107. unsigned long loops_per_jiffy;
  108. int ipi_pipe[2];
  109. };
  110. extern struct cpuinfo_um boot_cpu_data;
  111. #define my_cpu_data cpu_data[smp_processor_id()]
  112. #ifdef CONFIG_SMP
  113. extern struct cpuinfo_um cpu_data[];
  114. #define current_cpu_data cpu_data[smp_processor_id()]
  115. #else
  116. #define cpu_data (&boot_cpu_data)
  117. #define current_cpu_data boot_cpu_data
  118. #endif
  119. #define KSTK_EIP(tsk) (PT_REGS_IP(&tsk->thread.regs))
  120. #define KSTK_ESP(tsk) (PT_REGS_SP(&tsk->thread.regs))
  121. #define get_wchan(p) (0)
  122. #endif
  123. /*
  124. * Overrides for Emacs so that we follow Linus's tabbing style.
  125. * Emacs will notice this stuff at the end of the file and automatically
  126. * adjust the settings for this buffer only. This must remain at the end
  127. * of the file.
  128. * ---------------------------------------------------------------------------
  129. * Local variables:
  130. * c-file-style: "linux"
  131. * End:
  132. */