Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / lib / cpu / src / SS_Signal.cc
CommitLineData
920dae64
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: SS_Signal.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
23#include "SS_Signal.h"
24#include "SS_Tlb.h"
25
26SS_Signal* SS_Signal::free_list = 0;
27BL_Mutex SS_Signal::free_mutex;
28
29SS_Signal* SS_Signal::alloc_block()/*{{{*/
30{
31 SS_Signal* block = (SS_Signal*)ss_malloc(sizeof(SS_Signal) * NR_BLOCK_SIGNAL);
32
33 SS_Signal* next = 0;
34 for (uint_t i = 1; i < NR_BLOCK_SIGNAL; i++)
35 {
36 block[i].type = SS_Signal::FREE;
37 block[i].next = next;
38 next = &block[i];
39 }
40 free_list = next;
41
42 return block;
43}
44/*}}}*/
45void SS_Signal::dump()/*{{{*/
46{
47 switch (type)
48 {
49 case RUNNING:
50 fprintf(stderr,"SS_Signal::RUNNING %d\n",running);
51 break;
52 case FLUSH_TTE:
53 fprintf(stderr,"SS_Signal::FLUSH_TTE %llx %llx %llx %x\n",tte,tlb,tte->virt_page,tte->index);
54 break;
55 case FLUSH_VA:
56 fprintf(stderr,"SS_Signal::FLUSH_VA %llx\n",flush_va);
57 break;
58 case FLUSH_8B:
59 fprintf(stderr,"SS_Signal::FLUSH_8B %llx\n",flush_pa);
60 break;
61 case FLUSH_8K:
62 fprintf(stderr,"SS_Signal::FLUSH_8K %llx\n",flush_pa);
63 break;
64 case FLUSH_ALL:
65 fprintf(stderr,"SS_Signal::FLUSH_ALL %llx\n",flush_pa);
66 break;
67 case BREAKPOINT:
68 fprintf(stderr,"SS_Signal::BREAKPOINT\n");
69 break;
70 case EXTERNAL_INTERRUPT:
71 fprintf(stderr,"SS_Signal::EXTERNAL_INTERRUPT: %x raise=%d\n",irq_type,irq_raise);
72 break;
73 default:
74 assert(0);
75 }
76}
77/*}}}*/