processor-generic.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  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 <sysdep/archsetjmp.h>
  11. #include <linux/prefetch.h>
  12. #include <asm/cpufeatures.h>
  13. struct mm_struct;
  14. struct thread_struct {
  15. struct pt_regs regs;
  16. struct pt_regs *segv_regs;
  17. void *fault_addr;
  18. jmp_buf *fault_catcher;
  19. struct task_struct *prev_sched;
  20. struct arch_thread arch;
  21. jmp_buf switch_buf;
  22. struct {
  23. struct {
  24. int (*proc)(void *);
  25. void *arg;
  26. } thread;
  27. } request;
  28. };
  29. #define INIT_THREAD \
  30. { \
  31. .regs = EMPTY_REGS, \
  32. .fault_addr = NULL, \
  33. .prev_sched = NULL, \
  34. .arch = INIT_ARCH_THREAD, \
  35. .request = { } \
  36. }
  37. /*
  38. * User space process size: 3GB (default).
  39. */
  40. extern unsigned long task_size;
  41. #define TASK_SIZE (task_size)
  42. #undef STACK_TOP
  43. #undef STACK_TOP_MAX
  44. extern unsigned long stacksizelim;
  45. #define STACK_ROOM (stacksizelim)
  46. #define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE)
  47. #define STACK_TOP_MAX STACK_TOP
  48. /* This decides where the kernel will search for a free chunk of vm
  49. * space during mmap's.
  50. */
  51. #define TASK_UNMAPPED_BASE (0x40000000)
  52. extern void start_thread(struct pt_regs *regs, unsigned long entry,
  53. unsigned long stack);
  54. struct cpuinfo_um {
  55. unsigned long loops_per_jiffy;
  56. int ipi_pipe[2];
  57. int cache_alignment;
  58. union {
  59. __u32 x86_capability[NCAPINTS + NBUGINTS];
  60. unsigned long x86_capability_alignment;
  61. };
  62. };
  63. extern struct cpuinfo_um boot_cpu_data;
  64. #define cpu_data(cpu) boot_cpu_data
  65. #define current_cpu_data boot_cpu_data
  66. #define cache_line_size() (boot_cpu_data.cache_alignment)
  67. #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
  68. extern unsigned long __get_wchan(struct task_struct *p);
  69. #endif