-
Notifications
You must be signed in to change notification settings - Fork 981
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backend/hypervisor: Update libhypervisor.dylib
- Loading branch information
Showing
8 changed files
with
112 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...pervisor/src/main/native/hypervisor/com_github_unidbg_arm_backend_hypervisor_Hypervisor.h
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-10.9 KB
(89%)
backend/hypervisor/src/main/resources/natives/osx_arm64/libhypervisor.dylib
Binary file not shown.
45 changes: 45 additions & 0 deletions
45
backend/hypervisor/src/test/java/com/github/unidbg/arm/backend/hypervisor/VCpuTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.github.unidbg.arm.backend.hypervisor; | ||
|
||
import com.sun.jna.Pointer; | ||
import junit.framework.TestCase; | ||
import org.scijava.nativelib.NativeLoader; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.IOException; | ||
|
||
public class VCpuTest extends TestCase { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(VCpuTest.class); | ||
|
||
static { | ||
try { | ||
NativeLoader.loadLibrary("hypervisor"); | ||
} catch (IOException ignored) { | ||
} | ||
} | ||
|
||
public void testVcpu() throws Exception { | ||
Pointer vcpu = Hypervisor.getVCpusPointer(); | ||
assertNotNull(vcpu); | ||
System.out.println(vcpu); | ||
|
||
try (final Hypervisor hypervisor = new Hypervisor(true)) { | ||
{ | ||
Pointer context = hypervisor.getCpuContextPointer(); | ||
assertNotNull(context); | ||
log.info("main context={}", context); | ||
} | ||
|
||
Thread thread = new Thread(() -> { | ||
Pointer context = hypervisor.getCpuContextPointer(); | ||
assertNotNull(context); | ||
log.info("thread context={}", context); | ||
}, "TestThread"); | ||
thread.start(); | ||
thread.join(); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
log4j.rootCategory=INFO, stdout | ||
|
||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss SSS}] %5p [%t] (%c{2}:%L) - %m%n | ||
|
||
log4j.logger.com.github.unidbg=INFO | ||
log4j.logger.com.github.unidbg.arm.backend.hypervisor=DEBUG |