arch: arm: update function documentation for __svc

Fixing the documentation for ARM core __svc function, which was
outdated and present only for the ARMv7-M version.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2019-02-11 11:07:58 +01:00 committed by Kumar Gala
commit 533cfa18fa
2 changed files with 17 additions and 4 deletions

View file

@ -36,7 +36,7 @@ extern const int _k_neg_eagain;
* Given that __swap() is called to effect a cooperative context switch, * Given that __swap() is called to effect a cooperative context switch,
* only the caller-saved integer registers need to be saved in the thread of the * only the caller-saved integer registers need to be saved in the thread of the
* outgoing thread. This is all performed by the hardware, which stores it in * outgoing thread. This is all performed by the hardware, which stores it in
* its exception stack frame, created when handling the svc exception. * its exception stack frame, created when handling the __pendsv exception.
* *
* On ARMv6-M, the intlock key is represented by the PRIMASK register, * On ARMv6-M, the intlock key is represented by the PRIMASK register,
* as BASEPRI is not available. * as BASEPRI is not available.

View file

@ -258,6 +258,17 @@ _thread_irq_disabled:
bx lr bx lr
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) #if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
/**
*
* @brief Service call handler
*
* The service call (svc) is used in the following occasions:
* - IRQ offloading
* - Kernel run-time exceptions
*
* @return N/A
*/
SECTION_FUNC(TEXT, __svc) SECTION_FUNC(TEXT, __svc)
/* Use EXC_RETURN state to find out if stack frame is on the /* Use EXC_RETURN state to find out if stack frame is on the
* MSP or PSP * MSP or PSP
@ -305,16 +316,18 @@ _oops:
pop {r0, pc} pop {r0, pc}
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) #elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
/** /**
* *
* @brief Service call handler * @brief Service call handler
* *
* The service call (svc) is only used in __swap() to enter handler mode so we * The service call (svc) is used in the following occasions:
* can go through the PendSV exception to perform a context switch. * - IRQ offloading
* - Kernel run-time exceptions
* - System Calls (User mode)
* *
* @return N/A * @return N/A
*/ */
SECTION_FUNC(TEXT, __svc) SECTION_FUNC(TEXT, __svc)
tst lr, #0x4 /* did we come from thread mode ? */ tst lr, #0x4 /* did we come from thread mode ? */
ite eq /* if zero (equal), came from handler mode */ ite eq /* if zero (equal), came from handler mode */