]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/clock_oldops.c
xnu-2422.110.17.tar.gz
[apple/xnu.git] / osfmk / kern / clock_oldops.c
index 9870369543803dbb19c19198dd5f4ff347e6f49b..13a9fa1c6fc52ad45daf38e44f927ea91ba1b765 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -155,7 +155,7 @@ kern_return_t       calend_getattr(
        mach_msg_type_number_t  *count);
 
 struct clock_ops calend_ops = {
-       0,                                      0,
+       NULL, NULL,
        calend_gettime,
        calend_getattr,
 };
@@ -188,7 +188,7 @@ clock_oldconfig(void)
                clock = &clock_list[i];
                if (clock->cl_ops && clock->cl_ops->c_config) {
                        if ((*clock->cl_ops->c_config)() == 0)
-                               clock->cl_ops = 0;
+                               clock->cl_ops = NULL;
                }
        }
 
@@ -298,7 +298,12 @@ kern_return_t
 rtclock_gettime(
        mach_timespec_t         *time)  /* OUT */
 {
-       clock_get_system_nanotime(&time->tv_sec, (uint32_t *)&time->tv_nsec);
+       clock_sec_t             secs;
+       clock_nsec_t    nsecs;
+
+       clock_get_system_nanotime(&secs, &nsecs);
+       time->tv_sec = (unsigned int)secs;
+       time->tv_nsec = nsecs;
 
        return (KERN_SUCCESS);
 }
@@ -307,7 +312,12 @@ kern_return_t
 calend_gettime(
        mach_timespec_t         *time)  /* OUT */
 {
-       clock_get_calendar_nanotime(&time->tv_sec, (uint32_t *)&time->tv_nsec);
+       clock_sec_t             secs;
+       clock_nsec_t    nsecs;
+
+       clock_get_calendar_nanotime(&secs, &nsecs);
+       time->tv_sec = (unsigned int)secs;
+       time->tv_nsec = nsecs;
 
        return (KERN_SUCCESS);
 }
@@ -645,7 +655,7 @@ alarm_expire(void)
                 * which issued the clock_sleep() call.
                 */
                if (alrm2->al_status == ALARM_SLEEP) {
-                       alrm2->al_next = 0;
+                       alrm2->al_next = NULL;
                        alrm2->al_status = ALARM_DONE;
                        alrm2->al_time = clock_time;
                        thread_wakeup((event_t)alrm2);
@@ -756,7 +766,7 @@ set_alarm(
        uint64_t        abstime;
 
        nanotime_to_absolutetime(alarm_time->tv_sec, alarm_time->tv_nsec, &abstime);
-       timer_call_enter(&alarm_expire_timer, abstime);
+       timer_call_enter_with_leeway(&alarm_expire_timer, NULL, abstime, 0, TIMER_CALL_USER_NORMAL, FALSE);
 }
 
 /*
@@ -785,6 +795,8 @@ check_time(
        return ((result >= 0)? result: 0);
 }
 
+#ifndef        __LP64__
+
 mach_timespec_t
 clock_get_system_value(void)
 {
@@ -806,3 +818,5 @@ clock_get_calendar_value(void)
 
        return value;
 }
+
+#endif /* __LP64__ */