// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: SS_SnapShot.cc
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
// The above named program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License version 2 as published by the Free Software Foundation.
// The above named program is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public
// License along with this work; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
// ========== Copyright Header End ============================================
// The list here describes which class uses a particular
// SS_SnapShot::VERSION, e.g. where and what fix/change
// 2 SS_Message - pending interrupt
// 3 Rk_Strand - imu qd_reverse_map fix
// 4 SS_Cpu - strand_stepping grows to 128 bits for xx
SS_SnapShot::SS_SnapShot( FILE* f
, bool _load
)/*{{{*/
VERSION(4), // When bumped add line above to keep track
void SS_SnapShot::val( uint8_t* ptr
)/*{{{*/
if (fgets(line
,LINE_SIZE
,file
) == 0)
else if (sscanf(line
,"%s%x",_tag
,&_val
) != 2)
else if (strcmp(tag
,_tag
) != 0)
fprintf(file
,"%s\t%x\n",tag
,*ptr
);
void SS_SnapShot::val( uint16_t* ptr
)/*{{{*/
if (fgets(line
,LINE_SIZE
,file
) == 0)
else if (sscanf(line
,"%s%x",_tag
,&_val
) != 2)
else if (strcmp(tag
,_tag
) != 0)
fprintf(file
,"%s\t%x\n",tag
,*ptr
);
void SS_SnapShot::val( uint32_t* ptr
)/*{{{*/
if (fgets(line
,LINE_SIZE
,file
) == 0)
else if (sscanf(line
,"%s%x",_tag
,&_val
) != 2)
else if (strcmp(tag
,_tag
) != 0)
fprintf(file
,"%s\t%x\n",tag
,*ptr
);
void SS_SnapShot::val( uint64_t* ptr
)/*{{{*/
if (fgets(line
,LINE_SIZE
,file
) == 0)
else if (sscanf(line
,"%s%llx",_tag
,&_val
) != 2)
else if (strcmp(tag
,_tag
) != 0)
fprintf(file
,"%s\t%llx\n",tag
,*ptr
);
void SS_SnapShot::val( char* ptr
)/*{{{*/
if (fgets(line
,LINE_SIZE
,file
) == 0)
else if (sscanf(line
,"%s%s",_tag
,ptr
) != 2)
else if (strcmp(tag
,_tag
) != 0)
fprintf(file
,"%s\t%s\n",tag
,ptr
);
void SS_SnapShot::val( bool* ptr
)/*{{{*/
if (fgets(line
,LINE_SIZE
,file
) == 0)
else if (sscanf(line
,"%s%x",_tag
,&_val
) != 2)
else if (strcmp(tag
,_tag
) != 0)
fprintf(file
,"%s\t%x\n",tag
,*ptr
);