From 3c64d87329399f9f7434163e8dab14e905d48824 Mon Sep 17 00:00:00 2001 From: schulz Date: Wed, 30 Jan 2019 20:01:01 +0000 Subject: [PATCH] ARM instructions are always LE, even in big endian mode. Remember that when fetching syscall number git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@55612 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/arm-native/kernel/syscall.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm-native/kernel/syscall.c b/arch/arm-native/kernel/syscall.c index 3297c478c9..629af8a16c 100644 --- a/arch/arm-native/kernel/syscall.c +++ b/arch/arm-native/kernel/syscall.c @@ -94,11 +94,14 @@ void handle_syscall(void *regs) program counter, subtract the instruction from it and obtain the value from there. we also use this to check if we have been called from outwith the kernel's code (illegal!) + + Keep in mind ARM instructions are *always* little endian, remmeber + it when extracting SWI number... */ addr = ((uint32_t *)regs)[15]; addr -= 4; - swi_no = *((unsigned int *)addr) & 0x00ffffff; + swi_no = AROS_LE2LONG(*((unsigned int *)addr)) & 0x00ffffff; D(bug("[Kernel] ## SWI %d @ 0x%p\n", swi_no, addr)); @@ -110,7 +113,7 @@ void handle_syscall(void *regs) if (swi_no <= 0x0b || swi_no == 0x100) { DREGS(cpu_DumpRegs(regs)); - + switch (swi_no) { case SC_CLI: -- 2.11.4.GIT