se_translating_port_proxy.hh revision 2445
12086SN/A/* 22086SN/A * Copyright (c) 2001-2005 The Regents of The University of Michigan 32086SN/A * All rights reserved. 42086SN/A * 52086SN/A * Redistribution and use in source and binary forms, with or without 62086SN/A * modification, are permitted provided that the following conditions are 72086SN/A * met: redistributions of source code must retain the above copyright 82086SN/A * notice, this list of conditions and the following disclaimer; 92086SN/A * redistributions in binary form must reproduce the above copyright 102086SN/A * notice, this list of conditions and the following disclaimer in the 112086SN/A * documentation and/or other materials provided with the distribution; 122086SN/A * neither the name of the copyright holders nor the names of its 132086SN/A * contributors may be used to endorse or promote products derived from 142086SN/A * this software without specific prior written permission. 152086SN/A * 162086SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172086SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182086SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192086SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202086SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212086SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222086SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232086SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242086SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252086SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262086SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272086SN/A */ 282086SN/A 292086SN/A#ifndef __MEM_TRANSLATING_PROT_HH__ 302086SN/A#define __MEM_TRANSLATING_PROT_HH__ 312086SN/A 322086SN/A#include "mem/memory.hh" 332086SN/A 342086SN/Aclass Port; 352086SN/Aclass PageTable; 362086SN/A 372086SN/Aclass TranslatingPort 382086SN/A{ 392086SN/A private: 402086SN/A Port *port; 412086SN/A PageTable *pTable; 422086SN/A 432152SN/A TranslatingPort(const TranslatingPort &specmem); 442152SN/A const TranslatingPort &operator=(const TranslatingPort &specmem); 452152SN/A 462086SN/A public: 472086SN/A TranslatingPort(Port *_port, PageTable *p_table); 482086SN/A virtual ~TranslatingPort(); 492152SN/A 502652Ssaidi@eecs.umich.edu public: 512650Ssaidi@eecs.umich.edu bool tryReadBlobFunctional(Addr addr, uint8_t *p, int size); 522086SN/A bool tryWriteBlobFunctional(Addr addr, uint8_t *p, int size, 532086SN/A bool alloc = false); 542086SN/A bool tryMemsetBlobFunctional(Addr addr, uint8_t val, int size, 552152SN/A bool alloc = false); 562579SN/A bool tryWriteStringFunctional(Addr addr, const char *str); 572458SN/A bool tryReadStringFunctional(std::string &str, Addr addr); 582600SN/A 592600SN/A void readBlobFunctional(Addr addr, uint8_t *p, int size); 602209SN/A void writeBlobFunctional(Addr addr, uint8_t *p, int size, 612086SN/A bool alloc = false); 622086SN/A void memsetBlobFunctional(Addr addr, uint8_t val, int size, 632152SN/A bool alloc = false); 642086SN/A void writeStringFunctional(Addr addr, const char *str); 652086SN/A void readStringFunctional(std::string &str, Addr addr); 662152SN/A}; 672086SN/A 682152SN/A#endif 692086SN/A