IOFireWireSBP2Diagnostics.cpp [plain text]
#include "IOFireWireSBP2Diagnostics.h"
OSDefineMetaClassAndStructors(IOFireWireSBP2Diagnostics, OSObject)
OSObject * IOFireWireSBP2Diagnostics::createDiagnostics( void )
{
IOFireWireSBP2Diagnostics * diagnostics;
diagnostics = new IOFireWireSBP2Diagnostics;
if( diagnostics && !diagnostics->init() )
{
diagnostics->release();
diagnostics = NULL;
}
return diagnostics;
}
bool IOFireWireSBP2Diagnostics::serialize( OSSerialize * s ) const
{
OSDictionary * dictionary;
bool ok;
dictionary = OSDictionary::withCapacity( 4 );
if( !dictionary )
return false;
updateNumberEntry( dictionary, fExecutedORBCount, "Executed ORB Count" );
ok = dictionary->serialize(s);
dictionary->release();
return ok;
}
void IOFireWireSBP2Diagnostics::updateNumberEntry( OSDictionary * dictionary, UInt32 value, const char * name )
{
OSNumber * number;
number = OSNumber::withNumber( value, 32 );
if( !number )
return;
dictionary->setObject( name, number );
number->release();
}
void IOFireWireSBP2Diagnostics::incrementExecutedORBCount( void )
{
fExecutedORBCount++;
}