18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright 2015, Cyril Bur, IBM Corp. 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#include "basic_asm.h" 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci/* long signal_self(pid_t pid, int sig); */ 98c2ecf20Sopenharmony_ciFUNC_START(signal_self) 108c2ecf20Sopenharmony_ci li r0,37 /* sys_kill */ 118c2ecf20Sopenharmony_ci /* r3 already has our pid in it */ 128c2ecf20Sopenharmony_ci /* r4 already has signal type in it */ 138c2ecf20Sopenharmony_ci sc 148c2ecf20Sopenharmony_ci bc 4,3,1f 158c2ecf20Sopenharmony_ci subfze r3,r3 168c2ecf20Sopenharmony_ci1: blr 178c2ecf20Sopenharmony_ciFUNC_END(signal_self) 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci/* long tm_signal_self(pid_t pid, int sig, int *ret); */ 208c2ecf20Sopenharmony_ciFUNC_START(tm_signal_self) 218c2ecf20Sopenharmony_ci PUSH_BASIC_STACK(8) 228c2ecf20Sopenharmony_ci std r5,STACK_FRAME_PARAM(0)(sp) /* ret */ 238c2ecf20Sopenharmony_ci tbegin. 248c2ecf20Sopenharmony_ci beq 1f 258c2ecf20Sopenharmony_ci tsuspend. 268c2ecf20Sopenharmony_ci li r0,37 /* sys_kill */ 278c2ecf20Sopenharmony_ci /* r3 already has our pid in it */ 288c2ecf20Sopenharmony_ci /* r4 already has signal type in it */ 298c2ecf20Sopenharmony_ci sc 308c2ecf20Sopenharmony_ci ld r5,STACK_FRAME_PARAM(0)(sp) /* ret */ 318c2ecf20Sopenharmony_ci bc 4,3,2f 328c2ecf20Sopenharmony_ci subfze r3,r3 338c2ecf20Sopenharmony_ci2: std r3,0(r5) 348c2ecf20Sopenharmony_ci tabort. 0 358c2ecf20Sopenharmony_ci tresume. /* Be nice to some cleanup, jumps back to tbegin then to 1: */ 368c2ecf20Sopenharmony_ci /* 378c2ecf20Sopenharmony_ci * Transaction should be proper doomed and we should never get 388c2ecf20Sopenharmony_ci * here 398c2ecf20Sopenharmony_ci */ 408c2ecf20Sopenharmony_ci li r3,1 418c2ecf20Sopenharmony_ci POP_BASIC_STACK(8) 428c2ecf20Sopenharmony_ci blr 438c2ecf20Sopenharmony_ci1: li r3,0 448c2ecf20Sopenharmony_ci POP_BASIC_STACK(8) 458c2ecf20Sopenharmony_ci blr 468c2ecf20Sopenharmony_ciFUNC_END(tm_signal_self) 47