This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
forked from jonsmirl/mpc5200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
kmemcheck2: add dispatcher/scheduler
Signed-off-by: Vegard Nossum <vegardno@posco.ifi.uio.no>
- Loading branch information
Vegard Nossum
committed
Oct 28, 2011
1 parent
a416ad0
commit 24d68dd
Showing
3 changed files
with
82 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
obj-y += kmemcheck2.o | ||
obj-y += kmemcheck2.o dispatch-amd64-linux.o |
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,48 @@ | ||
#include <libvex_guest_offsets.h> | ||
|
||
.text | ||
.globl kmemcheck2_dispatch | ||
kmemcheck2_dispatch: | ||
/* Save guest state on the stack */ | ||
pushq %rbx | ||
pushq %rcx | ||
pushq %rdx | ||
pushq %rsi | ||
pushq %rbp | ||
pushq %r8 | ||
pushq %r9 | ||
pushq %r10 | ||
pushq %r11 | ||
pushq %r12 | ||
pushq %r13 | ||
pushq %r14 | ||
pushq %r15 | ||
pushq %rdi /* Guest state pointer */ | ||
|
||
/* Fetch guest RIP into %rax */ | ||
movq OFFSET_amd64_RIP(%rdi), %rdi | ||
|
||
/* XXX: flags/FP/SSE/etc. registers */ | ||
|
||
/* Call the scheduler, which will translate the next piece of code | ||
* if necessary. */ | ||
call kmemcheck2_schedule | ||
|
||
/* Restore guest state from the stack */ | ||
popq %rdi | ||
movq %rax, OFFSET_amd64_RIP(%rdi) | ||
|
||
popq %r15 | ||
popq %r14 | ||
popq %r13 | ||
popq %r12 | ||
popq %r11 | ||
popq %r10 | ||
popq %r9 | ||
popq %r8 | ||
popq %rbp | ||
popq %rsi | ||
popq %rdx | ||
popq %rcx | ||
popq %rbx | ||
ret |
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