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
6 * Copyright (C) 2001 Silicon Graphics, Inc. All rights reserved.
8 * SGI Hi Resolution Clock
10 * SGI SN platforms provide a high resolution clock that is
11 * synchronized across all nodes. The clock can be memory mapped
12 * and directly read from user space.
14 * Access to the clock is thru the following:
15 * (error checking not shown)
17 * (Note: should library routines be provided to encapsulate this??)
22 * fd = open (HIRES_FULLNAME, O_RDONLY);
23 * clk = mmap(0, getpagesize(), PROT_READ, MAP_SHARED, fd, 0);
24 * clk += ioctl(fd, HIRES_IOCQGETOFFSET, 0);
26 * At this point, clk is a pointer to the high resolution clock.
28 * The clock period can be obtained via:
30 * long picosec_per_tick;
31 * picosec_per_tick = ioctl(fd, HIRES_IOCQGETPICOSEC, 0);
34 #ifndef _ASM_IA64_SN_HIRES_CLOCK_H
35 #define _ASM_IA64_SN_HIRES_CLOCK_H
38 #define HIRES_BASENAME "sgi_hires_clock"
39 #define HIRES_FULLNAME "/dev/sgi_hires_clock"
40 #define HIRES_IOC_BASE 's'
43 /* Get page offset of hires timer */
44 #define HIRES_IOCQGETOFFSET _IO( HIRES_IOC_BASE, 0 )
46 /* get clock period in picoseconds per tick */
47 #define HIRES_IOCQGETPICOSEC _IO( HIRES_IOC_BASE, 1 )
49 /* get number of significant bits in clock counter */
50 #define HIRES_IOCQGETCLOCKBITS _IO( HIRES_IOC_BASE, 2 )
52 #endif /* _ASM_IA64_SN_HIRES_CLOCK_H */