Skip to content

Commit

Permalink
Merge branch 'main' into feature/smp_granular_locks_v4
Browse files Browse the repository at this point in the history
  • Loading branch information
ActoryOu authored Nov 2, 2024
2 parents 8fe9539 + 7d76dce commit cd06778
Show file tree
Hide file tree
Showing 193 changed files with 2,733 additions and 378 deletions.
5 changes: 5 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ MAINRDY
MAIR
Mang
Mbits
mbranch
mcause
MCFR
MCKA
Expand Down Expand Up @@ -586,6 +587,8 @@ OWATCOM
OWDR
OWER
OWSR
pacbti
PACBTI
PAGEN
PCDR
PCER
Expand Down Expand Up @@ -900,6 +903,7 @@ TXTEN
TXUBR
TXVC
TXVDIS
UBTI
UDCP
UNACKED
uncrustify
Expand All @@ -915,6 +919,7 @@ UNSUB
UNSUBACK
unsubscriptions
unsuspended
UPAC
URAD
URAT
URSTEN
Expand Down
99 changes: 91 additions & 8 deletions .github/scripts/kernel_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# */

import os
import re
from common.header_checker import HeaderChecker

#--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -106,6 +107,15 @@
r'.*portable/GCC/AVR32_UC3/.*',
]

KERNEL_ARM_COLLAB_FILES_PATTERNS = [
r'.*portable/ARMv8M/*',
r'.*portable/.*/ARM_CM23*',
r'.*portable/.*/ARM_CM33*',
r'.*portable/.*/ARM_CM35*',
r'.*portable/.*/ARM_CM55*',
r'.*portable/.*/ARM_CM85*',
]

KERNEL_HEADER = [
'/*\n',
' * FreeRTOS Kernel <DEVELOPMENT BRANCH>\n',
Expand Down Expand Up @@ -139,19 +149,92 @@

FREERTOS_COPYRIGHT_REGEX = r"^(;|#)?( *(\/\*|\*|#|\/\/))? Copyright \(C\) 20\d\d Amazon.com, Inc. or its affiliates. All Rights Reserved\.( \*\/)?$"

FREERTOS_ARM_COLLAB_COPYRIGHT_REGEX = r"(^(;|#)?( *(\/\*|\*|#|\/\/))? Copyright \(C\) 20\d\d Amazon.com, Inc. or its affiliates. All Rights Reserved\.( \*\/)?$)|" + \
r"(^(;|#)?( *(\/\*|\*|#|\/\/))? Copyright 20\d\d Arm Limited and/or its affiliates( \*\/)?$)|" + \
r"(^(;|#)?( *(\/\*|\*|#|\/\/))? <open-source-office@arm.com>( \*\/)?$)"


class KernelHeaderChecker(HeaderChecker):
def __init__(
self,
header,
padding=1000,
ignored_files=None,
ignored_ext=None,
ignored_patterns=None,
py_ext=None,
asm_ext=None,
third_party_patterns=None,
copyright_regex = None
):
super().__init__(header, padding, ignored_files, ignored_ext, ignored_patterns,
py_ext, asm_ext, third_party_patterns, copyright_regex)

self.armCollabRegex = re.compile(FREERTOS_ARM_COLLAB_COPYRIGHT_REGEX)

self.armCollabFilesPatternList = []
for pattern in KERNEL_ARM_COLLAB_FILES_PATTERNS:
self.armCollabFilesPatternList.append(re.compile(pattern))

def isArmCollabFile(self, path):
for pattern in self.armCollabFilesPatternList:
if pattern.match(path):
return True
return False

def checkArmCollabFile(self, path):
isValid = False
file_ext = os.path.splitext(path)[-1]

with open(path, encoding="utf-8", errors="ignore") as file:
chunk = file.read(len("".join(self.header)) + self.padding)
lines = [("%s\n" % line) for line in chunk.strip().splitlines()][
: len(self.header) + 2
]
if (len(lines) > 0) and (lines[0].find("#!") == 0):
lines.remove(lines[0])

# Split lines in sections.
headers = dict()
headers["text"] = []
headers["copyright"] = []
headers["spdx"] = []
for line in lines:
if self.armCollabRegex.match(line):
headers["copyright"].append(line)
elif "SPDX-License-Identifier:" in line:
headers["spdx"].append(line)
else:
headers["text"].append(line)

text_equal = self.isValidHeaderSection(file_ext, "text", headers["text"])
spdx_equal = self.isValidHeaderSection(file_ext, "spdx", headers["spdx"])

if text_equal and spdx_equal and len(headers["copyright"]) == 3:
isValid = True

return isValid

def customCheck(self, path):
isValid = False
if self.isArmCollabFile(path):
isValid = self.checkArmCollabFile(path)
return isValid


def main():
parser = HeaderChecker.configArgParser()
args = parser.parse_args()

# Configure the checks then run
checker = HeaderChecker(KERNEL_HEADER,
copyright_regex=FREERTOS_COPYRIGHT_REGEX,
ignored_files=KERNEL_IGNORED_FILES,
ignored_ext=KERNEL_IGNORED_EXTENSIONS,
ignored_patterns=KERNEL_IGNORED_PATTERNS,
third_party_patterns=KERNEL_THIRD_PARTY_PATTERNS,
py_ext=KERNEL_PY_EXTENSIONS,
asm_ext=KERNEL_ASM_EXTENSIONS)
checker = KernelHeaderChecker(KERNEL_HEADER,
copyright_regex=FREERTOS_COPYRIGHT_REGEX,
ignored_files=KERNEL_IGNORED_FILES,
ignored_ext=KERNEL_IGNORED_EXTENSIONS,
ignored_patterns=KERNEL_IGNORED_PATTERNS,
third_party_patterns=KERNEL_THIRD_PARTY_PATTERNS,
py_ext=KERNEL_PY_EXTENSIONS,
asm_ext=KERNEL_ASM_EXTENSIONS)
checker.ignoreFile(os.path.split(__file__)[-1])

rc = checker.processArgs(args)
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,18 @@ if(NOT FREERTOS_PORT)
" IAR_ARM_CM33_NONSECURE - Compiler: IAR Target: ARM Cortex-M33 non-secure\n"
" IAR_ARM_CM33_SECURE - Compiler: IAR Target: ARM Cortex-M33 secure\n"
" IAR_ARM_CM33_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M33 non-trustzone non-secure\n"
" IAR_ARM_CM33_TFM - Compiler: IAR Target: ARM Cortex-M33 non-secure for TF-M\n"
" IAR_ARM_CM35P_NONSECURE - Compiler: IAR Target: ARM Cortex-M35P non-secure\n"
" IAR_ARM_CM35P_SECURE - Compiler: IAR Target: ARM Cortex-M35P secure\n"
" IAR_ARM_CM35P_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M35P non-trustzone non-secure\n"
" IAR_ARM_CM55_NONSECURE - Compiler: IAR Target: ARM Cortex-M55 non-secure\n"
" IAR_ARM_CM55_SECURE - Compiler: IAR Target: ARM Cortex-M55 secure\n"
" IAR_ARM_CM55_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M55 non-trustzone non-secure\n"
" IAR_ARM_CM55_TFM - Compiler: IAR Target: ARM Cortex-M55 non-secure for TF-M\n"
" IAR_ARM_CM85_NONSECURE - Compiler: IAR Target: ARM Cortex-M85 non-secure\n"
" IAR_ARM_CM85_SECURE - Compiler: IAR Target: ARM Cortex-M85 secure\n"
" IAR_ARM_CM85_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M85 non-trustzone non-secure\n"
" IAR_ARM_CM85_TFM - Compiler: IAR Target: ARM Cortex-M85 non-secure for TF-M\n"
" IAR_ARM_CRX_NOGIC - Compiler: IAR Target: ARM Cortex-Rx no GIC\n"
" IAR_ATMEGA323 - Compiler: IAR Target: ATMega323\n"
" IAR_ATMEL_SAM7S64 - Compiler: IAR Target: Atmel SAM7S64\n"
Expand Down
8 changes: 4 additions & 4 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ Changes between FreeRTOS V10.4.3 and FreeRTOS V10.4.4 released May 28 2021
in more files.
+ Other minor updates include adding additional configASSERT() checks and
correcting and improving code comments.
+ Go look at the smp branch to see the progress towards the Symetric
+ Go look at the smp branch to see the progress towards the Symmetric
Multiprocessing Kernel. https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/smp

Changes between FreeRTOS V10.4.2 and FreeRTOS V10.4.3 released December 14 2020
Expand Down Expand Up @@ -2015,7 +2015,7 @@ Changes between V6.1.0 and V6.1.1 released January 14 2011
Embedded Workbench.
+ Added a new port for the MSP430X core using the IAR Embedded Workbench.
+ Updated all the RX62N demo projects that target the Renesas Demonstration
Kit (RDK) to take into account the revered LED wiring on later hardware
Kit (RDK) to take into account the reversed LED wiring on later hardware
revisions, and the new J-Link debug interface DLL.
+ Updated all the RX62N demo projects so the IO page served by the example
embedded web server works with all web browsers.
Expand Down Expand Up @@ -3174,7 +3174,7 @@ Changes between V1.2.3 and V1.2.4
xSerialPortInitMinimal() and the function xPortInit() has been renamed
to xSerialPortInit().
+ The function sSerialPutChar() has been renamed cSerialPutChar() and
the function return type chaned to portCHAR.
the function return type changed to portCHAR.
+ The integer and flop tasks now include calls to tskYIELD(), allowing
them to be used with the cooperative scheduler.
+ All the demo applications now use the integer and comtest tasks when the
Expand Down Expand Up @@ -3308,7 +3308,7 @@ Changes between V1.01 and V1.2.0
ports to allocate a different maximum number of priorities.
+ By default the trace facility is off, previously USE_TRACE_FACILITY
was defined.
+ comtest.c now uses a psuedo random delay between sends. This allows for
+ comtest.c now uses a pseudo random delay between sends. This allows for
better testing as the interrupts do not arrive at regular intervals.
+ Minor change to the Flashlite serial port driver. The driver is written
to demonstrate the scheduler and is not written to be efficient.
Expand Down
4 changes: 2 additions & 2 deletions examples/coverity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ files.

## Getting Started
### Prerequisites
Coverity can be run on any platform mentioned [here](https://sig-docs.synopsys.com/polaris/topics/c_coverity-compatible-platforms.html).
Coverity can be run on any platform mentioned [here](https://documentation.blackduck.com/bundle/coverity-docs/page/deploy-install-guide/topics/supported_platforms_for_coverity_analysis.html).
The following are the prerequisites to generate coverity report:

1. CMake version > 3.13.0 (You can check whether you have this by typing `cmake --version`).
Expand All @@ -35,7 +35,7 @@ commands in a terminal:
~~~
2. Create the build files using CMake in a `build` directory:

Singe core FreeRTOS:
Single core FreeRTOS:
~~~
cmake -B build -S examples/coverity
~~~
Expand Down
2 changes: 1 addition & 1 deletion examples/template_configuration/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
* contain the most recent error for that task. */
#define configUSE_POSIX_ERRNO 0

/* Set the following INCLUDE_* constants to 1 to incldue the named API function,
/* Set the following INCLUDE_* constants to 1 to include the named API function,
* or 0 to exclude the named API function. Most linkers will remove unused
* functions even when the constant is 1. */
#define INCLUDE_vTaskPrioritySet 1
Expand Down
12 changes: 12 additions & 0 deletions include/FreeRTOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -3185,6 +3185,18 @@
#define configCONTROL_INFINITE_LOOP()
#endif

/* Set configENABLE_PAC and/or configENABLE_BTI to 1 to enable PAC and/or BTI
* support and 0 to disable them. These are currently used in ARMv8.1-M ports. */
#if ( portHAS_PACBTI_FEATURE == 1 )
#ifndef configENABLE_PAC
#define configENABLE_PAC 0
#endif

#ifndef configENABLE_BTI
#define configENABLE_BTI 0
#endif
#endif

/* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
* dynamically allocated RAM, in which case when any task is deleted it is known
* that both the task's stack and TCB need to be freed. Sometimes the
Expand Down
6 changes: 3 additions & 3 deletions include/mpu_prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer,
BaseType_t MPU_xTimerGenericCommandFromTaskEntry( const xTimerGenericCommandFromTaskParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
const BaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
const BaseType_t xAutoReload ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
Expand All @@ -346,12 +346,12 @@ TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
* with all the APIs. */
TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName,
const TickType_t xTimerPeriodInTicks,
const UBaseType_t uxAutoReload,
const BaseType_t xAutoReload,
void * const pvTimerID,
TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;
TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName,
const TickType_t xTimerPeriodInTicks,
const UBaseType_t uxAutoReload,
const BaseType_t xAutoReload,
void * const pvTimerID,
TimerCallbackFunction_t pxCallbackFunction,
StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION;
Expand Down
2 changes: 1 addition & 1 deletion include/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION;
*
* WARN: This function assumes that the pcWriteBuffer is of length
* configSTATS_BUFFER_MAX_LENGTH. This function is there only for
* backward compatiblity. New applications are recommended to use
* backward compatibility. New applications are recommended to use
* vTaskGetRunTimeStatistics and supply the length of the pcWriteBuffer
* explicitly.
*
Expand Down
Loading

0 comments on commit cd06778

Please sign in to comment.