diff options
Diffstat (limited to 'ports_module/rxv2')
25 files changed, 279 insertions, 414 deletions
diff --git a/ports_module/rxv2/iar/example_build/hwsetup.c b/ports_module/rxv2/iar/example_build/hwsetup.c index ab3e3bac..c03895a5 100644 --- a/ports_module/rxv2/iar/example_build/hwsetup.c +++ b/ports_module/rxv2/iar/example_build/hwsetup.c @@ -1,25 +1,25 @@ /* Adapted for use with IAR Embedded Workbench */ /*********************************************************************************************************************** * DISCLAIMER -* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No -* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all -* applicable laws, including copyright laws. +* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No +* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all +* applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING -* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM -* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES -* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS +* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM +* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES +* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS * SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of -* this software. By using this software, you agree to the additional terms and conditions found by accessing the +* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of +* this software. By using this software, you agree to the additional terms and conditions found by accessing the * following link: -* http://www.renesas.com/disclaimer +* http://www.renesas.com/disclaimer * -* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved. +* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved. ***********************************************************************************************************************/ /*********************************************************************************************************************** * File Name : hwsetup.c -* Version : 1.0 +* Version : 1.0 * Device(s) : RX * H/W Platform : RX65N * Description : Defines the initialisation routines used each time the MCU is restarted. @@ -83,34 +83,34 @@ void operating_frequency_set(void) Peripheral Clock Frequency....... 48 MHz USB Clock Frequency.............. 48 MHz External Bus Clock Frequency..... 24 MHz */ - + volatile unsigned int i; - + /* Protect off. */ SYSTEM.PRCR.WORD = 0xA50B; - + /* Uncomment if not using sub-clock */ //SYSTEM.SOSCCR.BYTE = 0x01; /* stop sub-clock */ SYSTEM.SOSCCR.BYTE = 0x00; /* Enable sub-clock for RTC */ - + /* Wait 131,072 cycles * 12 MHz = 10.9 ms */ SYSTEM.MOSCWTCR.BYTE = 0x0D; - + /* x16 @PLL, 2 divisor */ SYSTEM.PLLCR.WORD = 0x0F01; - + /* EXTAL ON */ SYSTEM.MOSCCR.BYTE = 0x00; - + /* PLL ON */ SYSTEM.PLLCR2.BYTE = 0x00; - + for(i = 0;i< 0x168;i++) { /* Wait over 12ms */ __no_operation(); } - + /* Setup system clocks SCKCR - System Clock Control Register b31:b28 FCK[3:0] 0x02 = Flash clock: PLL/4 = (192 / 4) = 48 MHz @@ -120,17 +120,17 @@ void operating_frequency_set(void) b11:b8 PCKB[3:0] 0x02 = Peripheral clock B: PLL/4 = 48 MHz */ SYSTEM.SCKCR.LONG = 0x21031222; /* ICK=PLL/2,BCK,FCK,PCK=PLL/4 */ - + /* Setup IEBUS and USB clocks - SCKCR2 - System Clock Control Register 2 + SCKCR2 - System Clock Control Register 2 b7:b4 UCK[3:0] 0x03 = USB clock is PLL/4 = 48 MHz b3:b0 IEBCK[3:0] 0x01 = IE Bus clock is PLL/2 = 96 MHz */ SYSTEM.SCKCR2.WORD = 0x0031; - + /* ICLK, PCLKB, FCLK, BCLK, IECLK, and USBCLK all come from PLL circuit */ SYSTEM.SCKCR3.WORD = 0x0400; - + /* Protect on. */ SYSTEM.PRCR.WORD = 0xA500; } @@ -146,7 +146,7 @@ void interrupts_configure(void) { /* Protect off. */ SYSTEM.PRCR.WORD = 0xA50B; - + /* Enable the bus error interrupt to catch accesses to illegal/reserved areas of memory. */ @@ -154,9 +154,9 @@ void interrupts_configure(void) IR(BSC,BUSERR) = 0; /* Make this the highest priority interrupt (adjust as necessary for your application) */ - IPR(BSC,BUSERR) = 0x0F; + IPR(BSC,BUSERR) = 0x0F; /* Enable the interrupt in the ICU */ - IEN(BSC,BUSERR) = 1; + IEN(BSC,BUSERR) = 1; /* Enable illegal address interrupt in the BSC */ BSC.BEREN.BIT.IGAEN = 1; } @@ -167,11 +167,11 @@ void interrupts_configure(void) * Description : Sample ISR for bus error (must do hardware setup first!) * By default, this demo code enables the Bus Error Interrupt. * This interrupt will fire if the user tries to access code -* or data from one of the reserved areas in the memory map, +* or data from one of the reserved areas in the memory map, * including the areas covered by disabled chip selects. * A nop statement is included here as a convenient place * to set a breakpoint during debugging and development, and -* further handling should be added by the user for their +* further handling should be added by the user for their * application. * Arguments : none * Return value : none @@ -183,7 +183,7 @@ __interrupt void buserr_isr(void) the register BSC.BERSR2.WORD. The upper 13 bits of this register contain the upper 13-bits of the offending address (in 512K byte units). */ - + /* Add your own code here to handle this interrupt */ __no_operation(); } diff --git a/ports_module/rxv2/iar/example_build/hwsetup.h b/ports_module/rxv2/iar/example_build/hwsetup.h index d2bae5f6..5ff001c0 100644 --- a/ports_module/rxv2/iar/example_build/hwsetup.h +++ b/ports_module/rxv2/iar/example_build/hwsetup.h @@ -1,25 +1,25 @@ /* Adapted for use with IAR Embedded Workbench */ /*********************************************************************************************************************** * DISCLAIMER -* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No -* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all -* applicable laws, including copyright laws. +* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No +* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all +* applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING -* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM -* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES -* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS +* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM +* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES +* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS * SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of -* this software. By using this software, you agree to the additional terms and conditions found by accessing the +* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of +* this software. By using this software, you agree to the additional terms and conditions found by accessing the * following link: -* http://www.renesas.com/disclaimer +* http://www.renesas.com/disclaimer * -* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved. +* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved. ***********************************************************************************************************************/ /*********************************************************************************************************************** * File Name : hwsetup.h -* Version : 1.0 +* Version : 1.0 * Description : Hardware setup header file.. ***********************************************************************************************************************/ /*********************************************************************************************************************** diff --git a/ports_module/rxv2/iar/example_build/low_level_init.c b/ports_module/rxv2/iar/example_build/low_level_init.c index 5b89a40a..95069278 100644 --- a/ports_module/rxv2/iar/example_build/low_level_init.c +++ b/ports_module/rxv2/iar/example_build/low_level_init.c @@ -31,7 +31,7 @@ __intrinsic int __low_level_init ( void ) { hardware_setup(); - + /*==================================*/ /* Choose if segment initialization */ /* should be done or not. */ diff --git a/ports_module/rxv2/iar/example_build/sample_module_linker.icf b/ports_module/rxv2/iar/example_build/sample_module_linker.icf index b6187731..d37c93f1 100644 --- a/ports_module/rxv2/iar/example_build/sample_module_linker.icf +++ b/ports_module/rxv2/iar/example_build/sample_module_linker.icf @@ -60,10 +60,10 @@ define block HEAP with alignment = 4, size = _HEAP_SIZE { }; // { ro section .dataflash* }; define movable block ROPI with alignment = 4, fixed order, static base CB -{ +{ ro object txm_module_preamble_rx65n.o, - ro, - ro data + ro, + ro data }; define movable block RWPI with alignment = 8, fixed order, static base SB diff --git a/ports_module/rxv2/iar/example_build/sample_threadx_module.c b/ports_module/rxv2/iar/example_build/sample_threadx_module.c index 51822c10..80d89b01 100644 --- a/ports_module/rxv2/iar/example_build/sample_threadx_module.c +++ b/ports_module/rxv2/iar/example_build/sample_threadx_module.c @@ -1,5 +1,5 @@ -/* This is a small demo of the high-performance ThreadX kernel running as a module. It includes - examples of eight threads of different priorities, using a message queue, semaphore, mutex, +/* This is a small demo of the high-performance ThreadX kernel running as a module. It includes + examples of eight threads of different priorities, using a message queue, semaphore, mutex, event flags group, byte pool, and block pool. */ /* Specify that this is a module! */ @@ -20,7 +20,7 @@ #define DEMO_QUEUE_SIZE 100 -/* Define the pool space in the bss section of the module. ULONG is used to +/* Define the pool space in the bss section of the module. ULONG is used to get the word alignment. */ ULONG demo_module_pool_space[DEMO_BYTE_POOL_SIZE / 4]; @@ -99,7 +99,7 @@ void demo_module_start(ULONG id) CHAR *pointer; /* Allocate all the objects. In MPU mode, modules cannot allocate control blocks within - their own memory area so they cannot corrupt the resident portion of ThreadX by overwriting + their own memory area so they cannot corrupt the resident portion of ThreadX by overwriting the control block(s). */ txm_module_object_allocate((void*)&thread_0, sizeof(TX_THREAD)); txm_module_object_allocate((void*)&thread_1, sizeof(TX_THREAD)); @@ -115,7 +115,7 @@ CHAR *pointer; txm_module_object_allocate((void*)&event_flags_0, sizeof(TX_EVENT_FLAGS_GROUP)); txm_module_object_allocate((void*)&byte_pool_0, sizeof(TX_BYTE_POOL)); txm_module_object_allocate((void*)&block_pool_0, sizeof(TX_BLOCK_POOL)); - + /* Create a byte memory pool from which to allocate the thread stacks. */ tx_byte_pool_create(byte_pool_0, "module byte pool 0", demo_module_pool_space, DEMO_BYTE_POOL_SIZE); @@ -127,42 +127,42 @@ CHAR *pointer; tx_byte_allocate(byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create the main thread. */ - tx_thread_create(thread_0, "module thread 0", thread_0_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(thread_0, "module thread 0", thread_0_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 1. */ tx_byte_allocate(byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 1 and 2. These threads pass information through a ThreadX + /* Create threads 1 and 2. These threads pass information through a ThreadX message queue. It is also interesting to note that these threads have a time slice. */ - tx_thread_create(thread_1, "module thread 1", thread_1_entry, 1, - pointer, DEMO_STACK_SIZE, + tx_thread_create(thread_1, "module thread 1", thread_1_entry, 1, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 2. */ tx_byte_allocate(byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(thread_2, "module thread 2", thread_2_entry, 2, - pointer, DEMO_STACK_SIZE, + tx_thread_create(thread_2, "module thread 2", thread_2_entry, 2, + pointer, DEMO_STACK_SIZE, 16, 16, 4, TX_AUTO_START); /* Allocate the stack for thread 3. */ tx_byte_allocate(byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. + /* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore. An interesting thing here is that both threads share the same instruction area. */ - tx_thread_create(thread_3, "module thread 3", thread_3_and_4_entry, 3, - pointer, DEMO_STACK_SIZE, + tx_thread_create(thread_3, "module thread 3", thread_3_and_4_entry, 3, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 4. */ tx_byte_allocate(byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(thread_4, "module thread 4", thread_3_and_4_entry, 4, - pointer, DEMO_STACK_SIZE, + tx_thread_create(thread_4, "module thread 4", thread_3_and_4_entry, 4, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 5. */ @@ -170,23 +170,23 @@ CHAR *pointer; /* Create thread 5. This thread simply pends on an event flag which will be set by thread_0. */ - tx_thread_create(thread_5, "module thread 5", thread_5_entry, 5, - pointer, DEMO_STACK_SIZE, + tx_thread_create(thread_5, "module thread 5", thread_5_entry, 5, + pointer, DEMO_STACK_SIZE, 4, 4, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 6. */ tx_byte_allocate(byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); /* Create threads 6 and 7. These threads compete for a ThreadX mutex. */ - tx_thread_create(thread_6, "module thread 6", thread_6_and_7_entry, 6, - pointer, DEMO_STACK_SIZE, + tx_thread_create(thread_6, "module thread 6", thread_6_and_7_entry, 6, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the stack for thread 7. */ tx_byte_allocate(byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT); - tx_thread_create(thread_7, "module thread 7", thread_6_and_7_entry, 7, - pointer, DEMO_STACK_SIZE, + tx_thread_create(thread_7, "module thread 7", thread_6_and_7_entry, 7, + pointer, DEMO_STACK_SIZE, 8, 8, TX_NO_TIME_SLICE, TX_AUTO_START); /* Allocate the message queue. */ @@ -196,7 +196,7 @@ CHAR *pointer; tx_queue_create(queue_0, "module queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG)); tx_queue_send_notify(queue_0, queue_0_notify); - + /* Create the semaphore used by threads 3 and 4. */ tx_semaphore_create(semaphore_0, "module semaphore 0", 1); @@ -241,7 +241,7 @@ UINT status; /* Sleep for 10 ticks. */ tx_thread_sleep(10); - + /* Set event flag 0 to wakeup thread 5. */ status = tx_event_flags_set(event_flags_0, 0x1, TX_OR); @@ -289,18 +289,18 @@ UINT status; { /* Write value to shared memory region. */ // *(ULONG *)0x00020000 = 0xCDCDCDCD; - + /* Increment the thread counter. */ thread_2_counter++; /* Retrieve a message from the queue. */ status = tx_queue_receive(queue_0, &received_message, TX_WAIT_FOREVER); - /* Check completion status and make sure the message is what we + /* Check completion status and make sure the message is what we expected. */ if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received)) break; - + /* Otherwise, all is okay. Increment the received message count. */ thread_2_messages_received++; } @@ -354,12 +354,12 @@ ULONG actual_flags; /* This thread simply waits for an event in a forever loop. */ while(1) { - + /* Increment the thread counter. */ thread_5_counter++; /* Wait for event flag 0. */ - status = tx_event_flags_get(event_flags_0, 0x1, TX_OR_CLEAR, + status = tx_event_flags_get(event_flags_0, 0x1, TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER); /* Check status. */ @@ -412,7 +412,7 @@ UINT status; if (status != TX_SUCCESS) break; - /* Release the mutex again. This will actually + /* Release the mutex again. This will actually release ownership since it was obtained twice. */ status = tx_mutex_put(mutex_0); diff --git a/ports_module/rxv2/iar/example_build/sample_threadx_module_manager.c b/ports_module/rxv2/iar/example_build/sample_threadx_module_manager.c index 4afbbe39..46e3be59 100644 --- a/ports_module/rxv2/iar/example_build/sample_threadx_module_manager.c +++ b/ports_module/rxv2/iar/example_build/sample_threadx_module_manager.c @@ -54,8 +54,8 @@ void tx_application_define(void *first_unused_memory) CHAR *pointer = (CHAR*)first_unused_memory; - tx_thread_create(&module_manager, "Module Manager Thread", module_manager_entry, 0, - pointer, DEMO_STACK_SIZE, + tx_thread_create(&module_manager, "Module Manager Thread", module_manager_entry, 0, + pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START); pointer = pointer + DEMO_STACK_SIZE; } @@ -75,39 +75,39 @@ void module_manager_entry(ULONG thread_input) /* Register a fault handler. */ txm_module_manager_memory_fault_notify(module_fault_handler); - + /* Load the module that is already there, in this example it is placed there by the multiple image download. */ txm_module_manager_in_place_load(&my_module, "my module", (VOID *) 0xFFF10400); - - + + /* Enable 128 byte read/write shared memory region at 0x00020000. */ txm_module_manager_external_memory_enable(&my_module, (void *) 0x00020000, 128, TXM_MODULE_MANAGER_SHARED_ATTRIBUTE_READ | TXM_MODULE_MANAGER_SHARED_ATTRIBUTE_WRITE); - + /* Start the module. */ txm_module_manager_start(&my_module); - + /* Sleep for a while.... */ tx_thread_sleep(1000); - + /* Stop the module. */ txm_module_manager_stop(&my_module); - + /* Unload the module. */ txm_module_manager_unload(&my_module); /* Load the module that is already there. */ txm_module_manager_in_place_load(&my_module, "my module", (VOID *) 0xFFF10400); - + /* Set maximum module priority to 5. */ txm_module_manager_maximum_module_priority_set(&my_module, 5); - + /* Start the module again. */ txm_module_manager_start(&my_module); - + /* Now just spin... */ while(1) { - + tx_thread_sleep(100); } } diff --git a/ports_module/rxv2/iar/example_build/tx_initialize_low_level.s b/ports_module/rxv2/iar/example_build/tx_initialize_low_level.s index 391e9c5c..b47b1684 100644 --- a/ports_module/rxv2/iar/example_build/tx_initialize_low_level.s +++ b/ports_module/rxv2/iar/example_build/tx_initialize_low_level.s @@ -1,10 +1,10 @@ ;/*************************************************************************** -; * Copyright (c) 2024 Microsoft Corporation -; * +; * Copyright (c) 2024 Microsoft Corporation +; * ; * This program and the accompanying materials are made available under the ; * terms of the MIT License which is available at ; * https://opensource.org/licenses/MIT. -; * +; * ; * SPDX-License-Identifier: MIT ; **************************************************************************/ ; @@ -59,12 +59,6 @@ ;/* */ ;/* _tx_initialize_kernel_enter ThreadX entry function */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 01-31-2022 William E. Lamie Initial Version 6.1.10 */ -;/* */ ;/**************************************************************************/ public __tx_initialize_low_level @@ -74,7 +68,7 @@ __tx_initialize_low_level: ; _tx_initialize_unused_memory = (VOID_PTR) &free_mem_start; ; MOV.L #__tx_free_memory_start, R1 ; Pickup unused memory address - MOV.L #__tx_initialize_unused_memory,R2 + MOV.L #__tx_initialize_unused_memory,R2 MOV.L R1,[R2] ; Save first free memory address ; /* Set priority of SWINT to 1. */ diff --git a/ports_module/rxv2/iar/example_build/txm_module_preamble.s b/ports_module/rxv2/iar/example_build/txm_module_preamble.s index bf5bb9fb..13487bc7 100644 --- a/ports_module/rxv2/iar/example_build/txm_module_preamble.s +++ b/ports_module/rxv2/iar/example_build/txm_module_preamble.s @@ -1,7 +1,7 @@ /* Alignment of 4 (16-byte) */ SECTION .text:CODE (4) - - + + /* Define public symbols. */ PUBLIC __txm_module_preamble @@ -25,7 +25,7 @@ __txm_module_preamble: DC32 0x5 // Module Major Version DC32 0x6 // Module Minor Version DC32 32 // Module Preamble Size in 32-bit words - DC32 0x12345678 // Module ID (application defined) + DC32 0x12345678 // Module ID (application defined) DC32 0x00000007 // Module Properties where: // Bits 31-24: Compiler ID // 0 -> IAR @@ -39,23 +39,23 @@ __txm_module_preamble: // 1 -> Enable shared/external memory access DC32 __txm_module_thread_shell_entry - $ // Module Shell Entry Point DC32 _demo_module_start - $ // Module Start Thread Entry Point - DC32 0 // Module Stop Thread Entry Point + DC32 0 // Module Stop Thread Entry Point DC32 1 // Module Start/Stop Thread Priority DC32 1024 // Module Start/Stop Thread Stack Size DC32 __txm_module_callback_request_thread_entry - $ // Module Callback Thread Entry - DC32 1 // Module Callback Thread Priority - DC32 1024 // Module Callback Thread Stack Size + DC32 1 // Module Callback Thread Priority + DC32 1024 // Module Callback Thread Stack Size DC32 ROPI$$Length // Module Code Size DC32 RWPI$$Length // Module Data Size - DC32 0 // Reserved 0 + DC32 0 // Reserved 0 DC32 0 // Reserved 1 DC32 0 // Reserved 2 DC32 0 // Reserved 3 DC32 0 // Reserved 4 - DC32 0 // Reserved 5 - DC32 0 // Reserved 6 - DC32 0 // Reserved 7 - DC32 0 // Reserved 8 + DC32 0 // Reserved 5 + DC32 0 // Reserved 6 + DC32 0 // Reserved 7 + DC32 0 // Reserved 8 DC32 0 // Reserved 9 DC32 0 // Reserved 10 DC32 0 // Reserved 11 diff --git a/ports_module/rxv2/iar/inc/tx_port.h b/ports_module/rxv2/iar/inc/tx_port.h index 1790cd94..cc4bddee 100644 --- a/ports_module/rxv2/iar/inc/tx_port.h +++ b/ports_module/rxv2/iar/inc/tx_port.h @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -42,21 +43,6 @@ /* own special types that can be mapped to actual data types by this */ /* file to guarantee consistency in the interface and functionality. */ /* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */ -/* 06-02-2021 William E. Lamie Modified comments, */ -/* resulting in version 6.1.7 */ -/* 10-15-2021 William E. Lamie Modified comment(s), */ -/* resulting in version 6.1.9 */ -/* 01-31-2022 William E. Lamie Modified comment(s), removed */ -/* system state macro, and */ -/* added missing interrupt */ -/* control defines, */ -/* resulting in version 6.1.10 */ -/* */ /**************************************************************************/ #ifndef TX_PORT_H @@ -70,13 +56,13 @@ #ifdef TX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in tx_user.h. The defines in this file may +/* Yes, include the user defines in tx_user.h. The defines in this file may alternately be defined on the command line. */ #include "tx_user.h" #endif -/* Define ThreadX basic types for this port. */ +/* Define ThreadX basic types for this port. */ #define VOID void typedef char CHAR; @@ -118,8 +104,8 @@ typedef unsigned short USHORT; #define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ #endif -#ifndef TX_TIMER_THREAD_PRIORITY -#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ +#ifndef TX_TIMER_THREAD_PRIORITY +#define TX_TIMER_THREAD_PRIORITY 0 /* Default timer thread priority */ #endif @@ -144,7 +130,7 @@ typedef unsigned short USHORT; #define TX_INLINE_INITIALIZATION -/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is +/* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is disabled. When the following is defined, ThreadX thread stack checking is enabled. If stack checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING define is negated, thereby forcing the stack fill which is necessary for the stack checking @@ -156,11 +142,11 @@ typedef unsigned short USHORT; /* Define the TX_THREAD control block extensions for this port. The main reason - for the multiple macros is so that backward compatibility can be maintained with + for the multiple macros is so that backward compatibility can be maintained with existing ThreadX kernel awareness modules. */ -#define TX_THREAD_EXTENSION_0 -#define TX_THREAD_EXTENSION_1 +#define TX_THREAD_EXTENSION_0 +#define TX_THREAD_EXTENSION_1 #define TX_THREAD_EXTENSION_2 VOID *tx_thread_module_instance_ptr; \ VOID *tx_thread_module_entry_info_ptr; \ ULONG tx_thread_module_current_user_mode; \ @@ -174,7 +160,7 @@ typedef unsigned short USHORT; ULONG tx_thread_module_stack_size; \ VOID *tx_thread_module_reserved; \ VOID *tx_thread_iar_tls_pointer; -#define TX_THREAD_EXTENSION_3 +#define TX_THREAD_EXTENSION_3 /* Define the port extensions of the remaining ThreadX objects. */ @@ -195,11 +181,11 @@ typedef unsigned short USHORT; VOID (*tx_timer_module_expiration_function)(ULONG id); -/* Define the user extension field of the thread control block. Nothing +/* Define the user extension field of the thread control block. Nothing additional is needed for this port so it is defined as white space. */ #ifndef TX_THREAD_USER_EXTENSION -#define TX_THREAD_USER_EXTENSION +#define TX_THREAD_USER_EXTENSION #endif @@ -207,8 +193,8 @@ typedef unsigned short USHORT; tx_thread_shell_entry, and tx_thread_terminate. */ -#define TX_THREAD_CREATE_EXTENSION(thread_ptr) -#define TX_THREAD_DELETE_EXTENSION(thread_ptr) +#define TX_THREAD_CREATE_EXTENSION(thread_ptr) +#define TX_THREAD_DELETE_EXTENSION(thread_ptr) #define TX_THREAD_COMPLETED_EXTENSION(thread_ptr) #define TX_THREAD_TERMINATED_EXTENSION(thread_ptr) @@ -234,9 +220,9 @@ typedef unsigned short USHORT; #define TX_SEMAPHORE_DELETE_EXTENSION(semaphore_ptr) #define TX_TIMER_DELETE_EXTENSION(timer_ptr) -/* Define ThreadX interrupt lockout and restore macros for protection on - access of critical kernel information. The restore interrupt macro must - restore the interrupt posture of the running thread prior to the value +/* Define ThreadX interrupt lockout and restore macros for protection on + access of critical kernel information. The restore interrupt macro must + restore the interrupt posture of the running thread prior to the value present prior to the disable macro. In most cases, the save area macro is used to define a local function save area for the disable and restore macros. */ @@ -286,8 +272,8 @@ static void _tx_thread_system_return_inline(void) /* Define the version ID of ThreadX. This may be utilized by the application. */ #ifdef TX_THREAD_INIT -CHAR _tx_version_id[] = - "Copyright (c) 2024 Microsoft Corporation. * ThreadX RXv2/IAR Version 6.4.2 *"; +CHAR _tx_version_id[] = + "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * ThreadX RXv2/IAR Version 6.5.0.202601 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports_module/rxv2/iar/inc/txm_module_port.h b/ports_module/rxv2/iar/inc/txm_module_port.h index fc7520b9..5712f376 100644 --- a/ports_module/rxv2/iar/inc/txm_module_port.h +++ b/ports_module/rxv2/iar/inc/txm_module_port.h @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -35,12 +36,6 @@ /* This file defines the basic module constants, interface structures, */ /* and function prototypes. */ /* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 01-31-2022 Scott Larson Initial Version 6.1.10 */ -/* */ /**************************************************************************/ #ifndef TXM_MODULE_PORT_H @@ -90,7 +85,7 @@ The following extensions must also be defined in tx_port.h: VOID (*tx_timer_module_expiration_function)(ULONG id); */ -#define TXM_MODULE_THREAD_ENTRY_INFO_USER_EXTENSION +#define TXM_MODULE_THREAD_ENTRY_INFO_USER_EXTENSION /* Define constants specific to the tools the module can be built with for this particular modules port. */ @@ -255,7 +250,7 @@ typedef struct TXM_MODULE_MANAGER_MEMORY_FAULT_INFO_STRUCT { \ _tx_mutex_put(&_txm_module_manager_mutex); \ return(TXM_MODULE_INVALID_PROPERTIES); \ - } + } /* Define the macro to check the code alignment. */ @@ -395,6 +390,6 @@ VOID _txm_module_manager_setup_mpu_registers(TXM_MODULE_INSTANCE *module_instan #define TXM_MODULE_MANAGER_VERSION_ID \ CHAR _txm_module_manager_version_id[] = \ - "Copyright (c) 2024 Microsoft Corporation. * ThreadX Module RXv2/IAR Version 6.4.2 *"; + "Copyright (c) 2024 Microsoft Corporation. * ThreadX Module RXv2/IAR Version 6.5.0.202601 *"; #endif diff --git a/ports_module/rxv2/iar/module_lib/src/txm_module_thread_shell_entry.c b/ports_module/rxv2/iar/module_lib/src/txm_module_thread_shell_entry.c index 95d085fa..1242184c 100644 --- a/ports_module/rxv2/iar/module_lib/src/txm_module_thread_shell_entry.c +++ b/ports_module/rxv2/iar/module_lib/src/txm_module_thread_shell_entry.c @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -86,12 +87,6 @@ extern VOID __iar_data_init2(VOID); /* */ /* Initial thread stack frame */ /* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 10-15-2021 Scott Larson Initial Version 6.1.9 */ -/* */ /**************************************************************************/ VOID _txm_module_thread_shell_entry(TX_THREAD *thread_ptr, TXM_MODULE_THREAD_ENTRY_INFO *thread_info) { @@ -107,14 +102,14 @@ VOID _txm_module_thread_shell_entry(TX_THREAD *thread_ptr, TXM_MODULE_THREAD_EN { /* Initialize the IAR C environment. */ __iar_data_init2(); - + /* Save the entry info pointer, for later use. */ _txm_module_entry_info = thread_info; - + /* Save the kernel function dispatch address. This is used to make all resident calls from the module. */ _txm_module_kernel_call_dispatcher = thread_info -> txm_module_thread_entry_info_kernel_call_dispatcher; - + /* Ensure that we have a valid pointer. */ while (!_txm_module_kernel_call_dispatcher) { @@ -122,7 +117,7 @@ VOID _txm_module_thread_shell_entry(TX_THREAD *thread_ptr, TXM_MODULE_THREAD_EN An error here typically indicates the resident portion of _tx_thread_schedule is not supporting the trap to obtain the function pointer. */ } - + /* Resume the module's callback thread, already created in the manager. */ _txe_thread_resume(thread_info -> txm_module_thread_entry_info_callback_request_thread); } diff --git a/ports_module/rxv2/iar/module_manager/src/tx_initialize_low_level.s b/ports_module/rxv2/iar/module_manager/src/tx_initialize_low_level.s index f3d5293c..3faf9bc9 100644 --- a/ports_module/rxv2/iar/module_manager/src/tx_initialize_low_level.s +++ b/ports_module/rxv2/iar/module_manager/src/tx_initialize_low_level.s @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -56,13 +57,6 @@ /* CALLED BY */ /* */ /* _tx_initialize_kernel_enter ThreadX entry function */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 01-31-2022 William E. Lamie Initial Version 6.1.10 */ -/* */ /**************************************************************************/ public __tx_initialize_low_level @@ -72,7 +66,7 @@ __tx_initialize_low_level: // _tx_initialize_unused_memory = (VOID_PTR) &free_mem_start; MOV.L #__tx_free_memory_start, R1 // Pick up unused memory address - MOV.L #__tx_initialize_unused_memory,R2 + MOV.L #__tx_initialize_unused_memory,R2 MOV.L R1,[R2] // Save first free memory address /* Set priority of SWINT to 1. */ @@ -89,7 +83,7 @@ __tx_initialize_low_level: /* Enable SWINT2. */ OR #(1 << 2), r2 MOV.B r2, [r1] - + RTS section FREEMEM:DATA diff --git a/ports_module/rxv2/iar/module_manager/src/tx_thread_context_restore.s b/ports_module/rxv2/iar/module_manager/src/tx_thread_context_restore.s index b9dc97da..f4c5f492 100644 --- a/ports_module/rxv2/iar/module_manager/src/tx_thread_context_restore.s +++ b/ports_module/rxv2/iar/module_manager/src/tx_thread_context_restore.s @@ -1,10 +1,10 @@ ;/*************************************************************************** -; * Copyright (c) 2024 Microsoft Corporation -; * +; * Copyright (c) 2024 Microsoft Corporation +; * ; * This program and the accompanying materials are made available under the ; * terms of the MIT License which is available at ; * https://opensource.org/licenses/MIT. -; * +; * ; * SPDX-License-Identifier: MIT ; **************************************************************************/ ; @@ -72,16 +72,6 @@ ;/* */ ;/* ISRs Interrupt Service Routines */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */ -;/* 10-15-2021 William E. Lamie Modified comment(s), and */ -;/* removed unnecessary stack */ -;/* type placement, */ -;/* resulting in version 6.1.9 */ -;/* */ ;/**************************************************************************/ public __tx_thread_context_restore @@ -99,7 +89,7 @@ __tx_thread_context_restore: MOV.L [R1], R2 SUB #1, R2 MOV.L R2,[R1] - BEQ __tx_thread_not_nested_restore + BEQ __tx_thread_not_nested_restore ; ; /* Interrupts are nested. */ @@ -121,17 +111,17 @@ __tx_thread_not_nested_restore: ; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)) ; || (_tx_thread_preempt_disable)) ; { - + MOV.L #__tx_thread_current_ptr, R1 ; Pickup current thread ptr address MOV.L [R1], R2 CMP #0, R2 - BEQ __tx_thread_idle_system_restore - + BEQ __tx_thread_idle_system_restore + MOV.L #__tx_thread_preempt_disable, R3 ; Pick up preempt disable flag MOV.L [R3], R3 CMP #0, R3 BNE __tx_thread_no_preempt_restore ; If pre-empt disable flag set, we simply return to the original point of interrupt regardless - + MOV.L #__tx_thread_execute_ptr, R3 ; (_tx_thread_current_ptr != _tx_thread_execute_ptr) CMP [R3], R2 BNE __tx_thread_preempt_restore ; Jump to pre-empt restoring @@ -172,7 +162,7 @@ __tx_thread_dont_save_ts: SETPSW U ; User stack PUSHM R6-R13 - + MVFACGU #0, A1, R4 ; Save accumulators. MVFACHI #0, A1, R5 MVFACLO #0, A1, R6 @@ -181,7 +171,7 @@ __tx_thread_dont_save_ts: MVFACHI #0, A0, R5 MVFACLO #0, A0, R6 PUSHM R4-R6 - + ; ; /* Clear the current task pointer. */ ; _tx_thread_current_ptr = TX_NULL; diff --git a/ports_module/rxv2/iar/module_manager/src/tx_thread_context_save.s b/ports_module/rxv2/iar/module_manager/src/tx_thread_context_save.s index 0d461baa..4e7b8fc3 100644 --- a/ports_module/rxv2/iar/module_manager/src/tx_thread_context_save.s +++ b/ports_module/rxv2/iar/module_manager/src/tx_thread_context_save.s @@ -1,10 +1,10 @@ ;/*************************************************************************** -; * Copyright (c) 2024 Microsoft Corporation -; * +; * Copyright (c) 2024 Microsoft Corporation +; * ; * This program and the accompanying materials are made available under the ; * terms of the MIT License which is available at ; * https://opensource.org/licenses/MIT. -; * +; * ; * SPDX-License-Identifier: MIT ; **************************************************************************/ ; @@ -65,14 +65,6 @@ ;/* */ ;/* ISRs */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */ -;/* 10-15-2021 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.9 */ -;/* */ ;/**************************************************************************/ ;VOID _tx_thread_context_save(VOID) ;{ @@ -100,7 +92,7 @@ __tx_thread_context_save: BEQ __tx_thread_not_nested_save ; ; /* Nested interrupt condition. */ -; +; ADD #1, r2 ; _tx_thread_system_state++ MOV.L r2, [r1] @@ -126,7 +118,7 @@ __tx_thread_not_nested_save: MOV.L #__tx_thread_current_ptr, R2 ; Pickup current thread pointer MOV.L [R2], R2 - CMP #0,R2 ; Is it NULL? + CMP #0,R2 ; Is it NULL? BEQ __tx_thread_idle_system_save ; Yes, idle system is running - idle restore ; ; /* Move stack frame over to the current threads stack. */ @@ -148,7 +140,7 @@ __tx_thread_not_nested_save: MOV.L R14, [-R1] ; Save R14 on thread stack MVFC FPSW, R3 MOV.L R3, [-R1] ; Save FPSW on thread stack - + POP R2 ; Pick up return address from interrupt stack ADD #16, R0, R0 ; Correct interrupt stack pointer back to the bottom MVTC R1, USP ; Set user/thread stack pointer @@ -167,5 +159,5 @@ __tx_thread_idle_system_save: JMP R1 ; Return to caller ; ; } -;} +;} END diff --git a/ports_module/rxv2/iar/module_manager/src/tx_thread_interrupt_control.s b/ports_module/rxv2/iar/module_manager/src/tx_thread_interrupt_control.s index 558b9153..b2cb65e4 100644 --- a/ports_module/rxv2/iar/module_manager/src/tx_thread_interrupt_control.s +++ b/ports_module/rxv2/iar/module_manager/src/tx_thread_interrupt_control.s @@ -1,18 +1,18 @@ ;/*************************************************************************** -; * Copyright (c) 2024 Microsoft Corporation -; * +; * Copyright (c) 2024 Microsoft Corporation +; * ; * This program and the accompanying materials are made available under the ; * terms of the MIT License which is available at ; * https://opensource.org/licenses/MIT. -; * +; * ; * SPDX-License-Identifier: MIT ; **************************************************************************/ ; ; ;/**************************************************************************/ ;/**************************************************************************/ -;/** */ -;/** ThreadX Component */ +;/** */ +;/** ThreadX Component */ ;/** */ ;/** Thread */ ;/** */ @@ -59,14 +59,6 @@ ;/* */ ;/* Application Code */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */ -;/* 10-15-2021 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.9 */ -;/* */ ;/**************************************************************************/ ;UINT _tx_thread_interrupt_control(UINT new_posture) ;{ @@ -75,20 +67,20 @@ __tx_thread_interrupt_control: ; ; /* Pickup current interrupt lockout posture. */ ; - + MVFC PSW, R2 ; Save PSW to R2 MOV.L R2, R3 ; Make a copy of PSW in r3 - + ; ; /* Apply the new interrupt posture. */ ; - + BTST #16, R1 ; Test I bit of PSW of "new posture" BMNE #16, R2 ; Conditionally set I bit of intermediate posture - + MVTC R2, PSW ; Save intermediate posture to PSW - - MOV.L R3,R1 ; Get original SR + + MOV.L R3,R1 ; Get original SR RTS ; Return to caller ;} END diff --git a/ports_module/rxv2/iar/module_manager/src/tx_thread_schedule.s b/ports_module/rxv2/iar/module_manager/src/tx_thread_schedule.s index fb60efaa..572eff32 100644 --- a/ports_module/rxv2/iar/module_manager/src/tx_thread_schedule.s +++ b/ports_module/rxv2/iar/module_manager/src/tx_thread_schedule.s @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -62,17 +63,6 @@ /* _tx_initialize_kernel_enter ThreadX entry function */ /* _tx_thread_system_return Return to system from thread */ /* _tx_thread_context_restore Restore thread's context */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */ -/* 10-15-2021 William E. Lamie Modified comment(s), and */ -/* removed unnecessary stack */ -/* type checking, */ -/* resulting in version 6.1.9 */ -/* */ /**************************************************************************/ // VOID _tx_thread_schedule(VOID) // { @@ -134,40 +124,40 @@ __tx_thread_schedule_loop: MOV.L 156[R2],R1 // Pickup user_mode CMP #0,R1 // Is protection required for this thread? BEQ skip_mpu_setup // No, skip MPU setup - + MOV.L #0x00086408,R1 // Region 1 Start Page Register address MOV.L 144[R2],R2 // Address of module instance ptr at offset 144 in TCB ADD #100,R2,R2 // Get address of MPU table in module struct, starting at region 1 - + // Region 0 (Trampoline from User mode to ThreadX) set up in txm_module_manager_setup_mpu_registers.c - + // Build region 1 (User code) MOV.L [R2+],R4 // Pickup region 1 start page, increment to region 1 end page MOV.L R4,[R1+] // Setup region 1 start page reg, increment to region 1 end page reg. MOV.L [R2+],R4 // Pickup region 1 end page, increment to region 2 start page MOV.L R4,[R1+] // Setup region 1 end page reg, increment to region 2 start page reg. - + // Build region 2 (User data) MOV.L [R2+],R4 // Pickup region 2 start page, increment to region 2 end page MOV.L R4,[R1+] // Setup region 2 start page reg, increment to region 2 end page reg. MOV.L [R2+],R4 // Pickup region 2 end page, increment to region 3 start page MOV.L R4,[R1+] // Setup region 2 end page reg, increment to region 3 start page reg. - + // Build region 3 (Shared memory) MOV.L [R2+],R4 // Pickup region 3 start page, increment to region 3 end page MOV.L R4,[R1+] // Setup region 3 start page reg, increment to region 3 end page reg. MOV.L [R2+],R4 // Pickup region 3 end page, increment to region 4 start page MOV.L R4,[R1+] // Setup region 3 end page reg, increment to region 4 start page reg. - + // Region 4-7 unused - + // Setup background region MOV.L #0x00086504,R1 // Pickup MPBAC MOV #0,[R1] // Read/Write/Execute prohibited. // Enable MPU MOV.L #0x00086500,R1 // Pickup MPEN MOV #1,[R1] // Enable MPU - + skip_mpu_setup POPM R1-R3 // Restore accumulators. @@ -180,7 +170,7 @@ skip_mpu_setup MVTACGU R1, A1 POPM R6-R13 // Recover interrupt stack frame - POPC FPSW + POPC FPSW POPM R14-R15 POPM R3-R5 POPM R1-R2 @@ -195,7 +185,7 @@ skip_mpu_setup The priority of this interrupt is set to the lowest priority within tx_initialize_low_level() and triggered by ThreadX when calling _tx_thread_system_return(). */ - + public ___interrupt_27 ___interrupt_27: @@ -206,7 +196,7 @@ ___interrupt_27: BRA __tx_thread_context_restore -/* You may have to modify BSP to use this handler. +/* You may have to modify BSP to use this handler. // MPU Memory access violation PUBLIC ___excep_access_inst PUBLIC ___violation_handler @@ -260,15 +250,15 @@ ___violation_handler MOV.L R3, 32[R1] // Save R1 POP R3 // Recall R2 MOV.L R3, 36[R1] // Save R2 - + BSR __txm_module_manager_memory_fault_handler // Call memory manager fault handler - + // Decrement and save system state MOV.L #__tx_thread_system_state, R1 // Pickup address of system state MOV.L [R1], R2 // Pickup system state SUB #1, R2 // Decrement MOV.L R2, [R1] // Store new system state - + MOV.L #__tx_thread_current_ptr, R2 // Pickup address of current thread pointer MOV.L #0, [R2] // Clear current thread pointer BRA __tx_thread_schedule // Attempt to schedule the next thread @@ -284,15 +274,15 @@ __txm_module_manager_kernel CMP #__txm_module_manager_user_mode_entry+3, R5 // Did we come from user_mode_entry? BEQ __txm_module_manager_entry // If so, continue. RTE // If not, then return from where we came. - + __txm_module_manager_entry // We are entering the kernel from a module thread with user mode selected. - // At this point, we are out of user mode! + // At this point, we are out of user mode! // Clear current user mode. MOV.L #__tx_thread_current_ptr, R5 MOV [R5],R5 MOV #0,152[R5] - + // Switch to kernel stack PUSHM R1-R2 MVFC USP, R1 // Pickup module thread stack pointer @@ -312,7 +302,7 @@ __txm_module_manager_entry MOV.L 4[SP], R5 BCLR #20, R5 MOV.L R5, 4[SP] - + // Return to user_mode_entry where kernel_dispatch will be called. RTE @@ -324,12 +314,12 @@ __txm_module_manager_entry __txm_module_manager_user_mode_entry INT #26 // Enter ThreadX kernel (exit User mode). - + // At this point, we are out of user mode. // Simply call the kernel dispatch function. MOV.L #__txm_module_manager_kernel_dispatch,R5 JSR R5 - + // Restore user mode while inside of ThreadX. MOV.L #__tx_thread_current_ptr, R5 MOV [R5],R5 @@ -348,7 +338,7 @@ __txm_module_manager_user_mode_entry #endif MOV.L 172[R5], R5 // Pickup module thread stack pointer MVTC R5, USP // Set stack pointer - + // USP is set for an RTS, need to set for RTE to set User mode in PSW. // Push return address on SP @@ -359,21 +349,21 @@ __txm_module_manager_user_mode_entry BSET #20,R5 MOV.L R5,4[SP] RTE - + // Fill rest of page with NOPs. NOP NOP NOP NOP - + NOP NOP NOP NOP - + NOP NOP NOP NOP - + END diff --git a/ports_module/rxv2/iar/module_manager/src/tx_thread_stack_build.s b/ports_module/rxv2/iar/module_manager/src/tx_thread_stack_build.s index be33d407..1d8f4593 100644 --- a/ports_module/rxv2/iar/module_manager/src/tx_thread_stack_build.s +++ b/ports_module/rxv2/iar/module_manager/src/tx_thread_stack_build.s @@ -1,10 +1,10 @@ ;/*************************************************************************** -; * Copyright (c) 2024 Microsoft Corporation -; * +; * Copyright (c) 2024 Microsoft Corporation +; * ; * This program and the accompanying materials are made available under the ; * terms of the MIT License which is available at ; * https://opensource.org/licenses/MIT. -; * +; * ; * SPDX-License-Identifier: MIT ; **************************************************************************/ ; @@ -55,26 +55,14 @@ ;/* */ ;/* _tx_thread_create Create thread service */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */ -;/* 10-15-2021 William E. Lamie Modified comment(s), and */ -;/* removed unnecessary stack */ -;/* type placement, */ -;/* resulting in version 6.1.9 */ -;/* 01-31-2022 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.10 */ -;/* */ ;/**************************************************************************/ public __tx_thread_stack_build __tx_thread_stack_build: ; -; +; ; /* Build an interrupt frame. The form of the fake interrupt stack ; on the Renesas RX should look like the following after it is built: -; +; ; Stack Top: ACC0 ; ACC1 ; R6 @@ -137,11 +125,11 @@ __tx_thread_stack_build: MOV.L R4,[-R3] ; /* Setup stack pointer. */ -; thread_ptr -> tx_thread_stack_ptr = R1; +; thread_ptr -> tx_thread_stack_ptr = R1; MOV.L R3, 8[R1] ; Store initial SP in thread control block RTS - + ;} END diff --git a/ports_module/rxv2/iar/module_manager/src/tx_thread_system_return.s b/ports_module/rxv2/iar/module_manager/src/tx_thread_system_return.s index 714e1276..2c2021f6 100644 --- a/ports_module/rxv2/iar/module_manager/src/tx_thread_system_return.s +++ b/ports_module/rxv2/iar/module_manager/src/tx_thread_system_return.s @@ -1,10 +1,10 @@ ;/*************************************************************************** -; * Copyright (c) 2024 Microsoft Corporation -; * +; * Copyright (c) 2024 Microsoft Corporation +; * ; * This program and the accompanying materials are made available under the ; * terms of the MIT License which is available at ; * https://opensource.org/licenses/MIT. -; * +; * ; * SPDX-License-Identifier: MIT ; **************************************************************************/ ; @@ -20,7 +20,7 @@ ;/**************************************************************************/ section .text:CODE:ROOT - + ;/**************************************************************************/ ;/* */ ;/* FUNCTION RELEASE */ @@ -54,14 +54,6 @@ ;/* */ ;/* ThreadX components */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 12-31-2020 William E. Lamie Initial Version 6.1.3 */ -;/* 10-15-2021 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.9 */ -;/* */ ;/**************************************************************************/ public __tx_thread_system_return diff --git a/ports_module/rxv2/iar/module_manager/src/tx_timer_interrupt.s b/ports_module/rxv2/iar/module_manager/src/tx_timer_interrupt.s index 1b736519..cb79535a 100644 --- a/ports_module/rxv2/iar/module_manager/src/tx_timer_interrupt.s +++ b/ports_module/rxv2/iar/module_manager/src/tx_timer_interrupt.s @@ -1,10 +1,10 @@ ;/*************************************************************************** -; * Copyright (c) 2024 Microsoft Corporation -; * +; * Copyright (c) 2024 Microsoft Corporation +; * ; * This program and the accompanying materials are made available under the ; * terms of the MIT License which is available at ; * https://opensource.org/licenses/MIT. -; * +; * ; * SPDX-License-Identifier: MIT ; **************************************************************************/ ; @@ -73,18 +73,6 @@ SWI0 EQU 0x872E0 ;/* */ ;/* interrupt vector */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 12-30-2020 William E. Lamie Initial Version 6.1.3 */ -;/* 10-15-2021 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.9 */ -;/* 01-31-2022 William E. Lamie Modified comment(s), and */ -;/* added missing thread */ -;/* preemption logic, */ -;/* resulting in version 6.1.10 */ -;/* */ ;/**************************************************************************/ public __tx_timer_interrupt @@ -147,14 +135,14 @@ __tx_timer_no_time_slice: MOV.L [R2+], R1 ; Pickup timer list entry, _tx_timer_current_ptr++ CMP #0, R1 ; Is timer pointer NULL? BEQ __tx_timer_no_timer ; Yes, no timer has expired - + ; ; /* Set expiration flag. */ ; _tx_timer_expired = TX_TRUE; ; MOV.L #__tx_timer_expired,R2 ; Build address of expired flag MOV.L #1, R1 ; Build expired value - MOV.L R1, [R2] + MOV.L R1, [R2] BRA __tx_timer_done ; Finished with timer processing ; ; } @@ -165,7 +153,7 @@ __tx_timer_no_timer: ; /* No timer expired, increment the timer pointer. */ ; _tx_timer_current_ptr++; ; -; /* R2 already contains __tx_timer_current_ptr++ */ +; /* R2 already contains __tx_timer_current_ptr++ */ ; ; /* Check for wrap-around. */ ; if (_tx_timer_current_ptr == _tx_timer_list_end) @@ -184,9 +172,9 @@ __tx_timer_no_timer: ; } ; __tx_timer_skip_wrap: - MOV.L #__tx_timer_current_ptr,R1 + MOV.L #__tx_timer_current_ptr,R1 MOV.L R2, [R1] ; Store in updated pointer in _tx_timer_current_ptr - + __tx_timer_done: ; ; /* See if anything has expired. */ @@ -220,14 +208,14 @@ __tx_timer_dont_activate: ; /* Did time slice expire? */ ; if (_tx_timer_expired_time_slice) ; { -; +; MOV.L #__tx_timer_expired_time_slice, R1 ; Pickup time-slice expired flag addr MOV.L [R1], R1 ; Pickup actual flag CMP #0,R1 ; Has time-slice expired? BEQ __tx_timer_not_ts_expiration ; No, skip time-slice expiration ; ; /* Time slice interrupted thread. */ -; _tx_thread_time_slice(); +; _tx_thread_time_slice(); BSR __tx_thread_time_slice ; Call time-slice processing diff --git a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_alignment_adjust.c b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_alignment_adjust.c index a12e5386..c14c1715 100644 --- a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_alignment_adjust.c +++ b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_alignment_adjust.c @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -60,12 +61,6 @@ /* */ /* Initial thread stack frame */ /* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 10-15-2021 Scott Larson Initial Version 6.1.9 */ -/* */ /**************************************************************************/ VOID _txm_module_manager_alignment_adjust(TXM_MODULE_PREAMBLE *module_preamble, ULONG *code_size, diff --git a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_external_memory_enable.c b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_external_memory_enable.c index 25d1ea2b..f407249a 100644 --- a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_external_memory_enable.c +++ b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_external_memory_enable.c @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -64,12 +65,6 @@ /* */ /* Application code */ /* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 10-15-2021 Scott Larson Initial Version 6.1.9 */ -/* */ /**************************************************************************/ UINT _txm_module_manager_external_memory_enable(TXM_MODULE_INSTANCE *module_instance, VOID *start_address, @@ -106,7 +101,7 @@ TXM_MODULE_PREAMBLE *module_preamble; /* Invalid module pointer. */ return(TX_PTR_ERROR); } - + /* Determine if the module instance is in the loaded state. */ if (module_instance -> txm_module_instance_state != TXM_MODULE_LOADED) { @@ -116,7 +111,7 @@ TXM_MODULE_PREAMBLE *module_preamble; /* Return error if the module is not ready. */ return(TX_START_ERROR); } - + /* Check if preamble ext/shared mem property bit set. */ module_preamble = module_instance -> txm_module_instance_preamble_ptr; if(!(module_preamble -> txm_module_preamble_property_flags & TXM_MODULE_SHARED_EXTERNAL_MEMORY_ACCESS)) @@ -127,24 +122,24 @@ TXM_MODULE_PREAMBLE *module_preamble; /* Return error if bit not set. */ return(TXM_MODULE_INVALID_PROPERTIES); } - + /* Start address must be 16-byte aligned. */ address = (ULONG) start_address; if(address != (address & 0xFFFFFFF0)) { /* Release the protection mutex. */ _tx_mutex_put(&_txm_module_manager_mutex); - + /* Return alignment error. */ return(TXM_MODULE_ALIGNMENT_ERROR); } - + /* Check length. */ - + /* At this point, we have a valid address and length. */ /* Build region start page register. */ module_instance -> txm_module_instance_mpu_registers[TXM_MODULE_MANAGER_SHARED_MPU_INDEX] = address & 0xFFFFFFF0; - + /* Check for valid attributes. */ if(attributes & TXM_MODULE_MANAGER_SHARED_ATTRIBUTE_EXECUTE) { @@ -158,17 +153,17 @@ TXM_MODULE_PREAMBLE *module_preamble; { attributes_check |= TXM_MODULE_MANAGER_ATTRIBUTE_READ_MPU_BIT; } - + /* Build region end page register with attributes, OR in the Valid bit. */ module_instance -> txm_module_instance_mpu_registers[TXM_MODULE_MANAGER_SHARED_MPU_INDEX+1] = ((address + length - 1) & 0xFFFFFFF0) | attributes_check | 0x01; - + /* Save address and length in module. */ module_instance -> txm_module_instance_shared_memory_address = address; module_instance -> txm_module_instance_shared_memory_length = length; - + /* Release the protection mutex. */ _tx_mutex_put(&_txm_module_manager_mutex); - + /* Return success. */ return(TX_SUCCESS); } diff --git a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_memory_fault_handler.c b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_memory_fault_handler.c index 4cc5159e..0ff6baf2 100644 --- a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_memory_fault_handler.c +++ b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_memory_fault_handler.c @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -71,12 +72,6 @@ TXM_MODULE_MANAGER_FAULT_INFO /* */ /* Fault handler */ /* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 10-15-2021 Scott Larson Initial Version 6.1.9 */ -/* */ /**************************************************************************/ VOID _txm_module_manager_memory_fault_handler(VOID) { @@ -89,7 +84,7 @@ TX_THREAD *thread_ptr; /* Initialize the module instance pointer to NULL. */ module_instance_ptr = TX_NULL; - + /* Is there a thread? */ if (thread_ptr) { @@ -99,7 +94,7 @@ TX_THREAD *thread_ptr; /* Terminate the current thread. */ _tx_thread_terminate(_tx_thread_current_ptr); } - + /* Determine if there is a user memory fault notification callback. */ if (_txm_module_manager_fault_notify) { diff --git a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_memory_fault_notify.c b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_memory_fault_notify.c index 405c049f..7fe88dfe 100644 --- a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_memory_fault_notify.c +++ b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_memory_fault_notify.c @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -66,18 +67,12 @@ extern VOID (*_txm_module_manager_fault_notify)(TX_THREAD *, TXM_MODULE_INSTA /* */ /* Application Code */ /* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 10-15-2021 Scott Larson Initial Version 6.1.9 */ -/* */ /**************************************************************************/ UINT _txm_module_manager_memory_fault_notify(VOID (*notify_function)(TX_THREAD *, TXM_MODULE_INSTANCE *)) { /* Setup notification function. */ _txm_module_manager_fault_notify = notify_function; - + /* Return success. */ return(TX_SUCCESS); } diff --git a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_setup_mpu_registers.c b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_setup_mpu_registers.c index 9175331b..183f38ae 100644 --- a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_setup_mpu_registers.c +++ b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_setup_mpu_registers.c @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -55,12 +56,6 @@ /* */ /* _txm_module_manager_thread_create */ /* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 10-15-2021 Scott Larson Initial Version 6.1.9 */ -/* */ /**************************************************************************/ VOID _txm_module_manager_setup_mpu_registers(TXM_MODULE_INSTANCE *module_instance) { @@ -73,34 +68,34 @@ ULONG region_end_page_register; region_start_page_register = (ULONG) _txm_module_manager_user_mode_entry; region_start_page_register = region_start_page_register & 0xFFFFFFF0; module_instance -> txm_module_instance_mpu_registers[0] = region_start_page_register; - /* Region 0 End page is 2 pages away (for a total of 3 pages). + /* Region 0 End page is 2 pages away (for a total of 3 pages). * Set reading permitted, writing prohibited, execution permitted, enable region. */ module_instance -> txm_module_instance_mpu_registers[1] = (region_start_page_register + 0x20) | 0x0B; - + /* Place the trampoline protection in the MPU registers */ RSPAGE0 = module_instance -> txm_module_instance_mpu_registers[0]; REPAGE0 = module_instance -> txm_module_instance_mpu_registers[1]; - + /* Setup region 1 for code area. */ /* Set reading permitted, writing prohibited, execution permitted, enable region. */ - region_start_page_register = (ULONG) module_instance -> txm_module_instance_code_start; + region_start_page_register = (ULONG) module_instance -> txm_module_instance_code_start; region_size = (ULONG) module_instance -> txm_module_instance_code_size; - + region_end_page_register = (region_start_page_register + region_size - 1) & 0xFFFFFFF0; region_start_page_register = region_start_page_register & 0xFFFFFFF0; - + module_instance -> txm_module_instance_mpu_registers[2] = region_start_page_register; module_instance -> txm_module_instance_mpu_registers[3] = region_end_page_register | 0x0B; - + /* Setup region 2 for data area. */ /* Set reading permitted, writing permitted, execution prohibited, enable region. */ - region_start_page_register = (ULONG) module_instance -> txm_module_instance_data_start; + region_start_page_register = (ULONG) module_instance -> txm_module_instance_data_start; region_size = (ULONG) module_instance -> txm_module_instance_data_size; - + region_end_page_register = (region_start_page_register + region_size - 1) & 0xFFFFFFF0; region_start_page_register = region_start_page_register & 0xFFFFFFF0; - + module_instance -> txm_module_instance_mpu_registers[4] = region_start_page_register; module_instance -> txm_module_instance_mpu_registers[5] = region_end_page_register | 0x0D; - + } diff --git a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_thread_stack_build.s b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_thread_stack_build.s index 9cf9fa14..fa5bf71d 100644 --- a/ports_module/rxv2/iar/module_manager/src/txm_module_manager_thread_stack_build.s +++ b/ports_module/rxv2/iar/module_manager/src/txm_module_manager_thread_stack_build.s @@ -1,10 +1,11 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ @@ -53,13 +54,6 @@ /* CALLED BY */ /* */ /* _tx_thread_create Create thread service */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ -/* 01-31-2022 Scott Larson Initial Version 6.1.10 */ -/* */ /**************************************************************************/ // VOID _txm_module_manager_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(TX_THREAD *, TXM_MODULE_INSTANCE *)) // { @@ -68,7 +62,7 @@ __txm_module_manager_thread_stack_build: /* Build an interrupt frame. The form of the fake interrupt stack on the Renesas RX should look like the following after it is built: - + Stack Top: 1 Interrupt stack frame type ACC0 ACC1 @@ -103,9 +97,9 @@ __txm_module_manager_thread_stack_build: BMC #20,R4 // if user mode, set mode bit of initial PSW MOV.L R4, [-R3] // initial PSW MOV.L R2, [-R3] // initial PC - + MOV.L 8[R1], R4 // Pickup thread entry info pointer, which is in the stack pointer position of the thread control block. - // It was setup in the txm_module_manager_thread_create function. It will be overwritten later in this + // It was setup in the txm_module_manager_thread_create function. It will be overwritten later in this // function with the actual, initial stack pointer. MOV.L R4,[-R3] // initial R2, which is the module entry information. MOV.L R1,[-R3] // initial R1, which is the thread control block. |
