use jr instead of jirl

jirl -> jr
This commit is contained in:
zhoumingtao 2022-07-07 15:16:10 +08:00
parent e7db4418b1
commit 5849eacdce
3 changed files with 9 additions and 6 deletions

View File

@ -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. <zhoumingtao@loongson.cn> * Copyright (C) 2021 Loongson Technology Corporation Limited. <zhoumingtao@loongson.cn>
* Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org> * Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
@ -17,6 +17,9 @@
* either version 2 of the License, or (at your option) any later version. * either version 2 of the License, or (at your option) any later version.
*/ */
#ifndef EFI_SUBSYSTEM
#define EFI_SUBSYSTEM 0xa
#endif
.section .text.head .section .text.head
/* /*
@ -144,5 +147,5 @@ _start:
0: ld.d $ra, $sp, 0 0: ld.d $ra, $sp, 0
addi.d $sp, $sp, 24 addi.d $sp, $sp, 24
jirl $ra, $ra, 0 jr $ra
.end _start .end _start

View File

@ -30,7 +30,7 @@ typedef int int32_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef short int16_t; typedef short int16_t;
typedef unsigned char uint8_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 uint64_t uintptr_t;
typedef int64_t intptr_t; typedef int64_t intptr_t;

View File

@ -40,7 +40,7 @@ setjmp:
st.d $s8, $a0, 0x58 st.d $s8, $a0, 0x58
move $a0, $zero move $a0, $zero
jirl $zero,$ra,0 jr $ra
/* /*
void longjmp(jmp_buf env, int val); void longjmp(jmp_buf env, int val);
@ -65,4 +65,4 @@ longjmp:
beqz $a1, .L0 # if (a1 == 0); goto L0 beqz $a1, .L0 # if (a1 == 0); goto L0
move $a0, $a1 # a0 = a1 move $a0, $a1 # a0 = a1
.L0: .L0:
jirl $zero,$ra,0 jr $ra