Package ghidra.pcode.memstate
Class UniqueMemoryBank
- java.lang.Object
-
- ghidra.pcode.memstate.MemoryBank
-
- ghidra.pcode.memstate.UniqueMemoryBank
-
public class UniqueMemoryBank extends MemoryBank
An subclass ofMemoryBank
intended for modeling the "unique" memory space. The space is byte-addressable and paging is not supported.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UniqueMemoryBank.WordInfo
A simple class representing a byte-addressable word of memory.
-
Field Summary
Fields Modifier and Type Field Description protected MapSTL<java.lang.Long,UniqueMemoryBank.WordInfo>
map
A map fromLong
offsets to byte values would require many lookups.-
Fields inherited from class ghidra.pcode.memstate.MemoryBank
faultHandler
-
-
Constructor Summary
Constructors Constructor Description UniqueMemoryBank(AddressSpace spc, boolean isBigEndian)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear unique storage at the start of an instructionint
getChunk(long offset, int size, byte[] dest, boolean stopOnUninitialized)
protected MemoryPage
getPage(long addr)
void
setChunk(long offset, int size, byte[] src)
protected void
setPage(long addr, byte[] val, int skip, int size, int bufOffset)
protected void
setPageInitialized(long addr, boolean initialized, int skip, int size, int bufOffset)
-
Methods inherited from class ghidra.pcode.memstate.MemoryBank
constructValue, deconstructValue, getInitializedMaskSize, getMemoryFaultHandler, getPageSize, getSpace, isBigEndian, setInitialized
-
-
-
-
Field Detail
-
map
protected MapSTL<java.lang.Long,UniqueMemoryBank.WordInfo> map
A map fromLong
offsets to byte values would require many lookups. As an optimization, this map is defined fromLong
values toUniqueMemoryBank.WordInfo
objects, each of which represents an eight-byte word of memory. Each key in this map must be 0 mod 8.
-
-
Constructor Detail
-
UniqueMemoryBank
public UniqueMemoryBank(AddressSpace spc, boolean isBigEndian)
-
-
Method Detail
-
getPage
protected MemoryPage getPage(long addr)
- Specified by:
getPage
in classMemoryBank
-
setPage
protected void setPage(long addr, byte[] val, int skip, int size, int bufOffset)
- Specified by:
setPage
in classMemoryBank
-
setPageInitialized
protected void setPageInitialized(long addr, boolean initialized, int skip, int size, int bufOffset)
- Specified by:
setPageInitialized
in classMemoryBank
-
getChunk
public int getChunk(long offset, int size, byte[] dest, boolean stopOnUninitialized)
- Overrides:
getChunk
in classMemoryBank
-
setChunk
public void setChunk(long offset, int size, byte[] src)
- Overrides:
setChunk
in classMemoryBank
-
clear
public void clear()
Clear unique storage at the start of an instruction
-
-