From 335ba2165729bf3f737d79f15ad5877c15e95b64 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 16 Mar 2021 22:26:18 +0800 Subject: [PATCH] arch/arm: Fix syscall number out of swi range in thumb mode The immediate number is 8bits in thumb mode: +---------------------+---------------+ |15 14 13 12 11 10 9 8|7 6 5 4 3 2 1 0| +---------------------+---------------+ | 1 1 0 1 1 1 1 1| imm8 | +---------------------+---------------+ The immediate number is 24bits in arm mode: +-----------+-------------------------------------------------------------------------+ |31 30 29 28|27 26 25 24|23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0| +-----------+-----------+-------------------------------------------------------------+ | cond | 1 1 1 1| imm24 | +-----------+-----------+-------------------------------------------------------------+ Signed-off-by: Xiang Xiao Change-Id: I62503cdc377fcee81864e88e981d389bce2e1b45 --- arch/arm/include/arm/syscall.h | 2 +- arch/arm/include/armv7-a/syscall.h | 2 +- arch/arm/include/armv7-r/syscall.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/arm/syscall.h b/arch/arm/include/arm/syscall.h index 3341062abb..151a894098 100644 --- a/arch/arm/include/arm/syscall.h +++ b/arch/arm/include/arm/syscall.h @@ -54,7 +54,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define SYS_syscall 0x900001 +#define SYS_syscall 0x00 #if defined(__thumb__) || defined(__thumb2__) # define SYS_smhcall 0xab diff --git a/arch/arm/include/armv7-a/syscall.h b/arch/arm/include/armv7-a/syscall.h index 20be865c2e..627355d52a 100644 --- a/arch/arm/include/armv7-a/syscall.h +++ b/arch/arm/include/armv7-a/syscall.h @@ -54,7 +54,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define SYS_syscall 0x900001 +#define SYS_syscall 0x00 #if defined(__thumb__) || defined(__thumb2__) # define SYS_smhcall 0xab diff --git a/arch/arm/include/armv7-r/syscall.h b/arch/arm/include/armv7-r/syscall.h index f66cfbf53e..a284faf3f1 100644 --- a/arch/arm/include/armv7-r/syscall.h +++ b/arch/arm/include/armv7-r/syscall.h @@ -54,7 +54,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define SYS_syscall 0x900001 +#define SYS_syscall 0x00 #if defined(__thumb__) || defined(__thumb2__) # define SYS_smhcall 0xab