gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
SETranslatingPortProxy Class Reference

#include <se_translating_port_proxy.hh>

Inheritance diagram for SETranslatingPortProxy:
PortProxy FunctionalRequestProtocol

Public Types

enum  AllocType { Always, Never, NextPage }
 
- Public Types inherited from PortProxy
typedef std::function< void(PacketPtr pkt)> SendFunctionalFunc
 

Public Member Functions

 SETranslatingPortProxy (SendFunctionalFunc func, Process *p, AllocType alloc)
 
 SETranslatingPortProxy (MasterPort &port, Process *p, AllocType alloc)
 
 ~SETranslatingPortProxy ()
 
void setPageTable (EmulationPageTable *p)
 
void setProcess (Process *p)
 
bool tryReadBlob (Addr addr, void *p, int size) const override
 Methods to override in base classes. More...
 
bool tryWriteBlob (Addr addr, const void *p, int size) const override
 Write size bytes from p to address. More...
 
bool tryMemsetBlob (Addr addr, uint8_t val, int size) const override
 Fill size bytes starting at addr with byte value val. More...
 
- Public Member Functions inherited from PortProxy
 PortProxy (SendFunctionalFunc func, unsigned int cacheLineSize)
 
 PortProxy (const MasterPort &port, unsigned int cacheLineSize)
 
virtual ~PortProxy ()
 
void readBlobPhys (Addr addr, Request::Flags flags, void *p, int size) const
 Fixed functionality for use in base classes. More...
 
void writeBlobPhys (Addr addr, Request::Flags flags, const void *p, int size) const
 Write size bytes from p to physical address. More...
 
void memsetBlobPhys (Addr addr, Request::Flags flags, uint8_t v, int size) const
 Fill size bytes starting at physical addr with byte value val. More...
 
void readBlob (Addr addr, void *p, int size) const
 Higher level interfaces based on the above. More...
 
void writeBlob (Addr addr, const void *p, int size) const
 Same as tryWriteBlob, but insists on success. More...
 
void memsetBlob (Addr addr, uint8_t v, int size) const
 Same as tryMemsetBlob, but insists on success. More...
 
template<typename T >
read (Addr address) const
 Read sizeof(T) bytes from address and return as object T. More...
 
template<typename T >
void write (Addr address, const T &data) const
 Write object T to address. More...
 
template<typename T >
read (Addr address, ByteOrder guest_byte_order) const
 Read sizeof(T) bytes from address and return as object T. More...
 
template<typename T >
void write (Addr address, T data, ByteOrder guest_byte_order) const
 Write object T to address. More...
 
bool tryWriteString (Addr addr, const char *str) const
 Write the string str into guest memory at address addr. More...
 
void writeString (Addr addr, const char *str) const
 Same as tryWriteString, but insists on success. More...
 
bool tryReadString (std::string &str, Addr addr) const
 Reads the string at guest address addr into the std::string str. More...
 
void readString (std::string &str, Addr addr) const
 Same as tryReadString, but insists on success. More...
 
bool tryReadString (char *str, Addr addr, size_t maxlen) const
 Reads the string at guest address addr into the char * str, reading up to maxlen characters. More...
 
void readString (char *str, Addr addr, size_t maxlen) const
 Same as tryReadString, but insists on success. More...
 

Private Attributes

EmulationPageTablepTable
 
Processprocess
 
AllocType allocating
 

Detailed Description

Definition at line 67 of file se_translating_port_proxy.hh.

Member Enumeration Documentation

◆ AllocType

Enumerator
Always 
Never 
NextPage 

Definition at line 71 of file se_translating_port_proxy.hh.

Constructor & Destructor Documentation

◆ SETranslatingPortProxy() [1/2]

SETranslatingPortProxy::SETranslatingPortProxy ( SendFunctionalFunc  func,
Process p,
AllocType  alloc 
)

Definition at line 58 of file se_translating_port_proxy.cc.

◆ SETranslatingPortProxy() [2/2]

SETranslatingPortProxy::SETranslatingPortProxy ( MasterPort port,
Process p,
AllocType  alloc 
)

Definition at line 63 of file se_translating_port_proxy.cc.

◆ ~SETranslatingPortProxy()

SETranslatingPortProxy::~SETranslatingPortProxy ( )
inline

Definition at line 86 of file se_translating_port_proxy.hh.

Member Function Documentation

◆ setPageTable()

void SETranslatingPortProxy::setPageTable ( EmulationPageTable p)
inline

Definition at line 88 of file se_translating_port_proxy.hh.

References MipsISA::p.

Referenced by Process::clone().

◆ setProcess()

void SETranslatingPortProxy::setProcess ( Process p)
inline

◆ tryMemsetBlob()

bool SETranslatingPortProxy::tryMemsetBlob ( Addr  addr,
uint8_t  val,
int  size 
) const
overridevirtual

Fill size bytes starting at addr with byte value val.

Returns true on success and false on failure.

Reimplemented from PortProxy.

Definition at line 122 of file se_translating_port_proxy.cc.

References Process::allocateMem(), allocating, Always, ChunkGenerator::done(), PortProxy::memsetBlobPhys(), AlphaISA::PageBytes, process, pTable, roundDown(), and EmulationPageTable::translate().

Referenced by setProcess().

◆ tryReadBlob()

bool SETranslatingPortProxy::tryReadBlob ( Addr  addr,
void *  p,
int  size 
) const
overridevirtual

Methods to override in base classes.

Read size bytes memory at address and store in p. Returns true on success and false on failure.

Reimplemented from PortProxy.

Definition at line 70 of file se_translating_port_proxy.cc.

References ChunkGenerator::done(), MipsISA::p, AlphaISA::PageBytes, pTable, PortProxy::readBlobPhys(), and EmulationPageTable::translate().

Referenced by setProcess().

◆ tryWriteBlob()

bool SETranslatingPortProxy::tryWriteBlob ( Addr  addr,
const void *  p,
int  size 
) const
overridevirtual

Write size bytes from p to address.

Returns true on success and false on failure.

Reimplemented from PortProxy.

Definition at line 90 of file se_translating_port_proxy.cc.

References Process::allocateMem(), allocating, Always, ChunkGenerator::done(), Process::fixupStackFault(), NextPage, MipsISA::p, AlphaISA::PageBytes, panic, process, pTable, roundDown(), EmulationPageTable::translate(), and PortProxy::writeBlobPhys().

Referenced by setProcess().

Member Data Documentation

◆ allocating

AllocType SETranslatingPortProxy::allocating
private

Definition at line 80 of file se_translating_port_proxy.hh.

Referenced by tryMemsetBlob(), and tryWriteBlob().

◆ process

Process* SETranslatingPortProxy::process
private

Definition at line 79 of file se_translating_port_proxy.hh.

Referenced by tryMemsetBlob(), and tryWriteBlob().

◆ pTable

EmulationPageTable* SETranslatingPortProxy::pTable
private

Definition at line 78 of file se_translating_port_proxy.hh.

Referenced by tryMemsetBlob(), tryReadBlob(), and tryWriteBlob().


The documentation for this class was generated from the following files:

Generated on Fri Feb 28 2020 16:27:15 for gem5 by doxygen 1.8.13