* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: SS_Signal.h
* 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_BreakPoint.h"
// The Type are the signal types used in Vonk to tell a
// strand to do something before the next instruction
FREE
, // Explict free signal
RUNNING
, // Change in running status of the strand
FLUSH_TTE
, // Tell the strand to remove cached TTE from decode cache
FLUSH_VA
, // Tell the strand to flush the opcode(2) (64 bit) at given va
FLUSH_8B
, // Tell the strand to flush 8 bytes at given pa
FLUSH_8K
, // Tell the strand to flush an 8k page at given pa
FLUSH_ALL
, // Tell the strand to flush the whole Icache (decode cache)
BREAKPOINT
, // Tell the strand it hit a breakpoint
EXTERNAL_INTERRUPT
, // An external interrupt (cross call, dev mondo, ..)
SET_INST_BRKPT
// Update sim_state.ib_enabled(x)
SS_Signal( Type t
) : type(t
), next(0) {}
void init( Type t
, SS_Signal
* n
=0 ) { type
=t
; next
= n
; }
SS_Signal
* next
; // Link the signals in a list
bool running
; // New running status
bool ib_enable
; // New inst breakpoint check status
SS_BreakPoint
* breakpoint
; // The breakpoint that hit
int_t irq_type
; // The (trap) type of the interrupt
SS_Tte
* tte
; // The TTE to demap from decode cache, 0 is all TTEs
SS_Vaddr flush_va
; // The va of the double word to flush from the icache
SS_Paddr flush_pa
; // The va of the double word to flush from the icache
SS_Tlb
* tlb
; // Flush tte flush from which tlb
bool irq_raise
; // True raise irq, False retract irq
static SS_Signal
* free_list
;
static BL_Mutex free_mutex
;
static SS_Signal
* alloc_block();
static const uint_t NR_BLOCK_SIGNAL
= 256;
// alloc() returns a SS_Signal instance with type set to type.
// Don't use this function if you have direct access to a SS_Strand.
// Use s->msg.make_signal(type) if you can.
inline static SS_Signal
* alloc( SS_Signal::Type type
)
SS_Signal
* help
= free_list
;
// frees a list of SS_Signal blocks
// All elements of the list to free must be marked as type=FREE.
inline static void list_free( SS_Signal
* head
, SS_Signal
* tail
)