Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / dev / dummy / src / SS_Dummy.cc
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T2 Processor File: SS_Dummy.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 <sys/socket.h>
#include <unistd.h>
#include "SS_Dummy.h"
SS_Dummy::SS_Dummy( SS_AddressMap* map, SS_Paddr lo, SS_Paddr hi )/*{{{*/
{
map->add(lo,hi,this,SS_AddressMap::REL,SS_Dummy::access);
}
/*}}}*/
SS_Dummy::~SS_Dummy()/*{{{*/
{
}
/*}}}*/
void SS_Dummy::access( void* obj, uint_t sid, SS_Access::Type type, SS_Paddr pa, uint_t size, uint64_t* data )/*{{{*/
{
SS_Dummy* self = (SS_Dummy*)obj;
switch (type)
{
case SS_Access::LOAD:
switch (size)
{
case 1:
case 2:
case 4:
case 8:
*data = 0;
break;
case 16:
data[0] = 0;
data[1] = 0;
break;
case 64:
data[0] = 0;
data[1] = 0;
data[2] = 0;
data[3] = 0;
data[4] = 0;
data[5] = 0;
data[6] = 0;
data[7] = 0;
break;
default:
assert(0);
}
break;
case SS_Access::STORE:
case SS_Access::STP:
break;
case SS_Access::SWAP:
case SS_Access::CAS:
case SS_Access::LDST:
*data = 0;
break;
default:
assert(0);
}
}
/*}}}*/