pda.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
  7. */
  8. #ifndef _ASM_IA64_SN_PDA_H
  9. #define _ASM_IA64_SN_PDA_H
  10. #include <linux/cache.h>
  11. #include <asm/percpu.h>
  12. #include <asm/system.h>
  13. /*
  14. * CPU-specific data structure.
  15. *
  16. * One of these structures is allocated for each cpu of a NUMA system.
  17. *
  18. * This structure provides a convenient way of keeping together
  19. * all SN per-cpu data structures.
  20. */
  21. typedef struct pda_s {
  22. /* Having a pointer in the begining of PDA tends to increase
  23. * the chance of having this pointer in cache. (Yes something
  24. * else gets pushed out). Doing this reduces the number of memory
  25. * access to all nodepda variables to be one
  26. */
  27. struct nodepda_s *p_nodepda; /* Pointer to Per node PDA */
  28. struct subnodepda_s *p_subnodepda; /* Pointer to CPU subnode PDA */
  29. /*
  30. * Support for SN LEDs
  31. */
  32. volatile short *led_address;
  33. u8 led_state;
  34. u8 hb_state; /* supports blinking heartbeat leds */
  35. unsigned int hb_count;
  36. unsigned int idle_flag;
  37. volatile unsigned long *bedrock_rev_id;
  38. volatile unsigned long *pio_write_status_addr;
  39. unsigned long pio_write_status_val;
  40. volatile unsigned long *pio_shub_war_cam_addr;
  41. unsigned long sn_soft_irr[4];
  42. unsigned long sn_in_service_ivecs[4];
  43. int sn_lb_int_war_ticks;
  44. int sn_last_irq;
  45. int sn_first_irq;
  46. } pda_t;
  47. #define CACHE_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
  48. /*
  49. * PDA
  50. * Per-cpu private data area for each cpu. The PDA is located immediately after
  51. * the IA64 cpu_data area. A full page is allocated for the cp_data area for each
  52. * cpu but only a small amout of the page is actually used. We put the SNIA PDA
  53. * in the same page as the cpu_data area. Note that there is a check in the setup
  54. * code to verify that we don't overflow the page.
  55. *
  56. * Seems like we should should cache-line align the pda so that any changes in the
  57. * size of the cpu_data area don't change cache layout. Should we align to 32, 64, 128
  58. * or 512 boundary. Each has merits. For now, pick 128 but should be revisited later.
  59. */
  60. DECLARE_PER_CPU(struct pda_s, pda_percpu);
  61. #define pda (&__ia64_per_cpu_var(pda_percpu))
  62. #define pdacpu(cpu) (&per_cpu(pda_percpu, cpu))
  63. #endif /* _ASM_IA64_SN_PDA_H */