Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / lib / cpu / src / SS_Message.cc
CommitLineData
920dae64
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: SS_Message.cc
4// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
5// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
6//
7// The above named program is free software; you can redistribute it and/or
8// modify it under the terms of the GNU General Public
9// License version 2 as published by the Free Software Foundation.
10//
11// The above named program is distributed in the hope that it will be
12// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// General Public License for more details.
15//
16// You should have received a copy of the GNU General Public
17// License along with this work; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19//
20// ========== Copyright Header End ============================================
21
22#include "SS_Message.h"
23
24SS_Message::SS_Message()/*{{{*/
25 :
26 head(0),
27 tail(0),
28 free_list(0),
29 free_count(0)
30{
31 // The Flags and uint64_t have to be the same size so that
32 // one ldx can load 8 bytes of message conditions ...
33 assert(sizeof(Flags) <= sizeof(uint64_t));
34
35 pending = 0;
36
37 // The empty message queue is a queue with one dummy
38 // node in place.
39
40 head = tail = new SS_Signal(SS_Signal::FREE);
41 head->next = 0;
42}
43/*}}}*/
44void SS_Message::snapshot( SS_SnapShot& ss, const char* prefix )/*{{{*/
45{
46 if (ss.get_version() > 1)
47 {
48 sprintf(ss.tag,"%s.msg.pending",prefix);
49 ss.val(&pending);
50 }
51}
52/*}}}*/