Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / lib / cpu / src / SS_Signal.cc
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T2 Processor File: SS_Signal.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 ============================================
#include "SS_Signal.h"
#include "SS_Tlb.h"
SS_Signal* SS_Signal::free_list = 0;
BL_Mutex SS_Signal::free_mutex;
SS_Signal* SS_Signal::alloc_block()/*{{{*/
{
SS_Signal* block = (SS_Signal*)ss_malloc(sizeof(SS_Signal) * NR_BLOCK_SIGNAL);
SS_Signal* next = 0;
for (uint_t i = 1; i < NR_BLOCK_SIGNAL; i++)
{
block[i].type = SS_Signal::FREE;
block[i].next = next;
next = &block[i];
}
free_list = next;
return block;
}
/*}}}*/
void SS_Signal::dump()/*{{{*/
{
switch (type)
{
case RUNNING:
fprintf(stderr,"SS_Signal::RUNNING %d\n",running);
break;
case FLUSH_TTE:
fprintf(stderr,"SS_Signal::FLUSH_TTE %llx %llx %llx %x\n",tte,tlb,tte->virt_page,tte->index);
break;
case FLUSH_VA:
fprintf(stderr,"SS_Signal::FLUSH_VA %llx\n",flush_va);
break;
case FLUSH_8B:
fprintf(stderr,"SS_Signal::FLUSH_8B %llx\n",flush_pa);
break;
case FLUSH_8K:
fprintf(stderr,"SS_Signal::FLUSH_8K %llx\n",flush_pa);
break;
case FLUSH_ALL:
fprintf(stderr,"SS_Signal::FLUSH_ALL %llx\n",flush_pa);
break;
case BREAKPOINT:
fprintf(stderr,"SS_Signal::BREAKPOINT\n");
break;
case EXTERNAL_INTERRUPT:
fprintf(stderr,"SS_Signal::EXTERNAL_INTERRUPT: %x raise=%d\n",irq_type,irq_raise);
break;
default:
assert(0);
}
}
/*}}}*/