diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-09-15 10:55:10 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-09-15 10:55:10 -0600 |
commit | 0f95d236d32cb70cdb1114ef67fc682c42406e3d (patch) | |
tree | d16959711e72f7813bfd8caf07a4fe153a5f4637 | |
parent | e4810b1352b911cad4e2d914e2f0d6d5cb98dc0b (diff) | |
download | nuttx-0f95d236d32cb70cdb1114ef67fc682c42406e3d.tar.gz nuttx-0f95d236d32cb70cdb1114ef67fc682c42406e3d.tar.bz2 nuttx-0f95d236d32cb70cdb1114ef67fc682c42406e3d.zip |
Fix a typo in system call when fetching parameter from the stack: regs[REG_PC]+4 is the address, not regs[REG_PC+4]
-rw-r--r-- | nuttx/arch/arm/src/armv6-m/up_svcall.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/armv7-a/arm_syscall.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/armv7-m/up_svcall.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/armv6-m/up_svcall.c b/nuttx/arch/arm/src/armv6-m/up_svcall.c index ac5e89d7b..1151c480e 100644 --- a/nuttx/arch/arm/src/armv6-m/up_svcall.c +++ b/nuttx/arch/arm/src/armv6-m/up_svcall.c @@ -407,7 +407,7 @@ int up_svcall(int irq, FAR void *context) * parameter will reside at an offset of 4 from the stack pointer. */ - regs[REG_R3] = *(uint32_t*)(regs[REG_SP+4]); + regs[REG_R3] = *(uint32_t*)(regs[REG_SP]+4); } break; #endif diff --git a/nuttx/arch/arm/src/armv7-a/arm_syscall.c b/nuttx/arch/arm/src/armv7-a/arm_syscall.c index 9fb46f388..7be976ae0 100644 --- a/nuttx/arch/arm/src/armv7-a/arm_syscall.c +++ b/nuttx/arch/arm/src/armv7-a/arm_syscall.c @@ -378,7 +378,7 @@ uint32_t *arm_syscall(uint32_t *regs) * parameter will reside at an offset of 4 from the stack pointer. */ - regs[REG_R3] = *(uint32_t*)(regs[REG_SP+4]); + regs[REG_R3] = *(uint32_t*)(regs[REG_SP]+4); } break; #endif diff --git a/nuttx/arch/arm/src/armv7-m/up_svcall.c b/nuttx/arch/arm/src/armv7-m/up_svcall.c index ada12e61a..e0f0e3aea 100644 --- a/nuttx/arch/arm/src/armv7-m/up_svcall.c +++ b/nuttx/arch/arm/src/armv7-m/up_svcall.c @@ -407,7 +407,7 @@ int up_svcall(int irq, FAR void *context) * parameter will reside at an offset of 4 from the stack pointer. */ - regs[REG_R3] = *(uint32_t*)(regs[REG_SP+4]); + regs[REG_R3] = *(uint32_t*)(regs[REG_SP]+4); } break; #endif |