Package ghidra.pcode.memstate
Class MemoryBank
java.lang.Object
ghidra.pcode.memstate.MemoryBank
- Direct Known Subclasses:
MemoryImage,MemoryPageBank,UniqueMemoryBank
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMemoryBank(AddressSpace spc, boolean isBigEndian, int ps, MemoryFaultHandler faultHandler) A MemoryBank must be associated with a specific address space, have a preferred or natural pagesize. -
Method Summary
Modifier and TypeMethodDescriptionstatic longconstructValue(byte[] ptr, int offset, int size, boolean bigendian) static voiddeconstructValue(byte[] ptr, int offset, long val, int size, boolean bigendian) intgetChunk(long addrOffset, int size, byte[] res, boolean stopOnUnintialized) intprotected abstract MemoryPagegetPage(long addr) intA MemoryBank is instantiated with a \e natural page size.getSpace()booleanvoidsetChunk(long offset, int size, byte[] val) voidsetInitialized(long offset, int size, boolean initialized) protected abstract voidsetPage(long addr, byte[] val, int skip, int size, int bufOffset) protected abstract voidsetPageInitialized(long addr, boolean initialized, int skip, int size, int bufOffset)
-
Field Details
-
faultHandler
-
-
Constructor Details
-
MemoryBank
A MemoryBank must be associated with a specific address space, have a preferred or natural pagesize. The pagesize must be a power of 2.- Parameters:
spc- is the associated address spaceisBigEndian- memory endianessps- ps is the number of bytes in a page (must be a power of 2)faultHandler- memory fault handler
-
-
Method Details
-
getMemoryFaultHandler
- Returns:
- memory fault handler (may be null)
-
isBigEndian
public boolean isBigEndian()- Returns:
- true if memory bank is big endian
-
getPageSize
public int getPageSize()A MemoryBank is instantiated with a \e natural page size. Requests for large chunks of data may be broken down into units of this size.- Returns:
- the number of bytes in a page.
-
getInitializedMaskSize
public int getInitializedMaskSize()- Returns:
- the size of a page initialized mask in bytes. Each bit within the mask corresponds to a data byte within a page.
-
getSpace
- Returns:
- the AddressSpace associated with this bank.
-
getPage
-
setPage
protected abstract void setPage(long addr, byte[] val, int skip, int size, int bufOffset) -
setPageInitialized
protected abstract void setPageInitialized(long addr, boolean initialized, int skip, int size, int bufOffset) -
setChunk
public void setChunk(long offset, int size, byte[] val) -
setInitialized
public void setInitialized(long offset, int size, boolean initialized) -
getChunk
public int getChunk(long addrOffset, int size, byte[] res, boolean stopOnUnintialized) -
constructValue
public static long constructValue(byte[] ptr, int offset, int size, boolean bigendian) -
deconstructValue
public static void deconstructValue(byte[] ptr, int offset, long val, int size, boolean bigendian)
-