mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 13:11:31 +00:00
add support for hypercalls
This commit is contained in:
11
xencall/examples/simple.rs
Normal file
11
xencall/examples/simple.rs
Normal file
@ -0,0 +1,11 @@
|
||||
use std::ffi::c_ulong;
|
||||
use std::ptr::addr_of;
|
||||
use xencall::{XenCall, XenCallError};
|
||||
|
||||
fn main() -> Result<(), XenCallError> {
|
||||
let mut call = XenCall::open()?;
|
||||
let message = "Hello World";
|
||||
let bytes = message.as_bytes();
|
||||
call.hypercall3(18, 0, bytes.len() as c_ulong, addr_of!(bytes) as c_ulong)?;
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user