mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-03 12:53:52 -04:00
Update system call entry mechanism (#898)
Earlier the System Call entry from an unprivileged task looked like: 1. SVC for entering system call. 2. System call implementation. 3. SVC for exiting system call. Now, the system call entry needs to make only one SVC call and everything else is handled internally. This PR also makes the following changes: 1. Update the Access Control List (ACL) mechanism to grant access to all the kernel objects before the scheduler is started. 2. Add one struct param for system calls with 5 parameters. This removes the need for special handling for system calls with 5 parameters. 3. Remove raise privilege SVC when MPU wrapper v2 is used. 4. Add additional run time parameter checks to MPU wrappers for xTaskGenericNotify and xQueueTakeMutexRecursive APIs.
This commit is contained in:
parent
4ff01a7a4a
commit
76be28cdc6
114 changed files with 7521 additions and 16320 deletions
|
@ -32,6 +32,7 @@ To avoid errors place any such code inside a #ifdef __ICCARM__/#endif block so
|
|||
the code is included in C files but excluded by the preprocessor in assembly
|
||||
files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler. */
|
||||
#include <FreeRTOSConfig.h>
|
||||
#include <mpu_syscall_numbers.h>
|
||||
|
||||
RSEG CODE:CODE(2)
|
||||
thumb
|
||||
|
@ -40,7 +41,6 @@ files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler.
|
|||
EXTERN vTaskSwitchContext
|
||||
EXTERN vPortSVCHandler_C
|
||||
EXTERN vSystemCallEnter
|
||||
EXTERN vSystemCallEnter_1
|
||||
EXTERN vSystemCallExit
|
||||
|
||||
PUBLIC xPortPendSVHandler
|
||||
|
@ -64,9 +64,8 @@ files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler.
|
|||
#endif
|
||||
|
||||
/* These must be in sync with portmacro.h. */
|
||||
#define portSVC_SYSTEM_CALL_ENTER 3
|
||||
#define portSVC_SYSTEM_CALL_ENTER_1 4
|
||||
#define portSVC_SYSTEM_CALL_EXIT 5
|
||||
#define portSVC_START_SCHEDULER 100
|
||||
#define portSVC_SYSTEM_CALL_EXIT 103
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
xPortPendSVHandler:
|
||||
|
@ -170,10 +169,8 @@ vPortSVCHandler:
|
|||
|
||||
ldr r1, [r0, #24]
|
||||
ldrb r2, [r1, #-2]
|
||||
cmp r2, #portSVC_SYSTEM_CALL_ENTER
|
||||
beq syscall_enter
|
||||
cmp r2, #portSVC_SYSTEM_CALL_ENTER_1
|
||||
beq syscall_enter_1
|
||||
cmp r2, #NUM_SYSTEM_CALLS
|
||||
blt syscall_enter
|
||||
cmp r2, #portSVC_SYSTEM_CALL_EXIT
|
||||
beq syscall_exit
|
||||
b vPortSVCHandler_C
|
||||
|
@ -182,10 +179,6 @@ vPortSVCHandler:
|
|||
mov r1, lr
|
||||
b vSystemCallEnter
|
||||
|
||||
syscall_enter_1:
|
||||
mov r1, lr
|
||||
b vSystemCallEnter_1
|
||||
|
||||
syscall_exit:
|
||||
mov r1, lr
|
||||
b vSystemCallExit
|
||||
|
@ -224,7 +217,7 @@ vPortStartFirstTask:
|
|||
cpsie f
|
||||
dsb
|
||||
isb
|
||||
svc 0
|
||||
svc #portSVC_START_SCHEDULER
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue