Result of a memory access: success or fault.
Constructors
ok {α : Type} : α → Jar.JAVM.MemResult α
panic {α : Type} : Jar.JAVM.MemResult α
fault {α : Type} : UInt64 → Jar.JAVM.MemResult α
Jar.JAVM.MemResult (α : Type) : TypeJar.JAVM.MemResult (α : Type) : Type
Result of a memory access: success or fault.
ok {α : Type} : α → Jar.JAVM.MemResult α
panic {α : Type} : Jar.JAVM.MemResult α
fault {α : Type} : UInt64 → Jar.JAVM.MemResult α
Jar.JAVM.pageOf (addr : UInt64) : NatJar.JAVM.pageOf (addr : UInt64) : Nat
Page index for an address.
Jar.JAVM.pageAligned (addr : UInt64) : UInt64Jar.JAVM.pageAligned (addr : UInt64) : UInt64
Page-aligned address for fault reporting.
Check read access for an address range [addr, addr+n).
Check write access for an address range [addr, addr+n).
Read n bytes from memory at address, returning LE-encoded UInt64.
Read 1 byte unsigned.
Read 1 byte sign-extended.
Read 2 bytes unsigned LE.
Read 2 bytes sign-extended LE.
Read 4 bytes unsigned LE.
Read 4 bytes sign-extended LE.
Read 8 bytes LE.
Jar.JAVM.writeMemBytes (m : Jar.JAVM.Memory) (addr val : UInt64) (n : Nat) : Jar.JAVM.MemResult Jar.JAVM.MemoryJar.JAVM.writeMemBytes (m : Jar.JAVM.Memory) (addr val : UInt64) (n : Nat) : Jar.JAVM.MemResult Jar.JAVM.Memory
Write bytes to memory at address in LE order. Returns updated memory or fault.
Write 1 byte.
Write 2 bytes LE.
Write 4 bytes LE.
Write 8 bytes LE.
Jar.JAVM.readByteArray (m : Jar.JAVM.Memory) (addr : UInt64) (n : Nat) : Jar.JAVM.MemResult ByteArrayJar.JAVM.readByteArray (m : Jar.JAVM.Memory) (addr : UInt64) (n : Nat) : Jar.JAVM.MemResult ByteArray
Read n raw bytes from memory starting at addr. Returns ByteArray or fault.
Jar.JAVM.writeByteArray (m : Jar.JAVM.Memory) (addr : UInt64) (data : ByteArray) : Jar.JAVM.MemResult Jar.JAVM.MemoryJar.JAVM.writeByteArray (m : Jar.JAVM.Memory) (addr : UInt64) (data : ByteArray) : Jar.JAVM.MemResult Jar.JAVM.Memory
Write a ByteArray into memory starting at addr. Returns updated memory or fault.
sbrk(n): Grow the heap by n pages. Returns new heap base or 0 on failure. Finds the first inaccessible page after existing writable heap and marks n new pages as writable.