se_translating_port_proxy.hh revision 2445
11689SN/A/*
22326SN/A * Copyright (c) 2001-2005 The Regents of The University of Michigan
31689SN/A * All rights reserved.
41689SN/A *
51689SN/A * Redistribution and use in source and binary forms, with or without
61689SN/A * modification, are permitted provided that the following conditions are
71689SN/A * met: redistributions of source code must retain the above copyright
81689SN/A * notice, this list of conditions and the following disclaimer;
91689SN/A * redistributions in binary form must reproduce the above copyright
101689SN/A * notice, this list of conditions and the following disclaimer in the
111689SN/A * documentation and/or other materials provided with the distribution;
121689SN/A * neither the name of the copyright holders nor the names of its
131689SN/A * contributors may be used to endorse or promote products derived from
141689SN/A * this software without specific prior written permission.
151689SN/A *
161689SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171689SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181689SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191689SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201689SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211689SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221689SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231689SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241689SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251689SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261689SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu */
282665Ssaidi@eecs.umich.edu
291689SN/A#ifndef __MEM_TRANSLATING_PROT_HH__
301689SN/A#define __MEM_TRANSLATING_PROT_HH__
311060SN/A
321060SN/A#include "mem/memory.hh"
331689SN/A
341060SN/Aclass Port;
351060SN/Aclass PageTable;
361060SN/A
371060SN/Aclass TranslatingPort
382292SN/A{
391717SN/A  private:
401060SN/A    Port *port;
411681SN/A    PageTable *pTable;
422292SN/A
432873Sktlim@umich.edu    TranslatingPort(const TranslatingPort &specmem);
441060SN/A    const TranslatingPort &operator=(const TranslatingPort &specmem);
451061SN/A
462292SN/A  public:
472292SN/A    TranslatingPort(Port *_port, PageTable *p_table);
482292SN/A    virtual ~TranslatingPort();
492292SN/A
502820Sktlim@umich.edu  public:
512292SN/A    bool tryReadBlobFunctional(Addr addr, uint8_t *p, int size);
522820Sktlim@umich.edu    bool tryWriteBlobFunctional(Addr addr, uint8_t *p, int size,
532820Sktlim@umich.edu                                bool alloc = false);
542307SN/A    bool tryMemsetBlobFunctional(Addr addr, uint8_t val, int size,
552307SN/A                                 bool alloc = false);
561060SN/A    bool tryWriteStringFunctional(Addr addr, const char *str);
572292SN/A    bool tryReadStringFunctional(std::string &str, Addr addr);
582292SN/A
592292SN/A    void readBlobFunctional(Addr addr, uint8_t *p, int size);
601060SN/A    void writeBlobFunctional(Addr addr, uint8_t *p, int size,
611060SN/A                             bool alloc = false);
621060SN/A    void memsetBlobFunctional(Addr addr, uint8_t val, int size,
631060SN/A                              bool alloc = false);
641060SN/A    void writeStringFunctional(Addr addr, const char *str);
651060SN/A    void readStringFunctional(std::string &str, Addr addr);
661681SN/A};
672292SN/A
681681SN/A#endif
692292SN/A