// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: tm_impl.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 ============================================
* Copyright (C) 1991, 2001 Sun Microsystems, Inc.
#pragma ident "@(#)1.4 01/11/06 tm_impl.cc"
* Copyright (c) 1989, Sun Microsystems, Inc. All Rights Reserved. Sun
* considers its source code as an unpublished, proprietary trade secret, and
* it is available only under strict license provisions. This copyright
* notice is placed here only to protect Sun in the event the source is
* deemed a published work. Disassembly, decompilation, or other means of
* reducing the object code to human readable form is prohibited by the
* license agreement under which this code is provided to the user or company
* in possession of this copy
* RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the
* Government is subject to restrictions as set forth in subparagraph
* (c) (1) (ii) of the Rights in Technical Data and Computer Software clause
* at DFARS 52.227-7013 and in similar clauses in the FAR and NASA FAR
// This module contains an implementation of TRACING in blaze v4
#include "blaze_globals.h"
#include "cpu_interface.h"
#include "schizo_module.h"
typedef void* TM_OPAQUE_DATA
;
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
void TM_time_interval (uint64_t time
)
for (pnode
=head_ldm
; pnode
!= NULL
; pnode
=pnode
->Next()) {
Ldm
* pldm
= pnode
->GetData();
pldm
->ti_action ((TM_OPAQUE_DATA
)pldm
->client_data
, time
);
tm_time_target
+= tm_time_interval
;
void TM_context (cpuT
*sp
)
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
uint64_t base
, size
, end
;
typedef List1Node
<PhysioMap
> PhysioMapNode
;
PhysioMapNode
* headPhysioMap
;
static std::set
<uint64_t> unmapped_addresses
;
int SYSTEM_physio_access(uint32_t cpu_id
, void* /* obj */, uint64_t paddr
, bool_t wr
, uint32_t size
, uint64_t* buf
, uint8_t bytemask
)
uint64_t end
= paddr
+size
;
for (PhysioMapNode
*pnode
= headPhysioMap
; pnode
; pnode
= pnode
->Next()) {
if (pmap
->base
<= paddr
&& end
<= pmap
->end
)
return pmap
->access(cpu_id
, pmap
->obj
, paddr
, (mmi_bool_t
)wr
, size
, buf
, bytemask
);
if (unmapped_addresses
.find(paddr
) == unmapped_addresses
.end())
ui
->warning("unmapped SYSTEM_physio_access: [%llx %llx], %s \n", paddr
, end
,wr
?"write":"read" );
unmapped_addresses
.insert(paddr
);
int mmi_map_physio(uint64_t base
, uint64_t size
, void* obj
, mmi_access access
)
PhysioMapNode
*pnode
= PhysioMapNode::CreateInstance("physio map");
ui
->error("%s(L%d): Unable to create physio map\n", __FILE__
, __LINE__
);
PhysioMapNode::AddHead (&headPhysioMap
, pnode
);
void mmi_unmap_physio(uint64_t base
, uint64_t size
, void* obj
)
PhysioMapNode
*pnode
, *prev
;
for (prev
= NULL
, pnode
= headPhysioMap
; pnode
; pnode
= pnode
->Next()) {
PhysioMap
* pmap
= pnode
->GetData();
if (pmap
->obj
== obj
&& pmap
->base
== base
&& pmap
->size
== size
) {
PhysioMapNode::DeleteNode(&headPhysioMap
, prev
);