ia64/xen-unstable

view xen/include/asm-x86/multicall.h @ 19848:5839491bbf20

[IA64] replace MAX_VCPUS with d->max_vcpus where necessary.

don't use MAX_VCPUS, and use vcpu::max_vcpus.
The changeset of 2f9e1348aa98 introduced max_vcpus to allow more vcpus
per guest. This patch is ia64 counter part.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 11:26:05 2009 +0900 (2009-06-29)
parents 96f167771979
children
line source
1 /******************************************************************************
2 * asm-x86/multicall.h
3 */
5 #ifndef __ASM_X86_MULTICALL_H__
6 #define __ASM_X86_MULTICALL_H__
8 #include <xen/errno.h>
10 #ifdef __x86_64__
12 #define do_multicall_call(_call) \
13 do { \
14 __asm__ __volatile__ ( \
15 " movq %c1(%0),%%rax; " \
16 " leaq hypercall_table(%%rip),%%rdi; " \
17 " cmpq $("STR(NR_hypercalls)"),%%rax; " \
18 " jae 2f; " \
19 " movq (%%rdi,%%rax,8),%%rax; " \
20 " movq %c2+0*%c3(%0),%%rdi; " \
21 " movq %c2+1*%c3(%0),%%rsi; " \
22 " movq %c2+2*%c3(%0),%%rdx; " \
23 " movq %c2+3*%c3(%0),%%rcx; " \
24 " movq %c2+4*%c3(%0),%%r8; " \
25 " callq *%%rax; " \
26 "1: movq %%rax,%c4(%0)\n" \
27 ".section .fixup,\"ax\"\n" \
28 "2: movq $-"STR(ENOSYS)",%%rax\n" \
29 " jmp 1b\n" \
30 ".previous\n" \
31 : \
32 : "b" (_call), \
33 "i" (offsetof(__typeof__(*_call), op)), \
34 "i" (offsetof(__typeof__(*_call), args)), \
35 "i" (sizeof(*(_call)->args)), \
36 "i" (offsetof(__typeof__(*_call), result)) \
37 /* all the caller-saves registers */ \
38 : "rax", "rcx", "rdx", "rsi", "rdi", \
39 "r8", "r9", "r10", "r11" ); \
40 } while ( 0 )
42 #define compat_multicall_call(_call) \
43 __asm__ __volatile__ ( \
44 " movl %c1(%0),%%eax; " \
45 " leaq compat_hypercall_table(%%rip),%%rdi; "\
46 " cmpl $("STR(NR_hypercalls)"),%%eax; " \
47 " jae 2f; " \
48 " movq (%%rdi,%%rax,8),%%rax; " \
49 " movl %c2+0*%c3(%0),%%edi; " \
50 " movl %c2+1*%c3(%0),%%esi; " \
51 " movl %c2+2*%c3(%0),%%edx; " \
52 " movl %c2+3*%c3(%0),%%ecx; " \
53 " movl %c2+4*%c3(%0),%%r8d; " \
54 " callq *%%rax; " \
55 "1: movl %%eax,%c4(%0)\n" \
56 ".section .fixup,\"ax\"\n" \
57 "2: movl $-"STR(ENOSYS)",%%eax\n" \
58 " jmp 1b\n" \
59 ".previous\n" \
60 : \
61 : "b" (_call), \
62 "i" (offsetof(__typeof__(*_call), op)), \
63 "i" (offsetof(__typeof__(*_call), args)), \
64 "i" (sizeof(*(_call)->args)), \
65 "i" (offsetof(__typeof__(*_call), result)) \
66 /* all the caller-saves registers */ \
67 : "rax", "rcx", "rdx", "rsi", "rdi", \
68 "r8", "r9", "r10", "r11" ) \
70 #else
72 #define do_multicall_call(_call) \
73 __asm__ __volatile__ ( \
74 " movl %c1(%0),%%eax; " \
75 " pushl %c2+4*%c3(%0); " \
76 " pushl %c2+3*%c3(%0); " \
77 " pushl %c2+2*%c3(%0); " \
78 " pushl %c2+1*%c3(%0); " \
79 " pushl %c2+0*%c3(%0); " \
80 " cmpl $("STR(NR_hypercalls)"),%%eax; " \
81 " jae 2f; " \
82 " call *hypercall_table(,%%eax,4); " \
83 "1: movl %%eax,%c4(%0); " \
84 " addl $20,%%esp\n" \
85 ".section .fixup,\"ax\"\n" \
86 "2: movl $-"STR(ENOSYS)",%%eax\n" \
87 " jmp 1b\n" \
88 ".previous\n" \
89 : \
90 : "bSD" (_call), \
91 "i" (offsetof(__typeof__(*_call), op)), \
92 "i" (offsetof(__typeof__(*_call), args)), \
93 "i" (sizeof(*(_call)->args)), \
94 "i" (offsetof(__typeof__(*_call), result)) \
95 /* all the caller-saves registers */ \
96 : "eax", "ecx", "edx" ) \
98 #endif
100 #endif /* __ASM_X86_MULTICALL_H__ */