2 * Copyright (c) 1998-2011 Apple 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@
28 #include <IOKit/IOBSD.h>
29 #include <IOKit/IOLib.h>
30 #include <IOKit/IOService.h>
31 #include <IOKit/IOCatalogue.h>
32 #include <IOKit/IODeviceTreeSupport.h>
33 #include <IOKit/IOKitKeys.h>
34 #include <IOKit/IOPlatformExpert.h>
35 #include <IOKit/IOUserClient.h>
39 #include <pexpert/pexpert.h>
40 #include <kern/clock.h>
41 #include <uuid/uuid.h>
42 #include <sys/vnode_internal.h>
43 #include <sys/mount.h>
45 // how long to wait for matching root device, secs
47 #define ROOTDEVICETIMEOUT 120
49 #define ROOTDEVICETIMEOUT 60
52 int panic_on_exception_triage
= 0;
54 extern dev_t
mdevadd(int devid
, uint64_t base
, unsigned int size
, int phys
);
55 extern dev_t
mdevlookup(int devid
);
56 extern void mdevremoveall(void);
57 extern void di_root_ramfile(IORegistryEntry
* entry
);
61 #define IOPOLLED_COREFILE 1
63 #define kIOCoreDumpSize 0ULL
64 #define kIOCoreDumpFreeSize 0ULL
66 #define IOPOLLED_COREFILE 0
72 NewKernelCoreMedia(void * target
, void * refCon
,
73 IOService
* newService
,
74 IONotifier
* notifier
);
75 #endif /* IOPOLLED_COREFILE */
81 IOService::publishResource("IOBSD");
83 return( kIOReturnSuccess
);
87 IOServicePublishResource( const char * property
, boolean_t value
)
90 IOService::publishResource( property
, kOSBooleanTrue
);
92 IOService::getResourceService()->removeProperty( property
);
96 IOServiceWaitForMatchingResource( const char * property
, uint64_t timeout
)
98 OSDictionary
* dict
= 0;
99 IOService
* match
= 0;
100 boolean_t found
= false;
104 dict
= IOService::resourceMatching( property
);
107 match
= IOService::waitForMatchingService( dict
, timeout
);
122 IOCatalogueMatchingDriversPresent( const char * property
)
124 OSDictionary
* dict
= 0;
125 OSOrderedSet
* set
= 0;
126 SInt32 generationCount
= 0;
127 boolean_t found
= false;
131 dict
= OSDictionary::withCapacity(1);
134 dict
->setObject( property
, kOSBooleanTrue
);
135 set
= gIOCatalogue
->findDrivers( dict
, &generationCount
);
136 if ( set
&& (set
->getCount() > 0))
149 OSDictionary
* IOBSDNameMatching( const char * name
)
152 const OSSymbol
* str
= 0;
156 dict
= IOService::serviceMatching( gIOServiceKey
);
159 str
= OSSymbol::withCString( name
);
162 dict
->setObject( kIOBSDNameKey
, (OSObject
*) str
);
177 OSDictionary
* IOUUIDMatching( void )
179 return IOService::resourceMatching( "boot-uuid-media" );
182 OSDictionary
* IONetworkNamePrefixMatching( const char * prefix
)
184 OSDictionary
* matching
;
185 OSDictionary
* propDict
= 0;
186 const OSSymbol
* str
= 0;
187 char networkType
[128];
190 matching
= IOService::serviceMatching( "IONetworkInterface" );
194 propDict
= OSDictionary::withCapacity(1);
198 str
= OSSymbol::withCString( prefix
);
202 propDict
->setObject( "IOInterfaceNamePrefix", (OSObject
*) str
);
206 // see if we're contrained to netroot off of specific network type
207 if(PE_parse_boot_argn( "network-type", networkType
, 128 ))
209 str
= OSSymbol::withCString( networkType
);
212 propDict
->setObject( "IONetworkRootType", str
);
218 if ( matching
->setObject( gIOPropertyMatchKey
,
219 (OSObject
*) propDict
) != true )
229 if ( matching
) matching
->release();
230 if ( propDict
) propDict
->release();
231 if ( str
) str
->release();
236 static bool IORegisterNetworkInterface( IOService
* netif
)
238 // A network interface is typically named and registered
239 // with BSD after receiving a request from a user space
240 // "namer". However, for cases when the system needs to
241 // root from the network, this registration task must be
242 // done inside the kernel and completed before the root
243 // device is handed to BSD.
248 OSDictionary
* dict
= 0;
251 enum { kMaxPathLen
= 512 };
254 stack
= IOService::waitForService(
255 IOService::serviceMatching("IONetworkStack") );
256 if ( stack
== 0 ) break;
258 dict
= OSDictionary::withCapacity(3);
259 if ( dict
== 0 ) break;
261 zero
= OSNumber::withNumber((UInt64
) 0, 32);
262 if ( zero
== 0 ) break;
264 pathBuf
= (char *) IOMalloc( kMaxPathLen
);
265 if ( pathBuf
== 0 ) break;
268 if ( netif
->getPath( pathBuf
, &len
, gIOServicePlane
)
271 path
= OSString::withCStringNoCopy( pathBuf
);
272 if ( path
== 0 ) break;
274 dict
->setObject( "IOInterfaceUnit", zero
);
275 dict
->setObject( kIOPathMatchKey
, path
);
277 stack
->setProperties( dict
);
281 if ( zero
) zero
->release();
282 if ( path
) path
->release();
283 if ( dict
) dict
->release();
284 if ( pathBuf
) IOFree(pathBuf
, kMaxPathLen
);
286 return ( netif
->getProperty( kIOBSDNameKey
) != 0 );
289 OSDictionary
* IOOFPathMatching( const char * path
, char * buf
, int maxLen
)
291 OSDictionary
* matching
= NULL
;
298 len
= strlen( kIODeviceTreePlane
":" );
303 strlcpy( buf
, kIODeviceTreePlane
":", len
+ 1 );
306 len
= strlen( path
);
310 strlcpy( comp
, path
, len
+ 1 );
312 matching
= OSDictionary::withCapacity( 1 );
316 str
= OSString::withCString( buf
);
319 matching
->setObject( kIOPathMatchKey
, str
);
332 static int didRam
= 0;
333 enum { kMaxPathBuf
= 512, kMaxBootVar
= 128 };
335 kern_return_t
IOFindBSDRoot( char * rootName
, unsigned int rootNameSize
,
336 dev_t
* root
, u_int32_t
* oflags
)
340 IORegistryEntry
* regEntry
;
341 OSDictionary
* matching
= 0;
348 const char * mediaProperty
= 0;
351 const char * look
= 0;
353 bool debugInfoPrintedOnce
= false;
354 const char * uuidStr
= NULL
;
356 static int mountAttempts
= 0;
364 str
= (char *) IOMalloc( kMaxPathBuf
+ kMaxBootVar
);
366 return( kIOReturnNoMemory
);
367 rdBootVar
= str
+ kMaxPathBuf
;
369 if (!PE_parse_boot_argn("rd", rdBootVar
, kMaxBootVar
)
370 && !PE_parse_boot_argn("rootdev", rdBootVar
, kMaxBootVar
))
374 if( (regEntry
= IORegistryEntry::fromPath( "/chosen", gIODTPlane
))) {
375 di_root_ramfile(regEntry
);
376 data
= OSDynamicCast(OSData
, regEntry
->getProperty( "root-matching" ));
378 matching
= OSDynamicCast(OSDictionary
, OSUnserializeXML((char *)data
->getBytesNoCopy()));
384 data
= (OSData
*) regEntry
->getProperty( "boot-uuid" );
386 uuidStr
= (const char*)data
->getBytesNoCopy();
387 OSString
*uuidString
= OSString::withCString( uuidStr
);
389 // match the boot-args boot-uuid processing below
391 IOLog("rooting via boot-uuid from /chosen: %s\n", uuidStr
);
392 IOService::publishResource( "boot-uuid", uuidString
);
393 uuidString
->release();
394 matching
= IOUUIDMatching();
395 mediaProperty
= "boot-uuid-media";
407 // See if we have a RAMDisk property in /chosen/memory-map. If so, make it into a device.
408 // It will become /dev/mdx, where x is 0-f.
411 if(!didRam
) { /* Have we already build this ram disk? */
412 didRam
= 1; /* Remember we did this */
413 if((regEntry
= IORegistryEntry::fromPath( "/chosen/memory-map", gIODTPlane
))) { /* Find the map node */
414 data
= (OSData
*)regEntry
->getProperty("RAMDisk"); /* Find the ram disk, if there */
415 if(data
) { /* We found one */
416 uintptr_t *ramdParms
;
417 ramdParms
= (uintptr_t *)data
->getBytesNoCopy(); /* Point to the ram disk base and size */
418 (void)mdevadd(-1, ml_static_ptovirt(ramdParms
[0]) >> 12, ramdParms
[1] >> 12, 0); /* Initialize it and pass back the device number */
420 regEntry
->release(); /* Toss the entry */
425 // Now check if we are trying to root on a memory device
428 if((rdBootVar
[0] == 'm') && (rdBootVar
[1] == 'd') && (rdBootVar
[3] == 0)) {
429 dchar
= xchar
= rdBootVar
[2]; /* Get the actual device */
430 if((xchar
>= '0') && (xchar
<= '9')) xchar
= xchar
- '0'; /* If digit, convert */
432 xchar
= xchar
& ~' '; /* Fold to upper case */
433 if((xchar
>= 'A') && (xchar
<= 'F')) { /* Is this a valid digit? */
434 xchar
= (xchar
& 0xF) + 9; /* Convert the hex digit */
435 dchar
= dchar
| ' '; /* Fold to lower case */
437 else xchar
= -1; /* Show bogus */
439 if(xchar
>= 0) { /* Do we have a valid memory device name? */
440 *root
= mdevlookup(xchar
); /* Find the device number */
441 if(*root
>= 0) { /* Did we find one? */
443 rootName
[0] = 'm'; /* Build root name */
444 rootName
[1] = 'd'; /* Build root name */
445 rootName
[2] = dchar
; /* Build root name */
446 rootName
[3] = 0; /* Build root name */
447 IOLog("BSD root: %s, major %d, minor %d\n", rootName
, major(*root
), minor(*root
));
448 *oflags
= 0; /* Show that this is not network */
449 goto iofrootx
; /* Join common exit... */
451 panic("IOFindBSDRoot: specified root memory device, %s, has not been configured\n", rdBootVar
); /* Not there */
455 if( (!matching
) && rdBootVar
[0] ) {
461 if ( strncmp( look
, "en", strlen( "en" )) == 0 ) {
462 matching
= IONetworkNamePrefixMatching( "en" );
463 } else if ( strncmp( look
, "uuid", strlen( "uuid" )) == 0 ) {
465 OSString
*uuidString
;
467 uuid
= (char *)IOMalloc( kMaxBootVar
);
470 if (!PE_parse_boot_argn( "boot-uuid", uuid
, kMaxBootVar
)) {
471 panic( "rd=uuid but no boot-uuid=<value> specified" );
473 uuidString
= OSString::withCString( uuid
);
475 IOService::publishResource( "boot-uuid", uuidString
);
476 uuidString
->release();
477 IOLog( "\nWaiting for boot volume with UUID %s\n", uuid
);
478 matching
= IOUUIDMatching();
479 mediaProperty
= "boot-uuid-media";
481 IOFree( uuid
, kMaxBootVar
);
484 matching
= IOBSDNameMatching( look
);
490 // Match any HFS media
492 matching
= IOService::serviceMatching( "IOMedia" );
493 astring
= OSString::withCStringNoCopy("Apple_HFS");
495 matching
->setObject("Content", astring
);
500 if( gIOKitDebug
& kIOWaitQuietBeforeRoot
) {
501 IOLog( "Waiting for matching to complete\n" );
502 IOService::getPlatform()->waitQuiet();
505 if( true && matching
) {
506 OSSerialize
* s
= OSSerialize::withCapacity( 5 );
508 if( matching
->serialize( s
)) {
509 IOLog( "Waiting on %s\n", s
->text() );
515 t
.tv_sec
= ROOTDEVICETIMEOUT
;
518 service
= IOService::waitForService( matching
, &t
);
519 if( (!service
) || (mountAttempts
== 10)) {
520 PE_display_icon( 0, "noroot");
521 IOLog( "Still waiting for root device\n" );
523 if( !debugInfoPrintedOnce
) {
524 debugInfoPrintedOnce
= true;
525 if( gIOKitDebug
& kIOLogDTree
) {
526 IOLog("\nDT plane:\n");
527 IOPrintPlane( gIODTPlane
);
529 if( gIOKitDebug
& kIOLogServiceTree
) {
530 IOLog("\nService plane:\n");
531 IOPrintPlane( gIOServicePlane
);
533 if( gIOKitDebug
& kIOLogMemory
)
540 if ( service
&& mediaProperty
) {
541 service
= (IOService
*)service
->getProperty(mediaProperty
);
547 // If the IOService we matched to is a subclass of IONetworkInterface,
548 // then make sure it has been registered with BSD and has a BSD name
552 && service
->metaCast( "IONetworkInterface" )
553 && !IORegisterNetworkInterface( service
) )
561 service
->getPath( str
, &len
, gIOServicePlane
);
562 IOLog( "Got boot device = %s\n", str
);
564 iostr
= (OSString
*) service
->getProperty( kIOBSDNameKey
);
566 strlcpy( rootName
, iostr
->getCStringNoCopy(), rootNameSize
);
567 off
= (OSNumber
*) service
->getProperty( kIOBSDMajorKey
);
569 mjr
= off
->unsigned32BitValue();
570 off
= (OSNumber
*) service
->getProperty( kIOBSDMinorKey
);
572 mnr
= off
->unsigned32BitValue();
574 if( service
->metaCast( "IONetworkInterface" ))
579 IOLog( "Wait for root failed\n" );
580 strlcpy( rootName
, "en0", rootNameSize
);
584 IOLog( "BSD root: %s", rootName
);
586 IOLog(", major %d, minor %d\n", mjr
, mnr
);
590 *root
= makedev( mjr
, mnr
);
593 IOFree( str
, kMaxPathBuf
+ kMaxBootVar
);
596 if( (gIOKitDebug
& (kIOLogDTree
| kIOLogServiceTree
| kIOLogMemory
)) && !debugInfoPrintedOnce
) {
598 IOService::getPlatform()->waitQuiet();
599 if( gIOKitDebug
& kIOLogDTree
) {
600 IOLog("\nDT plane:\n");
601 IOPrintPlane( gIODTPlane
);
603 if( gIOKitDebug
& kIOLogServiceTree
) {
604 IOLog("\nService plane:\n");
605 IOPrintPlane( gIOServicePlane
);
607 if( gIOKitDebug
& kIOLogMemory
)
611 return( kIOReturnSuccess
);
614 bool IORamDiskBSDRoot(void)
616 char rdBootVar
[kMaxBootVar
];
617 if (PE_parse_boot_argn("rd", rdBootVar
, kMaxBootVar
)
618 || PE_parse_boot_argn("rootdev", rdBootVar
, kMaxBootVar
)) {
619 if((rdBootVar
[0] == 'm') && (rdBootVar
[1] == 'd') && (rdBootVar
[3] == 0)) {
626 void IOSecureBSDRoot(const char * rootName
)
631 IOBSDRegistryEntryForDeviceTree(char * path
)
633 return (IORegistryEntry::fromPath(path
, gIODTPlane
));
637 IOBSDRegistryEntryRelease(void * entry
)
639 IORegistryEntry
* regEntry
= (IORegistryEntry
*)entry
;
647 IOBSDRegistryEntryGetData(void * entry
, char * property_name
,
651 IORegistryEntry
* regEntry
= (IORegistryEntry
*)entry
;
653 data
= (OSData
*) regEntry
->getProperty(property_name
);
655 *packet_length
= data
->getLength();
656 return (data
->getBytesNoCopy());
661 kern_return_t
IOBSDGetPlatformUUID( uuid_t uuid
, mach_timespec_t timeout
)
663 IOService
* resources
;
666 resources
= IOService::waitForService( IOService::resourceMatching( kIOPlatformUUIDKey
), ( timeout
.tv_sec
|| timeout
.tv_nsec
) ? &timeout
: 0 );
667 if ( resources
== 0 ) return KERN_OPERATION_TIMED_OUT
;
669 string
= ( OSString
* ) IOService::getPlatform( )->getProvider( )->getProperty( kIOPlatformUUIDKey
);
670 if ( string
== 0 ) return KERN_NOT_SUPPORTED
;
672 uuid_parse( string
->getCStringNoCopy( ), uuid
);
677 kern_return_t
IOBSDGetPlatformSerialNumber( char *serial_number_str
, u_int32_t len
)
679 OSDictionary
* platform_dict
;
686 serial_number_str
[0] = '\0';
688 platform_dict
= IOService::serviceMatching( "IOPlatformExpertDevice" );
689 if (platform_dict
== NULL
) {
690 return KERN_NOT_SUPPORTED
;
693 platform
= IOService::waitForService( platform_dict
);
695 string
= ( OSString
* ) platform
->getProperty( kIOPlatformSerialNumberKey
);
697 return KERN_NOT_SUPPORTED
;
699 strlcpy( serial_number_str
, string
->getCStringNoCopy( ), len
);
706 void IOBSDIterateMediaWithContent(const char *content_uuid_cstring
, int (*func
)(const char *bsd_dev_name
, const char *uuid_str
, void *arg
), void *arg
)
708 OSDictionary
*dictionary
;
709 OSString
*content_uuid_string
;
711 dictionary
= IOService::serviceMatching( "IOMedia" );
713 content_uuid_string
= OSString::withCString( content_uuid_cstring
);
714 if( content_uuid_string
) {
718 dictionary
->setObject( "Content", content_uuid_string
);
719 dictionary
->retain();
721 iter
= IOService::getMatchingServices(dictionary
);
722 while (iter
&& (service
= (IOService
*)iter
->getNextObject())) {
724 OSString
*iostr
= (OSString
*) service
->getProperty( kIOBSDNameKey
);
725 OSString
*uuidstr
= (OSString
*) service
->getProperty( "UUID" );
730 uuid
= uuidstr
->getCStringNoCopy();
732 uuid
= "00000000-0000-0000-0000-000000000000";
736 if (func
&& func(iostr
->getCStringNoCopy(), uuid
, arg
) == 0) {
745 content_uuid_string
->release();
747 dictionary
->release();
752 int IOBSDIsMediaEjectable( const char *cdev_name
)
755 OSDictionary
*dictionary
;
758 if (strncmp(cdev_name
, "/dev/", 5) == 0) {
762 dictionary
= IOService::serviceMatching( "IOMedia" );
764 dev_name
= OSString::withCString( cdev_name
);
767 mach_timespec_t tv
= { 5, 0 }; // wait up to "timeout" seconds for the device
769 dictionary
->setObject( kIOBSDNameKey
, dev_name
);
770 dictionary
->retain();
771 service
= IOService::waitForService( dictionary
, &tv
);
773 OSBoolean
*ejectable
= (OSBoolean
*) service
->getProperty( "Ejectable" );
776 ret
= (int)ejectable
->getValue();
782 dictionary
->release();
790 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
792 #include <sys/conf.h>
793 #include <sys/vnode.h>
794 #include <sys/vnode_internal.h>
795 #include <sys/fcntl.h>
796 #include <IOKit/IOPolledInterface.h>
797 #include <IOKit/IOBufferMemoryDescriptor.h>
799 IOPolledFileIOVars
* gIOPolledCoreFileVars
;
801 #if IOPOLLED_COREFILE
804 IOOpenPolledCoreFile(const char * filename
)
809 if (gIOPolledCoreFileVars
) return (kIOReturnBusy
);
810 if (!IOPolledInterface::gMetaClass
.getInstanceCount()) return (kIOReturnUnsupported
);
813 PE_parse_boot_argn("debug", &debug
, sizeof (debug
));
814 if (DB_DISABLE_LOCAL_CORE
& debug
) return (kIOReturnUnsupported
);
816 err
= IOPolledFileOpen(filename
, kIOCoreDumpSize
, kIOCoreDumpFreeSize
,
818 &gIOPolledCoreFileVars
, NULL
, NULL
, 0);
819 if (kIOReturnSuccess
!= err
) return (err
);
821 err
= IOPolledFilePollersSetup(gIOPolledCoreFileVars
, kIOPolledPreflightCoreDumpState
);
822 if (kIOReturnSuccess
!= err
)
824 IOPolledFileClose(&gIOPolledCoreFileVars
, NULL
, NULL
, 0, 0, 0);
831 IOClosePolledCoreFile(void)
833 IOPolledFilePollersClose(gIOPolledCoreFileVars
, kIOPolledPostflightState
);
834 IOPolledFileClose(&gIOPolledCoreFileVars
, NULL
, NULL
, 0, 0, 0);
837 static thread_call_t gIOOpenPolledCoreFileTC
;
838 static IONotifier
* gIOPolledCoreFileNotifier
;
839 static IONotifier
* gIOPolledCoreFileInterestNotifier
;
842 KernelCoreMediaInterest(void * target
, void * refCon
,
843 UInt32 messageType
, IOService
* provider
,
844 void * messageArgument
, vm_size_t argSize
)
846 if (kIOMessageServiceIsTerminated
== messageType
)
848 gIOPolledCoreFileInterestNotifier
->remove();
849 gIOPolledCoreFileInterestNotifier
= 0;
850 IOClosePolledCoreFile();
853 return (kIOReturnSuccess
);
857 OpenKernelCoreMedia(thread_call_param_t p0
, thread_call_param_t p1
)
859 IOService
* newService
;
863 newService
= (IOService
*) p1
;
866 if (gIOPolledCoreFileVars
) break;
867 string
= OSDynamicCast(OSString
, newService
->getProperty(kIOBSDNameKey
));
869 snprintf(filename
, sizeof(filename
), "/dev/%s", string
->getCStringNoCopy());
870 if (kIOReturnSuccess
!= IOOpenPolledCoreFile(filename
)) break;
871 gIOPolledCoreFileInterestNotifier
= newService
->registerInterest(
872 gIOGeneralInterest
, &KernelCoreMediaInterest
, NULL
, 0);
876 newService
->release();
880 NewKernelCoreMedia(void * target
, void * refCon
,
881 IOService
* newService
,
882 IONotifier
* notifier
)
886 if (gIOPolledCoreFileVars
) break;
887 if (!gIOOpenPolledCoreFileTC
) break;
888 newService
= newService
->getProvider();
889 if (!newService
) break;
890 newService
->retain();
891 thread_call_enter1(gIOOpenPolledCoreFileTC
, newService
);
898 #endif /* IOPOLLED_COREFILE */
901 IOBSDMountChange(struct mount
* mp
, uint32_t op
)
903 #if IOPOLLED_COREFILE
905 OSDictionary
* bsdMatching
;
906 OSDictionary
* mediaMatching
;
909 if (!gIOPolledCoreFileNotifier
) do
911 if (!gIOOpenPolledCoreFileTC
) gIOOpenPolledCoreFileTC
= thread_call_allocate(&OpenKernelCoreMedia
, NULL
);
912 bsdMatching
= IOService::serviceMatching("IOMediaBSDClient");
913 if (!bsdMatching
) break;
914 mediaMatching
= IOService::serviceMatching("IOMedia");
915 string
= OSString::withCStringNoCopy("5361644D-6163-11AA-AA11-00306543ECAC");
916 if (!string
|| !mediaMatching
) break;
917 mediaMatching
->setObject("Content", string
);
919 bsdMatching
->setObject(gIOParentMatchKey
, mediaMatching
);
920 mediaMatching
->release();
922 gIOPolledCoreFileNotifier
= IOService::addMatchingNotification(
923 gIOFirstMatchNotification
, bsdMatching
,
924 &NewKernelCoreMedia
, NULL
, NULL
, -1000);
928 #endif /* IOPOLLED_COREFILE */
931 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
934 IOTaskHasEntitlement(task_t task
, const char * entitlement
)
937 obj
= IOUserClient::copyClientEntitlement(task
, entitlement
);
938 if (!obj
) return (false);
940 return (obj
!= kOSBooleanFalse
);