4 /* Define nops for use with alternative() */
6 /* generic versions from gas
9 3: leal 0x00(%esi),%esi
10 4: leal 0x00(,%esi,1),%esi
11 6: leal 0x00000000(%esi),%esi
12 7: leal 0x00000000(,%esi,1),%esi
14 #define GENERIC_NOP1 ".byte 0x90\n"
15 #define GENERIC_NOP2 ".byte 0x89,0xf6\n"
16 #define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n"
17 #define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n"
18 #define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
19 #define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n"
20 #define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n"
21 #define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7
29 #define K8_NOP1 GENERIC_NOP1
30 #define K8_NOP2 ".byte 0x66,0x90\n"
31 #define K8_NOP3 ".byte 0x66,0x66,0x90\n"
32 #define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n"
33 #define K8_NOP5 K8_NOP3 K8_NOP2
34 #define K8_NOP6 K8_NOP3 K8_NOP3
35 #define K8_NOP7 K8_NOP4 K8_NOP3
36 #define K8_NOP8 K8_NOP4 K8_NOP4
39 uses eax dependencies (arbitary choice)
42 3: leal (,%eax,1),%eax
43 4: leal 0x00(,%eax,1),%eax
44 6: leal 0x00000000(%eax),%eax
45 7: leal 0x00000000(,%eax,1),%eax
47 #define K7_NOP1 GENERIC_NOP1
48 #define K7_NOP2 ".byte 0x8b,0xc0\n"
49 #define K7_NOP3 ".byte 0x8d,0x04,0x20\n"
50 #define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n"
51 #define K7_NOP5 K7_NOP4 ASM_NOP1
52 #define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n"
53 #define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
54 #define K7_NOP8 K7_NOP7 ASM_NOP1
57 uses eax dependencies (Intel-recommended choice)
62 5: nopl 0x00(%eax,%eax,1)
63 6: osp nopl 0x00(%eax,%eax,1)
64 7: nopl 0x00000000(%eax)
65 8: nopl 0x00000000(%eax,%eax,1)
67 #define P6_NOP1 GENERIC_NOP1
68 #define P6_NOP2 ".byte 0x66,0x90\n"
69 #define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"
70 #define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n"
71 #define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n"
72 #define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n"
73 #define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
74 #define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"
76 #if defined(CONFIG_MK8)
77 #define ASM_NOP1 K8_NOP1
78 #define ASM_NOP2 K8_NOP2
79 #define ASM_NOP3 K8_NOP3
80 #define ASM_NOP4 K8_NOP4
81 #define ASM_NOP5 K8_NOP5
82 #define ASM_NOP6 K8_NOP6
83 #define ASM_NOP7 K8_NOP7
84 #define ASM_NOP8 K8_NOP8
85 #elif defined(CONFIG_MK7)
86 #define ASM_NOP1 K7_NOP1
87 #define ASM_NOP2 K7_NOP2
88 #define ASM_NOP3 K7_NOP3
89 #define ASM_NOP4 K7_NOP4
90 #define ASM_NOP5 K7_NOP5
91 #define ASM_NOP6 K7_NOP6
92 #define ASM_NOP7 K7_NOP7
93 #define ASM_NOP8 K7_NOP8
94 #elif defined(CONFIG_X86_P6_NOP)
95 #define ASM_NOP1 P6_NOP1
96 #define ASM_NOP2 P6_NOP2
97 #define ASM_NOP3 P6_NOP3
98 #define ASM_NOP4 P6_NOP4
99 #define ASM_NOP5 P6_NOP5
100 #define ASM_NOP6 P6_NOP6
101 #define ASM_NOP7 P6_NOP7
102 #define ASM_NOP8 P6_NOP8
104 #define ASM_NOP1 GENERIC_NOP1
105 #define ASM_NOP2 GENERIC_NOP2
106 #define ASM_NOP3 GENERIC_NOP3
107 #define ASM_NOP4 GENERIC_NOP4
108 #define ASM_NOP5 GENERIC_NOP5
109 #define ASM_NOP6 GENERIC_NOP6
110 #define ASM_NOP7 GENERIC_NOP7
111 #define ASM_NOP8 GENERIC_NOP8
114 #define ASM_NOP_MAX 8