From d96e7c10df70565b9deec725baadd87a14801d5f Mon Sep 17 00:00:00 2001 From: cinsights Date: Thu, 6 Aug 2020 09:11:54 +0000 Subject: [PATCH] Fix typos in ARM port. Add _exit, _kill and _getpid to syscalls.c git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13803 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/common/ports/ARMCMx/chcore_v7m.c | 2 +- os/common/ports/ARMCMx/chcore_v7m.h | 4 ++-- os/various/syscalls.c | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/os/common/ports/ARMCMx/chcore_v7m.c b/os/common/ports/ARMCMx/chcore_v7m.c index 5b1816c81..77038eb47 100644 --- a/os/common/ports/ARMCMx/chcore_v7m.c +++ b/os/common/ports/ARMCMx/chcore_v7m.c @@ -301,7 +301,7 @@ void port_init(os_instance_t *oip) { /** * @brief Setting up MPU region for the current thread. */ -void _port_set_region(void) { +void __port_set_region(void) { mpuSetRegionAddress(PORT_USE_GUARD_MPU_REGION, chThdGetSelfX()->wabase); diff --git a/os/common/ports/ARMCMx/chcore_v7m.h b/os/common/ports/ARMCMx/chcore_v7m.h index 02995a63f..e5712fac5 100644 --- a/os/common/ports/ARMCMx/chcore_v7m.h +++ b/os/common/ports/ARMCMx/chcore_v7m.h @@ -578,11 +578,11 @@ struct port_context { if ((stkalign_t *)(r13 - 1) < (otp)->wabase) { \ chSysHalt("stack overflow"); \ } \ - __port_switch(ntp, otp); \ + __port_switch(ntp, otp); \ } #else #define port_switch(ntp, otp) { \ - _port_switch(ntp, otp); \ + __port_switch(ntp, otp); \ \ /* Setting up the guard page for the switched-in thread.*/ \ mpuSetRegionAddress(PORT_USE_GUARD_MPU_REGION, \ diff --git a/os/various/syscalls.c b/os/various/syscalls.c index 8da8f755a..b2052e954 100644 --- a/os/various/syscalls.c +++ b/os/various/syscalls.c @@ -169,4 +169,29 @@ int _isatty_r(struct _reent *r, int fd) { return 1; } +/***************************************************************************/ + +__attribute__((used)) +void _exit(int status) { + (void) status; + chSysHalt("exit"); + abort(); +} + +/***************************************************************************/ + +__attribute__((used)) +int _kill(int pid, int sig) { + (void) pid; + (void) sig; + return -1; +} + +/***************************************************************************/ + +__attribute__((used)) +int _getpid(void) { + + return 1; +} /*** EOF ***/