63
64
strategyPtr = new SmiMockStrategy(getParameterString("smiFile"));
67
// used for automatic setup of magic io stuff
70
smbios::TokenTableFactory *ttFactory = 0;
71
smbios::ITokenTable *tokenTable = 0;
75
case DELL_CALLING_INTERFACE_SMI_RAW:
76
ret = new DellCallingInterfaceSmiImpl(strategyPtr);
68
79
case DELL_CALLING_INTERFACE_SMI:
69
80
ret = new DellCallingInterfaceSmiImpl(strategyPtr);
81
// automatically set up cmd io port/magic
82
// step 1: get token table
83
ttFactory = smbios::TokenTableFactory::getFactory() ;
84
tokenTable = ttFactory->getSingleton();
85
// step 2: iterate through token table
87
smbios::ITokenTable::iterator token = tokenTable->begin();
88
token != tokenTable->end();
91
// Step 3: go until we get to the first one that will dynamic cast
94
if( token->getTokenClass() != "TokenDA" )
97
// Step 4: then set cmd io stuff
98
dynamic_cast<smbios::ISmiToken *>(&*token)->getSmiDetails(&cmdIOAddress, &cmdIOCode, static_cast<u8*>(0));
99
ret->setCommandIOMagic( cmdIOAddress, cmdIOCode );
105
if( ! (cmdIOAddress && cmdIOCode))
106
throw SmiExceptionImpl(_("Could not automatically setup up magic io"));
72
110
throw InvalidSmiModeImpl(_("Unknown smi factory mode requested"));