Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ionescu007/SimpleVisor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorionescu007 <aionescu+git@gmail.com>2016-09-03 18:57:31 +0300
committerionescu007 <aionescu+git@gmail.com>2016-09-03 18:57:31 +0300
commitdfd4909816fc06841cffc86d1c2170e5cd68bfbd (patch)
treedcab701180edd81b64a7edcee6c7480c3520de9c
parent0903433af27e842c6d7c73874cb340ae5c44db5d (diff)
Invert files... idiot.
-rw-r--r--shvosx64.asm42
-rw-r--r--shvvmxhvx64.asm42
2 files changed, 42 insertions, 42 deletions
diff --git a/shvosx64.asm b/shvosx64.asm
index e010e66..1e75175 100644
--- a/shvosx64.asm
+++ b/shvosx64.asm
@@ -4,11 +4,11 @@
;
; Module:
;
-; shvx64.asm
+; shvvmxhvx64.asm
;
; Abstract:
;
-; This module implements the AMD64-specific SimpleVisor VMENTRY routine.
+; This module implements AMD64-specific code for NT support of SimpleVisor.
;
; Author:
;
@@ -20,24 +20,28 @@
;
;--
- .code
+include ksamd64.inc
- extern ShvVmxEntryHandler:proc
- extern ShvOsCaptureContext:proc
+ LEAF_ENTRY _str, _TEXT$00
+ str word ptr [rcx] ; Store TR value
+ ret ; Return
+ LEAF_END _str, _TEXT$00
- ShvVmxEntry PROC
- push rcx ; save the RCX register, which we spill below
- lea rcx, [rsp+8h] ; store the context in the stack, bias for
- ; the return address and the push we just did.
- call ShvOsCaptureContext ; save the current register state.
- ; note that this is a specially written function
- ; which has the following key characteristics:
- ; 1) it does not taint the value of RCX
- ; 2) it does not spill any registers, nor
- ; expect home space to be allocated for it
- jmp ShvVmxEntryHandler ; jump to the C code handler. we assume that it
- ; compiled with optimizations and does not use
- ; home space, which is true of release builds.
- ShvVmxEntry ENDP
+ LEAF_ENTRY _sldt, _TEXT$00
+ sldt word ptr [rcx] ; Store LDTR value
+ ret ; Return
+ LEAF_END _sldt, _TEXT$00
+
+ LEAF_ENTRY ShvVmxCleanup, _TEXT$00
+ mov ds, cx ; set DS to parameter 1
+ mov es, cx ; set ES to parameter 1
+ mov fs, dx ; set FS to parameter 2
+ ret ; return
+ LEAF_END ShvVmxCleanup, _TEXT$00
+
+ LEAF_ENTRY __lgdt, _TEXT$00
+ lgdt fword ptr [rcx] ; load the GDTR with the value in parameter 1
+ ret ; return
+ LEAF_END __lgdt, _TEXT$00
end
diff --git a/shvvmxhvx64.asm b/shvvmxhvx64.asm
index 1e75175..e010e66 100644
--- a/shvvmxhvx64.asm
+++ b/shvvmxhvx64.asm
@@ -4,11 +4,11 @@
;
; Module:
;
-; shvvmxhvx64.asm
+; shvx64.asm
;
; Abstract:
;
-; This module implements AMD64-specific code for NT support of SimpleVisor.
+; This module implements the AMD64-specific SimpleVisor VMENTRY routine.
;
; Author:
;
@@ -20,28 +20,24 @@
;
;--
-include ksamd64.inc
+ .code
- LEAF_ENTRY _str, _TEXT$00
- str word ptr [rcx] ; Store TR value
- ret ; Return
- LEAF_END _str, _TEXT$00
+ extern ShvVmxEntryHandler:proc
+ extern ShvOsCaptureContext:proc
- LEAF_ENTRY _sldt, _TEXT$00
- sldt word ptr [rcx] ; Store LDTR value
- ret ; Return
- LEAF_END _sldt, _TEXT$00
-
- LEAF_ENTRY ShvVmxCleanup, _TEXT$00
- mov ds, cx ; set DS to parameter 1
- mov es, cx ; set ES to parameter 1
- mov fs, dx ; set FS to parameter 2
- ret ; return
- LEAF_END ShvVmxCleanup, _TEXT$00
-
- LEAF_ENTRY __lgdt, _TEXT$00
- lgdt fword ptr [rcx] ; load the GDTR with the value in parameter 1
- ret ; return
- LEAF_END __lgdt, _TEXT$00
+ ShvVmxEntry PROC
+ push rcx ; save the RCX register, which we spill below
+ lea rcx, [rsp+8h] ; store the context in the stack, bias for
+ ; the return address and the push we just did.
+ call ShvOsCaptureContext ; save the current register state.
+ ; note that this is a specially written function
+ ; which has the following key characteristics:
+ ; 1) it does not taint the value of RCX
+ ; 2) it does not spill any registers, nor
+ ; expect home space to be allocated for it
+ jmp ShvVmxEntryHandler ; jump to the C code handler. we assume that it
+ ; compiled with optimizations and does not use
+ ; home space, which is true of release builds.
+ ShvVmxEntry ENDP
end