aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:32:06 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:06 -0500
commit6057fc827b3a9f2fe5db18b882ebf96500500b64 (patch)
treeaa674ba3760ace08686407ca5d92c1b478bb2189 /include
parent658be9d395630d30a501c850bde90ac791a678c9 (diff)
x86: adjust assembly macros on 64-bit as well.
This patch adjust the paravirt macros used in assembly code to accomodate for x86_64 as well. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/paravirt.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index 56389954d100..854c19364da3 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -1159,8 +1159,6 @@ static inline unsigned long __raw_local_irq_save(void)
1159 1159
1160#else /* __ASSEMBLY__ */ 1160#else /* __ASSEMBLY__ */
1161 1161
1162#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 4)
1163
1164#define _PVSITE(ptype, clobbers, ops, word, algn) \ 1162#define _PVSITE(ptype, clobbers, ops, word, algn) \
1165771:; \ 1163771:; \
1166 ops; \ 1164 ops; \
@@ -1175,8 +1173,14 @@ static inline unsigned long __raw_local_irq_save(void)
1175 1173
1176 1174
1177#ifdef CONFIG_X86_64 1175#ifdef CONFIG_X86_64
1176#define PV_SAVE_REGS pushq %rax; pushq %rdi; pushq %rcx; pushq %rdx
1177#define PV_RESTORE_REGS popq %rdx; popq %rcx; popq %rdi; popq %rax
1178#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 8)
1178#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .quad, 8) 1179#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .quad, 8)
1179#else 1180#else
1181#define PV_SAVE_REGS pushl %eax; pushl %edi; pushl %ecx; pushl %edx
1182#define PV_RESTORE_REGS popl %edx; popl %ecx; popl %edi; popl %eax
1183#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 4)
1180#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .long, 4) 1184#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .long, 4)
1181#endif 1185#endif
1182 1186
@@ -1186,25 +1190,27 @@ static inline unsigned long __raw_local_irq_save(void)
1186 1190
1187#define DISABLE_INTERRUPTS(clobbers) \ 1191#define DISABLE_INTERRUPTS(clobbers) \
1188 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_disable), clobbers, \ 1192 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_disable), clobbers, \
1189 pushl %eax; pushl %ecx; pushl %edx; \ 1193 PV_SAVE_REGS; \
1190 call *%cs:pv_irq_ops+PV_IRQ_irq_disable; \ 1194 call *%cs:pv_irq_ops+PV_IRQ_irq_disable; \
1191 popl %edx; popl %ecx; popl %eax) \ 1195 PV_RESTORE_REGS;) \
1192 1196
1193#define ENABLE_INTERRUPTS(clobbers) \ 1197#define ENABLE_INTERRUPTS(clobbers) \
1194 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_enable), clobbers, \ 1198 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_enable), clobbers, \
1195 pushl %eax; pushl %ecx; pushl %edx; \ 1199 PV_SAVE_REGS; \
1196 call *%cs:pv_irq_ops+PV_IRQ_irq_enable; \ 1200 call *%cs:pv_irq_ops+PV_IRQ_irq_enable; \
1197 popl %edx; popl %ecx; popl %eax) 1201 PV_RESTORE_REGS;)
1198 1202
1199#define ENABLE_INTERRUPTS_SYSCALL_RET \ 1203#define ENABLE_INTERRUPTS_SYSCALL_RET \
1200 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_irq_enable_syscall_ret),\ 1204 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_irq_enable_syscall_ret),\
1201 CLBR_NONE, \ 1205 CLBR_NONE, \
1202 jmp *%cs:pv_cpu_ops+PV_CPU_irq_enable_syscall_ret) 1206 jmp *%cs:pv_cpu_ops+PV_CPU_irq_enable_syscall_ret)
1203 1207
1208#ifdef CONFIG_X86_32
1204#define GET_CR0_INTO_EAX \ 1209#define GET_CR0_INTO_EAX \
1205 push %ecx; push %edx; \ 1210 push %ecx; push %edx; \
1206 call *pv_cpu_ops+PV_CPU_read_cr0; \ 1211 call *pv_cpu_ops+PV_CPU_read_cr0; \
1207 pop %edx; pop %ecx 1212 pop %edx; pop %ecx
1213#endif
1208 1214
1209#endif /* __ASSEMBLY__ */ 1215#endif /* __ASSEMBLY__ */
1210#endif /* CONFIG_PARAVIRT */ 1216#endif /* CONFIG_PARAVIRT */