// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: SS_Tte.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 ============================================
void SS_Tte::snapshot( SS_SnapShot
& ss
, const char* prefix
)/*{{{*/
// Save the tte_flags as a char string rather then a number to
// make us independant of the implementations. The characters
// are choosens to "match" the flags, e.g. 'x' is execuable, etc.
// If flags == 0 then a '-' is used to give the flags string length.
if (lock()) *ptr
++ = 'L';
if (valid_bit()) *ptr
++ = 'v';
if (real_bit()) *ptr
++ = 'r';
if (flg
== ptr
) *ptr
++ = '-';
sprintf(ss
.tag
,"%s.pid",prefix
); ss
.val(&tte_pid
);
sprintf(ss
.tag
,"%s.sze",prefix
); ss
.val(&tte_page_size
);
sprintf(ss
.tag
,"%s.ctx",prefix
); ss
.val(&tte_context
);
sprintf(ss
.tag
,"%s.flg",prefix
); ss
.val(flg
);
sprintf(ss
.tag
,"%s.tag",prefix
); ss
.val(&tte_tag
);
sprintf(ss
.tag
,"%s.pa",prefix
); ss
.val(&tte_taddr
);
// Load the tte flags back, converting the characters back to
// numeric flags values. The character to flag conversion has to match
// the once in teh do_save() black above.
case 'L': lock(1); break;
case 'v': valid_bit(1); break;
case 'r': real_bit(1); break;
default: fprintf(stderr
,"Warning: Unknown character in TTE flags of snapshot %s\n",flg
);
void SS_Tte::dump(FILE *fp
)/*{{{*/
m
[0] = is_real() ? 'r' : (is_virt() ? 'v' : '-');
m
[5] = nfo() ? 'f' : '-';
fprintf(fp
,"[%04x] %s %016llx(%016llx) %016llx %016llx ----\n",index
,m
,virt_page
,tag(),virt_mask
,phys_page
);
fprintf(fp
,"[%04x] %s %016llx(%016llx) %016llx %016llx %04x\n",index
,m
,virt_page
,tag(),virt_mask
,phys_page
,context());