processor.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * include/asm-alpha/processor.h
  3. *
  4. * Copyright (C) 1994 Linus Torvalds
  5. */
  6. #ifndef __ASM_ALPHA_PROCESSOR_H
  7. #define __ASM_ALPHA_PROCESSOR_H
  8. #include <linux/personality.h> /* for ADDR_LIMIT_32BIT */
  9. /*
  10. * Returns current instruction pointer ("program counter").
  11. */
  12. #define current_text_addr() \
  13. ({ void *__pc; __asm__ ("br %0,.+4" : "=r"(__pc)); __pc; })
  14. /*
  15. * We have a 42-bit user address space: 4TB user VM...
  16. */
  17. #define TASK_SIZE (0x40000000000UL)
  18. #define STACK_TOP \
  19. (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
  20. #define STACK_TOP_MAX 0x00120000000UL
  21. /* This decides where the kernel will search for a free chunk of vm
  22. * space during mmap's.
  23. */
  24. #define TASK_UNMAPPED_BASE \
  25. ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
  26. typedef struct {
  27. unsigned long seg;
  28. } mm_segment_t;
  29. /* This is dead. Everything has been moved to thread_info. */
  30. struct thread_struct { };
  31. #define INIT_THREAD { }
  32. /* Return saved PC of a blocked thread. */
  33. struct task_struct;
  34. extern unsigned long thread_saved_pc(struct task_struct *);
  35. /* Do necessary setup to start up a newly executed thread. */
  36. extern void start_thread(struct pt_regs *, unsigned long, unsigned long);
  37. /* Free all resources held by a thread. */
  38. extern void release_thread(struct task_struct *);
  39. /* Prepare to copy thread state - unlazy all lazy status */
  40. #define prepare_to_copy(tsk) do { } while (0)
  41. /* Create a kernel thread without removing it from tasklists. */
  42. extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
  43. unsigned long get_wchan(struct task_struct *p);
  44. #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
  45. #define KSTK_ESP(tsk) \
  46. ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
  47. #define cpu_relax() barrier()
  48. #define ARCH_HAS_PREFETCH
  49. #define ARCH_HAS_PREFETCHW
  50. #define ARCH_HAS_SPINLOCK_PREFETCH
  51. #ifndef CONFIG_SMP
  52. /* Nothing to prefetch. */
  53. #define spin_lock_prefetch(lock) do { } while (0)
  54. #endif
  55. extern inline void prefetch(const void *ptr)
  56. {
  57. __builtin_prefetch(ptr, 0, 3);
  58. }
  59. extern inline void prefetchw(const void *ptr)
  60. {
  61. __builtin_prefetch(ptr, 1, 3);
  62. }
  63. #ifdef CONFIG_SMP
  64. extern inline void spin_lock_prefetch(const void *ptr)
  65. {
  66. __builtin_prefetch(ptr, 1, 3);
  67. }
  68. #endif
  69. #endif /* __ASM_ALPHA_PROCESSOR_H */