Newer
Older
static inline unsigned long __raw_local_irq_save(void)
{
unsigned long f;
Jeremy Fitzhardinge
committed
f = __raw_local_save_flags();
raw_local_irq_disable();
return f;
}
Jeremy Fitzhardinge
committed
#define CLI_STRING \
_paravirt_alt("pushl %%ecx; pushl %%edx;" \
"call *paravirt_ops+%c[paravirt_cli_type]*4;" \
"popl %%edx; popl %%ecx", \
"%c[paravirt_cli_type]", "%c[paravirt_clobber]")
#define STI_STRING \
_paravirt_alt("pushl %%ecx; pushl %%edx;" \
"call *paravirt_ops+%c[paravirt_sti_type]*4;" \
"popl %%edx; popl %%ecx", \
"%c[paravirt_sti_type]", "%c[paravirt_clobber]")
#define CLI_STI_CLOBBERS , "%eax"
Jeremy Fitzhardinge
committed
#define CLI_STI_INPUT_ARGS \
, \
Jeremy Fitzhardinge
committed
[paravirt_cli_type] "i" (PARAVIRT_PATCH(irq_disable)), \
[paravirt_sti_type] "i" (PARAVIRT_PATCH(irq_enable)), \
paravirt_clobber(CLBR_EAX)
#undef PARAVIRT_CALL
Jeremy Fitzhardinge
committed
#undef PVOP_VCALL0
#undef PVOP_CALL0
#undef PVOP_VCALL1
#undef PVOP_CALL1
#undef PVOP_VCALL2
#undef PVOP_CALL2
#undef PVOP_VCALL3
#undef PVOP_CALL3
#undef PVOP_VCALL4
#undef PVOP_CALL4
#else /* __ASSEMBLY__ */
Jeremy Fitzhardinge
committed
#define PARA_PATCH(off) ((off) / 4)
#define PARA_SITE(ptype, clobbers, ops) \
771:; \
ops; \
772:; \
.pushsection .parainstructions,"a"; \
.long 771b; \
.byte ptype; \
.byte 772b-771b; \
.short clobbers; \
.popsection
Jeremy Fitzhardinge
committed
#define INTERRUPT_RETURN \
Jeremy Fitzhardinge
committed
PARA_SITE(PARA_PATCH(PARAVIRT_iret), CLBR_NONE, \
Jeremy Fitzhardinge
committed
jmp *%cs:paravirt_ops+PARAVIRT_iret)
#define DISABLE_INTERRUPTS(clobbers) \
PARA_SITE(PARA_PATCH(PARAVIRT_irq_disable), clobbers, \
Jeremy Fitzhardinge
committed
pushl %eax; pushl %ecx; pushl %edx; \
Jeremy Fitzhardinge
committed
call *%cs:paravirt_ops+PARAVIRT_irq_disable; \
Jeremy Fitzhardinge
committed
popl %edx; popl %ecx; popl %eax) \
Jeremy Fitzhardinge
committed
#define ENABLE_INTERRUPTS(clobbers) \
PARA_SITE(PARA_PATCH(PARAVIRT_irq_enable), clobbers, \
Jeremy Fitzhardinge
committed
pushl %eax; pushl %ecx; pushl %edx; \
Jeremy Fitzhardinge
committed
call *%cs:paravirt_ops+PARAVIRT_irq_enable; \
Jeremy Fitzhardinge
committed
popl %edx; popl %ecx; popl %eax)
Jeremy Fitzhardinge
committed
#define ENABLE_INTERRUPTS_SYSEXIT \
Jeremy Fitzhardinge
committed
PARA_SITE(PARA_PATCH(PARAVIRT_irq_enable_sysexit), CLBR_NONE, \
Jeremy Fitzhardinge
committed
jmp *%cs:paravirt_ops+PARAVIRT_irq_enable_sysexit)
#define GET_CR0_INTO_EAX \
Jeremy Fitzhardinge
committed
push %ecx; push %edx; \
call *paravirt_ops+PARAVIRT_read_cr0; \
pop %edx; pop %ecx
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_PARAVIRT */
#endif /* __ASM_PARAVIRT_H */