2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
32 #define TEST_HEADERS 0
36 #include <libkern/OSByteOrder.h>
37 #include <libkern/c++/OSArray.h>
38 #include <libkern/c++/OSAllocation.h>
39 #include <libkern/c++/OSBoolean.h>
40 #include <libkern/c++/OSBoundedArray.h>
41 #include <libkern/c++/OSBoundedArrayRef.h>
42 #include <libkern/c++/OSBoundedPtr.h>
43 #include <libkern/c++/OSCollection.h>
44 #include <libkern/c++/OSCollectionIterator.h>
45 #include <libkern/c++/OSContainers.h>
46 #include <libkern/c++/OSCPPDebug.h>
47 #include <libkern/c++/OSData.h>
48 #include <libkern/c++/OSDictionary.h>
49 #include <libkern/c++/OSEndianTypes.h>
50 #include <libkern/c++/OSIterator.h>
51 #include <libkern/c++/OSKext.h>
52 #include <libkern/c++/OSLib.h>
53 #include <libkern/c++/OSMetaClass.h>
54 #include <libkern/c++/OSNumber.h>
55 #include <libkern/c++/OSObject.h>
56 #include <libkern/c++/OSOrderedSet.h>
57 #include <libkern/c++/OSSerialize.h>
58 #include <libkern/c++/OSSet.h>
59 #include <libkern/c++/OSSharedPtr.h>
60 #include <libkern/c++/OSString.h>
61 #include <libkern/c++/OSSymbol.h>
62 #include <libkern/c++/OSUnserialize.h>
63 #include <libkern/crypto/aes.h>
64 #include <libkern/crypto/aesxts.h>
65 #include <libkern/crypto/crypto_internal.h>
66 #include <libkern/crypto/des.h>
67 #include <libkern/crypto/md5.h>
68 #include <libkern/crypto/register_crypto.h>
69 #include <libkern/crypto/sha1.h>
70 #include <libkern/crypto/sha2.h>
71 #include <libkern/kernel_mach_header.h>
72 #include <libkern/kext_request_keys.h>
73 #include <libkern/kxld.h>
74 #include <libkern/kxld_types.h>
75 #include <libkern/locks.h>
76 #include <libkern/mkext.h>
77 #include <libkern/OSAtomic.h>
78 #include <libkern/OSBase.h>
79 #include <libkern/OSDebug.h>
80 #include <libkern/OSKextLib.h>
81 #include <libkern/OSKextLibPrivate.h>
82 #include <libkern/OSReturn.h>
83 #include <libkern/OSSerializeBinary.h>
84 #include <libkern/OSTypes.h>
85 #include <libkern/prelink.h>
86 #include <libkern/stack_protector.h>
87 #include <libkern/sysctl.h>
88 #include <libkern/tree.h>
89 #include <libkern/zconf.h>
90 #include <libkern/zlib.h>
92 #include <IOKit/AppleKeyStoreInterface.h>
93 #include <IOKit/assert.h>
94 #include <IOKit/IOBSD.h>
95 #include <IOKit/IOBufferMemoryDescriptor.h>
96 #include <IOKit/IOCatalogue.h>
97 #include <IOKit/IOCommand.h>
98 #include <IOKit/IOCommandGate.h>
99 #include <IOKit/IOCommandPool.h>
100 #include <IOKit/IOCommandQueue.h>
101 #include <IOKit/IOConditionLock.h>
102 #include <IOKit/IOCPU.h>
103 //#include <IOKit/IODataQueue.h>
104 #include <IOKit/IODataQueueShared.h>
105 #include <IOKit/IODeviceMemory.h>
106 #include <IOKit/IODeviceTreeSupport.h>
107 #include <IOKit/IODMACommand.h>
108 #include <IOKit/IODMAController.h>
109 #include <IOKit/IODMAEventSource.h>
110 #include <IOKit/IOEventSource.h>
111 #include <IOKit/IOFilterInterruptEventSource.h>
112 #include <IOKit/IOHibernatePrivate.h>
113 #include <IOKit/IOInterleavedMemoryDescriptor.h>
114 #include <IOKit/IOInterruptAccounting.h>
115 #include <IOKit/IOInterruptAccountingPrivate.h>
116 #include <IOKit/IOInterruptController.h>
117 #include <IOKit/IOInterruptEventSource.h>
118 #include <IOKit/IOInterrupts.h>
119 #include <IOKit/IOKernelReporters.h>
120 #include <IOKit/IOKernelReportStructs.h>
121 #include <IOKit/IOKitDebug.h>
122 #include <IOKit/IOKitDiagnosticsUserClient.h>
123 #include <IOKit/IOKitKeys.h>
124 #include <IOKit/IOKitKeysPrivate.h>
125 #include <IOKit/IOKitServer.h>
126 #include <IOKit/IOLib.h>
127 #include <IOKit/IOLocks.h>
128 #include <IOKit/IOLocksPrivate.h>
129 #include <IOKit/IOMapper.h>
130 #include <IOKit/IOMemoryCursor.h>
131 #include <IOKit/IOMemoryDescriptor.h>
132 #include <IOKit/IOMessage.h>
133 #include <IOKit/IOMultiMemoryDescriptor.h>
134 #include <IOKit/IONotifier.h>
135 #include <IOKit/IONVRAM.h>
136 #include <IOKit/IOPlatformExpert.h>
137 #include <IOKit/IOPolledInterface.h>
138 #include <IOKit/IORangeAllocator.h>
139 #include <IOKit/IORegistryEntry.h>
140 #include <IOKit/IOReportMacros.h>
141 #include <IOKit/IOReportTypes.h>
142 #include <IOKit/IOReturn.h>
143 #include <IOKit/IOService.h>
144 #include <IOKit/IOServicePM.h>
145 #include <IOKit/IOSharedDataQueue.h>
146 #include <IOKit/IOSharedLock.h>
147 #include <IOKit/IOStatistics.h>
148 #include <IOKit/IOStatisticsPrivate.h>
149 #include <IOKit/IOSubMemoryDescriptor.h>
150 #include <IOKit/IOSyncer.h>
151 #include <IOKit/IOTimerEventSource.h>
152 #include <IOKit/IOTimeStamp.h>
153 #include <IOKit/IOTypes.h>
154 #include <IOKit/IOUserClient.h>
155 #include <IOKit/IOWorkLoop.h>
156 #include <IOKit/nvram/IONVRAMController.h>
157 #include <IOKit/OSMessageNotification.h>
158 #include <IOKit/platform/AppleMacIO.h>
159 #include <IOKit/platform/AppleMacIODevice.h>
160 #include <IOKit/platform/AppleNMI.h>
161 #include <IOKit/platform/ApplePlatformExpert.h>
162 #include <IOKit/power/IOPwrController.h>
163 #include <IOKit/pwr_mgt/IOPM.h>
164 #include <IOKit/pwr_mgt/IOPMinformee.h>
165 #include <IOKit/pwr_mgt/IOPMinformeeList.h>
166 #include <IOKit/pwr_mgt/IOPMLibDefs.h>
167 #include <IOKit/pwr_mgt/IOPMlog.h>
168 #include <IOKit/pwr_mgt/IOPMPowerSource.h>
169 #include <IOKit/pwr_mgt/IOPMPowerSourceList.h>
170 #include <IOKit/pwr_mgt/IOPMpowerState.h>
171 #include <IOKit/pwr_mgt/IOPMPrivate.h>
172 #include <IOKit/pwr_mgt/IOPowerConnection.h>
173 #include <IOKit/pwr_mgt/RootDomain.h>
174 #include <IOKit/rtc/IORTCController.h>
175 #include <IOKit/system.h>
176 #include <IOKit/system_management/IOWatchDogTimer.h>
178 #endif /* TEST_HEADERS */
180 #include <sys/sysctl.h>
181 #include <libkern/c++/OSData.h>
185 #if DEVELOPMENT || DEBUG
187 #include <IOKit/IOWorkLoop.h>
188 #include <IOKit/IOTimerEventSource.h>
189 #include <IOKit/IOInterruptEventSource.h>
190 #include <IOKit/IOCommandGate.h>
191 #include <IOKit/IOPlatformExpert.h>
192 #include <IOKit/IOSharedDataQueue.h>
193 #include <IOKit/IODataQueueShared.h>
194 #include <libkern/Block.h>
195 #include <libkern/Block_private.h>
196 #include <libkern/c++/OSAllocation.h>
197 #include <libkern/c++/OSBoundedArray.h>
198 #include <libkern/c++/OSBoundedArrayRef.h>
199 #include <libkern/c++/OSBoundedPtr.h>
200 #include <libkern/c++/OSSharedPtr.h>
201 #include <os/cpp_util.h>
203 static uint64_t gIOWorkLoopTestDeadline
;
206 TESAction(OSObject
* owner
, IOTimerEventSource
* tes
)
208 if (mach_absolute_time() < gIOWorkLoopTestDeadline
) {
209 tes
->setTimeout(1, kMicrosecondScale
);
214 IOWorkLoopTest(int newValue
)
219 IOTimerEventSource
* tes
;
220 IOInterruptEventSource
* ies
;
222 wl
= IOWorkLoop::workLoop();
224 tes
= IOTimerEventSource::timerEventSource(kIOTimerEventSourceOptionsPriorityWorkLoop
, wl
, &TESAction
);
226 err
= wl
->addEventSource(tes
);
227 assert(kIOReturnSuccess
== err
);
228 clock_interval_to_deadline(100, kMillisecondScale
, &gIOWorkLoopTestDeadline
);
229 for (idx
= 0; mach_absolute_time() < gIOWorkLoopTestDeadline
; idx
++) {
230 tes
->setTimeout(idx
& 1023, kNanosecondScale
);
232 tes
->cancelTimeout();
233 wl
->removeEventSource(tes
);
238 tes
= IOTimerEventSource::timerEventSource(kIOTimerEventSourceOptionsDefault
, wl
, ^(IOTimerEventSource
* tes
){
239 kprintf("wl %p, value %d\n", wl
, value
);
241 err
= wl
->addEventSource(tes
);
242 assert(kIOReturnSuccess
== err
);
245 tes
->setTimeout(1, kNanosecondScale
);
247 wl
->removeEventSource(tes
);
250 ies
= IOInterruptEventSource::interruptEventSource(wl
, NULL
, 0, ^void (IOInterruptEventSource
*sender
, int count
){
251 kprintf("ies block %p, %d\n", sender
, count
);
255 kprintf("ies %p\n", ies
);
256 err
= wl
->addEventSource(ies
);
257 assert(kIOReturnSuccess
== err
);
258 ies
->interruptOccurred(NULL
, NULL
, 0);
260 ies
->interruptOccurred(NULL
, NULL
, 0);
262 wl
->removeEventSource(ies
);
271 OSCollectionTest(int newValue
)
273 OSArray
* array
= OSArray::withCapacity(8);
274 array
->setObject(kOSBooleanTrue
);
275 array
->setObject(kOSBooleanFalse
);
276 array
->setObject(kOSBooleanFalse
);
277 array
->setObject(kOSBooleanTrue
);
278 array
->setObject(kOSBooleanFalse
);
279 array
->setObject(kOSBooleanTrue
);
281 __block
unsigned int index
;
283 array
->iterateObjects(^bool (OSObject
* obj
) {
284 kprintf("%d:%d ", index
, (obj
== kOSBooleanTrue
) ? 1 : (obj
== kOSBooleanFalse
) ? 0 : 2);
291 OSDictionary
* dict
= IOService::resourceMatching("hello");
294 dict
->iterateObjects(^bool (const OSSymbol
* sym
, OSObject
* obj
) {
295 OSString
* str
= OSDynamicCast(OSString
, obj
);
297 kprintf("%d:%s=%s\n", index
, sym
->getCStringNoCopy(), str
->getCStringNoCopy());
303 OSSerializer
* serializer
= OSSerializer::withBlock(^bool (OSSerialize
* s
){
304 return gIOBSDUnitKey
->serialize(s
);
307 IOService::getPlatform()->setProperty("OSSerializer_withBlock", serializer
);
308 serializer
->release();
314 OSAllocationTests(int)
316 OSAllocation
<int> ints(100, OSAllocateMemory
);
321 for (int& i
: ints
) {
328 for (int& i
: ints
) {
329 assert(i
== counter
);
334 // Make sure we can have two-level OSAllocations
336 OSAllocation
<OSAllocation
<int> > testArray(10, OSAllocateMemory
);
337 for (int i
= 0; i
< 10; i
++) {
338 testArray
[i
] = OSAllocation
<int>(10, OSAllocateMemory
);
339 for (int j
= 0; j
< 10; ++j
) {
340 testArray
[i
][j
] = i
+ j
;
344 for (int i
= 0; i
< 10; i
++) {
345 for (int j
= 0; j
< 10; ++j
) {
346 assert(testArray
[i
][j
] == i
+ j
);
355 OSBoundedArrayTests(int)
357 OSBoundedArray
<int, 5> ints
= {0, 1, 2, 3, 4};
358 assert(ints
.size() == 5);
362 for (int& i
: ints
) {
369 for (int& i
: ints
) {
370 assert(i
== counter
);
379 OSBoundedArrayRefTests(int)
381 OSBoundedArray
<int, 5> storage
= {0, 1, 2, 3, 4};
382 OSBoundedArrayRef
<int> ints(storage
);
387 for (int& i
: ints
) {
394 for (int& i
: ints
) {
395 assert(i
== counter
);
404 OSBoundedPtrTests(int)
406 int array
[5] = {55, 66, 77, 88, 99};
407 OSBoundedPtr
<int> begin(&array
[0], &array
[0], &array
[5]);
408 OSBoundedPtr
<int> end(&array
[5], &array
[0], &array
[5]);
412 for (OSBoundedPtr
<int> b
= begin
; b
!= end
; ++b
) {
419 for (OSBoundedPtr
<int> b
= begin
; b
!= end
; ++b
) {
420 assert(*b
== counter
);
429 IOSharedDataQueue_44636964(__unused
int newValue
)
431 IOSharedDataQueue
* sd
= IOSharedDataQueue::withCapacity(DATA_QUEUE_ENTRY_HEADER_SIZE
+ sizeof(UInt64
));
432 UInt64 data
= 0x11223344aa55aa55;
433 UInt32 data2
= 0x44332211;
434 UInt32 size
= sizeof(UInt32
);
435 /* enqueue moves tail to end */
436 sd
->enqueue(&data
, sizeof(UInt64
));
437 /* dequeue moves head to end */
438 sd
->dequeue(&data
, &size
);
439 /* Tail wraps around, head is still at end */
440 sd
->enqueue(&data2
, sizeof(UInt32
));
441 /* something in the queue so peek() should return non-null */
442 assert(sd
->peek() != NULL
);
447 #include <IOKit/IOUserClient.h>
448 class TestUserClient
: public IOUserClient
450 OSDeclareDefaultStructors(TestUserClient
);
451 virtual void stop( IOService
*provider
) APPLE_KEXT_OVERRIDE
;
452 virtual bool finalize(IOOptionBits options
) APPLE_KEXT_OVERRIDE
;
453 virtual IOReturn
externalMethod( uint32_t selector
,
454 IOExternalMethodArguments
* arguments
,
455 IOExternalMethodDispatch
* dispatch
,
457 void * reference
) APPLE_KEXT_OVERRIDE
;
461 TestUserClient::stop( IOService
*provider
)
463 kprintf("TestUserClient::stop\n");
466 TestUserClient::finalize(IOOptionBits options
)
468 kprintf("TestUserClient::finalize\n");
472 TestUserClient::externalMethod( uint32_t selector
,
473 IOExternalMethodArguments
* arguments
,
474 IOExternalMethodDispatch
* dispatch
,
478 getProvider()->terminate();
482 OSDefineMetaClassAndStructors(TestUserClient
, IOUserClient
);
486 IOServiceTest(int newValue
)
488 OSDictionary
* matching
;
490 __block IOService
* found
;
493 found
= new IOService
;
495 found
->setName("IOTestUserClientProvider");
496 found
->attach(IOService::getPlatform());
497 found
->setProperty("IOUserClientClass", "TestUserClient");
498 found
->registerService();
501 matching
= IOService::serviceMatching("IOPlatformExpert");
504 note
= IOService::addMatchingNotification(gIOMatchedNotification
, matching
, 0,
505 ^bool (IOService
* newService
, IONotifier
* notifier
) {
506 kprintf("found %s, %d\n", newService
->getName(), newService
->getRetainCount());
517 note
= found
->registerInterest(gIOBusyInterest
,
518 ^IOReturn (uint32_t messageType
, IOService
* provider
,
519 void * messageArgument
, size_t argSize
) {
520 kprintf("%p messageType 0x%08x %p\n", provider
, messageType
, messageArgument
);
521 return kIOReturnSuccess
;
532 OSStaticPtrCastTests()
536 OSSharedPtr
<OSDictionary
> const dict
= OSMakeShared
<OSDictionary
>();
537 OSSharedPtr
<OSCollection
> collection
= OSStaticPtrCast
<OSCollection
>(dict
);
538 assert(collection
== dict
);
541 OSSharedPtr
<OSDictionary
> const dict
= nullptr;
542 OSSharedPtr
<OSCollection
> collection
= OSStaticPtrCast
<OSCollection
>(dict
);
543 assert(collection
== nullptr);
547 OSSharedPtr
<OSDictionary
> dict
= OSMakeShared
<OSDictionary
>();
548 OSDictionary
* oldDict
= dict
.get();
549 OSSharedPtr
<OSCollection
> collection
= OSStaticPtrCast
<OSCollection
>(os::move(dict
));
550 assert(collection
.get() == oldDict
);
551 assert(dict
== nullptr);
554 OSSharedPtr
<OSDictionary
> dict
= nullptr;
555 OSSharedPtr
<OSCollection
> collection
= OSStaticPtrCast
<OSCollection
>(os::move(dict
));
556 assert(collection
== nullptr);
557 assert(dict
== nullptr);
562 OSConstPtrCastTests()
566 OSSharedPtr
<OSDictionary
const> const dict
= OSMakeShared
<OSDictionary
>();
567 OSSharedPtr
<OSDictionary
> dict2
= OSConstPtrCast
<OSDictionary
>(dict
);
568 assert(dict2
== dict
);
571 OSSharedPtr
<OSDictionary
const> const dict
= OSMakeShared
<OSDictionary
>();
572 OSSharedPtr
<OSDictionary
const> dict2
= OSConstPtrCast
<OSDictionary
const>(dict
);
573 assert(dict2
== dict
);
576 OSSharedPtr
<OSDictionary
const> const dict
= nullptr;
577 OSSharedPtr
<OSDictionary
> dict2
= OSConstPtrCast
<OSDictionary
>(dict
);
578 assert(dict2
== nullptr);
581 OSSharedPtr
<OSDictionary
const> const dict
= nullptr;
582 OSSharedPtr
<OSDictionary
const> dict2
= OSConstPtrCast
<OSDictionary
const>(dict
);
583 assert(dict2
== nullptr);
588 OSSharedPtr
<OSDictionary
const> dict
= OSMakeShared
<OSDictionary
>();
589 OSDictionary
const* oldDict
= dict
.get();
590 OSSharedPtr
<OSDictionary
> dict2
= OSConstPtrCast
<OSDictionary
>(os::move(dict
));
591 assert(dict
== nullptr);
592 assert(dict2
== oldDict
);
595 OSSharedPtr
<OSDictionary
const> dict
= nullptr;
596 OSSharedPtr
<OSDictionary
> dict2
= OSConstPtrCast
<OSDictionary
>(os::move(dict
));
597 assert(dict
== nullptr);
598 assert(dict2
== nullptr);
603 OSDynamicPtrCastTests()
605 OSSharedPtr
<OSDictionary
> const dict
= OSMakeShared
<OSDictionary
>();
607 OSSharedPtr
<OSCollection
> collection
= OSDynamicPtrCast
<OSCollection
>(dict
);
608 assert(collection
!= nullptr);
611 OSSharedPtr
<OSArray
> array
= OSDynamicPtrCast
<OSArray
>(dict
);
612 assert(array
== nullptr);
613 assert(dict
!= nullptr);
616 OSTaggedSharedPtr
<OSCollection
, OSCollection
> taggedDict(dict
.get(), OSRetain
);
617 OSTaggedSharedPtr
<OSCollection
, OSCollection
> collection
= OSDynamicPtrCast
<OSCollection
>(taggedDict
);
618 assert(collection
!= nullptr);
621 OSTaggedSharedPtr
<OSCollection
, OSCollection
> taggedDict(dict
.get(), OSRetain
);
622 OSTaggedSharedPtr
<OSArray
, OSCollection
> array
= OSDynamicPtrCast
<OSArray
>(taggedDict
);
623 assert(array
== nullptr);
624 assert(dict
!= nullptr);
627 OSSharedPtr
<OSCollection
> collection
= OSDynamicPtrCast
<OSCollection
>(dict
);
628 assert(collection
.get() == OSDynamicCast(OSDictionary
, dict
.get()));
629 OSSharedPtr
<OSDictionary
> newDict
= OSDynamicPtrCast
<OSDictionary
>(os::move(collection
));
630 assert(collection
== nullptr);
631 assert(newDict
!= nullptr);
632 assert(newDict
.get() == dict
.get());
637 OSSharedPtrTests(int)
639 OSDynamicPtrCastTests();
640 OSConstPtrCastTests();
641 OSStaticPtrCastTests();
645 #endif /* DEVELOPMENT || DEBUG */
647 #ifndef __clang_analyzer__
648 // All the scary things that this function is doing, such as the intentional
649 // overrelease of an OSData, are hidden from the static analyzer.
651 sysctl_iokittest(__unused
struct sysctl_oid
*oidp
, __unused
void *arg1
, __unused
int arg2
, struct sysctl_req
*req
)
654 int newValue
, changed
;
656 error
= sysctl_io_number(req
, 0, sizeof(int), &newValue
, &changed
);
661 #if DEVELOPMENT || DEBUG
662 if (changed
&& (66 == newValue
)) {
664 IOWorkLoop
* wl
= IOWorkLoop::workLoop();
665 IOCommandGate
* cg
= IOCommandGate::commandGate(wl
);
666 ret
= wl
->addEventSource(cg
);
674 y
.h
= 0x1111111122222222;
675 y
.l
= 0x3333333344444444;
677 kprintf("ret1 %d\n", ret
);
678 ret
= cg
->runActionBlock(^(){
679 printf("hello %d 0x%qx\n", wl
->inGate(), y
.h
);
682 kprintf("ret %d\n", ret
);
685 if (changed
&& (999 == newValue
)) {
686 OSData
* data
= OSData::withCapacity(16);
691 if (changed
&& (newValue
>= 6666) && (newValue
<= 6669)) {
696 iter
= IOService::getMatchingServices(IOService::nameMatching("XHC1"));
697 if (iter
&& (service
= (IOService
*) iter
->getNextObject())) {
698 if (newValue
== 6666) {
699 IOLog("terminating 0x%qx\n", service
->getRegistryEntryID());
700 service
->terminate();
701 } else if (newValue
== 6667) {
702 IOLog("register 0x%qx\n", service
->getRegistryEntryID());
703 service
->registerService();
706 OSSafeReleaseNULL(iter
);
713 if (changed
&& newValue
) {
714 error
= IOWorkLoopTest(newValue
);
715 assert(KERN_SUCCESS
== error
);
716 error
= IOServiceTest(newValue
);
717 assert(KERN_SUCCESS
== error
);
718 error
= OSCollectionTest(newValue
);
719 assert(KERN_SUCCESS
== error
);
720 error
= OSAllocationTests(newValue
);
721 assert(KERN_SUCCESS
== error
);
722 error
= OSBoundedArrayTests(newValue
);
723 assert(KERN_SUCCESS
== error
);
724 error
= OSBoundedArrayRefTests(newValue
);
725 assert(KERN_SUCCESS
== error
);
726 error
= OSBoundedPtrTests(newValue
);
727 assert(KERN_SUCCESS
== error
);
728 error
= IOMemoryDescriptorTest(newValue
);
729 assert(KERN_SUCCESS
== error
);
730 error
= OSSharedPtrTests(newValue
);
731 assert(KERN_SUCCESS
== error
);
732 error
= IOSharedDataQueue_44636964(newValue
);
733 assert(KERN_SUCCESS
== error
);
735 #endif /* DEVELOPMENT || DEBUG */
740 SYSCTL_PROC(_kern
, OID_AUTO
, iokittest
,
741 CTLTYPE_INT
| CTLFLAG_RW
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
| CTLFLAG_LOCKED
,
742 NULL
, 0, sysctl_iokittest
, "I", "");
743 #endif // __clang_analyzer__