00001 #ifndef __PREFETCH_H__
00002 #define __PREFETCH_H__
00003
00004 #define alternative_input(oldinstr, newinstr, feature, input...) \
00005 asm volatile ("661:\n\t" oldinstr "\n662:\n" \
00006 ".section .altinstructions,\"a\"\n" \
00007 " .align 4\n" \
00008 " .long 661b\n" \
00009 " .long 663f\n" \
00010 " .byte %c0\n" \
00011 " .byte 662b-661b\n" \
00012 " .byte 664f-663f\n" \
00013 ".previous\n" \
00014 ".section .altinstr_replacement,\"ax\"\n" \
00015 "663:\n\t" newinstr "\n664:\n" \
00016 ".previous" :: "i" (feature), ##input)
00017
00018
00019 static inline void prefetch(const void *x)
00020 {
00021 alternative_input(ASM_NOP4,
00022 "prefetchnta (%1)",
00023 X86_FEATURE_XMM,
00024 "r" (x));
00025 }
00026
00027
00028 #endif