1 /***************************************************************************
2 * Copyright (c) 2024 Microsoft Corporation
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the MIT License which is available at
6 * https://opensource.org/licenses/MIT.
7 *
8 * SPDX-License-Identifier: MIT
9 **************************************************************************/
10
11
12 /**************************************************************************/
13 /**************************************************************************/
14 /** */
15 /** ThreadX Component */
16 /** */
17 /** Module */
18 /** */
19 /**************************************************************************/
20 /**************************************************************************/
21
22 #define TXM_MODULE
23 #include "txm_module.h"
24 #ifndef TXM_THREAD_PRIORITY_CHANGE_CALL_NOT_USED
25 /**************************************************************************/
26 /* */
27 /* FUNCTION RELEASE */
28 /* */
29 /* _txe_thread_priority_change PORTABLE C */
30 /* 6.1.10 */
31 /* AUTHOR */
32 /* */
33 /* Scott Larson, Microsoft Corporation */
34 /* */
35 /* DESCRIPTION */
36 /* */
37 /* This function checks for errors in the change priority function */
38 /* call. */
39 /* */
40 /* INPUT */
41 /* */
42 /* thread_ptr Pointer to thread to suspend */
43 /* new_priority New thread priority */
44 /* old_priority Old thread priority */
45 /* */
46 /* OUTPUT */
47 /* */
48 /* TX_THREAD_ERROR Invalid thread pointer */
49 /* TX_PTR_ERROR Invalid old priority pointer */
50 /* TX_CALLER_ERROR Invalid caller of function */
51 /* status Actual completion 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 /**************************************************************************/
_txe_thread_priority_change(TX_THREAD * thread_ptr,UINT new_priority,UINT * old_priority)71 UINT _txe_thread_priority_change(TX_THREAD *thread_ptr, UINT new_priority, UINT *old_priority)
72 {
73
74 UINT return_value;
75
76 /* Call module manager dispatcher. */
77 return_value = (UINT) (_txm_module_kernel_call_dispatcher)(TXM_THREAD_PRIORITY_CHANGE_CALL, (ALIGN_TYPE) thread_ptr, (ALIGN_TYPE) new_priority, (ALIGN_TYPE) old_priority);
78
79 /* Return value to the caller. */
80 return(return_value);
81 }
82 #endif
83