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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved.
  8.  */
  9. /*
  10.  * This file contains definitions for accessing a platform supported high resolution
  11.  * clock. The clock is monitonically increasing and can be accessed from any node
  12.  * in the system. The clock is synchronized across nodes - all nodes see the
  13.  * same value.
  14.  * 
  15.  * RTC_COUNTER_ADDR - contains the address of the counter 
  16.  *
  17.  * GET_RTC_COUNTER() - macro to read the value of the clock
  18.  *
  19.  * RTC_CYCLES_PER_SEC - clock frequency in ticks per second
  20.  *
  21.  */
  22. #ifndef _ASM_IA64_SN_CLKSUPPORT_H
  23. #define _ASM_IA64_SN_CLKSUPPORT_H
  24. #include <linux/config.h>
  25. #include <asm/sn/arch.h>
  26. #include <asm/sn/addrs.h>
  27. typedef long clkreg_t;
  28. extern long sn_rtc_cycles_per_second;
  29. #if defined(CONFIG_IA64_SGI_SN1)
  30. #include <asm/sn/sn1/bedrock.h>
  31. #include <asm/sn/sn1/hubpi_next.h>
  32. /* clocks are not synchronized yet on SN1  - used node 0 (problem if no NASID 0) */
  33. #define RTC_COUNTER_ADDR ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_COUNTER))
  34. #define RTC_COMPARE_A_ADDR      ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_COMPARE_A))
  35. #define RTC_COMPARE_B_ADDR      ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_COMPARE_B))
  36. #define RTC_INT_PENDING_A_ADDR  ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_INT_PEND_A))
  37. #define RTC_INT_PENDING_B_ADDR  ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_INT_PEND_B))
  38. #define RTC_INT_ENABLED_A_ADDR  ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_INT_EN_A))
  39. #define RTC_INT_ENABLED_B_ADDR  ((clkreg_t*)REMOTE_HUB_ADDR(0, PI_RT_INT_EN_B))
  40. #else
  41. #include <asm/sn/sn2/shub_mmr.h>
  42. #define RTC_COUNTER_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
  43. #define RTC_COMPARE_A_ADDR      ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
  44. #define RTC_COMPARE_B_ADDR      ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
  45. #define RTC_INT_PENDING_A_ADDR  ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
  46. #define RTC_INT_PENDING_B_ADDR  ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
  47. #define RTC_INT_ENABLED_A_ADDR  ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
  48. #define RTC_INT_ENABLED_B_ADDR  ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
  49. #endif
  50. #define GET_RTC_COUNTER() (*RTC_COUNTER_ADDR)
  51. #define rtc_time() GET_RTC_COUNTER()
  52. #define RTC_CYCLES_PER_SEC sn_rtc_cycles_per_second
  53. #endif /* _ASM_IA64_SN_CLKSUPPORT_H */