processor.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. /* This decides where the kernel will search for a free chunk of vm
  19. * space during mmap's.
  20. */
  21. #define TASK_UNMAPPED_BASE \
  22. ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
  23. typedef struct {
  24. unsigned long seg;
  25. } mm_segment_t;
  26. /* This is dead. Everything has been moved to thread_info. */
  27. struct thread_struct { };
  28. #define INIT_THREAD { }
  29. /* Return saved PC of a blocked thread. */
  30. struct task_struct;
  31. extern unsigned long thread_saved_pc(struct task_struct *);
  32. /* Do necessary setup to start up a newly executed thread. */
  33. extern void start_thread(struct pt_regs *, unsigned long, unsigned long);
  34. /* Free all resources held by a thread. */
  35. extern void release_thread(struct task_struct *);
  36. /* Prepare to copy thread state - unlazy all lazy status */
  37. #define prepare_to_copy(tsk) do { } while (0)
  38. /* Create a kernel thread without removing it from tasklists. */
  39. extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
  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 ARCH_HAS_PREFETCH
  46. #define ARCH_HAS_PREFETCHW
  47. #define ARCH_HAS_SPINLOCK_PREFETCH
  48. #ifndef CONFIG_SMP
  49. /* Nothing to prefetch. */
  50. #define spin_lock_prefetch(lock) do { } while (0)
  51. #endif
  52. extern inline void prefetch(const void *ptr)
  53. {
  54. __builtin_prefetch(ptr, 0, 3);
  55. }
  56. extern inline void prefetchw(const void *ptr)
  57. {
  58. __builtin_prefetch(ptr, 1, 3);
  59. }
  60. #ifdef CONFIG_SMP
  61. extern inline void spin_lock_prefetch(const void *ptr)
  62. {
  63. __builtin_prefetch(ptr, 1, 3);
  64. }
  65. #endif
  66. #endif /* __ASM_ALPHA_PROCESSOR_H */