From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Anderson Date: Mon, 22 Mar 2021 00:56:56 -0400 Subject: [PATCH 1/2] riscv: simply longjmp In-Reply-To: <20210321101947.54746-2-xypron.glpk@gmx.de> References: <20210321101947.54746-1-xypron.glpk@gmx.de> <20210321101947.54746-2-xypron.glpk@gmx.de> Message-ID: <535a1454-ff69-aa97-9e1c-3e0a4926d68a@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 3/21/21 6:19 AM, Heinrich Schuchardt wrote: > The value returned by setjmp must be nonzero. If zero is passed as > parameter it must be replaced by 1. > > This patch reduces the code size a bit. > > Signed-off-by: Heinrich Schuchardt > --- > arch/riscv/lib/setjmp.S | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/arch/riscv/lib/setjmp.S b/arch/riscv/lib/setjmp.S > index 72bc9241f6..99d6195827 100644 > --- a/arch/riscv/lib/setjmp.S > +++ b/arch/riscv/lib/setjmp.S > @@ -54,12 +54,8 @@ ENTRY(longjmp) > LOAD_IDX(sp, 13) > > /* Move the return value in place, but return 1 if passed 0. */ > - beq a1, zero, longjmp_1 > - mv a0, a1 > - ret > - > - longjmp_1: > - li a0, 1 > + seqz a0, a1 > + add a0, a0, a1 > ret > ENDPROC(longjmp) > .popsection > -- > 2.30.2 > Reviewed-by: Sean Anderson