1 /**************************************************************************/
2 /* */
3 /* Copyright (c) Microsoft Corporation. All rights reserved. */
4 /* */
5 /* This software is licensed under the Microsoft Software License */
6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */
7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
8 /* and in the root directory of this software. */
9 /* */
10 /**************************************************************************/
11
12
13 /**************************************************************************/
14 /**************************************************************************/
15 /** */
16 /** ThreadX Component */
17 /** */
18 /** Module */
19 /** */
20 /**************************************************************************/
21 /**************************************************************************/
22
23 #define TXM_MODULE
24 #include "txm_module.h"
25 #ifndef TXM_THREAD_STACK_ERROR_NOTIFY_CALL_NOT_USED
26 /**************************************************************************/
27 /* */
28 /* FUNCTION RELEASE */
29 /* */
30 /* _tx_thread_stack_error_notify PORTABLE C */
31 /* 6.1.10 */
32 /* AUTHOR */
33 /* */
34 /* Scott Larson, Microsoft Corporation */
35 /* */
36 /* DESCRIPTION */
37 /* */
38 /* This function registers an application stack error handler. If */
39 /* ThreadX detects a stack error, this application handler is called. */
40 /* */
41 /* Note: stack checking must be enabled for this routine to serve any */
42 /* purpose via the TX_ENABLE_STACK_CHECKING define. */
43 /* */
44 /* INPUT */
45 /* */
46 /* stack_error_handler Pointer to stack error */
47 /* handler, TX_NULL to disable */
48 /* */
49 /* OUTPUT */
50 /* */
51 /* status Service return status */
52 /* */
53 /* CALLS */
54 /* */
55 /* _txm_module_kernel_call_dispatcher */
56 /* */
57 /* CALLED BY */
58 /* */
59 /* Module application code */
60 /* */
61 /* RELEASE HISTORY */
62 /* */
63 /* DATE NAME DESCRIPTION */
64 /* */
65 /* 09-30-2020 Scott Larson Initial Version 6.1 */
66 /* 01-31-2022 Scott Larson Modified comments and added */
67 /* CALL_NOT_USED option, */
68 /* resulting in version 6.1.10 */
69 /* */
70 /**************************************************************************/
_tx_thread_stack_error_notify(VOID (* stack_error_handler)(TX_THREAD * thread_ptr))71 UINT _tx_thread_stack_error_notify(VOID (*stack_error_handler)(TX_THREAD *thread_ptr))
72 {
73
74 UINT return_value;
75
76 /* Call module manager dispatcher. */
77 return_value = (UINT) (_txm_module_kernel_call_dispatcher)(TXM_THREAD_STACK_ERROR_NOTIFY_CALL, (ALIGN_TYPE) stack_error_handler, 0, 0);
78
79 /* Return value to the caller. */
80 return(return_value);
81 }
82 #endif
83