From 8c21a3da4a334d551f69a5e320a5ba4cd7dec6f4 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 8 Dec 2023 00:06:50 +0000 Subject: deploy: 20744b382d4d0226037eab810f312accc28fbfe2 --- help.html | 2 +- settings.html | 2 +- src/tiny_vm/tiny_vm.rs.html | 16 ++++++++-------- tiny_vm/enum.TinyInsn.html | 6 +++--- tiny_vm/enum.TinyReg.html | 6 +++--- tiny_vm/struct.PhysAddr.html | 4 ++-- tiny_vm/struct.TinyVm.html | 18 +++++++++--------- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/help.html b/help.html index 9b2ceb3..7ea44ac 100644 --- a/help.html +++ b/help.html @@ -1 +1 @@ -Rustdoc help

Rustdoc help

Back
\ No newline at end of file +Rustdoc help

Rustdoc help

Back
\ No newline at end of file diff --git a/settings.html b/settings.html index 69169e2..e11f2f1 100644 --- a/settings.html +++ b/settings.html @@ -1 +1 @@ -Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file +Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src/tiny_vm/tiny_vm.rs.html b/src/tiny_vm/tiny_vm.rs.html index 7de10c9..d36abd1 100644 --- a/src/tiny_vm/tiny_vm.rs.html +++ b/src/tiny_vm/tiny_vm.rs.html @@ -734,10 +734,7 @@ //! } //! ``` -#[cfg(not(any(target_arch = "x86_64", target_os = "linux")))] -compile_error!("Only supported on x86_64 with SystemV abi"); - -use juicebox_asm::insn::*; +use juicebox_asm::insn::*; use juicebox_asm::Runtime; use juicebox_asm::{Asm, Imm16, Imm64, Label, MemOp, Reg16, Reg64}; @@ -956,7 +953,8 @@ } } - /// Translate the bb at the current pc and return a JitFn pointer to it. + #[cfg(all(any(target_arch = "x86_64", target_os = "linux")))] + /// Translate the bb at the current pc and return a JitFn pointer to it. fn translate_next_bb(&mut self) -> JitFn { let mut bb = Asm::new(); let mut pc = self.pc; @@ -966,13 +964,15 @@ pc = pc.wrapping_add(1); - // JIT ABI. + // JIT abi: JitFn -> JitRet + // + // According to SystemV abi: // enter // rdi => regs // rsi => dmem // exit - // rax => JitRet(0, - // rdx => 1) + // rax => JitRet.0 + // rdx => JitRet.1 // Generate memory operand into regs for guest register. let reg_op = |r: TinyReg| { diff --git a/tiny_vm/enum.TinyInsn.html b/tiny_vm/enum.TinyInsn.html index 57b3487..b57d716 100644 --- a/tiny_vm/enum.TinyInsn.html +++ b/tiny_vm/enum.TinyInsn.html @@ -1,4 +1,4 @@ -TinyInsn in tiny_vm - Rust

Enum tiny_vm::TinyInsn

source ·
pub enum TinyInsn {
+TinyInsn in tiny_vm - Rust

Enum tiny_vm::TinyInsn

source ·
pub enum TinyInsn {
     Halt,
     LoadImm(TinyReg, u16),
     Load(TinyReg, u16),
@@ -16,9 +16,9 @@
 
§

Addi(TinyReg, i16)

Add the immediate to the register reg += imm.

§

Branch(usize)

Jump unconditional (absolute addressing) pc = disp.

§

BranchZero(TinyReg, usize)

Jump if the register is zero (absolute addressing) pc = (reg == 0) ? disp : pc++.

-

Trait Implementations§

source§

impl Clone for TinyInsn

source§

fn clone(&self) -> TinyInsn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinyInsn

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<TinyInsn> for TinyInsn

source§

fn eq(&self, other: &TinyInsn) -> bool

This method tests for self and other values to be equal, and is used +

Trait Implementations§

source§

impl Clone for TinyInsn

source§

fn clone(&self) -> TinyInsn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinyInsn

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<TinyInsn> for TinyInsn

source§

fn eq(&self, other: &TinyInsn) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for TinyInsn

source§

impl StructuralPartialEq for TinyInsn

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +sufficient, and should not be overridden without very good reason.

source§

impl Copy for TinyInsn

source§

impl StructuralPartialEq for TinyInsn

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/tiny_vm/enum.TinyReg.html b/tiny_vm/enum.TinyReg.html index a5c9df9..52b2104 100644 --- a/tiny_vm/enum.TinyReg.html +++ b/tiny_vm/enum.TinyReg.html @@ -1,11 +1,11 @@ -TinyReg in tiny_vm - Rust

Enum tiny_vm::TinyReg

source ·
pub enum TinyReg {
+TinyReg in tiny_vm - Rust

Enum tiny_vm::TinyReg

source ·
pub enum TinyReg {
     A,
     B,
     C,
 }
Expand description

The registers for the TinyVm.

-

Variants§

Trait Implementations§

source§

impl Clone for TinyReg

source§

fn clone(&self) -> TinyReg

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinyReg

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<TinyReg> for TinyReg

source§

fn eq(&self, other: &TinyReg) -> bool

This method tests for self and other values to be equal, and is used +

Variants§

Trait Implementations§

source§

impl Clone for TinyReg

source§

fn clone(&self) -> TinyReg

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TinyReg

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<TinyReg> for TinyReg

source§

fn eq(&self, other: &TinyReg) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for TinyReg

source§

impl StructuralPartialEq for TinyReg

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +sufficient, and should not be overridden without very good reason.

source§

impl Copy for TinyReg

source§

impl StructuralPartialEq for TinyReg

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/tiny_vm/struct.PhysAddr.html b/tiny_vm/struct.PhysAddr.html index 6f09f30..574570b 100644 --- a/tiny_vm/struct.PhysAddr.html +++ b/tiny_vm/struct.PhysAddr.html @@ -1,5 +1,5 @@ -PhysAddr in tiny_vm - Rust

Struct tiny_vm::PhysAddr

source ·
pub struct PhysAddr(pub u16);
Expand description

A guest physical address.

-

Tuple Fields§

§0: u16

Trait Implementations§

source§

impl Into<usize> for PhysAddr

source§

fn into(self) -> usize

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +PhysAddr in tiny_vm - Rust

Struct tiny_vm::PhysAddr

source ·
pub struct PhysAddr(pub u16);
Expand description

A guest physical address.

+

Tuple Fields§

§0: u16

Trait Implementations§

source§

impl Into<usize> for PhysAddr

source§

fn into(self) -> usize

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/tiny_vm/struct.TinyVm.html b/tiny_vm/struct.TinyVm.html index 9932a6a..890ce75 100644 --- a/tiny_vm/struct.TinyVm.html +++ b/tiny_vm/struct.TinyVm.html @@ -1,12 +1,12 @@ -TinyVm in tiny_vm - Rust

Struct tiny_vm::TinyVm

source ·
pub struct TinyVm { /* private fields */ }
Expand description

The TinyVm virtual machine state.

-

Implementations§

source§

impl TinyVm

source

pub fn new(code: Vec<TinyInsn>) -> Self

Create a new TinyVm and initialize the instruction memory from code.

-
source

pub fn read_reg(&self, reg: TinyReg) -> u16

Read guest register.

-
source

pub fn write_reg(&mut self, reg: TinyReg, val: u16)

Write guest register.

-
source

pub fn read_mem(&self, paddr: PhysAddr) -> u16

Read guest data memory.

-
source

pub fn write_mem(&mut self, paddr: PhysAddr, val: u16)

Write guest data memory.

-
source

pub fn dump(&self)

Dump the VM state to stdout.

-
source

pub fn interp(&mut self)

Run in interpreter mode until the next TinyInsn::Halt instruction is hit.

-
source

pub fn jit(&mut self)

Run in JIT mode until the next TinyInsn::Halt instruction is hit. Translate guest +TinyVm in tiny_vm - Rust

Struct tiny_vm::TinyVm

source ·
pub struct TinyVm { /* private fields */ }
Expand description

The TinyVm virtual machine state.

+

Implementations§

source§

impl TinyVm

source

pub fn new(code: Vec<TinyInsn>) -> Self

Create a new TinyVm and initialize the instruction memory from code.

+
source

pub fn read_reg(&self, reg: TinyReg) -> u16

Read guest register.

+
source

pub fn write_reg(&mut self, reg: TinyReg, val: u16)

Write guest register.

+
source

pub fn read_mem(&self, paddr: PhysAddr) -> u16

Read guest data memory.

+
source

pub fn write_mem(&mut self, paddr: PhysAddr, val: u16)

Write guest data memory.

+
source

pub fn dump(&self)

Dump the VM state to stdout.

+
source

pub fn interp(&mut self)

Run in interpreter mode until the next TinyInsn::Halt instruction is hit.

+
source

pub fn jit(&mut self)

Run in JIT mode until the next TinyInsn::Halt instruction is hit. Translate guest basic blocks on demand.

Auto Trait Implementations§

§

impl RefUnwindSafe for TinyVm

§

impl !Send for TinyVm

§

impl !Sync for TinyVm

§

impl Unpin for TinyVm

§

impl UnwindSafe for TinyVm

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere -- cgit v1.2.3