processor-generic.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. struct task_struct *saved_task;
  19. int forking;
  20. int nsyscalls;
  21. struct pt_regs regs;
  22. int singlestep_syscall;
  23. void *fault_addr;
  24. void *fault_catcher;
  25. struct task_struct *prev_sched;
  26. unsigned long temp_stack;
  27. void *exec_buf;
  28. struct arch_thread arch;
  29. union {
  30. #ifdef CONFIG_MODE_TT
  31. struct {
  32. int extern_pid;
  33. int tracing;
  34. int switch_pipe[2];
  35. int vm_seq;
  36. } tt;
  37. #endif
  38. #ifdef CONFIG_MODE_SKAS
  39. struct {
  40. void *switch_buf;
  41. void *fork_buf;
  42. int mm_count;
  43. } skas;
  44. #endif
  45. } mode;
  46. struct {
  47. int op;
  48. union {
  49. struct {
  50. int pid;
  51. } fork, exec;
  52. struct {
  53. int (*proc)(void *);
  54. void *arg;
  55. } thread;
  56. struct {
  57. void (*proc)(void *);
  58. void *arg;
  59. } cb;
  60. } u;
  61. } request;
  62. };
  63. #define INIT_THREAD \
  64. { \
  65. .forking = 0, \
  66. .nsyscalls = 0, \
  67. .regs = EMPTY_REGS, \
  68. .fault_addr = NULL, \
  69. .prev_sched = NULL, \
  70. .temp_stack = 0, \
  71. .exec_buf = NULL, \
  72. .arch = INIT_ARCH_THREAD, \
  73. .request = { 0 } \
  74. }
  75. typedef struct {
  76. unsigned long seg;
  77. } mm_segment_t;
  78. extern struct task_struct *alloc_task_struct(void);
  79. extern void release_thread(struct task_struct *);
  80. extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
  81. extern void dump_thread(struct pt_regs *regs, struct user *u);
  82. static inline void prepare_to_copy(struct task_struct *tsk)
  83. {
  84. }
  85. extern unsigned long thread_saved_pc(struct task_struct *t);
  86. static inline void mm_copy_segments(struct mm_struct *from_mm,
  87. struct mm_struct *new_mm)
  88. {
  89. }
  90. #define init_stack (init_thread_union.stack)
  91. /*
  92. * User space process size: 3GB (default).
  93. */
  94. extern unsigned long task_size;
  95. #define TASK_SIZE (task_size)
  96. /* This decides where the kernel will search for a free chunk of vm
  97. * space during mmap's.
  98. */
  99. #define TASK_UNMAPPED_BASE (0x40000000)
  100. extern void start_thread(struct pt_regs *regs, unsigned long entry,
  101. unsigned long stack);
  102. struct cpuinfo_um {
  103. unsigned long loops_per_jiffy;
  104. int ipi_pipe[2];
  105. };
  106. extern struct cpuinfo_um boot_cpu_data;
  107. #define my_cpu_data cpu_data[smp_processor_id()]
  108. #ifdef CONFIG_SMP
  109. extern struct cpuinfo_um cpu_data[];
  110. #define current_cpu_data cpu_data[smp_processor_id()]
  111. #else
  112. #define cpu_data (&boot_cpu_data)
  113. #define current_cpu_data boot_cpu_data
  114. #endif
  115. #define KSTK_EIP(tsk) (PT_REGS_IP(&tsk->thread.regs))
  116. #define KSTK_ESP(tsk) (PT_REGS_SP(&tsk->thread.regs))
  117. #define get_wchan(p) (0)
  118. #endif
  119. /*
  120. * Overrides for Emacs so that we follow Linus's tabbing style.
  121. * Emacs will notice this stuff at the end of the file and automatically
  122. * adjust the settings for this buffer only. This must remain at the end
  123. * of the file.
  124. * ---------------------------------------------------------------------------
  125. * Local variables:
  126. * c-file-style: "linux"
  127. * End:
  128. */