This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
FreeRTOS-Kernel/portable
RichardBarry bac101c988
Fix/clear MIE bit in initial RISC-V mstatus register. (#57)
* fix: CLEAR MIE BIT IN INITIAL RISC-V MSTATUS VALUE
The MIE bit in the RISC-V MSTATUS register is used to globally enable
or disable interrupts.  It is copied into the MPIE bit and cleared
on entry to an interrupt, and then copied back from the MPIE bit on
exit from an interrupt.

When a task is created it is given an initial MSTATUS value that is
derived from the current MSTATUS value with the MPIE bit force to 1,
but the MIE bit is not forced into any state.  This change forces
the MIE bit to 0 (interrupts disabled).

Why:
If a task is created before the scheduler is started the MIE bit
will happen to be 0 (interrupts disabled), which is fine.  If a
task is created after the scheduler has been started the MIE bit
is set (interrupts enabled), causing interrupts to unintentionally
become enabled inside the interrupt in which the task is first
moved to the running state - effectively breaking a critical
section which in turn could cause a crash if enabling interrupts
causes interrupts to nest.  It is only an issue when starting a
newly created task that was created after the scheduler was started.

Related Issues:
https://forums.freertos.org/t/risc-v-port-pxportinitialisestack-issue-about-mstatus-value-onto-the-stack/9622
Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
2020-05-01 22:35:42 -07:00
..
ARMClang Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -08:00
ARMv8M Add "Tickless Idle" support for ARMv8M ports (#29) 2020-03-16 10:50:49 -07:00
BCC/16BitDOS version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
CCS version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
CodeWarrior version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
Common version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
GCC Fix/clear MIE bit in initial RISC-V mstatus register. (#57) 2020-05-01 22:35:42 -07:00
IAR Fix/clear MIE bit in initial RISC-V mstatus register. (#57) 2020-05-01 22:35:42 -07:00
Keil Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -08:00
MemMang Fix Coverity warnings: In most cases the return value of xTaskResumeAll() is cast to void when it is not needed. This PR fixes a couple of instances in the heap_n.c implementations where that was not the case. 2020-03-16 10:20:25 -07:00
MikroC/ARM_CM4F version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
MPLAB version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
MSVC-MingW The Windows port layer is built with both MSVC and GCC. GCC generated a warning relating to the variable lWaitForYield being set but not used. This change removes the variable. 2020-03-15 20:24:18 -07:00
oWatcom/16BitDOS version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
Paradigm/Tern_EE version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
Renesas version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
Rowley version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
RVDS Enable ARMv7-M MPU ports to place FreeRTOS kernel code outside of flash (#46) 2020-04-06 15:51:40 -07:00
SDCC/Cygnal version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
Softune version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
Tasking/ARM_CM4F version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
ThirdParty Fix Linux port Valgrind errors (#56) 2020-04-28 14:42:34 -07:00
WizC/PIC18 version bump to v10.3.1 (#16) 2020-02-18 22:03:54 -08:00
readme.txt Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -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 http://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.