add support for hypercalls

This commit is contained in:
Alex Zenla
2024-01-08 20:45:16 -08:00
parent 47b924d618
commit faf8027590
5 changed files with 158 additions and 1 deletions

View 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(())
}