processor-generic.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 *segv_regs;
  16. struct task_struct *prev_sched;
  17. struct arch_thread arch;
  18. jmp_buf switch_buf;
  19. struct {
  20. struct {
  21. int (*proc)(void *);
  22. void *arg;
  23. } thread;
  24. } request;
  25. void *segv_continue;
  26. /* Contains variable sized FP registers */
  27. struct pt_regs regs;
  28. };
  29. #define INIT_THREAD \
  30. { \
  31. .regs = EMPTY_REGS, \
  32. .prev_sched = NULL, \
  33. .arch = INIT_ARCH_THREAD, \
  34. .request = { } \
  35. }
  36. /*
  37. * User space process size: 3GB (default).
  38. */
  39. extern unsigned long task_size;
  40. #define TASK_SIZE (task_size)
  41. #undef STACK_TOP
  42. #undef STACK_TOP_MAX
  43. extern unsigned long stacksizelim;
  44. #define STACK_ROOM (stacksizelim)
  45. #define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE)
  46. #define STACK_TOP_MAX STACK_TOP
  47. /* This decides where the kernel will search for a free chunk of vm
  48. * space during mmap's.
  49. */
  50. #define TASK_UNMAPPED_BASE (0x40000000)
  51. extern void start_thread(struct pt_regs *regs, unsigned long entry,
  52. unsigned long stack);
  53. struct cpuinfo_um {
  54. unsigned long loops_per_jiffy;
  55. int cache_alignment;
  56. union {
  57. __u32 x86_capability[NCAPINTS + NBUGINTS];
  58. unsigned long x86_capability_alignment;
  59. };
  60. };
  61. extern struct cpuinfo_um boot_cpu_data;
  62. #define cache_line_size() (boot_cpu_data.cache_alignment)
  63. #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
  64. extern unsigned long __get_wchan(struct task_struct *p);
  65. #endif