* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
/*
* Actual clock object data structure. Contains the machine
* dependent operations list and clock operation ports.
*/
/*
* Actual clock object data structure. Contains the machine
* dependent operations list and clock operation ports.
*/
-struct clock {
- clock_ops_t cl_ops; /* operations list */
- struct ipc_port *cl_service; /* service port */
- struct ipc_port *cl_control; /* control port */
+struct clock {
+ clock_ops_t cl_ops; /* operations list */
+ struct ipc_port *cl_service; /* service port */
+ struct ipc_port *cl_control; /* control port */
-extern void clock_gettimeofday_and_absolute_time(
- clock_sec_t *secs,
- clock_usec_t *microsecs,
- uint64_t *absolute_time);
+extern void clock_gettimeofday_new(clock_sec_t *secs,
+ clock_usec_t *microsecs);
+extern void clock_gettimeofday(
+ clock_sec_t *secs,
+ clock_usec_t *microsecs);
-extern void clock_get_calendar_microtime(
- clock_sec_t *secs,
- clock_usec_t *microsecs);
+extern void clock_get_calendar_absolute_and_microtime(
+ clock_sec_t *secs,
+ clock_usec_t *microsecs,
+ uint64_t *abstime);
-extern void clock_get_calendar_absolute_and_microtime(
- clock_sec_t *secs,
- clock_usec_t *microsecs,
- uint64_t *abstime);
+extern void clock_get_calendar_nanotime(
+ clock_sec_t *secs,
+ clock_nsec_t *nanosecs);
-#ifndef __LP64__
-
-#define MACH_TIMESPEC_SEC_MAX (0 - 1)
-#define MACH_TIMESPEC_NSEC_MAX (NSEC_PER_SEC - 1)
-
-#define MACH_TIMESPEC_MAX ((mach_timespec_t) { \
- MACH_TIMESPEC_SEC_MAX, \
- MACH_TIMESPEC_NSEC_MAX } )
-#define MACH_TIMESPEC_ZERO ((mach_timespec_t) { 0, 0 } )
-
-#define ADD_MACH_TIMESPEC_NSEC(t1, nsec) \
- do { \
- (t1)->tv_nsec += (clock_res_t)(nsec); \
- if ((clock_res_t)(nsec) > 0 && \
- (t1)->tv_nsec >= NSEC_PER_SEC) { \
- (t1)->tv_nsec -= NSEC_PER_SEC; \
- (t1)->tv_sec += 1; \
- } \
- else if ((clock_res_t)(nsec) < 0 && \
- (t1)->tv_nsec < 0) { \
- (t1)->tv_nsec += NSEC_PER_SEC; \
- (t1)->tv_sec -= 1; \
- } \
+#ifndef __LP64__
+
+#define MACH_TIMESPEC_SEC_MAX (0 - 1)
+#define MACH_TIMESPEC_NSEC_MAX (NSEC_PER_SEC - 1)
+
+#define MACH_TIMESPEC_MAX ((mach_timespec_t) { \
+ MACH_TIMESPEC_SEC_MAX, \
+ MACH_TIMESPEC_NSEC_MAX } )
+#define MACH_TIMESPEC_ZERO ((mach_timespec_t) { 0, 0 } )
+
+#define ADD_MACH_TIMESPEC_NSEC(t1, nsec) \
+ do { \
+ (t1)->tv_nsec += (clock_res_t)(nsec); \
+ if ((clock_res_t)(nsec) > 0 && \
+ (t1)->tv_nsec >= NSEC_PER_SEC) { \
+ (t1)->tv_nsec -= NSEC_PER_SEC; \
+ (t1)->tv_sec += 1; \
+ } \
+ else if ((clock_res_t)(nsec) < 0 && \
+ (t1)->tv_nsec < 0) { \
+ (t1)->tv_nsec += NSEC_PER_SEC; \
+ (t1)->tv_sec -= 1; \
+ } \
-extern mach_timespec_t clock_get_system_value(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_2_0, __IPHONE_6_0);
+extern mach_timespec_t clock_get_system_value(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_2_0, __IPHONE_6_0);
-extern mach_timespec_t clock_get_calendar_value(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_2_0, __IPHONE_6_0);
+extern mach_timespec_t clock_get_calendar_value(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_2_0, __IPHONE_6_0);