diff options
author | Andi Kleen <ak@suse.de> | 2008-01-30 07:32:38 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:38 -0500 |
commit | bd61643ef6139ba44142f2ba6e79e03267e6b54a (patch) | |
tree | 581be5e8f0ed23f93bbe258e6b0b2dc12a84282b /include/asm-x86/nops.h | |
parent | 6d5f718a497375f853d90247f5f6963368e89803 (diff) |
x86: move nop declarations into separate include file
Moving things out of processor.h is always a good thing.
Also needed to avoid include loop in later patch.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/nops.h')
-rw-r--r-- | include/asm-x86/nops.h | 90 |
1 files changed, 90 insertions, 0 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 | ||