pda.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  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-2002 Silicon Graphics, Inc. All rights reserved.
  7.  */
  8. #ifndef _ASM_IA64_SN_PDA_H
  9. #define _ASM_IA64_SN_PDA_H
  10. #include <linux/config.h>
  11. #include <linux/cache.h>
  12. #include <asm/system.h>
  13. #include <asm/processor.h>
  14. #include <asm/page.h>
  15. #include <asm/sn/bte.h>
  16. /*
  17.  * CPU-specific data structure.
  18.  *
  19.  * One of these structures is allocated for each cpu of a NUMA system.
  20.  *
  21.  * This structure provides a convenient way of keeping together 
  22.  * all SN per-cpu data structures. 
  23.  */
  24. typedef struct pda_s {
  25. /* Having a pointer in the begining of PDA tends to increase
  26.  * the chance of having this pointer in cache. (Yes something
  27.  * else gets pushed out). Doing this reduces the number of memory
  28.  * access to all nodepda variables to be one
  29.  */
  30. struct nodepda_s *p_nodepda; /* Pointer to Per node PDA */
  31. struct subnodepda_s *p_subnodepda; /* Pointer to CPU  subnode PDA */
  32. /*
  33.  * Support for SN LEDs
  34.  */
  35. #ifdef CONFIG_IA64_SGI_SN1
  36. volatile long *led_address;
  37. #else
  38. volatile short *led_address;
  39. #endif
  40. u8 led_state;
  41. u8 hb_state; /* supports blinking heartbeat leds */
  42. unsigned int hb_count;
  43. unsigned int idle_flag;
  44. #ifdef CONFIG_IA64_SGI_SN2
  45. struct irqpda_s *p_irqpda; /* Pointer to CPU irq data */
  46. #endif
  47. volatile unsigned long *bedrock_rev_id;
  48. volatile unsigned long *pio_write_status_addr;
  49. bteinfo_t *cpubte[BTES_PER_NODE];
  50. } pda_t;
  51. #define CACHE_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
  52. /*
  53.  * PDA
  54.  * Per-cpu private data area for each cpu. The PDA is located immediately after
  55.  * the IA64 cpu_data area. A full page is allocated for the cp_data area for each
  56.  * cpu but only a small amout of the page is actually used. We put the SNIA PDA
  57.  * in the same page as the cpu_data area. Note that there is a check in the setup
  58.  * code to verify that we dont overflow the page.
  59.  *
  60.  * Seems like we should should cache-line align the pda so that any changes in the
  61.  * size of the cpu_data area dont change cache layout. Should we align to 32, 64, 128
  62.  * or 512 boundary. Each has merits. For now, pick 128 but should be revisited later.
  63.  */
  64. #define CPU_DATA_END CACHE_ALIGN((long)&(((struct cpuinfo_ia64*)0)->platform_specific))
  65. #define PDAADDR (PERCPU_ADDR+CPU_DATA_END)
  66. #define pda (*((pda_t *) PDAADDR))
  67. #endif /* _ASM_IA64_SN_PDA_H */