thread_call_param_t p0,
thread_call_param_t p1)
{
-#ifdef CONFIG_EMBEDDED
- /* 30 seconds has elapsed - panic */
- panic("Halt/Restart Timed Out");
-
-#else /* ! CONFIG_EMBEDDED */
int type = (int)(long)p0;
/* 30 seconds has elapsed - resume shutdown */
if(gIOPlatform) gIOPlatform->haltRestart(type);
-#endif /* CONFIG_EMBEDDED */
}
the timer expires.
*/
shutdown_hang = thread_call_allocate( &IOShutdownNotificationsTimedOut,
- (thread_call_param_t) type);
+ (thread_call_param_t)(uintptr_t) type);
clock_interval_to_deadline( 30, kSecondScale, &deadline );
thread_call_enter1_delayed( shutdown_hang, 0, deadline );
*len = data->getLength();
vlen = min(vlen, *len);
- if (vlen)
+ if (value && vlen)
memcpy((void *) value, data->getBytesNoCopy(), vlen);
return TRUE;
}
+boolean_t PERemoveNVRAMProperty(const char *symbol)
+{
+ const OSSymbol *sym;
+
+ if (!symbol)
+ goto err;
+
+ if (init_gIOOptionsEntry() < 0)
+ goto err;
+
+ sym = OSSymbol::withCStringNoCopy(symbol);
+ if (!sym)
+ goto err;
+
+ gIOOptionsEntry->removeProperty(sym);
+
+ sym->release();
+
+ gIOOptionsEntry->sync();
+ return TRUE;
+
+err:
+ return FALSE;
+
+}
+
long PEGetGMTTimeOfDay(void)
{
long result = 0;
OSString * string = 0;
uuid_string_t uuid;
-#if CONFIG_EMBEDDED
- entry = IORegistryEntry::fromPath( "/chosen", gIODTPlane );
- if ( entry )
- {
- OSData * data1;
-
- data1 = OSDynamicCast( OSData, entry->getProperty( "unique-chip-id" ) );
- if ( data1 && data1->getLength( ) == 8 )
- {
- OSData * data2;
-
- data2 = OSDynamicCast( OSData, entry->getProperty( "chip-id" ) );
- if ( data2 && data2->getLength( ) == 4 )
- {
- SHA1_CTX context;
- uint8_t digest[ SHA_DIGEST_LENGTH ];
- const uuid_t space = { 0xA6, 0xDD, 0x4C, 0xCB, 0xB5, 0xE8, 0x4A, 0xF5, 0xAC, 0xDD, 0xB6, 0xDC, 0x6A, 0x05, 0x42, 0xB8 };
-
- SHA1Init( &context );
- SHA1Update( &context, space, sizeof( space ) );
- SHA1Update( &context, data1->getBytesNoCopy( ), data1->getLength( ) );
- SHA1Update( &context, data2->getBytesNoCopy( ), data2->getLength( ) );
- SHA1Final( digest, &context );
-
- digest[ 6 ] = ( digest[ 6 ] & 0x0F ) | 0x50;
- digest[ 8 ] = ( digest[ 8 ] & 0x3F ) | 0x80;
-
- uuid_unparse( digest, uuid );
- string = OSString::withCString( uuid );
- }
- }
-
- entry->release( );
- }
-#else /* !CONFIG_EMBEDDED */
entry = IORegistryEntry::fromPath( "/efi/platform", gIODTPlane );
if ( entry )
{
entry->release( );
}
-#endif /* !CONFIG_EMBEDDED */
if ( string == 0 )
{
if( !ok)
return( false);
+ reserved = NULL;
workLoop = IOWorkLoop::workLoop();
if (!workLoop)
return false;