ckrm-E15 memory controller
[linux-2.6.git] / include / asm-generic / relay.h
1 #ifndef _ASM_GENERIC_RELAY_H
2 #define _ASM_GENERIC_RELAY_H
3 /*
4  * linux/include/asm-generic/relay.h
5  *
6  * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp
7  * Copyright (C) 2002 - Karim Yaghmour (karim@opersys.com)
8  *
9  * Architecture-independent definitions for relayfs
10  */
11
12 #include <linux/relayfs_fs.h>
13
14 /**
15  *      get_time_delta - utility function for getting time delta
16  *      @now: pointer to a timeval struct that may be given current time
17  *      @rchan: the channel
18  *
19  *      Returns the time difference between the current time and the buffer
20  *      start time.
21  */
22 static inline u32
23 get_time_delta(struct timeval *now, struct rchan *rchan)
24 {
25         u32 time_delta;
26
27         do_gettimeofday(now);
28         time_delta = calc_time_delta(now, &rchan->buf_start_time);
29
30         return time_delta;
31 }
32
33 /**
34  *      get_timestamp - utility function for getting a time and TSC pair
35  *      @now: current time
36  *      @tsc: the TSC associated with now
37  *      @rchan: the channel
38  *
39  *      Sets the value pointed to by now to the current time. Value pointed to
40  *      by tsc is not set since there is no generic TSC support.
41  */
42 static inline void 
43 get_timestamp(struct timeval *now, 
44               u32 *tsc,
45               struct rchan *rchan)
46 {
47         do_gettimeofday(now);
48 }
49
50 /**
51  *      get_time_or_tsc: - Utility function for getting a time or a TSC.
52  *      @now: current time
53  *      @tsc: current TSC
54  *      @rchan: the channel
55  *
56  *      Sets the value pointed to by now to the current time.
57  */
58 static inline void 
59 get_time_or_tsc(struct timeval *now, 
60                 u32 *tsc,
61                 struct rchan *rchan)
62 {
63         do_gettimeofday(now);
64 }
65
66 /**
67  *      have_tsc - does this platform have a useable TSC?
68  *
69  *      Returns 0.
70  */
71 static inline int 
72 have_tsc(void)
73 {
74         return 0;
75 }
76 #endif