Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / cpus / vonk / ss / dev / dummy / src / SS_Dummy.cc
CommitLineData
920dae64
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: SS_Dummy.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#include <sys/socket.h>
23#include <unistd.h>
24#include "SS_Dummy.h"
25
26SS_Dummy::SS_Dummy( SS_AddressMap* map, SS_Paddr lo, SS_Paddr hi )/*{{{*/
27{
28 map->add(lo,hi,this,SS_AddressMap::REL,SS_Dummy::access);
29}
30/*}}}*/
31SS_Dummy::~SS_Dummy()/*{{{*/
32{
33}
34/*}}}*/
35
36void SS_Dummy::access( void* obj, uint_t sid, SS_Access::Type type, SS_Paddr pa, uint_t size, uint64_t* data )/*{{{*/
37{
38 SS_Dummy* self = (SS_Dummy*)obj;
39
40 switch (type)
41 {
42 case SS_Access::LOAD:
43 switch (size)
44 {
45 case 1:
46 case 2:
47 case 4:
48 case 8:
49 *data = 0;
50 break;
51 case 16:
52 data[0] = 0;
53 data[1] = 0;
54 break;
55 case 64:
56 data[0] = 0;
57 data[1] = 0;
58 data[2] = 0;
59 data[3] = 0;
60 data[4] = 0;
61 data[5] = 0;
62 data[6] = 0;
63 data[7] = 0;
64 break;
65 default:
66 assert(0);
67 }
68 break;
69 case SS_Access::STORE:
70 case SS_Access::STP:
71 break;
72 case SS_Access::SWAP:
73 case SS_Access::CAS:
74 case SS_Access::LDST:
75 *data = 0;
76 break;
77 default:
78 assert(0);
79 }
80}
81/*}}}*/
82
83
84
85