~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/arch/x86/include/asm/nops.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ASM_X86_NOPS_H
  3 #define _ASM_X86_NOPS_H
  4 
  5 #include <asm/asm.h>
  6 
  7 /*
  8  * Define nops for use with alternative() and for tracing.
  9  */
 10 
 11 #ifndef CONFIG_64BIT
 12 
 13 /*
 14  * Generic 32bit nops from GAS:
 15  *
 16  * 1: nop
 17  * 2: movl %esi,%esi
 18  * 3: leal 0x0(%esi),%esi
 19  * 4: leal 0x0(%esi,%eiz,1),%esi
 20  * 5: leal %ds:0x0(%esi,%eiz,1),%esi
 21  * 6: leal 0x0(%esi),%esi
 22  * 7: leal 0x0(%esi,%eiz,1),%esi
 23  * 8: leal %ds:0x0(%esi,%eiz,1),%esi
 24  *
 25  * Except 5 and 8, which are DS prefixed 4 and 7 resp, where GAS would emit 2
 26  * nop instructions.
 27  */
 28 #define BYTES_NOP1      0x90
 29 #define BYTES_NOP2      0x89,0xf6
 30 #define BYTES_NOP3      0x8d,0x76,0x00
 31 #define BYTES_NOP4      0x8d,0x74,0x26,0x00
 32 #define BYTES_NOP5      0x3e,BYTES_NOP4
 33 #define BYTES_NOP6      0x8d,0xb6,0x00,0x00,0x00,0x00
 34 #define BYTES_NOP7      0x8d,0xb4,0x26,0x00,0x00,0x00,0x00
 35 #define BYTES_NOP8      0x3e,BYTES_NOP7
 36 
 37 #define ASM_NOP_MAX 8
 38 
 39 #else
 40 
 41 /*
 42  * Generic 64bit nops from GAS:
 43  *
 44  * 1: nop
 45  * 2: osp nop
 46  * 3: nopl (%eax)
 47  * 4: nopl 0x00(%eax)
 48  * 5: nopl 0x00(%eax,%eax,1)
 49  * 6: osp nopl 0x00(%eax,%eax,1)
 50  * 7: nopl 0x00000000(%eax)
 51  * 8: nopl 0x00000000(%eax,%eax,1)
 52  * 9: cs nopl 0x00000000(%eax,%eax,1)
 53  * 10: osp cs nopl 0x00000000(%eax,%eax,1)
 54  * 11: osp osp cs nopl 0x00000000(%eax,%eax,1)
 55  */
 56 #define BYTES_NOP1      0x90
 57 #define BYTES_NOP2      0x66,BYTES_NOP1
 58 #define BYTES_NOP3      0x0f,0x1f,0x00
 59 #define BYTES_NOP4      0x0f,0x1f,0x40,0x00
 60 #define BYTES_NOP5      0x0f,0x1f,0x44,0x00,0x00
 61 #define BYTES_NOP6      0x66,BYTES_NOP5
 62 #define BYTES_NOP7      0x0f,0x1f,0x80,0x00,0x00,0x00,0x00
 63 #define BYTES_NOP8      0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00
 64 #define BYTES_NOP9      0x2e,BYTES_NOP8
 65 #define BYTES_NOP10     0x66,BYTES_NOP9
 66 #define BYTES_NOP11     0x66,BYTES_NOP10
 67 
 68 #define ASM_NOP9  _ASM_BYTES(BYTES_NOP9)
 69 #define ASM_NOP10 _ASM_BYTES(BYTES_NOP10)
 70 #define ASM_NOP11 _ASM_BYTES(BYTES_NOP11)
 71 
 72 #define ASM_NOP_MAX 11
 73 
 74 #endif /* CONFIG_64BIT */
 75 
 76 #define ASM_NOP1 _ASM_BYTES(BYTES_NOP1)
 77 #define ASM_NOP2 _ASM_BYTES(BYTES_NOP2)
 78 #define ASM_NOP3 _ASM_BYTES(BYTES_NOP3)
 79 #define ASM_NOP4 _ASM_BYTES(BYTES_NOP4)
 80 #define ASM_NOP5 _ASM_BYTES(BYTES_NOP5)
 81 #define ASM_NOP6 _ASM_BYTES(BYTES_NOP6)
 82 #define ASM_NOP7 _ASM_BYTES(BYTES_NOP7)
 83 #define ASM_NOP8 _ASM_BYTES(BYTES_NOP8)
 84 
 85 #ifndef __ASSEMBLY__
 86 extern const unsigned char * const x86_nops[];
 87 #endif
 88 
 89 #endif /* _ASM_X86_NOPS_H */
 90 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php