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

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/powerpc/tm/tm-signal.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-or-later */
  2 /*
  3  * Copyright 2015, Cyril Bur, IBM Corp.
  4  */
  5 
  6 #include "basic_asm.h"
  7 #include "gpr_asm.h"
  8 #include "fpu_asm.h"
  9 #include "vmx_asm.h"
 10 #include "vsx_asm.h"
 11 
 12 /*
 13  * Large caveat here being that the caller cannot expect the
 14  * signal to always be sent! The hardware can (AND WILL!) abort
 15  * the transaction between the tbegin and the tsuspend (however
 16  * unlikely it seems or infrequently it actually happens).
 17  * You have been warned.
 18  */
 19 /* long tm_signal_self(pid_t pid, long *gprs, double *fps, vector *vms, vector *vss); */
 20 FUNC_START(tm_signal_self_context_load)
 21         PUSH_BASIC_STACK(512)
 22         /*
 23          * Don't strictly need to save and restore as it depends on if
 24          * we're going to use them, however this reduces messy logic
 25          */
 26         PUSH_VMX(STACK_FRAME_LOCAL(5,0),r8)
 27         PUSH_FPU(512)
 28         PUSH_NVREGS_BELOW_FPU(512)
 29         std r3, STACK_FRAME_PARAM(0)(sp) /* pid */
 30         std r4, STACK_FRAME_PARAM(1)(sp) /* gps */
 31         std r5, STACK_FRAME_PARAM(2)(sp) /* fps */
 32         std r6, STACK_FRAME_PARAM(3)(sp) /* vms */
 33         std r7, STACK_FRAME_PARAM(4)(sp) /* vss */
 34 
 35         ld r3, STACK_FRAME_PARAM(1)(sp)
 36         cmpdi r3, 0
 37         beq skip_gpr_lc
 38         bl load_gpr
 39 skip_gpr_lc:
 40         ld r3, STACK_FRAME_PARAM(2)(sp)
 41         cmpdi   r3, 0
 42         beq     skip_fpu_lc
 43         bl load_fpu
 44 skip_fpu_lc:
 45         ld r3, STACK_FRAME_PARAM(3)(sp)
 46         cmpdi r3, 0
 47         beq     skip_vmx_lc
 48         bl load_vmx
 49 skip_vmx_lc:
 50         ld r3, STACK_FRAME_PARAM(4)(sp)
 51         cmpdi   r3, 0
 52         beq     skip_vsx_lc
 53         bl load_vsx
 54 skip_vsx_lc:
 55         /*
 56          * Set r3 (return value) before tbegin. Use the pid as a known
 57          * 'all good' return value, zero is used to indicate a non-doomed
 58          * transaction.
 59          */
 60         ld      r3, STACK_FRAME_PARAM(0)(sp)
 61         tbegin.
 62         beq     1f
 63         tsuspend. /* Can't enter a syscall transactionally */
 64         ld      r3, STACK_FRAME_PARAM(1)(sp)
 65         cmpdi   r3, 0
 66         beq skip_gpr_lt
 67         /* Get the second half of the array */
 68         addi    r3, r3, 8 * 18
 69         bl load_gpr
 70 skip_gpr_lt:
 71         ld r3, STACK_FRAME_PARAM(2)(sp)
 72         cmpdi   r3, 0
 73         beq     skip_fpu_lt
 74         /* Get the second half of the array */
 75         addi    r3, r3, 8 * 18
 76         bl load_fpu
 77 skip_fpu_lt:
 78         ld r3, STACK_FRAME_PARAM(3)(sp)
 79         cmpdi r3, 0
 80         beq     skip_vmx_lt
 81         /* Get the second half of the array */
 82         addi    r3, r3, 16 * 12
 83         bl load_vmx
 84 skip_vmx_lt:
 85         ld r3, STACK_FRAME_PARAM(4)(sp)
 86         cmpdi   r3, 0
 87         beq     skip_vsx_lt
 88         /* Get the second half of the array */
 89         addi    r3, r3, 16 * 12
 90         bl load_vsx
 91 skip_vsx_lt:
 92         li      r0, 37 /* sys_kill */
 93         ld r3, STACK_FRAME_PARAM(0)(sp) /* pid */
 94         li r4, 10 /* SIGUSR1 */
 95         sc /* Taking the signal will doom the transaction */
 96         tabort. 0
 97         tresume. /* Be super sure we abort */
 98         /*
 99          * This will cause us to resume doomed transaction and cause
100          * hardware to cleanup, we'll end up at 1: anything between
101          * tresume. and 1: shouldn't ever run.
102          */
103         li r3, 0
104         1:
105         POP_VMX(STACK_FRAME_LOCAL(5,0),r4)
106         POP_FPU(512)
107         POP_NVREGS_BELOW_FPU(512)
108         POP_BASIC_STACK(512)
109         blr
110 FUNC_END(tm_signal_self_context_load)

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