1 /*
2 * Mach Operating System
3 * Copyright (c) 1993 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: clock_dev.h,v $
29 * Revision 2.2 93/11/17 19:05:40 dbg
30 * Created.
31 * [93/09/29 dbg]
32 *
33 */
34
35 #ifndef _DEVICE_CLOCK_DEV_H_
36 #define _DEVICE_CLOCK_DEV_H_
37
38 /*
39 * Common operations on clock devices.
40 */
41
42 #include <mach/machine/vm_types.h>
43 #include <mach/vm_prot.h>
44 #include <kern/clock.h>
45 #include <device/device_types.h>
46 #include <device/clock_status.h>
47
48 /*
49 * Common clock routines.
50 */
51 extern io_return_t
52 clock_open(
53 mach_clock_t clock);
54
55 extern io_return_t
56 clock_getstat(
57 mach_clock_t clock,
58 dev_flavor_t flavor,
59 dev_status_t stat,
60 natural_t *count);
61
62 extern io_return_t
63 clock_setstat(
64 mach_clock_t clock,
65 dev_flavor_t flavor,
66 dev_status_t stat,
67 natural_t count);
68
69 extern vm_offset_t
70 clock_map_page(
71 mach_clock_t clock,
72 vm_offset_t off,
73 vm_prot_t prot);
74
75 /*
76 * Conversion between dates (Y/M/D H:M:S) and
77 * seconds since January 1, 1970 (our arbitrary
78 * time base)
79 */
80 extern natural_t
81 ymd_to_seconds(
82 int year,
83 int month,
84 int day,
85 int hour,
86 int minute,
87 int second);
88
89 extern void
90 seconds_to_ymd(
91 natural_t seconds,
92 int *year,
93 int *month,
94 int *day,
95 int *hour,
96 int *minute,
97 int *second,
98 int *day_of_week);
99
100 #endif /* _DEVICE_CLOCK_DEV_H_ */
Cache object: 6ac266a6938994cd992db986c639b790
|