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

TOMOYO Linux Cross Reference
Linux/tools/perf/arch/x86/tests/regs_load.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #include <linux/linkage.h>
  3 
  4 #define AX       0
  5 #define BX       1 * 8
  6 #define CX       2 * 8
  7 #define DX       3 * 8
  8 #define SI       4 * 8
  9 #define DI       5 * 8
 10 #define BP       6 * 8
 11 #define SP       7 * 8
 12 #define IP       8 * 8
 13 #define FLAGS    9 * 8
 14 #define CS      10 * 8
 15 #define SS      11 * 8
 16 #define DS      12 * 8
 17 #define ES      13 * 8
 18 #define FS      14 * 8
 19 #define GS      15 * 8
 20 #define R8      16 * 8
 21 #define R9      17 * 8
 22 #define R10     18 * 8
 23 #define R11     19 * 8
 24 #define R12     20 * 8
 25 #define R13     21 * 8
 26 #define R14     22 * 8
 27 #define R15     23 * 8
 28 
 29 .text
 30 #ifdef HAVE_ARCH_X86_64_SUPPORT
 31 SYM_FUNC_START(perf_regs_load)
 32         movq %rax, AX(%rdi)
 33         movq %rbx, BX(%rdi)
 34         movq %rcx, CX(%rdi)
 35         movq %rdx, DX(%rdi)
 36         movq %rsi, SI(%rdi)
 37         movq %rdi, DI(%rdi)
 38         movq %rbp, BP(%rdi)
 39 
 40         leaq 8(%rsp), %rax /* exclude this call.  */
 41         movq %rax, SP(%rdi)
 42 
 43         movq 0(%rsp), %rax
 44         movq %rax, IP(%rdi)
 45 
 46         movq $0, FLAGS(%rdi)
 47         movq $0, CS(%rdi)
 48         movq $0, SS(%rdi)
 49         movq $0, DS(%rdi)
 50         movq $0, ES(%rdi)
 51         movq $0, FS(%rdi)
 52         movq $0, GS(%rdi)
 53 
 54         movq %r8,  R8(%rdi)
 55         movq %r9,  R9(%rdi)
 56         movq %r10, R10(%rdi)
 57         movq %r11, R11(%rdi)
 58         movq %r12, R12(%rdi)
 59         movq %r13, R13(%rdi)
 60         movq %r14, R14(%rdi)
 61         movq %r15, R15(%rdi)
 62         ret
 63 SYM_FUNC_END(perf_regs_load)
 64 #else
 65 SYM_FUNC_START(perf_regs_load)
 66         push %edi
 67         movl 8(%esp), %edi
 68         movl %eax, AX(%edi)
 69         movl %ebx, BX(%edi)
 70         movl %ecx, CX(%edi)
 71         movl %edx, DX(%edi)
 72         movl %esi, SI(%edi)
 73         pop %eax
 74         movl %eax, DI(%edi)
 75         movl %ebp, BP(%edi)
 76 
 77         leal 4(%esp), %eax /* exclude this call.  */
 78         movl %eax, SP(%edi)
 79 
 80         movl 0(%esp), %eax
 81         movl %eax, IP(%edi)
 82 
 83         movl $0, FLAGS(%edi)
 84         movl $0, CS(%edi)
 85         movl $0, SS(%edi)
 86         movl $0, DS(%edi)
 87         movl $0, ES(%edi)
 88         movl $0, FS(%edi)
 89         movl $0, GS(%edi)
 90         ret
 91 SYM_FUNC_END(perf_regs_load)
 92 #endif
 93 
 94 /*
 95  * We need to provide note.GNU-stack section, saying that we want
 96  * NOT executable stack. Otherwise the final linking will assume that
 97  * the ELF stack should not be restricted at all and set it RWX.
 98  */
 99 .section .note.GNU-stack,"",@progbits

~ [ 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