paca.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef _PPC64_PACA_H
  2. #define _PPC64_PACA_H
  3. /*
  4. * include/asm-ppc64/paca.h
  5. *
  6. * This control block defines the PACA which defines the processor
  7. * specific data for each logical processor on the system.
  8. * There are some pointers defined that are utilized by PLIC.
  9. *
  10. * C 2001 PPC 64 Team, IBM Corp
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License
  14. * as published by the Free Software Foundation; either version
  15. * 2 of the License, or (at your option) any later version.
  16. */
  17. #include <linux/config.h>
  18. #include <asm/types.h>
  19. #include <asm/lppaca.h>
  20. #include <asm/iSeries/ItLpRegSave.h>
  21. #include <asm/mmu.h>
  22. register struct paca_struct *local_paca asm("r13");
  23. #define get_paca() local_paca
  24. struct task_struct;
  25. /*
  26. * Defines the layout of the paca.
  27. *
  28. * This structure is not directly accessed by firmware or the service
  29. * processor except for the first two pointers that point to the
  30. * lppaca area and the ItLpRegSave area for this CPU. Both the
  31. * lppaca and ItLpRegSave objects are currently contained within the
  32. * PACA but they do not need to be.
  33. */
  34. struct paca_struct {
  35. /*
  36. * Because hw_cpu_id, unlike other paca fields, is accessed
  37. * routinely from other CPUs (from the IRQ code), we stick to
  38. * read-only (after boot) fields in the first cacheline to
  39. * avoid cacheline bouncing.
  40. */
  41. /*
  42. * MAGIC: These first two pointers can't be moved - they're
  43. * accessed by the firmware
  44. */
  45. struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
  46. struct ItLpRegSave *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
  47. /*
  48. * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c
  49. * load lock_token and paca_index with a single lwz
  50. * instruction. They must travel together and be properly
  51. * aligned.
  52. */
  53. u16 lock_token; /* Constant 0x8000, used in locks */
  54. u16 paca_index; /* Logical processor number */
  55. u32 default_decr; /* Default decrementer value */
  56. u64 kernel_toc; /* Kernel TOC address */
  57. u64 stab_real; /* Absolute address of segment table */
  58. u64 stab_addr; /* Virtual address of segment table */
  59. void *emergency_sp; /* pointer to emergency stack */
  60. s16 hw_cpu_id; /* Physical processor number */
  61. u8 cpu_start; /* At startup, processor spins until */
  62. /* this becomes non-zero. */
  63. /*
  64. * Now, starting in cacheline 2, the exception save areas
  65. */
  66. u64 exgen[8] __attribute__((aligned(0x80))); /* used for most interrupts/exceptions */
  67. u64 exmc[8]; /* used for machine checks */
  68. u64 exslb[8]; /* used for SLB/segment table misses
  69. * on the linear mapping */
  70. mm_context_t context;
  71. u16 slb_cache[SLB_CACHE_ENTRIES];
  72. u16 slb_cache_ptr;
  73. /*
  74. * then miscellaneous read-write fields
  75. */
  76. struct task_struct *__current; /* Pointer to current */
  77. u64 kstack; /* Saved Kernel stack addr */
  78. u64 stab_rr; /* stab/slb round-robin counter */
  79. u64 next_jiffy_update_tb; /* TB value for next jiffy update */
  80. u64 saved_r1; /* r1 save for RTAS calls */
  81. u64 saved_msr; /* MSR saved here by enter_rtas */
  82. u8 proc_enabled; /* irq soft-enable flag */
  83. /* not yet used */
  84. u64 exdsi[8]; /* used for linear mapping hash table misses */
  85. /*
  86. * iSeries structure which the hypervisor knows about -
  87. * this structure should not cross a page boundary.
  88. * The vpa_init/register_vpa call is now known to fail if the
  89. * lppaca structure crosses a page boundary.
  90. * The lppaca is also used on POWER5 pSeries boxes.
  91. * The lppaca is 640 bytes long, and cannot readily change
  92. * since the hypervisor knows its layout, so a 1kB
  93. * alignment will suffice to ensure that it doesn't
  94. * cross a page boundary.
  95. */
  96. struct lppaca lppaca __attribute__((__aligned__(0x400)));
  97. #ifdef CONFIG_PPC_ISERIES
  98. struct ItLpRegSave reg_save;
  99. #endif
  100. };
  101. extern struct paca_struct paca[];
  102. #endif /* _PPC64_PACA_H */