]>
Commit | Line | Data |
---|---|---|
b0d623f7 A |
1 | /* |
2 | * testvmx.cpp | |
3 | * testkext | |
4 | * | |
5 | * Created by Shantonu Sen on 10/24/08. | |
6 | * Copyright 2008 Apple Computer, Inc.. All rights reserved. | |
7 | * | |
8 | */ | |
9 | ||
10 | #include "testvmx.h" | |
11 | ||
12 | #if !(defined(__i386__) || defined(__x86_64__)) | |
13 | #error VMX only supported on i386/x86_64 | |
14 | #endif | |
15 | ||
16 | #include <mach/boolean.h> | |
17 | #include <i386/vmx.h> | |
18 | ||
19 | ||
20 | #define super IOService | |
21 | OSDefineMetaClassAndStructors(testvmx, super); | |
22 | ||
23 | bool | |
24 | testvmx::start( IOService * provider ) | |
25 | { | |
26 | int ret; | |
27 | ||
28 | IOLog("%s\n", __PRETTY_FUNCTION__); | |
29 | ||
30 | if (!super::start(provider)) { | |
31 | return false; | |
32 | } | |
33 | ||
34 | IOLog("Attempting host_vmxon\n"); | |
35 | ret = host_vmxon(FALSE); | |
36 | IOLog("host_vmxon: %d\n", ret); | |
37 | ||
38 | return true; | |
39 | } | |
40 | ||
41 | void | |
42 | testvmx::stop( IOService * provider ) | |
43 | { | |
44 | IOLog("%s\n", __PRETTY_FUNCTION__); | |
45 | ||
46 | super::stop(provider); | |
47 | ||
48 | IOLog("Attempting host_vmxoff\n"); | |
49 | host_vmxoff(); | |
50 | IOLog("host_vmxoff called\n"); | |
51 | } |