xref: /xnu-11215/iokit/Kernel/IORTC.cpp (revision a5e72196)
1cc9a6355SApple OSS Distributions /*
2cc9a6355SApple OSS Distributions  * Copyright (c) 2017 Apple Inc. All rights reserved.
3cc9a6355SApple OSS Distributions  *
4cc9a6355SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5cc9a6355SApple OSS Distributions  *
6cc9a6355SApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7cc9a6355SApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8cc9a6355SApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9cc9a6355SApple OSS Distributions  * compliance with the License. The rights granted to you under the License
10cc9a6355SApple OSS Distributions  * may not be used to create, or enable the creation or redistribution of,
11cc9a6355SApple OSS Distributions  * unlawful or unlicensed copies of an Apple operating system, or to
12cc9a6355SApple OSS Distributions  * circumvent, violate, or enable the circumvention or violation of, any
13cc9a6355SApple OSS Distributions  * terms of an Apple operating system software license agreement.
14cc9a6355SApple OSS Distributions  *
15cc9a6355SApple OSS Distributions  * Please obtain a copy of the License at
16cc9a6355SApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17cc9a6355SApple OSS Distributions  *
18cc9a6355SApple OSS Distributions  * The Original Code and all software distributed under the License are
19cc9a6355SApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20cc9a6355SApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21cc9a6355SApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22cc9a6355SApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23cc9a6355SApple OSS Distributions  * Please see the License for the specific language governing rights and
24cc9a6355SApple OSS Distributions  * limitations under the License.
25cc9a6355SApple OSS Distributions  *
26cc9a6355SApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27cc9a6355SApple OSS Distributions  */
28cc9a6355SApple OSS Distributions 
29cc9a6355SApple OSS Distributions #include <IOKit/rtc/IORTCController.h>
30cc9a6355SApple OSS Distributions 
31cc9a6355SApple OSS Distributions #define super IOService
32cc9a6355SApple OSS Distributions 
33cc9a6355SApple OSS Distributions OSDefineMetaClassAndAbstractStructors(IORTC, IOService);
34cc9a6355SApple OSS Distributions 
35*a5e72196SApple OSS Distributions void
getUTCTimeOfDay(clock_sec_t * secs,clock_nsec_t * nsecs)36*a5e72196SApple OSS Distributions IORTC::getUTCTimeOfDay( clock_sec_t * secs, clock_nsec_t * nsecs )
37cc9a6355SApple OSS Distributions {
38cc9a6355SApple OSS Distributions 	*nsecs = 0;
39cc9a6355SApple OSS Distributions 	*secs = getGMTTimeOfDay();
40cc9a6355SApple OSS Distributions }
41cc9a6355SApple OSS Distributions 
42*a5e72196SApple OSS Distributions void
setUTCTimeOfDay(clock_sec_t secs,clock_nsec_t nsecs)43*a5e72196SApple OSS Distributions IORTC::setUTCTimeOfDay( clock_sec_t secs, clock_nsec_t nsecs )
44cc9a6355SApple OSS Distributions {
45cc9a6355SApple OSS Distributions 	setGMTTimeOfDay(secs);
46cc9a6355SApple OSS Distributions }
47cc9a6355SApple OSS Distributions 
48*a5e72196SApple OSS Distributions IOReturn
getMonotonicClockOffset(int64_t * usecs)49*a5e72196SApple OSS Distributions IORTC::getMonotonicClockOffset( int64_t * usecs )
50cc9a6355SApple OSS Distributions {
51cc9a6355SApple OSS Distributions 	return kIOReturnUnsupported;
52cc9a6355SApple OSS Distributions }
53cc9a6355SApple OSS Distributions 
54*a5e72196SApple OSS Distributions IOReturn
setMonotonicClockOffset(int64_t usecs)55*a5e72196SApple OSS Distributions IORTC::setMonotonicClockOffset( int64_t usecs )
56cc9a6355SApple OSS Distributions {
57cc9a6355SApple OSS Distributions 	return kIOReturnUnsupported;
58cc9a6355SApple OSS Distributions }
59cc9a6355SApple OSS Distributions 
60*a5e72196SApple OSS Distributions IOReturn
getMonotonicClockAndTimestamp(uint64_t * usecs,uint64_t * mach_absolute_time)61*a5e72196SApple OSS Distributions IORTC::getMonotonicClockAndTimestamp( uint64_t * usecs, uint64_t *mach_absolute_time )
62cc9a6355SApple OSS Distributions {
63cc9a6355SApple OSS Distributions 	return kIOReturnUnsupported;
64cc9a6355SApple OSS Distributions }
65cc9a6355SApple OSS Distributions 
66cc9a6355SApple OSS Distributions OSMetaClassDefineReservedUnused(IORTC, 0);
67cc9a6355SApple OSS Distributions OSMetaClassDefineReservedUnused(IORTC, 1);
68cc9a6355SApple OSS Distributions OSMetaClassDefineReservedUnused(IORTC, 2);
69cc9a6355SApple OSS Distributions OSMetaClassDefineReservedUnused(IORTC, 3);
70cc9a6355SApple OSS Distributions OSMetaClassDefineReservedUnused(IORTC, 4);
71cc9a6355SApple OSS Distributions OSMetaClassDefineReservedUnused(IORTC, 5);
72cc9a6355SApple OSS Distributions OSMetaClassDefineReservedUnused(IORTC, 6);
73cc9a6355SApple OSS Distributions OSMetaClassDefineReservedUnused(IORTC, 7);
74