00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #define LIBSMBIOS_SOURCE
00021 #include "smbios/compat.h"
00022
00023 #include <sstream>
00024 #include <iomanip>
00025
00026 #include "TokenImpl.h"
00027
00028 using namespace std;
00029
00030 namespace smbios
00031 {
00032 CmosTokenD6::CmosTokenD6( const smbios::ISmbiosItem &initItem, std::vector< CmosRWChecksumObserver > &initChecksumList)
00033 : CmosTokenD5(initItem, initChecksumList)
00034 {
00035 size_t size;
00036 const u8 *ptr = item->getBufferCopy(size) ;
00037 size = size < sizeof(structure)? size : sizeof(structure);
00038 memcpy( const_cast<dell_protected_value_2_structure*>(&structure), ptr, size );
00039
00040
00041 size = size < sizeof(CmosTokenD5::structure)? size : sizeof(CmosTokenD5::structure);
00042 memcpy(
00043 const_cast<dell_protected_value_1_structure*>(&(CmosTokenD5::structure)),
00044 ptr,
00045 sizeof(CmosTokenD5::structure) );
00046
00047 delete [] const_cast<u8 *>(ptr);
00048 }
00049
00050 string CmosTokenD6::getTokenClass() const
00051 {
00052 return "TokenD6";
00053 }
00054
00055 void CmosTokenD6::addChecksumObserver() const
00056 {
00057
00058 CmosTokenD5::addChecksumObserver();
00059
00060
00061
00062 ostringstream ost;
00063 ost << *item;
00064
00065 CmosRWChecksumObserver chk(
00066 ost.str(),
00067 cmos,
00068 structure.rangeCheckType,
00069 structure.indexPort,
00070 structure.dataPort,
00071 structure.rangeCheckStart,
00072 structure.rangeCheckEnd,
00073 structure.rangeCheckIndex );
00074
00075 checksumList.push_back( chk );
00076 }
00077 }