From 5849eacdce81bda09fd61e71f440f15e62c25deb Mon Sep 17 00:00:00 2001 From: zhoumingtao Date: Thu, 7 Jul 2022 15:16:10 +0800 Subject: [PATCH] use jr instead of jirl jirl -> jr --- gnuefi/crt0-efi-loongarch64.S | 9 ++++++--- inc/loongarch64/efibind.h | 2 +- lib/loongarch64/setjmp.S | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gnuefi/crt0-efi-loongarch64.S b/gnuefi/crt0-efi-loongarch64.S index 5790561..af45d46 100644 --- a/gnuefi/crt0-efi-loongarch64.S +++ b/gnuefi/crt0-efi-loongarch64.S @@ -1,5 +1,5 @@ /* - * crt0-efi-loongarch64.S - PE/COFF header for LOONGARCH64 EFI applications + * crt0-efi-loongarch64.S - PE/COFF header for LoongArch64 EFI applications * * Copyright (C) 2021 Loongson Technology Corporation Limited. * Copyright (C) 2014 Linaro Ltd. @@ -17,6 +17,9 @@ * either version 2 of the License, or (at your option) any later version. */ +#ifndef EFI_SUBSYSTEM +#define EFI_SUBSYSTEM 0xa +#endif .section .text.head /* @@ -140,9 +143,9 @@ _start: ld.d $a0, $sp, 8 ld.d $a1, $sp, 16 - bl efi_main + bl efi_main 0: ld.d $ra, $sp, 0 addi.d $sp, $sp, 24 - jirl $ra, $ra, 0 + jr $ra .end _start diff --git a/inc/loongarch64/efibind.h b/inc/loongarch64/efibind.h index 5dc0459..aaf3fb7 100644 --- a/inc/loongarch64/efibind.h +++ b/inc/loongarch64/efibind.h @@ -30,7 +30,7 @@ typedef int int32_t; typedef unsigned short uint16_t; typedef short int16_t; typedef unsigned char uint8_t; -typedef signed char int8_t; // unqualified 'char' is unsigned on ARM +typedef signed char int8_t; typedef uint64_t uintptr_t; typedef int64_t intptr_t; diff --git a/lib/loongarch64/setjmp.S b/lib/loongarch64/setjmp.S index 94955ee..6821af3 100644 --- a/lib/loongarch64/setjmp.S +++ b/lib/loongarch64/setjmp.S @@ -40,7 +40,7 @@ setjmp: st.d $s8, $a0, 0x58 move $a0, $zero - jirl $zero,$ra,0 + jr $ra /* void longjmp(jmp_buf env, int val); @@ -65,4 +65,4 @@ longjmp: beqz $a1, .L0 # if (a1 == 0); goto L0 move $a0, $a1 # a0 = a1 .L0: - jirl $zero,$ra,0 + jr $ra