Package ghidra.pcode.memstate
Class UniqueMemoryBank
java.lang.Object
ghidra.pcode.memstate.MemoryBank
ghidra.pcode.memstate.UniqueMemoryBank
Deprecated, for removal: This API element is subject to removal in a future version.
An subclass of
MemoryBank intended for modeling the "unique" memory
space. The space is byte-addressable and paging is not supported.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated, for removal: This API element is subject to removal in a future version.A simple class representing a byte-addressable word of memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MapSTL<Long, UniqueMemoryBank.WordInfo> Deprecated, for removal: This API element is subject to removal in a future version.A map fromLongoffsets to byte values would require many lookups.Fields inherited from class ghidra.pcode.memstate.MemoryBank
faultHandler -
Constructor Summary
ConstructorsConstructorDescriptionUniqueMemoryBank(AddressSpace spc, boolean isBigEndian) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Deprecated, for removal: This API element is subject to removal in a future version.Clear unique storage at the start of an instructionintgetChunk(long offset, int size, byte[] dest, boolean stopOnUninitialized) Deprecated, for removal: This API element is subject to removal in a future version.This is the most general method for reading a sequence of bytes from the memory bank.protected MemoryPagegetPage(long addr) Deprecated, for removal: This API element is subject to removal in a future version.voidsetChunk(long offset, int size, byte[] src) Deprecated, for removal: This API element is subject to removal in a future version.This the most general method for writing a sequence of bytes into the memory bank.protected voidsetPage(long addr, byte[] val, int skip, int size, int bufOffset) Deprecated, for removal: This API element is subject to removal in a future version.This routine writes data only to a single page of the memory bank.protected voidsetPageInitialized(long addr, boolean initialized, int skip, int size, int bufOffset) Deprecated, for removal: This API element is subject to removal in a future version.This routine marks a range within a single page of the memory bank as initialized or uninitialized.Methods inherited from class ghidra.pcode.memstate.MemoryBank
constructValue, deconstructValue, getInitializedMaskSize, getMemoryFaultHandler, getPageSize, getSpace, isBigEndian, setInitialized
-
Field Details
-
map
Deprecated, for removal: This API element is subject to removal in a future version.A map fromLongoffsets to byte values would require many lookups. As an optimization, this map is defined fromLongvalues toUniqueMemoryBank.WordInfoobjects, each of which represents an eight-byte word of memory. Each key in this map must be 0 mod 8.
-
-
Constructor Details
-
UniqueMemoryBank
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getPage
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getPagein classMemoryBank
-
setPage
protected void setPage(long addr, byte[] val, int skip, int size, int bufOffset) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:MemoryBankThis routine writes data only to a single page of the memory bank. Bytes need not be written to the exact start of the page, but all bytes must be written to only one page when using this routine. A page is a fixed number of bytes, and the address of a page is always aligned based on this size. This routine may be overridden for a page based implementation of the MemoryBank. The default implementation writes the page as a sequence of aligned words, using the insert method.- Specified by:
setPagein classMemoryBank- Parameters:
addr- is the aligned offset of the desired pageval- is a pointer to the bytes to be written into the pageskip- is the offset into the page where bytes will be writtensize- is the number of bytes to be writtenbufOffset- the offset in val from which to get the bytes
-
setPageInitialized
protected void setPageInitialized(long addr, boolean initialized, int skip, int size, int bufOffset) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:MemoryBankThis routine marks a range within a single page of the memory bank as initialized or uninitialized. A page is a fixed number of bytes, and the address of a page is always aligned based on this size. This routine may be overridden for a page based implementation of the MemoryBank. The default implementation writes the page as a sequence of aligned words, using the insert method.- Specified by:
setPageInitializedin classMemoryBank- Parameters:
addr- is the aligned offset of the desired pageinitialized- true if range should be marked as initialized, false if uninitializedskip- is the offset into the page where bytes will be writtensize- is the number of bytes to be writtenbufOffset- the offset in val from which to get the bytes
-
getChunk
public int getChunk(long offset, int size, byte[] dest, boolean stopOnUninitialized) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:MemoryBankThis is the most general method for reading a sequence of bytes from the memory bank. There is no restriction on the offset or the number of bytes to read, except that the range must be contained in the address space.- Overrides:
getChunkin classMemoryBank- Parameters:
offset- is the start of the byte range to readsize- is the number of bytes to readdest- is a pointer to where the retrieved bytes should be storedstopOnUninitialized- if true a partial read is permitted and returned size may be smaller than size requested if uninitialized data is encountered.- Returns:
- number of bytes actually read
-
setChunk
public void setChunk(long offset, int size, byte[] src) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:MemoryBankThis the most general method for writing a sequence of bytes into the memory bank. The initial offset and page writes will be wrapped within the address space.- Overrides:
setChunkin classMemoryBank- Parameters:
offset- is the start of the byte range to be written. This offset will be wrapped within the spacesize- is the number of bytes to writesrc- is a pointer to the sequence of bytes to be written into the bank
-
clear
public void clear()Deprecated, for removal: This API element is subject to removal in a future version.Clear unique storage at the start of an instruction
-