diff options
| author | Jesse Barnes <jbarnes@engr.sgi.com> | 2004-09-22 04:18:55 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-09-22 04:18:55 -0700 |
| commit | cea2509a17eac11ca4a40088a6087988ca70c435 (patch) | |
| tree | 3c2e9cde97aa0f5e647fe30cd670c95718458217 /include/linux/mmtimer.h | |
| parent | 38c75d44d7608912e04603e26288843a407de10a (diff) | |
[PATCH] mmtimer cleanups
A few cleanups that probably should have been done a long time ago:
o remove test program from mmtimer.h
o move name, desc., etc. #defines from mmtimer.h to mmtimer.c
o document what mmtimer.c is a little better
o some whitespace cleanups for linewrapping and such
Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/mmtimer.h')
| -rw-r--r-- | include/linux/mmtimer.h | 88 |
1 files changed, 2 insertions, 86 deletions
diff --git a/include/linux/mmtimer.h b/include/linux/mmtimer.h index 6b5855016a4e..884cabf16088 100644 --- a/include/linux/mmtimer.h +++ b/include/linux/mmtimer.h @@ -5,7 +5,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2001-2003 Silicon Graphics, Inc. All rights reserved. + * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved. * * This file should define an interface compatible with the IA-PC Multimedia * Timers Draft Specification (rev. 0.97) from Intel. Note that some @@ -14,17 +14,12 @@ * * 11/01/01 - jbarnes - initial revision * 9/10/04 - Christoph Lameter - remove interrupt support + * 9/17/04 - jbarnes - remove test program, move some #defines to the driver */ #ifndef _LINUX_MMTIMER_H #define _LINUX_MMTIMER_H -/* name of the device, usually in /dev */ -#define MMTIMER_NAME "mmtimer" -#define MMTIMER_FULLNAME "/dev/mmtimer" -#define MMTIMER_DESC "IA-PC Multimedia Timer" -#define MMTIMER_VERSION "1.0" - /* * Breakdown of the ioctl's available. An 'optional' next to the command * indicates that supporting this command is optional, while 'required' @@ -58,83 +53,4 @@ #define MMTIMER_MMAPAVAIL _IO(MMTIMER_IOCTL_BASE, 6) #define MMTIMER_GETCOUNTER _IOR(MMTIMER_IOCTL_BASE, 9, unsigned long) -/* - * An mmtimer verification program. WARNINGs are ok, but ERRORs indicate - * that the device doesn't fully support the interface defined here. - */ -#ifdef _MMTIMER_TEST_PROGRAM - -#include <stdio.h> -#include <unistd.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> - -#include <sys/ioctl.h> - -#include "mmtimer.h" - -int main(int argc, char *argv[]) -{ - int result, fd; - unsigned long val = 0; - unsigned long i; - - if((fd = open("/dev/"MMTIMER_NAME, O_RDONLY)) == -1) { - printf("failed to open /dev/%s", MMTIMER_NAME); - return 1; - } - - /* - * Can we mmap in the counter? - */ - if((result = ioctl(fd, MMTIMER_MMAPAVAIL, 0)) == 1) { - printf("mmap available\n"); - /* ... so try getting the offset for each clock */ - if((result = ioctl(fd, MMTIMER_GETOFFSET, 0)) != -ENOSYS) - printf("offset: %d\n", result); - else - printf("WARNING: offset unavailable for clock\n"); - } - else - printf("WARNING: mmap unavailable\n"); - - /* - * Get the resolution in femtoseconds - */ - if((result = ioctl(fd, MMTIMER_GETRES, &val)) != -ENOSYS) - printf("resolution: %ld femtoseconds\n", val); - else - printf("ERROR: failed to get resolution\n"); - - /* - * Get the frequency in Hz - */ - if((result = ioctl(fd, MMTIMER_GETFREQ, &val)) != -ENOSYS) - if(val < 10000000) /* less than 10 MHz? */ - printf("ERROR: frequency only %ld MHz, should be >= 10 MHz\n", val/1000000); - else - printf("frequency: %ld MHz\n", val/1000000); - else - printf("ERROR: failed to get frequency\n"); - - /* - * How many bits in the counter? - */ - if((result = ioctl(fd, MMTIMER_GETBITS, 0)) != -ENOSYS) - printf("bits in counter: %d\n", result); - else - printf("ERROR: can't get number of bits in counter\n"); - - if((result = ioctl(fd, MMTIMER_GETCOUNTER, &val)) != -ENOSYS) - printf("counter value: %ld\n", val); - else - printf("ERROR: can't get counter value\n"); - - return 0; -} - -#endif /* _MMTIMER_TEST_PROGRM */ - #endif /* _LINUX_MMTIMER_H */ |
