processor-generic.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.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 "asm/ptrace.h"
  10. #include "registers.h"
  11. #include "sysdep/archsetjmp.h"
  12. #include <linux/prefetch.h>
  13. struct mm_struct;
  14. struct thread_struct {
  15. struct task_struct *saved_task;
  16. struct pt_regs regs;
  17. int singlestep_syscall;
  18. void *fault_addr;
  19. jmp_buf *fault_catcher;
  20. struct task_struct *prev_sched;
  21. unsigned long temp_stack;
  22. jmp_buf *exec_buf;
  23. struct arch_thread arch;
  24. jmp_buf switch_buf;
  25. int mm_count;
  26. struct {
  27. int op;
  28. union {
  29. struct {
  30. int pid;
  31. } fork, exec;
  32. struct {
  33. int (*proc)(void *);
  34. void *arg;
  35. } thread;
  36. struct {
  37. void (*proc)(void *);
  38. void *arg;
  39. } cb;
  40. } u;
  41. } request;
  42. };
  43. #define INIT_THREAD \
  44. { \
  45. .regs = EMPTY_REGS, \
  46. .fault_addr = NULL, \
  47. .prev_sched = NULL, \
  48. .temp_stack = 0, \
  49. .exec_buf = NULL, \
  50. .arch = INIT_ARCH_THREAD, \
  51. .request = { 0 } \
  52. }
  53. static inline void release_thread(struct task_struct *task)
  54. {
  55. }
  56. extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
  57. extern unsigned long thread_saved_pc(struct task_struct *t);
  58. static inline void mm_copy_segments(struct mm_struct *from_mm,
  59. struct mm_struct *new_mm)
  60. {
  61. }
  62. #define init_stack (init_thread_union.stack)
  63. /*
  64. * User space process size: 3GB (default).
  65. */
  66. extern unsigned long task_size;
  67. #define TASK_SIZE (task_size)
  68. #undef STACK_TOP
  69. #undef STACK_TOP_MAX
  70. extern unsigned long stacksizelim;
  71. #define STACK_ROOM (stacksizelim)
  72. #define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE)
  73. #define STACK_TOP_MAX STACK_TOP
  74. /* This decides where the kernel will search for a free chunk of vm
  75. * space during mmap's.
  76. */
  77. #define TASK_UNMAPPED_BASE (0x40000000)
  78. extern void start_thread(struct pt_regs *regs, unsigned long entry,
  79. unsigned long stack);
  80. struct cpuinfo_um {
  81. unsigned long loops_per_jiffy;
  82. int ipi_pipe[2];
  83. };
  84. extern struct cpuinfo_um boot_cpu_data;
  85. #define my_cpu_data cpu_data[smp_processor_id()]
  86. #ifdef CONFIG_SMP
  87. extern struct cpuinfo_um cpu_data[];
  88. #define current_cpu_data cpu_data[smp_processor_id()]
  89. #else
  90. #define cpu_data (&boot_cpu_data)
  91. #define current_cpu_data boot_cpu_data
  92. #endif
  93. #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
  94. extern unsigned long get_wchan(struct task_struct *p);
  95. #endif