Small changes.

git-svn-id: https://svn.code.sf.net/p/chibios/svn2/trunk@11573 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
isiora 2018-02-27 00:13:30 +00:00
parent 043860de59
commit 98f9558822
3 changed files with 12 additions and 12 deletions

View File

@ -59,10 +59,10 @@ static smc_service_t *discovery_entry = NULL;
static bool isAddrSpaceValid(uint8_t *addr, size_t size)
{
return (bool)((addr - NSEC_MEMORY_START) <
(NSEC_MEMORY_END - NSEC_MEMORY_START)) &&
(bool)((addr + size - NSEC_MEMORY_START) <
(NSEC_MEMORY_END - NSEC_MEMORY_START));
return (bool)((addr - NSEC_IMAGE_START_ADDR) <
(NSEC_MEMORY_END - NSEC_IMAGE_START_ADDR)) &&
(bool)((addr + size - NSEC_IMAGE_START_ADDR) <
(NSEC_MEMORY_END - NSEC_IMAGE_START_ADDR));
}
static bool isHndlValid(smc_service_t *handle)
@ -160,7 +160,7 @@ void smcInit(void) {
* @retval MSG_RESET if the service is unavailable.
* @retval MSG_TIMEOUT call interrupted.
*
* @notapi
* @api
*/
msg_t smcEntry(smc_service_t *svc_handle, smc_params_area_t svc_data, size_t svc_datalen) {
smc_service_t *svcp = NULL;
@ -206,7 +206,7 @@ msg_t smcEntry(smc_service_t *svc_handle, smc_params_area_t svc_data, size_t svc
* @return a registered smc service object.
* @retval NULL if @p svc_name failed to be registered.
*
* @notapi
* @api
*/
smc_service_t *smcRegisterMeAsService(const char *svc_name)
{
@ -236,7 +236,7 @@ smc_service_t *smcRegisterMeAsService(const char *svc_name)
* @return the reason of the awakening
* @retval MSG_OK a success value.
*
* @notapi
* @api
*/
msg_t smcServiceWaitRequest(smc_service_t *svcp, msg_t msg)
{

View File

@ -55,7 +55,7 @@
* Non secure memory address space
* (to be redefined in an other place. Makefile?)
*/
#define NSEC_MEMORY_START ((uint8_t *)0x20000000)
#define NSEC_IMAGE_START_ADDR ((uint8_t *)0x20000000)
#define NSEC_MEMORY_END ((uint8_t *)0x20100000)
/*

View File

@ -79,7 +79,7 @@
* Helper macros
*/
/*
* Store out of context registers in a world area pointed by rm
* Store banked registers in a world area pointed by rm
*/
.macro sm_store_ooctx_regs rm
// cps #MODE_SYS // Assume mode SYS
@ -101,7 +101,7 @@
stm \rm!, {r12, sp, lr}
.endm
/*
* Retrieve out of context registers from a world area pointed by rm
* Retrieve banked registers from a world area pointed by rm
*/
.macro sm_load_ooctx_regs rm
// cps #MODE_SYS // Assume mode SYS
@ -214,7 +214,7 @@ sm_fiq:
cpsie f, #MODE_SYS // FIQ enabled, served via base table
cpsid f, #MODE_SYS // the handler returns here.
cpsid f, #MODE_SYS // the handler returns here, FIQ disabled.
ldr r0, =sm_secctx
sm_store_ooctx_regs r0
@ -236,7 +236,7 @@ sm_fiq:
* the return address+4 is in lr_mon.
* Because we are running in secure state, we are sure that
* the main thread is suspended in the smc handler.
* The main thread is then resumed with MSG_TIMEOUT
* The main thread is then resumed with SMC_SVC_INTR
* The non secure world has then the responsibility to return into
* secure state via a smc.
*