FreeRTOS-Kernel/portable
kar-rahul-aws 97050a17aa
Memory Protection Unit (MPU) Enhancements (#705)
Memory Protection Unit (MPU) Enhancements

This commit introduces a new MPU wrapper that places additional
restrictions on unprivileged tasks. The following is the list of changes
introduced with the new MPU wrapper:

1. Opaque and indirectly verifiable integers for kernel object handles:
   All the kernel object handles (for example, queue handles) are now
   opaque integers. Previously object handles were raw pointers.

2. Saving the task context in Task Control Block (TCB): When a task is
   swapped out by the scheduler, the task's context is now saved in its
   TCB. Previously the task's context was saved on its stack.

3. Execute system calls on a separate privileged only stack: FreeRTOS
   system calls, which execute with elevated privilege, now use a
   separate privileged only stack. Previously system calls used the
   calling task's stack. The application writer can control the size of
   the system call stack using new configSYSTEM_CALL_STACK_SIZE config
   macro.

4. Memory bounds checks: FreeRTOS system calls which accept a pointer
   and de-reference it, now verify that the calling task has required
   permissions to access the memory location referenced by the pointer.

5. System call restrictions: The following system calls are no longer
   available to unprivileged tasks:
    - vQueueDelete
    - xQueueCreateMutex
    - xQueueCreateMutexStatic
    - xQueueCreateCountingSemaphore
    - xQueueCreateCountingSemaphoreStatic
    - xQueueGenericCreate
    - xQueueGenericCreateStatic
    - xQueueCreateSet
    - xQueueRemoveFromSet
    - xQueueGenericReset
    - xTaskCreate
    - xTaskCreateStatic
    - vTaskDelete
    - vTaskPrioritySet
    - vTaskSuspendAll
    - xTaskResumeAll
    - xTaskGetHandle
    - xTaskCallApplicationTaskHook
    - vTaskList
    - vTaskGetRunTimeStats
    - xTaskCatchUpTicks
    - xEventGroupCreate
    - xEventGroupCreateStatic
    - vEventGroupDelete
    - xStreamBufferGenericCreate
    - xStreamBufferGenericCreateStatic
    - vStreamBufferDelete
    - xStreamBufferReset
   Also, an unprivileged task can no longer use vTaskSuspend to suspend
   any task other than itself.

We thank the following people for their inputs in these enhancements:
- David Reiss of Meta Platforms, Inc.
- Lan Luo, Xinhui Shao, Yumeng Wei, Zixia Liu, Huaiyu Yan and Zhen Ling
  of School of Computer Science and Engineering, Southeast University,
  China.
- Xinwen Fu of Department of Computer Science, University of
  Massachusetts Lowell, USA.
- Yuequi Chen, Zicheng Wang, Minghao Lin of University of Colorado
  Boulder, USA.
2023-07-13 16:51:04 +05:30
..
ARMClang Normalize line endings and whitespace in source files 2022-11-29 15:38:47 -08:00
ARMv8M Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
BCC/16BitDOS Added support of 64bit events. (#597) 2023-02-03 07:34:02 -07:00
CCS Fix typo in check comment of configMAX_SYSCALL_INTERRUPT_PRIORITY (#690) 2023-06-21 15:05:18 +05:30
CodeWarrior tree-wide: Unify formatting of __cplusplus ifdefs 2023-04-25 11:32:08 -07:00
Common Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
GCC Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
IAR Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
Keil Normalize line endings and whitespace in source files 2022-11-29 15:38:47 -08:00
MemMang Only add alignment padding when needed (#650) 2023-03-28 17:01:37 +05:30
MikroC/ARM_CM4F Fix typo in check comment of configMAX_SYSCALL_INTERRUPT_PRIORITY (#690) 2023-06-21 15:05:18 +05:30
MPLAB tree-wide: Unify formatting of __cplusplus ifdefs 2023-04-25 11:32:08 -07:00
MSVC-MingW Do not call exit() on MSVC Port when calling vPortEndScheduler (#624) 2023-02-15 11:40:32 +05:30
oWatcom/16BitDOS tree-wide: Unify formatting of __cplusplus ifdefs 2023-04-25 11:32:08 -07:00
Paradigm/Tern_EE tree-wide: Unify formatting of __cplusplus ifdefs 2023-04-25 11:32:08 -07:00
Renesas tree-wide: Unify formatting of __cplusplus ifdefs 2023-04-25 11:32:08 -07:00
Rowley Added support of 64bit events. (#597) 2023-02-03 07:34:02 -07:00
RVDS Memory Protection Unit (MPU) Enhancements (#705) 2023-07-13 16:51:04 +05:30
SDCC/Cygnal Added support of 64bit events. (#597) 2023-02-03 07:34:02 -07:00
Softune Added support of 64bit events. (#597) 2023-02-03 07:34:02 -07:00
Tasking/ARM_CM4F tree-wide: Unify formatting of __cplusplus ifdefs 2023-04-25 11:32:08 -07:00
ThirdParty Fix #697: Missing portPOINTER_SIZE_TYPE definition for ATmega port (#698) 2023-06-29 11:18:51 -07:00
WizC/PIC18 Add constant type for portMAX_DELAY in port (#691) 2023-06-26 10:49:59 +08:00
CMakeLists.txt Fix circular dependency in CMake project (#700) 2023-07-10 15:08:59 -07:00
readme.txt Normalize line endings and whitespace in source files 2022-11-29 15:38:47 -08:00

Each real time kernel port consists of three files that contain the core kernel
components and are common to every port, and one or more files that are
specific to a particular microcontroller and/or compiler.


+ The FreeRTOS/Source/Portable/MemMang directory contains the five sample
memory allocators as described on the https://www.FreeRTOS.org WEB site.

+ The other directories each contain files specific to a particular
microcontroller or compiler, where the directory name denotes the compiler
specific files the directory contains.



For example, if you are interested in the [compiler] port for the [architecture]
microcontroller, then the port specific files are contained in
FreeRTOS/Source/Portable/[compiler]/[architecture] directory.  If this is the
only port you are interested in then all the other directories can be
ignored.