WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 6efaae9b authored by qinsoon's avatar qinsoon
Browse files

[wip] introduce entrypoints (mu code into runtime)

parent 8fd15ab3
......@@ -412,7 +412,7 @@ impl <'a> InstructionSelection {
}
Instruction_::ThreadExit => {
// do nothing for now
// emit a call to swap_back_to_native_stack(sp_loc: Address)
}
_ => unimplemented!()
......
use runtime;
use runtime::ValueLocation;
use ast::ir;
use ast::ir::*;
use ast::ptr::*;
use ast::types::MuFuncSig;
use compiler::backend::RegGroup;
use std::sync::RwLock;
pub type EntryFuncSig = MuFuncSig;
pub struct RuntimeEntrypoint {
sig: P<MuFuncSig>,
aot: ValueLocation,
jit: RwLock<Option<ValueLocation>>
}
lazy_static! {
pub static ref SWAP_BACK_TO_NATIVE_STACK : RuntimeEntrypoint = RuntimeEntrypoint {
sig: P(MuFuncSig{
hdr: MuEntityHeader::unnamed(ir::new_internal_id()),
ret_tys: vec![],
arg_tys: vec![runtime::ADDRESS_TYPE.clone()]
}),
aot: ValueLocation::Relocatable(RegGroup::GPR, String::from("swap_back_to_native_stack")),
jit: RwLock::new(None),
};
}
\ No newline at end of file
pub mod mm;
pub mod thread;
pub mod entrypoints;
pub use runtime::mm::common::Address;
pub use runtime::mm::common::ObjectReference;
use utils;
use ast::ir;
use ast::ptr::*;
use ast::types::MuType_;
use ast::types::MuType;
use ast::ir::*;
use compiler::backend::Word;
use compiler::backend::RegGroup;
......@@ -13,6 +18,12 @@ use std::os::raw::c_char;
use std::os::raw::c_void;
use std::ffi::CString;
lazy_static! {
pub static ref ADDRESS_TYPE : P<MuType> = P(
MuType::new(ir::new_internal_id(), MuType_::int(64))
);
}
#[link(name="dl")]
extern "C" {
fn dlopen(filename: *const c_char, flags: isize) -> *const c_void;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment