processor.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. struct pt_regs;
  37. extern void start_thread(struct pt_regs *, unsigned long, unsigned long);
  38. /* Free all resources held by a thread. */
  39. extern void release_thread(struct task_struct *);
  40. unsigned long get_wchan(struct task_struct *p);
  41. #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
  42. #define KSTK_ESP(tsk) \
  43. ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
  44. #define cpu_relax() barrier()
  45. #define cpu_relax_lowlatency() cpu_relax()
  46. #define ARCH_HAS_PREFETCH
  47. #define ARCH_HAS_PREFETCHW
  48. #define ARCH_HAS_SPINLOCK_PREFETCH
  49. #ifndef CONFIG_SMP
  50. /* Nothing to prefetch. */
  51. #define spin_lock_prefetch(lock) do { } while (0)
  52. #endif
  53. extern inline void prefetch(const void *ptr)
  54. {
  55. __builtin_prefetch(ptr, 0, 3);
  56. }
  57. extern inline void prefetchw(const void *ptr)
  58. {
  59. __builtin_prefetch(ptr, 1, 3);
  60. }
  61. #ifdef CONFIG_SMP
  62. extern inline void spin_lock_prefetch(const void *ptr)
  63. {
  64. __builtin_prefetch(ptr, 1, 3);
  65. }
  66. #endif
  67. #endif /* __ASM_ALPHA_PROCESSOR_H */