aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-19 02:24:33 -0500
committerIngo Molnar <mingo@elte.hu>2008-02-26 06:55:51 -0500
commit4cd20952d74323df06e438c0c3273b5be89d6bfd (patch)
treedc9891edf781808943d5eb16da9a9c23f65ba0a2 /include
parent959b3be64cab9160cd74532a49b89cdd918d38e9 (diff)
x86: add comments for NOPs
Add comments describing the various NOP sequences. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/nops.h62
1 files changed, 45 insertions, 17 deletions
diff --git a/include/asm-x86/nops.h b/include/asm-x86/nops.h
index c52b334b8166..e3b2bce0aff8 100644
--- a/include/asm-x86/nops.h
+++ b/include/asm-x86/nops.h
@@ -3,17 +3,29 @@
3 3
4/* Define nops for use with alternative() */ 4/* Define nops for use with alternative() */
5 5
6/* generic versions from gas */ 6/* generic versions from gas
7#define GENERIC_NOP1 ".byte 0x90\n" 7 1: nop
8#define GENERIC_NOP2 ".byte 0x89,0xf6\n" 8 2: movl %esi,%esi
9#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n" 9 3: leal 0x00(%esi),%esi
10#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n" 10 4: leal 0x00(,%esi,1),%esi
11#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4 11 6: leal 0x00000000(%esi),%esi
12#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n" 12 7: leal 0x00000000(,%esi,1),%esi
13#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n" 13*/
14#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7 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
15 22
16/* Opteron 64bit nops */ 23/* Opteron 64bit nops
24 1: nop
25 2: osp nop
26 3: osp osp nop
27 4: osp osp osp nop
28*/
17#define K8_NOP1 GENERIC_NOP1 29#define K8_NOP1 GENERIC_NOP1
18#define K8_NOP2 ".byte 0x66,0x90\n" 30#define K8_NOP2 ".byte 0x66,0x90\n"
19#define K8_NOP3 ".byte 0x66,0x66,0x90\n" 31#define K8_NOP3 ".byte 0x66,0x66,0x90\n"
@@ -23,19 +35,35 @@
23#define K8_NOP7 K8_NOP4 K8_NOP3 35#define K8_NOP7 K8_NOP4 K8_NOP3
24#define K8_NOP8 K8_NOP4 K8_NOP4 36#define K8_NOP8 K8_NOP4 K8_NOP4
25 37
26/* K7 nops */ 38/* K7 nops
27/* uses eax dependencies (arbitary choice) */ 39 uses eax dependencies (arbitary choice)
28#define K7_NOP1 GENERIC_NOP1 40 1: nop
41 2: movl %eax,%eax
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
46*/
47#define K7_NOP1 GENERIC_NOP1
29#define K7_NOP2 ".byte 0x8b,0xc0\n" 48#define K7_NOP2 ".byte 0x8b,0xc0\n"
30#define K7_NOP3 ".byte 0x8d,0x04,0x20\n" 49#define K7_NOP3 ".byte 0x8d,0x04,0x20\n"
31#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n" 50#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n"
32#define K7_NOP5 K7_NOP4 ASM_NOP1 51#define K7_NOP5 K7_NOP4 ASM_NOP1
33#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n" 52#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n"
34#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n" 53#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
35#define K7_NOP8 K7_NOP7 ASM_NOP1 54#define K7_NOP8 K7_NOP7 ASM_NOP1
36 55
37/* P6 nops */ 56/* P6 nops
38/* uses eax dependencies (Intel-recommended choice) */ 57 uses eax dependencies (Intel-recommended choice)
58 1: nop
59 2: osp nop
60 3: nopl (%eax)
61 4: nopl 0x00(%eax)
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)
66*/
39#define P6_NOP1 GENERIC_NOP1 67#define P6_NOP1 GENERIC_NOP1
40#define P6_NOP2 ".byte 0x66,0x90\n" 68#define P6_NOP2 ".byte 0x66,0x90\n"
41#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n" 69#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"