예제 #1
0
 public MmappedRegion(SafeUnixHandle handle, int size = 0x1000, int offset = 0)
 {
     Pointer = Mmap(null, Length = (ulong)size, 4 | 2, 1, (int)handle.DangerousGetHandle(), (ulong)offset);
     if (Pointer == null)
     {
         throw new KvmException("Could not mmap region");
     }
 }
예제 #2
0
 internal RegWrapper(SafeUnixHandle handle, ulong @base, ulong stride)
 {
     Handle = handle;
     Base   = @base;
     Stride = stride;
 }
예제 #3
0
 internal VecWrapper(SafeUnixHandle handle, ulong @base)
 {
     Handle = handle;
     Base   = @base;
 }
예제 #4
0
 internal static bool VcpuSetGuestDebug(SafeUnixHandle handle, KvmGuestDebug debug)
 => Ioctl(handle, KVM_SET_GUEST_DEBUG, &debug) == 0;
예제 #5
0
 internal static bool VcpuSetOneReg(SafeUnixHandle handle, KvmOneReg reg)
 => Ioctl(handle, KVM_SET_ONE_REG, &reg) == 0;
예제 #6
0
 internal static bool VmArmPreferredTarget(SafeUnixHandle handle, out KvmVcpuInit init) {
     fixed(KvmVcpuInit *ptr = &init)
     return(Ioctl(handle, KVM_ARM_PREFERRED_TARGET, ptr) == 0);
 }
예제 #7
0
 internal static bool VcpuArmInit(SafeUnixHandle handle, KvmVcpuInit init)
 => Ioctl(handle, KVM_ARM_VCPU_INIT, &init) == 0;
예제 #8
0
 internal static SafeUnixHandle VmCreateVcpu(SafeUnixHandle handle, int id) => IoctlHandle(handle, KVM_CREATE_VCPU);
예제 #9
0
 internal static bool VcpuRun(SafeUnixHandle handle) => Ioctl(handle, KVM_RUN) == 0;
예제 #10
0
 internal static SafeUnixHandle KvmCreateVm(SafeUnixHandle handle) => IoctlHandle(handle, KVM_CREATE_VM);
예제 #11
0
 internal static int VmSetUserMemoryRegion(SafeUnixHandle handle, KvmUserspaceMemoryRegion region) =>
 Ioctl(handle, KVM_SET_USER_MEMORY_REGION, &region);
예제 #12
0
 internal static uint KvmGetApiVersion(SafeUnixHandle handle) => (uint)Ioctl(handle, KVM_GET_API_VERSION);
예제 #13
0
 internal static SafeUnixHandle IoctlHandle(SafeUnixHandle handle, uint request, int param) => IoctlHandle(handle, request, (void *)(uint)param);
예제 #14
0
 internal static SafeUnixHandle IoctlHandle(SafeUnixHandle handle, uint request) => IoctlHandle(handle, request, null);
예제 #15
0
 internal static int Ioctl(SafeUnixHandle handle, uint request) => Ioctl(handle, request, null);
예제 #16
0
 internal static extern SafeUnixHandle IoctlHandle(SafeUnixHandle handle, uint request, void *buffer);