processor-generic.h 3.3 KB

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