1
2 #ifndef _ASM_X86_NOPS_H
3 #define _ASM_X86_NOPS_H
4
5
6
7
8
9
10
11 #define NOP_DS_PREFIX 0x3e
12
13
14
15
16
17
18
19
20
21
22
23 #define GENERIC_NOP1 0x90
24 #define GENERIC_NOP2 0x89,0xf6
25 #define GENERIC_NOP3 0x8d,0x76,0x00
26 #define GENERIC_NOP4 0x8d,0x74,0x26,0x00
27 #define GENERIC_NOP5 GENERIC_NOP1,GENERIC_NOP4
28 #define GENERIC_NOP6 0x8d,0xb6,0x00,0x00,0x00,0x00
29 #define GENERIC_NOP7 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00
30 #define GENERIC_NOP8 GENERIC_NOP1,GENERIC_NOP7
31 #define GENERIC_NOP5_ATOMIC NOP_DS_PREFIX,GENERIC_NOP4
32
33
34
35
36
37
38
39 #define K8_NOP1 GENERIC_NOP1
40 #define K8_NOP2 0x66,K8_NOP1
41 #define K8_NOP3 0x66,K8_NOP2
42 #define K8_NOP4 0x66,K8_NOP3
43 #define K8_NOP5 K8_NOP3,K8_NOP2
44 #define K8_NOP6 K8_NOP3,K8_NOP3
45 #define K8_NOP7 K8_NOP4,K8_NOP3
46 #define K8_NOP8 K8_NOP4,K8_NOP4
47 #define K8_NOP5_ATOMIC 0x66,K8_NOP4
48
49
50
51
52
53
54
55
56
57
58 #define K7_NOP1 GENERIC_NOP1
59 #define K7_NOP2 0x8b,0xc0
60 #define K7_NOP3 0x8d,0x04,0x20
61 #define K7_NOP4 0x8d,0x44,0x20,0x00
62 #define K7_NOP5 K7_NOP4,K7_NOP1
63 #define K7_NOP6 0x8d,0x80,0,0,0,0
64 #define K7_NOP7 0x8D,0x04,0x05,0,0,0,0
65 #define K7_NOP8 K7_NOP7,K7_NOP1
66 #define K7_NOP5_ATOMIC NOP_DS_PREFIX,K7_NOP4
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81 #define P6_NOP1 GENERIC_NOP1
82 #define P6_NOP2 0x66,0x90
83 #define P6_NOP3 0x0f,0x1f,0x00
84 #define P6_NOP4 0x0f,0x1f,0x40,0
85 #define P6_NOP5 0x0f,0x1f,0x44,0x00,0
86 #define P6_NOP6 0x66,0x0f,0x1f,0x44,0x00,0
87 #define P6_NOP7 0x0f,0x1f,0x80,0,0,0,0
88 #define P6_NOP8 0x0f,0x1f,0x84,0x00,0,0,0,0
89 #define P6_NOP5_ATOMIC P6_NOP5
90
91 #ifdef __ASSEMBLY__
92 #define _ASM_MK_NOP(x) .byte x
93 #else
94 #define _ASM_MK_NOP(x) ".byte " __stringify(x) "\n"
95 #endif
96
97 #if defined(CONFIG_MK7)
98 #define ASM_NOP1 _ASM_MK_NOP(K7_NOP1)
99 #define ASM_NOP2 _ASM_MK_NOP(K7_NOP2)
100 #define ASM_NOP3 _ASM_MK_NOP(K7_NOP3)
101 #define ASM_NOP4 _ASM_MK_NOP(K7_NOP4)
102 #define ASM_NOP5 _ASM_MK_NOP(K7_NOP5)
103 #define ASM_NOP6 _ASM_MK_NOP(K7_NOP6)
104 #define ASM_NOP7 _ASM_MK_NOP(K7_NOP7)
105 #define ASM_NOP8 _ASM_MK_NOP(K7_NOP8)
106 #define ASM_NOP5_ATOMIC _ASM_MK_NOP(K7_NOP5_ATOMIC)
107 #elif defined(CONFIG_X86_P6_NOP)
108 #define ASM_NOP1 _ASM_MK_NOP(P6_NOP1)
109 #define ASM_NOP2 _ASM_MK_NOP(P6_NOP2)
110 #define ASM_NOP3 _ASM_MK_NOP(P6_NOP3)
111 #define ASM_NOP4 _ASM_MK_NOP(P6_NOP4)
112 #define ASM_NOP5 _ASM_MK_NOP(P6_NOP5)
113 #define ASM_NOP6 _ASM_MK_NOP(P6_NOP6)
114 #define ASM_NOP7 _ASM_MK_NOP(P6_NOP7)
115 #define ASM_NOP8 _ASM_MK_NOP(P6_NOP8)
116 #define ASM_NOP5_ATOMIC _ASM_MK_NOP(P6_NOP5_ATOMIC)
117 #elif defined(CONFIG_X86_64)
118 #define ASM_NOP1 _ASM_MK_NOP(K8_NOP1)
119 #define ASM_NOP2 _ASM_MK_NOP(K8_NOP2)
120 #define ASM_NOP3 _ASM_MK_NOP(K8_NOP3)
121 #define ASM_NOP4 _ASM_MK_NOP(K8_NOP4)
122 #define ASM_NOP5 _ASM_MK_NOP(K8_NOP5)
123 #define ASM_NOP6 _ASM_MK_NOP(K8_NOP6)
124 #define ASM_NOP7 _ASM_MK_NOP(K8_NOP7)
125 #define ASM_NOP8 _ASM_MK_NOP(K8_NOP8)
126 #define ASM_NOP5_ATOMIC _ASM_MK_NOP(K8_NOP5_ATOMIC)
127 #else
128 #define ASM_NOP1 _ASM_MK_NOP(GENERIC_NOP1)
129 #define ASM_NOP2 _ASM_MK_NOP(GENERIC_NOP2)
130 #define ASM_NOP3 _ASM_MK_NOP(GENERIC_NOP3)
131 #define ASM_NOP4 _ASM_MK_NOP(GENERIC_NOP4)
132 #define ASM_NOP5 _ASM_MK_NOP(GENERIC_NOP5)
133 #define ASM_NOP6 _ASM_MK_NOP(GENERIC_NOP6)
134 #define ASM_NOP7 _ASM_MK_NOP(GENERIC_NOP7)
135 #define ASM_NOP8 _ASM_MK_NOP(GENERIC_NOP8)
136 #define ASM_NOP5_ATOMIC _ASM_MK_NOP(GENERIC_NOP5_ATOMIC)
137 #endif
138
139 #define ASM_NOP_MAX 8
140 #define NOP_ATOMIC5 (ASM_NOP_MAX+1)
141
142 #ifndef __ASSEMBLY__
143 extern const unsigned char * const *ideal_nops;
144 extern void arch_init_ideal_nops(void);
145 #endif
146
147 #endif