Don't use .Xo/.Xc. Fix date format.
[netbsd-mini2440.git] / sys / dev / raidframe / rf_etimer.h
blob32e25cb59e8f44a2aab7ff5586844d73740caa2b
1 /* $NetBSD: rf_etimer.h,v 1.10 2005/12/11 12:23:37 christos Exp $ */
2 /*
3 * Copyright (c) 1995 Carnegie-Mellon University.
4 * All rights reserved.
6 * Author: Mark Holland
8 * Permission to use, copy, modify and distribute this software and
9 * its documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation.
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
16 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 * Carnegie Mellon requests users of this software to return to
20 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
25 * any improvements or extensions that they make and grant Carnegie the
26 * rights to redistribute these changes.
29 #ifndef _RF__RF_TIMER_H_
30 #define _RF__RF_TIMER_H_
32 #include "rf_utils.h"
34 #include <sys/time.h>
35 #include <sys/kernel.h>
37 struct RF_Etimer_s {
38 struct timeval st;
39 struct timeval et;
40 struct timeval diff;
43 #define RF_ETIMER_START(_t_) \
44 { \
45 memset(&(_t_), 0, sizeof (_t_)); \
46 getmicrouptime(&(_t_).st); \
49 #define RF_ETIMER_STOP(_t_) \
50 { \
51 getmicrouptime(&(_t_).et); \
54 #define RF_ETIMER_EVAL(_t_) \
55 { \
56 RF_TIMEVAL_DIFF(&(_t_).st, &(_t_).et, &(_t_).diff) \
59 #define RF_ETIMER_VAL_US(_t_) (RF_TIMEVAL_TO_US((_t_).diff))
60 #define RF_ETIMER_VAL_MS(_t_) (RF_TIMEVAL_TO_US((_t_).diff)/1000)
62 #endif /* !_RF__RF_TIMER_H_ */