win-pvdrivers

view xenpci/amd64/hypercall.asm @ 1054:471c94d04d8a

Refactoring to support xencache (tmem)
author James Harper <james.harper@bendigoit.com.au>
date Sun Jun 02 16:37:21 2013 +1000 (2013-06-02)
parents 25814a68e426
children
line source
1 .data
3 ; look up 'fastcall' in the ddk help for the calling convention for amd64
5 ; called with
6 ; address of function in rcx
7 ; p1 in rdx
8 ; p2 in r8
10 ; linux code is
11 ; #define _hypercall2(type, name, a1, a2)
12 ; ({
13 ; long __res, __ign1, __ign2;
14 ; asm volatile (
15 ; "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
16 ; : "=a" (__res), "=D" (__ign1), "=S" (__ign2)
17 ; : "1" ((long)(a1)), "2" ((long)(a2))
18 ; : "memory" );
19 ; (type)__res;
20 ; })
22 .code
23 _hypercall1 proc
24 push rdi
25 push rsi
26 mov rdi, rdx
27 mov rax, rcx
28 call rax
29 pop rsi
30 pop rdi
31 ret
32 _hypercall1 endp
34 _hypercall2 proc
35 push rdi
36 push rsi
37 mov rdi, rdx
38 mov rsi, r8
39 mov rax, rcx
40 call rax
41 pop rsi
42 pop rdi
43 ret
44 _hypercall2 endp
46 _hypercall3 proc
47 push rdi
48 push rsi
49 mov rdi, rdx
50 mov rsi, r8
51 mov rdx, r9
52 mov rax, rcx
53 call rax
54 pop rsi
55 pop rdi
56 ret
57 _hypercall3 endp
58 END