aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/nops.h90
-rw-r--r--include/asm-x86/processor.h86
2 files changed, 91 insertions, 85 deletions
diff --git a/include/asm-x86/nops.h b/include/asm-x86/nops.h
new file mode 100644
index 000000000000..fec025c7f58c
--- /dev/null
+++ b/include/asm-x86/nops.h
@@ -0,0 +1,90 @@
1#ifndef _ASM_NOPS_H
2#define _ASM_NOPS_H 1
3
4/* Define nops for use with alternative() */
5
6/* generic versions from gas */
7#define GENERIC_NOP1 ".byte 0x90\n"
8#define GENERIC_NOP2 ".byte 0x89,0xf6\n"
9#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n"
10#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n"
11#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
12#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n"
13#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n"
14#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7
15
16/* Opteron 64bit nops */
17#define K8_NOP1 GENERIC_NOP1
18#define K8_NOP2 ".byte 0x66,0x90\n"
19#define K8_NOP3 ".byte 0x66,0x66,0x90\n"
20#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n"
21#define K8_NOP5 K8_NOP3 K8_NOP2
22#define K8_NOP6 K8_NOP3 K8_NOP3
23#define K8_NOP7 K8_NOP4 K8_NOP3
24#define K8_NOP8 K8_NOP4 K8_NOP4
25
26/* K7 nops */
27/* uses eax dependencies (arbitary choice) */
28#define K7_NOP1 GENERIC_NOP1
29#define K7_NOP2 ".byte 0x8b,0xc0\n"
30#define K7_NOP3 ".byte 0x8d,0x04,0x20\n"
31#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n"
32#define K7_NOP5 K7_NOP4 ASM_NOP1
33#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n"
34#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
35#define K7_NOP8 K7_NOP7 ASM_NOP1
36
37/* P6 nops */
38/* uses eax dependencies (Intel-recommended choice) */
39#define P6_NOP1 GENERIC_NOP1
40#define P6_NOP2 ".byte 0x66,0x90\n"
41#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"
42#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n"
43#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n"
44#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n"
45#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
46#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"
47
48#if defined(CONFIG_MK8)
49#define ASM_NOP1 K8_NOP1
50#define ASM_NOP2 K8_NOP2
51#define ASM_NOP3 K8_NOP3
52#define ASM_NOP4 K8_NOP4
53#define ASM_NOP5 K8_NOP5
54#define ASM_NOP6 K8_NOP6
55#define ASM_NOP7 K8_NOP7
56#define ASM_NOP8 K8_NOP8
57#elif defined(CONFIG_MK7)
58#define ASM_NOP1 K7_NOP1
59#define ASM_NOP2 K7_NOP2
60#define ASM_NOP3 K7_NOP3
61#define ASM_NOP4 K7_NOP4
62#define ASM_NOP5 K7_NOP5
63#define ASM_NOP6 K7_NOP6
64#define ASM_NOP7 K7_NOP7
65#define ASM_NOP8 K7_NOP8
66#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
67 defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \
68 defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)
69#define ASM_NOP1 P6_NOP1
70#define ASM_NOP2 P6_NOP2
71#define ASM_NOP3 P6_NOP3
72#define ASM_NOP4 P6_NOP4
73#define ASM_NOP5 P6_NOP5
74#define ASM_NOP6 P6_NOP6
75#define ASM_NOP7 P6_NOP7
76#define ASM_NOP8 P6_NOP8
77#else
78#define ASM_NOP1 GENERIC_NOP1
79#define ASM_NOP2 GENERIC_NOP2
80#define ASM_NOP3 GENERIC_NOP3
81#define ASM_NOP4 GENERIC_NOP4
82#define ASM_NOP5 GENERIC_NOP5
83#define ASM_NOP6 GENERIC_NOP6
84#define ASM_NOP7 GENERIC_NOP7
85#define ASM_NOP8 GENERIC_NOP8
86#endif
87
88#define ASM_NOP_MAX 8
89
90#endif
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index 72740c6f1109..41c002440de7 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -20,6 +20,7 @@ struct mm_struct;
20#include <asm/percpu.h> 20#include <asm/percpu.h>
21#include <asm/msr.h> 21#include <asm/msr.h>
22#include <asm/desc_defs.h> 22#include <asm/desc_defs.h>
23#include <asm/nops.h>
23#include <linux/personality.h> 24#include <linux/personality.h>
24#include <linux/cpumask.h> 25#include <linux/cpumask.h>
25#include <linux/cache.h> 26#include <linux/cache.h>
@@ -674,91 +675,6 @@ extern int bootloader_type;
674extern char ignore_fpu_irq; 675extern char ignore_fpu_irq;
675#define cache_line_size() (boot_cpu_data.x86_cache_alignment) 676#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
676 677
677/* generic versions from gas */
678#define GENERIC_NOP1 ".byte 0x90\n"
679#define GENERIC_NOP2 ".byte 0x89,0xf6\n"
680#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n"
681#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n"
682#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
683#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n"
684#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n"
685#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7
686
687/* Opteron nops */
688#define K8_NOP1 GENERIC_NOP1
689#define K8_NOP2 ".byte 0x66,0x90\n"
690#define K8_NOP3 ".byte 0x66,0x66,0x90\n"
691#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n"
692#define K8_NOP5 K8_NOP3 K8_NOP2
693#define K8_NOP6 K8_NOP3 K8_NOP3
694#define K8_NOP7 K8_NOP4 K8_NOP3
695#define K8_NOP8 K8_NOP4 K8_NOP4
696
697/* K7 nops */
698/* uses eax dependencies (arbitary choice) */
699#define K7_NOP1 GENERIC_NOP1
700#define K7_NOP2 ".byte 0x8b,0xc0\n"
701#define K7_NOP3 ".byte 0x8d,0x04,0x20\n"
702#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n"
703#define K7_NOP5 K7_NOP4 ASM_NOP1
704#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n"
705#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
706#define K7_NOP8 K7_NOP7 ASM_NOP1
707
708/* P6 nops */
709/* uses eax dependencies (Intel-recommended choice) */
710#define P6_NOP1 GENERIC_NOP1
711#define P6_NOP2 ".byte 0x66,0x90\n"
712#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"
713#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n"
714#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n"
715#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n"
716#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
717#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"
718
719#ifdef CONFIG_MK7
720#define ASM_NOP1 K7_NOP1
721#define ASM_NOP2 K7_NOP2
722#define ASM_NOP3 K7_NOP3
723#define ASM_NOP4 K7_NOP4
724#define ASM_NOP5 K7_NOP5
725#define ASM_NOP6 K7_NOP6
726#define ASM_NOP7 K7_NOP7
727#define ASM_NOP8 K7_NOP8
728#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
729 defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \
730 defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4) || \
731 defined(CONFIG_MPSC)
732#define ASM_NOP1 P6_NOP1
733#define ASM_NOP2 P6_NOP2
734#define ASM_NOP3 P6_NOP3
735#define ASM_NOP4 P6_NOP4
736#define ASM_NOP5 P6_NOP5
737#define ASM_NOP6 P6_NOP6
738#define ASM_NOP7 P6_NOP7
739#define ASM_NOP8 P6_NOP8
740#elif defined(CONFIG_MK8) || defined(CONFIG_X86_64)
741#define ASM_NOP1 K8_NOP1
742#define ASM_NOP2 K8_NOP2
743#define ASM_NOP3 K8_NOP3
744#define ASM_NOP4 K8_NOP4
745#define ASM_NOP5 K8_NOP5
746#define ASM_NOP6 K8_NOP6
747#define ASM_NOP7 K8_NOP7
748#define ASM_NOP8 K8_NOP8
749#else
750#define ASM_NOP1 GENERIC_NOP1
751#define ASM_NOP2 GENERIC_NOP2
752#define ASM_NOP3 GENERIC_NOP3
753#define ASM_NOP4 GENERIC_NOP4
754#define ASM_NOP5 GENERIC_NOP5
755#define ASM_NOP6 GENERIC_NOP6
756#define ASM_NOP7 GENERIC_NOP7
757#define ASM_NOP8 GENERIC_NOP8
758#endif
759
760#define ASM_NOP_MAX 8
761
762#define HAVE_ARCH_PICK_MMAP_LAYOUT 1 678#define HAVE_ARCH_PICK_MMAP_LAYOUT 1
763#define ARCH_HAS_PREFETCHW 679#define ARCH_HAS_PREFETCHW
764#define ARCH_HAS_SPINLOCK_PREFETCH 680#define ARCH_HAS_SPINLOCK_PREFETCH