Browse Source

use jr instead of jirl

jirl -> jr
zhoumingtao 2 years ago
parent
commit
5849eacdce
3 changed files with 9 additions and 6 deletions
  1. 6 3
      gnuefi/crt0-efi-loongarch64.S
  2. 1 1
      inc/loongarch64/efibind.h
  3. 2 2
      lib/loongarch64/setjmp.S

+ 6 - 3
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. <zhoumingtao@loongson.cn>
  * 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.
  */
 
+#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

+ 1 - 1
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;
 

+ 2 - 2
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