diff --git a/components/esp_gdbstub/xtensa/gdbstub-entry.S b/components/esp_gdbstub/xtensa/gdbstub-entry.S index 2fd7bcae6a..6fd2168028 100644 --- a/components/esp_gdbstub/xtensa/gdbstub-entry.S +++ b/components/esp_gdbstub/xtensa/gdbstub-entry.S @@ -20,6 +20,8 @@ _xt_gdbstub_int: s32i a0, sp, XT_STK_PS rsr a0, EPC_1 /* save interruptee's PC */ s32i a0, sp, XT_STK_PC + rsr a0, EXCSAVE_1 /* save interruptee's a0 */ + s32i a0, sp, XT_STK_A0 #if XCHAL_HAVE_WINDOWED s32e a0, sp, -16 /* for debug backtrace */ #endif @@ -32,12 +34,6 @@ _xt_gdbstub_int: rsr a0, EXCVADDR s32i a0, sp, XT_STK_EXCVADDR - - /* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */ - rsr a0, EXCSAVE_1 /* save interruptee's a0 */ - - s32i a0, sp, XT_STK_A0 - mov a6,sp movi a3, gdbstub_handle_uart_int callx0 a3 diff --git a/components/esp_system/port/arch/xtensa/panic_handler_asm.S b/components/esp_system/port/arch/xtensa/panic_handler_asm.S index 3328f55537..a452c5f6a1 100644 --- a/components/esp_system/port/arch/xtensa/panic_handler_asm.S +++ b/components/esp_system/port/arch/xtensa/panic_handler_asm.S @@ -35,6 +35,8 @@ _xt_panic: s32i a0, sp, XT_STK_PS rsr a0, EPC_1 /* save interruptee's PC */ s32i a0, sp, XT_STK_PC + rsr a0, EXCSAVE_1 /* save interruptee's a0 */ + s32i a0, sp, XT_STK_A0 #if XCHAL_HAVE_WINDOWED s32e a0, sp, -16 /* for debug backtrace */ #endif @@ -48,11 +50,6 @@ _xt_panic: rsr a0, EXCVADDR s32i a0, sp, XT_STK_EXCVADDR - /* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */ - rsr a0, EXCSAVE_1 /* save interruptee's a0 */ - - s32i a0, sp, XT_STK_A0 - /* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */ movi a0, PS_INTLEVEL(XCHAL_DEBUGLEVEL - 2) | PS_UM | PS_WOE wsr a0, PS diff --git a/components/esp_system/port/soc/esp32/highint_hdl.S b/components/esp_system/port/soc/esp32/highint_hdl.S index 51b963cce6..8c77711188 100644 --- a/components/esp_system/port/soc/esp32/highint_hdl.S +++ b/components/esp_system/port/soc/esp32/highint_hdl.S @@ -228,6 +228,8 @@ xt_highintx: s32i a0, sp, XT_STK_PS rsr a0, EPC_X /* save interruptee's PC */ s32i a0, sp, XT_STK_PC + rsr a0, EXCSAVE_X /* save interruptee's a0 */ + s32i a0, sp, XT_STK_A0 #if XCHAL_HAVE_WINDOWED s32e a0, sp, -16 /* for debug backtrace */ #endif @@ -279,11 +281,6 @@ xt_highintx: /* Found the reason, now save it. */ s32i a0, sp, XT_STK_EXCCAUSE - /* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */ - rsr a0, EXCSAVE_X /* save interruptee's a0 */ - - s32i a0, sp, XT_STK_A0 - /* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */ movi a0, PS_INTLEVEL(5) | PS_UM | PS_WOE wsr a0, PS diff --git a/components/esp_system/port/soc/esp32s2/highint_hdl.S b/components/esp_system/port/soc/esp32s2/highint_hdl.S index 845a50a440..c3d7dc0d8f 100644 --- a/components/esp_system/port/soc/esp32s2/highint_hdl.S +++ b/components/esp_system/port/soc/esp32s2/highint_hdl.S @@ -47,6 +47,8 @@ xt_highint4: s32i a0, sp, XT_STK_PS rsr a0, EPC_4 /* save interruptee's PC */ s32i a0, sp, XT_STK_PC + rsr a0, EXCSAVE_4 /* save interruptee's a0 */ + s32i a0, sp, XT_STK_A0 #if XCHAL_HAVE_WINDOWED s32e a0, sp, -16 /* for debug backtrace */ #endif @@ -77,11 +79,6 @@ xt_highint4: /* Found the reason, now save it. */ s32i a0, sp, XT_STK_EXCCAUSE - /* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */ - rsr a0, EXCSAVE_4 /* save interruptee's a0 */ - - s32i a0, sp, XT_STK_A0 - /* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */ movi a0, PS_INTLEVEL(5) | PS_UM | PS_WOE wsr a0, PS diff --git a/components/esp_system/port/soc/esp32s3/highint_hdl.S b/components/esp_system/port/soc/esp32s3/highint_hdl.S index af0b2b31e7..12c01adf76 100644 --- a/components/esp_system/port/soc/esp32s3/highint_hdl.S +++ b/components/esp_system/port/soc/esp32s3/highint_hdl.S @@ -63,6 +63,8 @@ xt_highint4: s32i a0, sp, XT_STK_PS rsr a0, EPC_4 /* save interruptee's PC */ s32i a0, sp, XT_STK_PC + rsr a0, EXCSAVE_4 /* save interruptee's a0 */ + s32i a0, sp, XT_STK_A0 #if XCHAL_HAVE_WINDOWED s32e a0, sp, -16 /* for debug backtrace */ #endif @@ -105,11 +107,6 @@ xt_highint4: /* Found the reason, now save it. */ s32i a0, sp, XT_STK_EXCCAUSE - /* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */ - rsr a0, EXCSAVE_4 /* save interruptee's a0 */ - - s32i a0, sp, XT_STK_A0 - /* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */ movi a0, PS_INTLEVEL(5) | PS_UM | PS_WOE wsr a0, PS diff --git a/components/freertos/FreeRTOS-Kernel/croutine.c b/components/freertos/FreeRTOS-Kernel/croutine.c index c4c0fab422..282030ab22 100644 --- a/components/freertos/FreeRTOS-Kernel/croutine.c +++ b/components/freertos/FreeRTOS-Kernel/croutine.c @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/event_groups.c b/components/freertos/FreeRTOS-Kernel/event_groups.c index f7f38c4607..1e2f7f7322 100644 --- a/components/freertos/FreeRTOS-Kernel/event_groups.c +++ b/components/freertos/FreeRTOS-Kernel/event_groups.c @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h b/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h index eb0ee6be35..22a437d316 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/StackMacros.h b/components/freertos/FreeRTOS-Kernel/include/freertos/StackMacros.h index 8d09f10cd1..7af04f04c1 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/StackMacros.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/StackMacros.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/atomic.h b/components/freertos/FreeRTOS-Kernel/include/freertos/atomic.h index a47b96723c..7873a718f3 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/atomic.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/atomic.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/croutine.h b/components/freertos/FreeRTOS-Kernel/include/freertos/croutine.h index 99322d219f..ffbcb7160e 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/croutine.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/croutine.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/deprecated_definitions.h b/components/freertos/FreeRTOS-Kernel/include/freertos/deprecated_definitions.h index d3b942666d..1e0ce6d4bf 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/deprecated_definitions.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/deprecated_definitions.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/event_groups.h b/components/freertos/FreeRTOS-Kernel/include/freertos/event_groups.h index 94f78d6436..51db928850 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/event_groups.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/event_groups.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/list.h b/components/freertos/FreeRTOS-Kernel/include/freertos/list.h index f76328f8e0..68903c2cc5 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/list.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/list.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/message_buffer.h b/components/freertos/FreeRTOS-Kernel/include/freertos/message_buffer.h index af5c3290b7..6a27488e49 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/message_buffer.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/message_buffer.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/mpu_prototypes.h b/components/freertos/FreeRTOS-Kernel/include/freertos/mpu_prototypes.h index ceb74f3e5b..165e84652f 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/mpu_prototypes.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/mpu_prototypes.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/mpu_wrappers.h b/components/freertos/FreeRTOS-Kernel/include/freertos/mpu_wrappers.h index c02dcd0c41..eadb296d65 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/mpu_wrappers.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/mpu_wrappers.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/portable.h b/components/freertos/FreeRTOS-Kernel/include/freertos/portable.h index acc337cb96..9e3e375540 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/portable.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/portable.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/projdefs.h b/components/freertos/FreeRTOS-Kernel/include/freertos/projdefs.h index 1949e6e30b..4af7dfdb1d 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/projdefs.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/projdefs.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/queue.h b/components/freertos/FreeRTOS-Kernel/include/freertos/queue.h index 05ca7de454..7292008125 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/queue.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/queue.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h b/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h index 2041641b91..60064f74a8 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/stack_macros.h b/components/freertos/FreeRTOS-Kernel/include/freertos/stack_macros.h index 249c4ef840..c1086c7482 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/stack_macros.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/stack_macros.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/stdint.readme b/components/freertos/FreeRTOS-Kernel/include/freertos/stdint.readme index 20a8d663ef..b457269ef0 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/stdint.readme +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/stdint.readme @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/stream_buffer.h b/components/freertos/FreeRTOS-Kernel/include/freertos/stream_buffer.h index a20dcf0375..d5426a4c6b 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/stream_buffer.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/stream_buffer.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/task.h b/components/freertos/FreeRTOS-Kernel/include/freertos/task.h index bcceaa40e2..4a1c606b05 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/task.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/task.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/timers.h b/components/freertos/FreeRTOS-Kernel/include/freertos/timers.h index 324a618306..b0ca9160cc 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/timers.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/timers.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/list.c b/components/freertos/FreeRTOS-Kernel/list.c index 5eec523162..5739a85ecc 100644 --- a/components/freertos/FreeRTOS-Kernel/list.c +++ b/components/freertos/FreeRTOS-Kernel/list.c @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/portable/linux/include/freertos/FreeRTOSConfig_arch.h b/components/freertos/FreeRTOS-Kernel/portable/linux/include/freertos/FreeRTOSConfig_arch.h index 273593d86a..947ef2ee21 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/linux/include/freertos/FreeRTOSConfig_arch.h +++ b/components/freertos/FreeRTOS-Kernel/portable/linux/include/freertos/FreeRTOSConfig_arch.h @@ -1,71 +1,8 @@ /* - FreeRTOS V10 - Copyright (C) 2021 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef FREERTOS_CONFIG_LINUX_H #define FREERTOS_CONFIG_LINUX_H diff --git a/components/freertos/FreeRTOS-Kernel/portable/port_systick.c b/components/freertos/FreeRTOS-Kernel/portable/port_systick.c index ef10f9131d..75889a8a5e 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/port_systick.c +++ b/components/freertos/FreeRTOS-Kernel/portable/port_systick.c @@ -157,7 +157,9 @@ IRAM_ATTR void SysTickIsrHandler(void *arg) */ BaseType_t xPortSysTickHandler(void) { +#if configBENCHMARK portbenchmarkIntLatency(); +#endif //configBENCHMARK traceISR_ENTER(SYSTICK_INTR_ID); BaseType_t ret = xTaskIncrementTick(); if(ret != pdFALSE) { diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/FreeRTOSConfig_arch.h b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/FreeRTOSConfig_arch.h index 093954587a..c4e67fd76f 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/FreeRTOSConfig_arch.h +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/FreeRTOSConfig_arch.h @@ -1,71 +1,8 @@ /* - FreeRTOS V10 - Copyright (C) 2021 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef FREERTOS_CONFIG_RISCV_H #define FREERTOS_CONFIG_RISCV_H diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portbenchmark.h b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portbenchmark.h deleted file mode 100644 index 4ce41d3dad..0000000000 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portbenchmark.h +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -*/ - -/* - * This utility helps benchmarking interrupt latency and context switches. - * In order to enable it, set configBENCHMARK to 1 in FreeRTOSConfig.h. - * You will also need to download the FreeRTOS_trace patch that contains - * portbenchmark.c and the complete version of portbenchmark.h - */ - -#ifndef PORTBENCHMARK_H -#define PORTBENCHMARK_H - -#if configBENCHMARK - #error "You need to download the FreeRTOS_trace patch that overwrites this file" -#endif - -#define portbenchmarkINTERRUPT_DISABLE() -#define portbenchmarkINTERRUPT_RESTORE(newstate) -#define portbenchmarkIntLatency() -#define portbenchmarkIntWait() -#define portbenchmarkReset() -#define portbenchmarkPrint() - -#endif /* PORTBENCHMARK */ diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h index a6bcaf5234..36f1da5134 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -43,7 +50,6 @@ #include "esp_heap_caps.h" #include "esp_system.h" /* required by esp_get_...() functions in portable.h. [refactor-todo] Update portable.h */ #include "esp_newlib.h" -#include "portbenchmark.h" /* [refactor-todo] These includes are not directly used in this file. They are kept into to prevent a breaking change. Remove these. */ #include diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c b/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c index 42a6f89179..4bfba5ab0e 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c @@ -1,74 +1,36 @@ /* - FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution and was contributed - to the project by Technolution B.V. (www.technolution.nl, - freertos-riscv@technolution.eu) under the terms of the FreeRTOS - contributors license. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * FreeRTOS Kernel V10.4.3 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS + * + * 1 tab == 4 spaces! + */ /*----------------------------------------------------------------------- * Implementation of functions defined in portable.h for the RISC-V port. diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S b/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S index 20c094b7a6..8d8a7b3256 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ .global uxInterruptNesting .global uxSchedulerRunning diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/FreeRTOSConfig_arch.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/FreeRTOSConfig_arch.h index 74280b6422..919679f0e6 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/FreeRTOSConfig_arch.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/FreeRTOSConfig_arch.h @@ -1,71 +1,8 @@ /* - FreeRTOS V10 - Copyright (C) 2021 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef FREERTOS_CONFIG_XTENSA_H #define FREERTOS_CONFIG_XTENSA_H @@ -123,6 +60,7 @@ int xt_clock_freq(void) __attribute__((deprecated)); #define configXT_BOARD 1 /* Board mode */ #define configXT_SIMULATOR 0 +#define configBENCHMARK 0 /* The maximum interrupt priority from which FreeRTOS.org API functions can be called. Only API functions that end in ...FromISR() can be used within diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portbenchmark.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portbenchmark.h index 4ce41d3dad..69913f28f3 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portbenchmark.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portbenchmark.h @@ -1,26 +1,32 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -*/ +/* + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ /* * This utility helps benchmarking interrupt latency and context switches. diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h index 00a4b59b83..cc7dd588fe 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h @@ -1,6 +1,14 @@ +/* + * SPDX-FileCopyrightText: 2017 Amazon.com, Inc. or its affiliates + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 - * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in @@ -10,7 +18,8 @@ * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * copies or substantial portions of the Software. If you wish to use our Amazon + * FreeRTOS name, please do so in a fair use way that does not cause confusion. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS @@ -19,12 +28,35 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos + * https://www.FreeRTOS.org + * https://github.com/FreeRTOS * * 1 tab == 4 spaces! */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + #ifndef PORTMACRO_H #define PORTMACRO_H diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_config.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_config.h index be8125c46a..618fa6c11e 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_config.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_config.h @@ -1,34 +1,41 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- +/* + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ - Configuration-specific information for Xtensa build. This file must be - included in FreeRTOSConfig.h to properly set up the config-dependent - parameters correctly. - - NOTE: To enable thread-safe C library support, XT_USE_THREAD_SAFE_CLIB must - be defined to be > 0 somewhere above or on the command line. - -*******************************************************************************/ +/* + * Configuration-specific information for Xtensa build. This file must be + * included in FreeRTOSConfig.h to properly set up the config-dependent + * parameters correctly. + * + * NOTE: To enable thread-safe C library support, XT_USE_THREAD_SAFE_CLIB must + * be defined to be > 0 somewhere above or on the command line. + */ #ifndef XTENSA_CONFIG_H #define XTENSA_CONFIG_H diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_rtos.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_rtos.h index b7793d6803..f2e2f99ccc 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_rtos.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_rtos.h @@ -1,43 +1,50 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- +/* + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ - RTOS-SPECIFIC INFORMATION FOR XTENSA RTOS ASSEMBLER SOURCES - (FreeRTOS Port) - -This header is the primary glue between generic Xtensa RTOS support -sources and a specific RTOS port for Xtensa. It contains definitions -and macros for use primarily by Xtensa assembly coded source files. - -Macros in this header map callouts from generic Xtensa files to specific -RTOS functions. It may also be included in C source files. - -Xtensa RTOS ports support all RTOS-compatible configurations of the Xtensa -architecture, using the Xtensa hardware abstraction layer (HAL) to deal -with configuration specifics. - -Should be included by all Xtensa generic and RTOS port-specific sources. - -*******************************************************************************/ +/* + * RTOS-SPECIFIC INFORMATION FOR XTENSA RTOS ASSEMBLER SOURCES + * (FreeRTOS Port) + * + * This header is the primary glue between generic Xtensa RTOS support + * sources and a specific RTOS port for Xtensa. It contains definitions + * and macros for use primarily by Xtensa assembly coded source files. + * + * Macros in this header map callouts from generic Xtensa files to specific + * RTOS functions. It may also be included in C source files. + * + * Xtensa RTOS ports support all RTOS-compatible configurations of the Xtensa + * architecture, using the Xtensa hardware abstraction layer (HAL) to deal + * with configuration specifics. + * + * Should be included by all Xtensa generic and RTOS port-specific sources. + */ #ifndef XTENSA_RTOS_H #define XTENSA_RTOS_H @@ -86,7 +93,7 @@ However these can still be overridden from the command line. #endif #endif -#if !defined(XT_SIMULATOR) && !defined(XT_BOARD) +#if (!XT_SIMULATOR) && (!XT_BOARD) #error Either XT_SIMULATOR or XT_BOARD must be defined. #endif @@ -228,7 +235,7 @@ Xtensa Port Version. *******************************************************************************/ -#define XTENSA_PORT_VERSION 1.4.2 -#define XTENSA_PORT_VERSION_STRING "1.4.2" +#define XTENSA_PORT_VERSION 1.7 +#define XTENSA_PORT_VERSION_STRING "1.7" #endif /* XTENSA_RTOS_H */ diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_timer.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_timer.h index b7f8dc703d..53555ed8cd 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_timer.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_timer.h @@ -1,41 +1,48 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- +/* + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ - XTENSA INFORMATION FOR RTOS TICK TIMER AND CLOCK FREQUENCY - -This header contains definitions and macros for use primarily by Xtensa -RTOS assembly coded source files. It includes and uses the Xtensa hardware -abstraction layer (HAL) to deal with config specifics. It may also be -included in C source files. - -User may edit to modify timer selection and to specify clock frequency and -tick duration to match timer interrupt to the real-time tick duration. - -If the RTOS has no timer interrupt, then there is no tick timer and the -clock frequency is irrelevant, so all of these macros are left undefined -and the Xtensa core configuration need not have a timer. - -*******************************************************************************/ +/* + * XTENSA INFORMATION FOR RTOS TICK TIMER AND CLOCK FREQUENCY + * + * This header contains definitions and macros for use primarily by Xtensa + * RTOS assembly coded source files. It includes and uses the Xtensa hardware + * abstraction layer (HAL) to deal with config specifics. It may also be + * included in C source files. + * + * Edit this file to modify timer selection and to specify clock frequency and + * tick duration to match timer interrupt to the real-time tick duration. + * + * If the RTOS has no timer interrupt, then there is no tick timer and the + * clock frequency is irrelevant, so all of these macros are left undefined + * and the Xtensa core configuration need not have a timer. + */ #ifndef XTENSA_TIMER_H #define XTENSA_TIMER_H diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S b/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S index 188454c164..27b76d97b4 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S @@ -1,27 +1,32 @@ /* -//----------------------------------------------------------------------------- -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -//----------------------------------------------------------------------------- -*/ + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ #include "xtensa_rtos.h" #include "sdkconfig.h" @@ -37,16 +42,14 @@ * parameter "configISR_STACK_SIZE" in FreeRTOSConfig.h ******************************************************************************* */ - .data .align 16 .global port_IntStack - .global port_IntStackTop - .global port_switch_flag + .global port_switch_flag //Required by sysview_tracing build port_IntStack: - .space configISR_STACK_SIZE*portNUM_PROCESSORS /* This allocates stacks for each individual CPU. */ + .space configISR_STACK_SIZE*portNUM_PROCESSORS /* This allocates stacks for each individual CPU. */ port_IntStackTop: - .word 0 + .word 0 port_switch_flag: .space portNUM_PROCESSORS*4 /* One flag for each individual CPU. */ @@ -69,24 +72,18 @@ _frxt_setup_switch: ENTRY(16) - getcoreid a3 + getcoreid a3 movi a2, port_switch_flag - addx4 a2, a3, a2 - + addx4 a2, a3, a2 movi a3, 1 s32i a3, a2, 0 RET(16) - - - - - /* ******************************************************************************* -* _frxt_int_enter -* void _frxt_int_enter(void) +* _frxt_int_enter +* void _frxt_int_enter(void) * * Implements the Xtensa RTOS porting layer's XT_RTOS_INT_ENTER function for * freeRTOS. Saves the rest of the interrupt context (not already saved). @@ -116,11 +113,11 @@ _frxt_int_enter: Manage nesting directly rather than call the generic IntEnter() (in windowed ABI we can't call a C function here anyway because PS.EXCM is still set). */ - getcoreid a4 + getcoreid a4 movi a2, port_xSchedulerRunning - addx4 a2, a4, a2 + addx4 a2, a4, a2 movi a3, port_interruptNesting - addx4 a3, a4, a3 + addx4 a3, a4, a3 l32i a2, a2, 0 /* a2 = port_xSchedulerRunning */ beqz a2, 1f /* scheduler not running, no tasks */ l32i a2, a3, 0 /* a2 = port_interruptNesting */ @@ -129,14 +126,14 @@ _frxt_int_enter: bnei a2, 1, .Lnested /* !=0 before incr, so nested */ movi a2, pxCurrentTCB - addx4 a2, a4, a2 + addx4 a2, a4, a2 l32i a2, a2, 0 /* a2 = current TCB */ beqz a2, 1f s32i a1, a2, TOPOFSTACK_OFFS /* pxCurrentTCB->pxTopOfStack = SP */ movi a1, port_IntStack+configISR_STACK_SIZE /* a1 = top of intr stack for CPU 0 */ movi a2, configISR_STACK_SIZE /* add configISR_STACK_SIZE * cpu_num to arrive at top of stack for cpu_num */ - mull a2, a4, a2 - add a1, a1, a2 /* for current proc */ + mull a2, a4, a2 + add a1, a1, a2 /* for current proc */ #ifdef CONFIG_FREERTOS_FPU_IN_ISR #if XCHAL_CP_NUM > 0 @@ -161,8 +158,8 @@ _frxt_int_enter: /* ******************************************************************************* -* _frxt_int_exit -* void _frxt_int_exit(void) +* _frxt_int_exit +* void _frxt_int_exit(void) * * Implements the Xtensa RTOS porting layer's XT_RTOS_INT_EXIT function for * FreeRTOS. If required, calls vPortYieldFromInt() to perform task context @@ -179,11 +176,11 @@ _frxt_int_enter: .align 4 _frxt_int_exit: - getcoreid a4 + getcoreid a4 movi a2, port_xSchedulerRunning - addx4 a2, a4, a2 + addx4 a2, a4, a2 movi a3, port_interruptNesting - addx4 a3, a4, a3 + addx4 a3, a4, a3 rsil a0, XCHAL_EXCM_LEVEL /* lock out interrupts */ l32i a2, a2, 0 /* a2 = port_xSchedulerRunning */ beqz a2, .Lnoswitch /* scheduler not running, no tasks */ @@ -202,13 +199,13 @@ _frxt_int_exit: #endif movi a2, pxCurrentTCB - addx4 a2, a4, a2 + addx4 a2, a4, a2 l32i a2, a2, 0 /* a2 = current TCB */ beqz a2, 1f /* no task ? go to dispatcher */ l32i a1, a2, TOPOFSTACK_OFFS /* SP = pxCurrentTCB->pxTopOfStack */ movi a2, port_switch_flag /* address of switch flag */ - addx4 a2, a4, a2 /* point to flag for this cpu */ + addx4 a2, a4, a2 /* point to flag for this cpu */ l32i a3, a2, 0 /* a3 = port_switch_flag */ beqz a3, .Lnoswitch /* flag = 0 means no switch reqd */ movi a3, 0 @@ -430,13 +427,13 @@ _frxt_dispatch: #ifdef __XTENSA_CALL0_ABI__ call0 vTaskSwitchContext // Get next TCB to resume movi a2, pxCurrentTCB - getcoreid a3 - addx4 a2, a3, a2 + getcoreid a3 + addx4 a2, a3, a2 #else call4 vTaskSwitchContext // Get next TCB to resume movi a2, pxCurrentTCB - getcoreid a3 - addx4 a2, a3, a2 + getcoreid a3 + addx4 a2, a3, a2 #endif l32i a3, a2, 0 l32i sp, a3, TOPOFSTACK_OFFS /* SP = next_TCB->pxTopOfStack; */ @@ -475,8 +472,8 @@ _frxt_dispatch: #if XCHAL_CP_NUM > 0 /* Restore CPENABLE from task's co-processor save area. */ movi a3, pxCurrentTCB /* cp_state = */ - getcoreid a2 - addx4 a3, a2, a3 + getcoreid a2 + addx4 a3, a2, a3 l32i a3, a3, 0 l32i a2, a3, CP_TOPOFSTACK_OFFS /* StackType_t *pxStack; */ l16ui a3, a2, XT_CPENABLE /* CPENABLE = cp_state->cpenable; */ @@ -564,8 +561,8 @@ vPortYield: #endif movi a2, pxCurrentTCB - getcoreid a3 - addx4 a2, a3, a2 + getcoreid a3 + addx4 a2, a3, a2 l32i a2, a2, 0 /* a2 = pxCurrentTCB */ movi a3, 0 s32i a3, sp, XT_SOL_EXIT /* 0 to flag as solicited frame */ @@ -615,8 +612,8 @@ vPortYieldFromInt: #if XCHAL_CP_NUM > 0 /* Save CPENABLE in task's co-processor save area, and clear CPENABLE. */ movi a3, pxCurrentTCB /* cp_state = */ - getcoreid a2 - addx4 a3, a2, a3 + getcoreid a2 + addx4 a3, a2, a3 l32i a3, a3, 0 l32i a2, a3, CP_TOPOFSTACK_OFFS @@ -657,19 +654,19 @@ vPortYieldFromInt: _frxt_task_coproc_state: - /* We can use a3 as a scratchpad, the instances of code calling XT_RTOS_CP_STATE don't seem to need it saved. */ - getcoreid a3 + /* We can use a3 as a scratchpad, the instances of code calling XT_RTOS_CP_STATE don't seem to need it saved. */ + getcoreid a3 movi a15, port_xSchedulerRunning /* if (port_xSchedulerRunning */ - addx4 a15, a3,a15 + addx4 a15, a3,a15 l32i a15, a15, 0 beqz a15, 1f movi a15, port_interruptNesting /* && port_interruptNesting == 0 */ - addx4 a15, a3, a15 + addx4 a15, a3, a15 l32i a15, a15, 0 bnez a15, 1f movi a15, pxCurrentTCB - addx4 a15, a3, a15 + addx4 a15, a3, a15 l32i a15, a15, 0 /* && pxCurrentTCB != 0) { */ beqz a15, 2f diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/readme_xtensa.txt b/components/freertos/FreeRTOS-Kernel/portable/xtensa/readme_xtensa.txt index 5122ec2276..56dcc69656 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/readme_xtensa.txt +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/readme_xtensa.txt @@ -1,7 +1,7 @@ FreeRTOS Port for Xtensa Configurable and Diamond Processors ============================================================ - FreeRTOS Version 8.2.0 + FreeRTOS Kernel Version 10.0.0 Introduction @@ -11,7 +11,7 @@ This document describes the Xtensa port for FreeRTOS multitasking RTOS. For an introduction to FreeRTOS itself, please refer to FreeRTOS documentation. -This port currently works with version 8.2.0. +This port currently works with FreeRTOS kernel version 10.0.0. Xtensa Configuration Requirements and Restrictions @@ -28,12 +28,13 @@ xtensa-linux tools provided you have the correct overlay for your Xtensa configuration. However, this has not been tested and is currently not supported by Cadence. -This port includes optional reentrancy support for the 'newlib' C runtime -library that is distributed with Xtensa Tools, providing thread-safety on -a per task basis (for use in tasks only, not interrupt handlers). +This port includes optional reentrancy support for the 'newlib' and +'xclib' C runtime libraries distributed with Xtensa Tools, providing +thread-safety on a per task basis (for use in tasks only, not interrupt +handlers). -NOTE: At this time only the 'newlib' C library is supported for thread -safety. The 'xclib' and 'uclibc' libraries are not reentrant and do not +NOTE: At this time only 'newlib' and 'xclib' C libraries are supported +for thread safety. The 'uclibc' library is not reentrant and does not provide thread safety at this time. However, if you are not concerned with reentrancy then you can use any of these libraries. @@ -65,10 +66,17 @@ and drivers for any on-board devices you want to use. Installation ------------ -This port is downloaded in a ZIP file from FreeRTOS Web site. You will -also need to obtain the common FreeRTOS source package from FreeRTOS's -website in order to build the OS and applications. The Xtensa port files -are not currently included in the common package. +The Xtensa port of FreeRTOS is available at this location: + + https://github.com/foss-xtensa/amazon-freertos + +This download includes the core FreeRTOS source and include files needed +to build the port. You can also download the official release of FreeRTOS +version 1.0.0 or later from this location: + + https://github.com/aws/amazon-freertos + +The Xtensa port files are currently not included in the official package. All source is provided along with a Makefile that works for any host platform supported by Xtensa Tools (Windows, Linux). These instructions @@ -78,26 +86,24 @@ to other host platforms. First install the FreeRTOS common package in a directory of your choosing. The structure of that package will look like this: -FreeRTOS -|-- Demo -| |-- Common -| | |-- Minimal -| | `-- include -| | -| |-- Xtensa_XCC -| `-- ParTest -| -`-- Source - |-- include - `-- portable - |-- MemMang - `-- XCC - `-- Xtensa - -Since the Xtensa specific files are currently unavailable in the common -package, then you will need the separate zip file containing the Xtensa port -files. Extract from that zip file the Source/portable/XCC and Demo/Xtensa_XCC -folders and place them in the appropriate location under the common tree. + +|-- demos +| `-- cadence +| `-- sim +| |-- common +| | |-- application_code +| | | `-- cadence_code +| | `-- config_files +| `-- xplorer +`-- lib + |-- FreeRTOS + | `-- portable + | |-- Common + | |-- MemMang + | `-- XCC + | `-- Xtensa + `-- include + `-- private The Xtensa Tools are available from Cadence as part of a processor license. Be sure you have installed the Xtensa Tools and your processor @@ -107,10 +113,11 @@ configuration. Building FreeRTOS for Xtensa ---------------------------- -The Makefiles are provided for your convenience and you do not need to -use them. Essentially you need to compile all the FreeRTOS common files, -the port files, and your application, and link them all. However all the -build instructions in this note use the Makefiles. +To build the FreeRTOS library and the example programs, go into the +directory 'demos/cadence/sim' and use the makefile in that directory. +"make all" will build all the examples. There is another makefile in +the 'lib/FreeRTOS/portable/XCC/Xtensa' directory that builds just the +FreeRTOS library. By default, you will build for the Xtensa instruction set simulator. If you have a supported emulation board, you can build to run on that. You @@ -120,19 +127,21 @@ recommends doing functional development on the simulator because it is easier to debug with, then move to a board if/when you need to test hardware drivers or real-time performance. -The provided Makefile simplifies building FreeRTOS and the example +The provided makefile simplifies building FreeRTOS and the example for your Xtensa configuration and platform (ISS, board, etc.). There -are detailed instructions in the comment at the top of the Makefile. -The test/Makefile provides similar support for building the tests, -and may be invoked directly from the top level Makefile. +are detailed instructions in the comments at the top of the makefile. -The Makefiles work on any host platform and support incremental builds. +The makefiles work on Windows and Linux and support incremental builds. The build for each Xtensa configuration and target platform is placed in a subdirectory so several core and platform builds can co-exist even with incremental rebuilds. You may specify the root of the build area (if tou want it to be elsewhere than under the source tree) by defining BLDROOT either in the make command or your shell environment. + +Building the FreeRTOS Library +----------------------------- + First, be sure you have installed Xtensa Tools and your processor configuration, and be sure that Xtensa Tools are in your search path. You can use xt-make, which comes with the Xtensa Tools, to run the @@ -140,7 +149,7 @@ makefiles. Change directories to the Xtensa port directory: -> cd FreeRTOS/Source/portable/XCC/Xtensa +> cd lib/FreeRTOS/portable/XCC/Xtensa Now build the FreeRTOS RTOS as a library (libfreertos.a) as follows: @@ -169,29 +178,31 @@ After the library has been built, you must link your application with this library in order to use FreeRTOS. -Building a FreeRTOS Application -------------------------------- +Building the FreeRTOS Examples +------------------------------ -The provided FreeRTOS example is designed to run on the Xtensa instruction -set simulator (ISS) or a supported evaluation board programmed with your +The provided examples are designed to run on the Xtensa instruction set +simulator (ISS) or a supported evaluation board programmed with your Xtensa processor configuration. -To build the example for the default platform (simulator): +To build the examples for the default platform (simulator): -> xt-make example +> cd demos/cadence/sim + +> xt-make all which is the same as -> xt-make example TARGET=sim +> xt-make all TARGET=sim The boards currently supported are the Xilinx ML605 and KC705 FPGA development boards. To target these boards, type -> xt-make example TARGET=ml605 +> xt-make all TARGET=ml605 or -> xt-make example TARGET=kc705 +> xt-make all TARGET=kc705 To build in a location other than the default, specify the new location using the BLDROOT variable. Note that this makefile will invoke the @@ -201,31 +212,28 @@ parameters based on what you specified. You can override the default compilation options by specifying the new options via CFLAGS. For example: -> xt-make example TARGET=sim CFLAGS="-O2 -Os -g" +> xt-make all TARGET=sim CFLAGS="-O2 -Os -g" -This compiles example.c and links it with the FreeRTOS library +This compiles the examples and links them with the FreeRTOS library libfreertos.a and the appropriate linker-support package (LSP) for your target platform (you can override the LSP by adding LSP= to the -xt-make command line). The resulting file example.exe is an ELF binary -file that can be downloaded and executed on the target. +xt-make command line). The resulting ELF files can be downloaded and +executed on the target. The example binaries appear in the platform +specific subdirectory described earlier. -The example.exe binary appears in the platform specific subdirectory -described earlier. For the following commands, change to that directory -or prepend it as the path of example.exe. - -To build your application with thread-safe C library support using -the open-source 'newlib' library provided with the Xtensa Tools, you +To build your application with thread-safe C library support, you need to make certain modifications to the application to plug in and -invoke the newlib reentrancy support. This allows each task to use -the library without interference with other tasks (it is not safe for -interrupt handlers to call the C library). +invoke the reentrancy support. This allows each task to use the library +without interference with other tasks (it is not safe for interrupt +handlers to call the C library). First, you must define XT_USE_THREAD_SAFE_CLIB -to a nonzero either in FreeRTOSConfig.h or in the compiler's command -line. +to a nonzero value either in xtensa_config.h or on the compiler's command +line. Note that the default xtensa_config.h provided with this port does +define this to 1 if either newlib or xclib is detected. Then, you must also make sure to allocate extra space on the stack for each task that will use the C library reentrant functions. This extra @@ -239,13 +247,19 @@ saving the context for the C library as well as the coprocessors if any. E.g. if your task requires 2000 bytes of stack space, you must allocate (2000 + XT_STACK_EXTRA_CLIB) bytes for the stack. -To build the example with thread-safe C library support: -> xt-make CFLAGS="-O0 -DXT_USE_THREAD_SAFE_CLIB" example +IMPORTANT NOTE +-------------- -The "-O0" is necessary because you are overriding the default COPT=-O0. -You can specify any optimization level you require (if none, the compiler -defaults to -O2). +The header file FreeRTOS.h, which is a part of the core FreeRTOS sources, +includes if thread safety for the C libraries is enabled. For +xclib, this file exists in and so is reported as missing. +To work around this, the makefiles supplied with this port will copy the +reent.h header into the build directory during the build process. If you +use a different build process, then you must make sure to copy this file +to a location that is included in the list of include paths. This can be +the build directory or the directory that contains the Xtensa port source +files. Running or Debugging an Application @@ -350,8 +364,8 @@ Many definitions can be provided at compile-time via the -D option without editing the source code. Here are some of the more useful ones: XT_USE_THREAD_SAFE_CLIB Enable support for the reentrancy to provide - thread-safety in the GNU newlib supplied with - Xtensa Tools. Default off. + thread-safety for the newlib and xclib libraries + supplied with Xtensa Tools. Default ON. Note, the follwing defines are unique to the Xtensa port so have names beginning with "XT_". @@ -746,23 +760,4 @@ Overlay Support never defined when building. -Note on Porting Methodology and Copyrights ------------------------------------------- - -This port is based on a well-tested Cadence RTOS porting layer -that abstracts out Xtensa-generic aspects from the RTOS specifics -in the same way most RTOSes abstract out their generic code from the -architecture specific port code. This code is common to several RTOSes -ported by Cadence, and deals with highly Xtensa specific aspects such -as context save/restore, interrupt and exception dispatch, and handling -of co-processor, alloc and window over/underflow exceptions. - -The porting layer files are prefixed "xtensa_" and belong to Cadence -(they are provided freely as part of this port but are not subject to -FreeRTOS's copyright). The rest of the port is FreeRTOS specific and -are under FreeRTOS's copyright. - -The Makefiles are also provided by Cadence so have much in common with -other RTOS Makefiles provided by Cadence. - -End- diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xt_asm_utils.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xt_asm_utils.h index b56fc39ffc..d4f25b79f7 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xt_asm_utils.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xt_asm_utils.h @@ -1,13 +1,9 @@ /* - * Copyright (c) 2017, Intel Corporation + * SPDX-FileCopyrightText: 2017, Intel Corporation * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD * - * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD */ /* File adapted to use on IDF FreeRTOS component, extracted diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_context.S b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_context.S index 7620420317..df0b2324d2 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_context.S +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_context.S @@ -1,47 +1,54 @@ -/******************************************************************************* -Copyright (c) 2006-2015 Cadence Design Systems Inc. +/* + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- - - XTENSA CONTEXT SAVE AND RESTORE ROUTINES - -Low-level Call0 functions for handling generic context save and restore of -registers not specifically addressed by the interrupt vectors and handlers. -Those registers (not handled by these functions) are PC, PS, A0, A1 (SP). -Except for the calls to RTOS functions, this code is generic to Xtensa. - -Note that in Call0 ABI, interrupt handlers are expected to preserve the callee- -save regs (A12-A15), which is always the case if the handlers are coded in C. -However A12, A13 are made available as scratch registers for interrupt dispatch -code, so are presumed saved anyway, and are always restored even in Call0 ABI. -Only A14, A15 are truly handled as callee-save regs. - -Because Xtensa is a configurable architecture, this port supports all user -generated configurations (except restrictions stated in the release notes). -This is accomplished by conditional compilation using macros and functions -defined in the Xtensa HAL (hardware adaptation layer) for your configuration. -Only the processor state included in your configuration is saved and restored, -including any processor state added by user configuration options or TIE. - -*******************************************************************************/ +/* + * XTENSA CONTEXT SAVE AND RESTORE ROUTINES + * + * Low-level Call0 functions for handling generic context save and restore of + * registers not specifically addressed by the interrupt vectors and handlers. + * Those registers (not handled by these functions) are PC, PS, A0, A1 (SP). + * Except for the calls to RTOS functions, this code is generic to Xtensa. + * + * Note that in Call0 ABI, interrupt handlers are expected to preserve the callee- + * save regs (A12-A15), which is always the case if the handlers are coded in C. + * However A12, A13 are made available as scratch registers for interrupt dispatch + * code, so are presumed saved anyway, and are always restored even in Call0 ABI. + * Only A14, A15 are truly handled as callee-save regs. + * + * Because Xtensa is a configurable architecture, this port supports all user + * generated configurations (except restrictions stated in the release notes). + * This is accomplished by conditional compilation using macros and functions + * defined in the Xtensa HAL (hardware adaptation layer) for your configuration. + * Only the processor state included in your configuration is saved and restored, + * including any processor state added by user configuration options or TIE. + */ /* Warn nicely if this file gets named with a lowercase .s instead of .S: */ #define NOERROR # @@ -94,10 +101,11 @@ Exit conditions: .global _xt_context_save .type _xt_context_save,@function .align 4 - .literal_position + .literal_position .align 4 _xt_context_save: + s32i a2, sp, XT_STK_A2 s32i a3, sp, XT_STK_A3 s32i a4, sp, XT_STK_A4 @@ -239,7 +247,7 @@ Exit conditions: .global _xt_context_restore .type _xt_context_restore,@function .align 4 - .literal_position + .literal_position .align 4 _xt_context_restore: @@ -358,7 +366,7 @@ Obeys ABI conventions per prototype: .global _xt_coproc_init .type _xt_coproc_init,@function .align 4 - .literal_position + .literal_position .align 4 _xt_coproc_init: ENTRY0 @@ -408,16 +416,16 @@ Obeys ABI conventions per prototype: .global _xt_coproc_release .type _xt_coproc_release,@function .align 4 - .literal_position + .literal_position .align 4 _xt_coproc_release: ENTRY0 /* a2 = base of save area */ - getcoreid a5 - movi a3, XCHAL_CP_MAX << 2 - mull a5, a5, a3 + getcoreid a5 + movi a3, XCHAL_CP_MAX << 2 + mull a5, a5, a3 movi a3, _xt_coproc_owner_sa /* a3 = base of owner array */ - add a3, a3, a5 + add a3, a3, a5 addi a4, a3, XCHAL_CP_MAX << 2 /* a4 = top+1 of owner array */ movi a5, 0 /* a5 = 0 (unowned) */ @@ -463,7 +471,7 @@ Must be called from assembly code only, using CALL0. .global _xt_coproc_savecs .type _xt_coproc_savecs,@function .align 4 - .literal_position + .literal_position .align 4 _xt_coproc_savecs: @@ -573,7 +581,7 @@ Must be called from assembly code only, using CALL0. .global _xt_coproc_restorecs .type _xt_coproc_restorecs,@function .align 4 - .literal_position + .literal_position .align 4 _xt_coproc_restorecs: diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c index 4a74de21af..ed816032bd 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c @@ -1,32 +1,39 @@ -/******************************************************************************* -// Copyright (c) 2003-2015 Cadence Design Systems, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- +/* + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ - XTENSA INITIALIZATION ROUTINES CODED IN C - -This file contains miscellaneous Xtensa RTOS-generic initialization functions -that are implemented in C. - -*******************************************************************************/ +/* + * XTENSA INITIALIZATION ROUTINES CODED IN C + * + * This file contains miscellaneous Xtensa RTOS-generic initialization functions + * that are implemented in C. + */ #ifdef XT_BOARD diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_loadstore_handler.S b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_loadstore_handler.S index 88fc82c334..859a6ae81c 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_loadstore_handler.S +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_loadstore_handler.S @@ -1,18 +1,8 @@ /* - Copyright 2019 Espressif Systems (Shanghai) PTE LTD - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /* * LoadStoreErrorCause: Occurs when trying to access 32 bit addressable memory region as 8 bit or 16 bit diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_overlay_os_hook.c b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_overlay_os_hook.c index a5ca23ceef..8830f97ff7 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_overlay_os_hook.c +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_overlay_os_hook.c @@ -1,26 +1,36 @@ -// xtensa_overlay_os_hook.c -- Overlay manager OS hooks for FreeRTOS. - -// Copyright (c) 2015-2015 Cadence Design Systems Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +/* + * xtensa_overlay_os_hook.c -- Overlay manager OS hooks for FreeRTOS. + */ #include "FreeRTOS.h" #include "semphr.h" diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vector_defaults.S b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vector_defaults.S index 791116cfbc..628b75aef5 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vector_defaults.S +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vector_defaults.S @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "xtensa_rtos.h" #include "esp_private/panic_reason.h" diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S index 1560ff27d6..e70de48ba0 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S @@ -1,26 +1,34 @@ -/******************************************************************************* -Copyright (c) 2006-2015 Cadence Design Systems Inc. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- +/* + * SPDX-FileCopyrightText: 2015-2019 Cadence Design Systems, Inc. + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +/* XTENSA VECTORS AND LOW LEVEL HANDLERS FOR AN RTOS Xtensa low level exception and interrupt vectors and handlers for an RTOS. @@ -88,7 +96,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. call but needs to be ensured if 'call0' is used as a jump in lieu of 'j'. 4. This use of 'call0' is independent of the C function call ABI. -*******************************************************************************/ + */ #include "xtensa_rtos.h" #include "esp_private/panic_reason.h" @@ -192,7 +200,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. NOTE: For CALL0 ABI, a12-a15 have not yet been saved. - NOTE: This macro will use registers a0 and a2-a7. The arguments are: + NOTE: This macro will use registers a0 and a2-a6. The arguments are: level -- interrupt level mask -- interrupt bitmask for this level -------------------------------------------------------------------------------- @@ -622,6 +630,8 @@ _xt_user_exc: s32i a0, sp, XT_STK_PS rsr a0, EPC_1 /* save interruptee's PC */ s32i a0, sp, XT_STK_PC + rsr a0, EXCSAVE_1 /* save interruptee's a0 */ + s32i a0, sp, XT_STK_A0 #if XCHAL_HAVE_WINDOWED s32e a0, sp, -16 /* for debug backtrace */ #endif @@ -635,10 +645,6 @@ _xt_user_exc: rsr a0, EXCVADDR s32i a0, sp, XT_STK_EXCVADDR - /* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */ - rsr a0, EXCSAVE_1 /* save interruptee's a0 */ - s32i a0, sp, XT_STK_A0 - /* Set up PS for C, reenable debug and NMI interrupts, and clear EXCM. */ #ifdef __XTENSA_CALL0_ABI__ movi a0, PS_INTLEVEL(XCHAL_DEBUGLEVEL - 2) | PS_UM diff --git a/components/freertos/FreeRTOS-Kernel/queue.c b/components/freertos/FreeRTOS-Kernel/queue.c index db1b57468e..bd40e8057b 100644 --- a/components/freertos/FreeRTOS-Kernel/queue.c +++ b/components/freertos/FreeRTOS-Kernel/queue.c @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/stream_buffer.c b/components/freertos/FreeRTOS-Kernel/stream_buffer.c index fc3a921d0f..2cfb4aade6 100644 --- a/components/freertos/FreeRTOS-Kernel/stream_buffer.c +++ b/components/freertos/FreeRTOS-Kernel/stream_buffer.c @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/tasks.c b/components/freertos/FreeRTOS-Kernel/tasks.c index de1e80feb9..7db4a8d7dc 100644 --- a/components/freertos/FreeRTOS-Kernel/tasks.c +++ b/components/freertos/FreeRTOS-Kernel/tasks.c @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/FreeRTOS-Kernel/timers.c b/components/freertos/FreeRTOS-Kernel/timers.c index a620964a9b..dfdba57138 100644 --- a/components/freertos/FreeRTOS-Kernel/timers.c +++ b/components/freertos/FreeRTOS-Kernel/timers.c @@ -1,3 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2020 Amazon.com, Inc. or its affiliates + * + * SPDX-License-Identifier: MIT + * + * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD + */ /* * FreeRTOS Kernel V10.4.3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/components/freertos/esp_additions/include/freertos/FreeRTOSConfig.h b/components/freertos/esp_additions/include/freertos/FreeRTOSConfig.h index 8afc80cabb..5ee9b84e07 100644 --- a/components/freertos/esp_additions/include/freertos/FreeRTOSConfig.h +++ b/components/freertos/esp_additions/include/freertos/FreeRTOSConfig.h @@ -1,71 +1,8 @@ /* - FreeRTOS V10 - Copyright (C) 2021 Real Time Engineers Ltd. - All rights reserved - - VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. - - This file is part of the FreeRTOS distribution. - - FreeRTOS is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - - *************************************************************************** - >>! NOTE: The modification to the GPL is included to allow you to !<< - >>! distribute a combined work that includes FreeRTOS without being !<< - >>! obliged to provide the source code for proprietary components !<< - >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** - - FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. Full license text is available on the following - link: http://www.freertos.org/a00114.html - - *************************************************************************** - * * - * FreeRTOS provides completely free yet professionally developed, * - * robust, strictly quality controlled, supported, and cross * - * platform software that is more than just the market leader, it * - * is the industry's de facto standard. * - * * - * Help yourself get started quickly while simultaneously helping * - * to support the FreeRTOS project by purchasing a FreeRTOS * - * tutorial book, reference manual, or both: * - * http://www.FreeRTOS.org/Documentation * - * * - *************************************************************************** - - http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? - - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. - - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. - - http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, - including FreeRTOS+Trace - an indispensable productivity tool, a DOS - compatible FAT file system, and our tiny thread aware UDP/IP stack. - - http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. - Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. - - http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High - Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS - licenses offer ticketed support, indemnification and commercial middleware. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and - mission critical applications that require provable dependability. - - 1 tab == 4 spaces! -*/ + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H @@ -204,7 +141,6 @@ #define configGENERATE_RUN_TIME_STATS 1 /* Used by vTaskGetRunTimeStats() */ #endif -#define configBENCHMARK 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 0 #define configQUEUE_REGISTRY_SIZE CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE diff --git a/components/xtensa/include/xtensa/xtensa_context.h b/components/xtensa/include/xtensa/xtensa_context.h index e655904423..d8256162ce 100644 --- a/components/xtensa/include/xtensa/xtensa_context.h +++ b/components/xtensa/include/xtensa/xtensa_context.h @@ -1,38 +1,39 @@ -/******************************************************************************* -Copyright (c) 2006-2015 Cadence Design Systems Inc. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- - - XTENSA CONTEXT FRAMES AND MACROS FOR RTOS ASSEMBLER SOURCES - -This header contains definitions and macros for use primarily by Xtensa -RTOS assembly coded source files. It includes and uses the Xtensa hardware -abstraction layer (HAL) to deal with config specifics. It may also be -included in C source files. - -!! Supports only Xtensa Exception Architecture 2 (XEA2). XEA1 not supported. !! - -NOTE: The Xtensa architecture requires stack pointer alignment to 16 bytes. - -*******************************************************************************/ +/* + * XTENSA CONTEXT FRAMES AND MACROS FOR RTOS ASSEMBLER SOURCES + * + * This header contains definitions and macros for use primarily by Xtensa + * RTOS assembly coded source files. It includes and uses the Xtensa hardware + * abstraction layer (HAL) to deal with config specifics. It may also be + * included in C source files. + * + * !! Supports only Xtensa Exception Architecture 2 (XEA2). XEA1 not supported. !! + * + * NOTE: The Xtensa architecture requires stack pointer alignment to 16 bytes. + */ #ifndef XTENSA_CONTEXT_H #define XTENSA_CONTEXT_H @@ -57,6 +58,10 @@ NOTE: The Xtensa architecture requires stack pointer alignment to 16 bytes. ------------------------------------------------------------------------------- */ +/* +We need to undef due to redefinition from xtruntime.h +[refactor-todo] Prevent xtruntime.h from being included in IDF +*/ #ifdef STRUCT_BEGIN #undef STRUCT_BEGIN #undef STRUCT_FIELD @@ -380,7 +385,4 @@ STRUCT_END(XtSolFrame) #endif - - - #endif /* XTENSA_CONTEXT_H */ diff --git a/components/xtensa/xtensa_intr.c b/components/xtensa/xtensa_intr.c index c94a70eb9d..fb1f3e8efe 100644 --- a/components/xtensa/xtensa_intr.c +++ b/components/xtensa/xtensa_intr.c @@ -1,30 +1,31 @@ -/******************************************************************************* -Copyright (c) 2006-2015 Cadence Design Systems Inc. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -******************************************************************************/ - -/****************************************************************************** - Xtensa-specific interrupt and exception functions for RTOS ports. - Also see xtensa_intr_asm.S. -******************************************************************************/ +/* + * Xtensa-specific interrupt and exception functions for RTOS ports. + * Also see xtensa_intr_asm.S. + */ #include @@ -100,7 +101,7 @@ extern xt_handler_table_entry _xt_interrupt_table[XCHAL_NUM_INTERRUPTS*portNUM_P */ void IRAM_ATTR xt_unhandled_interrupt(void * arg) { - esp_rom_printf("Unhandled interrupt %d on cpu %d!\n", (int)arg, xPortGetCoreID()); + esp_rom_printf("Unhandled interrupt %d on cpu %d!\n", (int)arg, xPortGetCoreID()); } //Returns true if handler for interrupt is not the default unhandled interrupt handler diff --git a/components/xtensa/xtensa_intr_asm.S b/components/xtensa/xtensa_intr_asm.S index cc62762275..8745466469 100644 --- a/components/xtensa/xtensa_intr_asm.S +++ b/components/xtensa/xtensa_intr_asm.S @@ -1,30 +1,31 @@ -/******************************************************************************* -Copyright (c) 2006-2015 Cadence Design Systems Inc. -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +/* + * Copyright (c) 2015-2019 Cadence Design Systems, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -******************************************************************************/ - -/****************************************************************************** - Xtensa interrupt handling data and assembly routines. - Also see xtensa_intr.c and xtensa_vectors.S. -******************************************************************************/ +/* + * Xtensa interrupt handling data and assembly routines. + * Also see xtensa_intr.c and xtensa_vectors.S. + */ #include #include diff --git a/tools/ci/check_copyright_config.yaml b/tools/ci/check_copyright_config.yaml index 123b9791c4..03819d9bef 100644 --- a/tools/ci/check_copyright_config.yaml +++ b/tools/ci/check_copyright_config.yaml @@ -74,6 +74,13 @@ lwip_component: - BSD-3-Clause license_for_new_files: Apache-2.0 +freertos_component: + include: + - 'components/freertos/**' + allowed_licenses: + - Apache-2.0 #Files added to the freertos added by us + - MIT #FreeRTOS sources and port files + # files matching this section do not perform the check # file patterns starting with ! are negated, meaning files matching them won't match the section. ignore: diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 28739e1f75..b0c0063e4e 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -868,79 +868,6 @@ components/fatfs/vfs/esp_vfs_fat.h components/fatfs/vfs/vfs_fat_internal.h components/fatfs/vfs/vfs_fat_sdmmc.c components/fatfs/vfs/vfs_fat_spiflash.c -components/freertos/FreeRTOS-Kernel/croutine.c -components/freertos/FreeRTOS-Kernel/event_groups.c -components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h -components/freertos/FreeRTOS-Kernel/include/freertos/StackMacros.h -components/freertos/FreeRTOS-Kernel/include/freertos/atomic.h -components/freertos/FreeRTOS-Kernel/include/freertos/croutine.h -components/freertos/FreeRTOS-Kernel/include/freertos/deprecated_definitions.h -components/freertos/FreeRTOS-Kernel/include/freertos/event_groups.h -components/freertos/FreeRTOS-Kernel/include/freertos/list.h -components/freertos/FreeRTOS-Kernel/include/freertos/message_buffer.h -components/freertos/FreeRTOS-Kernel/include/freertos/mpu_prototypes.h -components/freertos/FreeRTOS-Kernel/include/freertos/mpu_wrappers.h -components/freertos/FreeRTOS-Kernel/include/freertos/portable.h -components/freertos/FreeRTOS-Kernel/include/freertos/projdefs.h -components/freertos/FreeRTOS-Kernel/include/freertos/queue.h -components/freertos/FreeRTOS-Kernel/include/freertos/semphr.h -components/freertos/FreeRTOS-Kernel/include/freertos/stack_macros.h -components/freertos/FreeRTOS-Kernel/include/freertos/stream_buffer.h -components/freertos/FreeRTOS-Kernel/include/freertos/task.h -components/freertos/FreeRTOS-Kernel/include/freertos/timers.h -components/freertos/FreeRTOS-Kernel/list.c -components/freertos/FreeRTOS-Kernel/portable/linux/include/freertos/FreeRTOSConfig_arch.h -components/freertos/FreeRTOS-Kernel/portable/linux/include/freertos/portmacro.h -components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/FreeRTOSConfig_arch.h -components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portbenchmark.h -components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h -components/freertos/FreeRTOS-Kernel/portable/riscv/port.c -components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/FreeRTOSConfig_arch.h -components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portbenchmark.h -components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h -components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro_priv.h -components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_api.h -components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_config.h -components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_context.h -components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_rtos.h -components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/xtensa_timer.h -components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c -components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_init.c -components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_overlay_os_hook.c -components/freertos/FreeRTOS-Kernel/queue.c -components/freertos/FreeRTOS-Kernel/stream_buffer.c -components/freertos/FreeRTOS-Kernel/tasks.c -components/freertos/FreeRTOS-Kernel/timers.c -components/freertos/FreeRTOS-openocd.c -components/freertos/esp_additions/include/freertos/FreeRTOSConfig.h -components/freertos/esp_additions/task_snapshot.c -components/freertos/test/test_context_save_clobber.c -components/freertos/test/test_float_in_isr.c -components/freertos/test/test_freertos_backported_functions.c -components/freertos/test/test_freertos_debug_functions.c -components/freertos/test/test_freertos_eventgroups.c -components/freertos/test/test_freertos_get_state.c -components/freertos/test/test_freertos_isinisrcontext.c -components/freertos/test/test_freertos_mutex.c -components/freertos/test/test_freertos_scheduling_time.c -components/freertos/test/test_freertos_task_delay_until.c -components/freertos/test/test_freertos_task_delete.c -components/freertos/test/test_freertos_task_notify.c -components/freertos/test/test_freertos_trace_utilities.c -components/freertos/test/test_isr_latency.c -components/freertos/test/test_legacy_hooks.c -components/freertos/test/test_newlib_reent.c -components/freertos/test/test_panic.c -components/freertos/test/test_preemption.c -components/freertos/test/test_queuesets.c -components/freertos/test/test_spinlocks.c -components/freertos/test/test_stream_buffers.c -components/freertos/test/test_suspend_scheduler.c -components/freertos/test/test_task_priorities.c -components/freertos/test/test_task_suspend_resume.c -components/freertos/test/test_tasks_snapshot.c -components/freertos/test/test_thread_local.c -components/freertos/test/test_xtensa_loadstore_handler.c components/hal/aes_hal.c components/hal/cpu_hal.c components/hal/dac_hal.c