aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/processor.h
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:31:40 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:40 -0500
commitea5e3593a493298c69b8c4a958628feace930478 (patch)
treeb6607e39bd44fd980e68a7ba80b0d76f7cdaa016 /include/asm-x86/processor.h
parentae2e15eb3b6c2a011bee615470bf52d2beb99a4b (diff)
x86: unify asm nops
There's only one difference between the NOPs used in asm code for i386 and x86_64: i386 has a lot more variants. The code is moved to processor.h, and adjusted accordingly. 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/asm-x86/processor.h')
-rw-r--r--include/asm-x86/processor.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index bfac9739f57e..a8f1702ec3ba 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -592,6 +592,91 @@ extern int bootloader_type;
592extern char ignore_fpu_irq; 592extern char ignore_fpu_irq;
593#define cache_line_size() (boot_cpu_data.x86_cache_alignment) 593#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
594 594
595/* generic versions from gas */
596#define GENERIC_NOP1 ".byte 0x90\n"
597#define GENERIC_NOP2 ".byte 0x89,0xf6\n"
598#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n"
599#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n"
600#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
601#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n"
602#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n"
603#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7
604
605/* Opteron nops */
606#define K8_NOP1 GENERIC_NOP1
607#define K8_NOP2 ".byte 0x66,0x90\n"
608#define K8_NOP3 ".byte 0x66,0x66,0x90\n"
609#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n"
610#define K8_NOP5 K8_NOP3 K8_NOP2
611#define K8_NOP6 K8_NOP3 K8_NOP3
612#define K8_NOP7 K8_NOP4 K8_NOP3
613#define K8_NOP8 K8_NOP4 K8_NOP4
614
615/* K7 nops */
616/* uses eax dependencies (arbitary choice) */
617#define K7_NOP1 GENERIC_NOP1
618#define K7_NOP2 ".byte 0x8b,0xc0\n"
619#define K7_NOP3 ".byte 0x8d,0x04,0x20\n"
620#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n"
621#define K7_NOP5 K7_NOP4 ASM_NOP1
622#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n"
623#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
624#define K7_NOP8 K7_NOP7 ASM_NOP1
625
626/* P6 nops */
627/* uses eax dependencies (Intel-recommended choice) */
628#define P6_NOP1 GENERIC_NOP1
629#define P6_NOP2 ".byte 0x66,0x90\n"
630#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"
631#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n"
632#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n"
633#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n"
634#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
635#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"
636
637#ifdef CONFIG_MK7
638#define ASM_NOP1 K7_NOP1
639#define ASM_NOP2 K7_NOP2
640#define ASM_NOP3 K7_NOP3
641#define ASM_NOP4 K7_NOP4
642#define ASM_NOP5 K7_NOP5
643#define ASM_NOP6 K7_NOP6
644#define ASM_NOP7 K7_NOP7
645#define ASM_NOP8 K7_NOP8
646#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
647 defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \
648 defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4) || \
649 defined(CONFIG_MPSC)
650#define ASM_NOP1 P6_NOP1
651#define ASM_NOP2 P6_NOP2
652#define ASM_NOP3 P6_NOP3
653#define ASM_NOP4 P6_NOP4
654#define ASM_NOP5 P6_NOP5
655#define ASM_NOP6 P6_NOP6
656#define ASM_NOP7 P6_NOP7
657#define ASM_NOP8 P6_NOP8
658#elif defined(CONFIG_MK8) || defined(CONFIG_X86_64)
659#define ASM_NOP1 K8_NOP1
660#define ASM_NOP2 K8_NOP2
661#define ASM_NOP3 K8_NOP3
662#define ASM_NOP4 K8_NOP4
663#define ASM_NOP5 K8_NOP5
664#define ASM_NOP6 K8_NOP6
665#define ASM_NOP7 K8_NOP7
666#define ASM_NOP8 K8_NOP8
667#else
668#define ASM_NOP1 GENERIC_NOP1
669#define ASM_NOP2 GENERIC_NOP2
670#define ASM_NOP3 GENERIC_NOP3
671#define ASM_NOP4 GENERIC_NOP4
672#define ASM_NOP5 GENERIC_NOP5
673#define ASM_NOP6 GENERIC_NOP6
674#define ASM_NOP7 GENERIC_NOP7
675#define ASM_NOP8 GENERIC_NOP8
676#endif
677
678#define ASM_NOP_MAX 8
679
595#define HAVE_ARCH_PICK_MMAP_LAYOUT 1 680#define HAVE_ARCH_PICK_MMAP_LAYOUT 1
596#define ARCH_HAS_PREFETCHW 681#define ARCH_HAS_PREFETCHW
597#define ARCH_HAS_SPINLOCK_PREFETCH 682#define ARCH_HAS_SPINLOCK_PREFETCH