processor-generic.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 pt_regs regs;
  16. struct pt_regs *segv_regs;
  17. int singlestep_syscall;
  18. void *fault_addr;
  19. jmp_buf *fault_catcher;
  20. struct task_struct *prev_sched;
  21. struct arch_thread arch;
  22. jmp_buf switch_buf;
  23. struct {
  24. int op;
  25. union {
  26. struct {
  27. int pid;
  28. } fork, exec;
  29. struct {
  30. int (*proc)(void *);
  31. void *arg;
  32. } thread;
  33. struct {
  34. void (*proc)(void *);
  35. void *arg;
  36. } cb;
  37. } u;
  38. } request;
  39. };
  40. #define INIT_THREAD \
  41. { \
  42. .regs = EMPTY_REGS, \
  43. .fault_addr = NULL, \
  44. .prev_sched = NULL, \
  45. .arch = INIT_ARCH_THREAD, \
  46. .request = { 0 } \
  47. }
  48. static inline void release_thread(struct task_struct *task)
  49. {
  50. }
  51. extern unsigned long thread_saved_pc(struct task_struct *t);
  52. static inline void mm_copy_segments(struct mm_struct *from_mm,
  53. struct mm_struct *new_mm)
  54. {
  55. }
  56. #define init_stack (init_thread_union.stack)
  57. /*
  58. * User space process size: 3GB (default).
  59. */
  60. extern unsigned long task_size;
  61. #define TASK_SIZE (task_size)
  62. #undef STACK_TOP
  63. #undef STACK_TOP_MAX
  64. extern unsigned long stacksizelim;
  65. #define STACK_ROOM (stacksizelim)
  66. #define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE)
  67. #define STACK_TOP_MAX STACK_TOP
  68. /* This decides where the kernel will search for a free chunk of vm
  69. * space during mmap's.
  70. */
  71. #define TASK_UNMAPPED_BASE (0x40000000)
  72. extern void start_thread(struct pt_regs *regs, unsigned long entry,
  73. unsigned long stack);
  74. struct cpuinfo_um {
  75. unsigned long loops_per_jiffy;
  76. int ipi_pipe[2];
  77. };
  78. extern struct cpuinfo_um boot_cpu_data;
  79. #define cpu_data (&boot_cpu_data)
  80. #define current_cpu_data boot_cpu_data
  81. #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
  82. extern unsigned long get_wchan(struct task_struct *p);
  83. #endif