Release 6.1.7
This commit is contained in:
@@ -101,6 +101,12 @@ UINT _txe_thread_secure_stack_free(struct TX_THREAD_STRUCT *thread_ptr);
|
||||
UINT _tx_thread_secure_stack_allocate(struct TX_THREAD_STRUCT *tx_thread, ULONG stack_size);
|
||||
UINT _tx_thread_secure_stack_free(struct TX_THREAD_STRUCT *tx_thread);
|
||||
|
||||
/* This port overrides tx_thread_stack_error_notify with an architecture specific version */
|
||||
#define TX_PORT_THREAD_STACK_ERROR_NOTIFY
|
||||
|
||||
/* This port overrides tx_thread_stack_error_handler with an architecture specific version */
|
||||
#define TX_PORT_THREAD_STACK_ERROR_HANDLER
|
||||
|
||||
/* This hardware has stack checking that we take advantage of - do NOT define. */
|
||||
#ifdef TX_ENABLE_STACK_CHECKING
|
||||
#error "Do not define TX_ENABLE_STACK_CHECKING"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_schedule Cortex-M33/MPU/IAR */
|
||||
/* 6.1.6 */
|
||||
/* 6.1.7 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, Microsoft Corporation */
|
||||
@@ -78,6 +78,9 @@
|
||||
/* 04-02-2021 Scott Larson Modified comments and fixed */
|
||||
/* MPU region configuration, */
|
||||
/* resulting in version 6.1.6 */
|
||||
/* 06-02-2021 Scott Larson Fixed extended stack handling */
|
||||
/* when calling kernel APIs, */
|
||||
/* resulting in version 6.1.7 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
// VOID _tx_thread_schedule(VOID)
|
||||
@@ -469,20 +472,24 @@ SVC_Handler:
|
||||
STR r0, [r2, #16] // Set stack end
|
||||
STR r3, [r2, #20] // Set stack size
|
||||
#endif
|
||||
|
||||
MRS r3, PSP // Pickup thread stack pointer
|
||||
TST lr, #0x10 // Test for extended module stack
|
||||
ITT EQ
|
||||
ORREQ r3, r3, #1 // If so, set LSB in thread stack pointer to indicate extended frame
|
||||
ORREQ lr, lr, #0x10 // Set bit, return with standard frame
|
||||
STR r3, [r2, #0xB0] // Save thread stack pointer
|
||||
|
||||
BIC r3, #1 // Clear possibly OR'd bit
|
||||
|
||||
/* Build kernel stack by copying thread stack two registers at a time */
|
||||
ADD r3, r3, #32 // Start at bottom of hardware stack
|
||||
LDMDB r3!,{r1-r2}
|
||||
STMDB r0!,{r1-r2}
|
||||
LDMDB r3!,{r1-r2}
|
||||
STMDB r0!,{r1-r2}
|
||||
LDMDB r3!,{r1-r2}
|
||||
STMDB r0!,{r1-r2}
|
||||
LDMDB r3!,{r1-r2}
|
||||
STMDB r0!,{r1-r2}
|
||||
LDMDB r3!, {r1-r2}
|
||||
STMDB r0!, {r1-r2}
|
||||
LDMDB r3!, {r1-r2}
|
||||
STMDB r0!, {r1-r2}
|
||||
LDMDB r3!, {r1-r2}
|
||||
STMDB r0!, {r1-r2}
|
||||
LDMDB r3!, {r1-r2}
|
||||
STMDB r0!, {r1-r2}
|
||||
|
||||
MSR PSP, r0 // Set kernel stack pointer
|
||||
|
||||
@@ -522,16 +529,21 @@ _tx_thread_user_return:
|
||||
#endif
|
||||
LDR r0, [r2, #0xB0] // Load the module thread stack pointer
|
||||
MRS r3, PSP // Pickup kernel stack pointer
|
||||
TST r0, #1 // Is module stack extended?
|
||||
ITTE NE // If so...
|
||||
BICNE lr, #0x10 // Clear bit, return with extended frame
|
||||
BICNE r0, #1 // Clear bit that indicates extended module frame
|
||||
ORREQ lr, lr, #0x10 // Else set bit, return with standard frame
|
||||
|
||||
/* Copy kernel hardware stack to module thread stack. */
|
||||
LDM r3!,{r1-r2}
|
||||
STM r0!,{r1-r2}
|
||||
LDM r3!,{r1-r2}
|
||||
STM r0!,{r1-r2}
|
||||
LDM r3!,{r1-r2}
|
||||
STM r0!,{r1-r2}
|
||||
LDM r3!,{r1-r2}
|
||||
STM r0!,{r1-r2}
|
||||
LDM r3!, {r1-r2}
|
||||
STM r0!, {r1-r2}
|
||||
LDM r3!, {r1-r2}
|
||||
STM r0!, {r1-r2}
|
||||
LDM r3!, {r1-r2}
|
||||
STM r0!, {r1-r2}
|
||||
LDM r3!, {r1-r2}
|
||||
STM r0!, {r1-r2}
|
||||
SUB r0, r0, #32 // Subtract 32 to get back to top of stack
|
||||
MSR PSP, r0 // Set thread stack pointer
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ typedef struct TX_THREAD_SECURE_STACK_INFO_STRUCT
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_secure_stack_initialize Cortex-M33/IAR */
|
||||
/* 6.1.5 */
|
||||
/* 6.1.1 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, Microsoft Corporation */
|
||||
@@ -96,8 +96,8 @@ typedef struct TX_THREAD_SECURE_STACK_INFO_STRUCT
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 09-30-2020 Scott Larson Initial Version 6.1 */
|
||||
/* 03-02-2021 Scott Larson Modified comment(s), */
|
||||
/* resulting in version 6.1.5 */
|
||||
/* 10-16-2020 Scott Larson Modified comment(s), */
|
||||
/* resulting in version 6.1.1 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
@@ -122,7 +122,7 @@ void _tx_thread_secure_stack_initialize(void)
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_secure_mode_stack_allocate Cortex-M33/IAR */
|
||||
/* 6.1.5 */
|
||||
/* 6.1.1 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, Microsoft Corporation */
|
||||
@@ -162,9 +162,9 @@ void _tx_thread_secure_stack_initialize(void)
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 09-30-2020 Scott Larson Initial Version 6.1 */
|
||||
/* 03-02-2021 Scott Larson Modified comment(s), */
|
||||
/* 10-16-2020 Scott Larson Modified comment(s), */
|
||||
/* added stack sealing, */
|
||||
/* resulting in version 6.1.5 */
|
||||
/* resulting in version 6.1.1 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
@@ -249,7 +249,7 @@ UCHAR *stack_mem;
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_secure_mode_stack_free Cortex-M33/IAR */
|
||||
/* 6.1.5 */
|
||||
/* 6.1.1 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, Microsoft Corporation */
|
||||
@@ -282,8 +282,8 @@ UCHAR *stack_mem;
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 09-30-2020 Scott Larson Initial Version 6.1 */
|
||||
/* 03-02-2021 Scott Larson Modified comment(s), */
|
||||
/* resulting in version 6.1.5 */
|
||||
/* 10-16-2020 Scott Larson Modified comment(s), */
|
||||
/* resulting in version 6.1.1 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
@@ -332,7 +332,7 @@ TX_THREAD_SECURE_STACK_INFO *info_ptr;
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_secure_stack_context_save Cortex-M33/IAR */
|
||||
/* 6.1.5 */
|
||||
/* 6.1.7 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, Microsoft Corporation */
|
||||
@@ -365,8 +365,10 @@ TX_THREAD_SECURE_STACK_INFO *info_ptr;
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 09-30-2020 Scott Larson Initial Version 6.1 */
|
||||
/* 03-02-2021 Scott Larson Modified comment(s), */
|
||||
/* resulting in version 6.1.5 */
|
||||
/* 10-16-2020 Scott Larson Modified comment(s), */
|
||||
/* resulting in version 6.1.1 */
|
||||
/* 06-02-2021 Scott Larson Fix stack pointer save, */
|
||||
/* resulting in version 6.1.7 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
@@ -399,7 +401,7 @@ ULONG sp;
|
||||
}
|
||||
|
||||
/* Save stack pointer. */
|
||||
*(ULONG *) info_ptr -> tx_thread_secure_stack_ptr = sp;
|
||||
info_ptr -> tx_thread_secure_stack_ptr = (VOID *) sp;
|
||||
|
||||
/* Set process stack pointer and stack limit to 0 to throw exception when a thread
|
||||
without a secure stack calls a secure function that tries to use secure stack. */
|
||||
@@ -416,7 +418,7 @@ ULONG sp;
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_secure_stack_context_restore Cortex-M33/IAR */
|
||||
/* 6.1.5 */
|
||||
/* 6.1.1 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, Microsoft Corporation */
|
||||
@@ -448,8 +450,8 @@ ULONG sp;
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 09-30-2020 Scott Larson Initial Version 6.1 */
|
||||
/* 03-02-2021 Scott Larson Modified comment(s), */
|
||||
/* resulting in version 6.1.5 */
|
||||
/* 10-16-2020 Scott Larson Modified comment(s), */
|
||||
/* resulting in version 6.1.1 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
__attribute__((cmse_nonsecure_entry))
|
||||
|
||||
Reference in New Issue
Block a user