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_TIME_SLICE_CHANGE_CALL_NOT_USED
25 /**************************************************************************/
26 /* */
27 /* FUNCTION RELEASE */
28 /* */
29 /* _txe_thread_time_slice_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 time slice change function */
38 /* call. */
39 /* */
40 /* INPUT */
41 /* */
42 /* thread_ptr Pointer to thread */
43 /* new_time_slice New time slice */
44 /* old_time_slice Old time slice */
45 /* */
46 /* OUTPUT */
47 /* */
48 /* TX_THREAD_ERROR Invalid thread pointer */
49 /* TX_CALLER_ERROR Invalid caller of function */
50 /* status Actual completion status */
51 /* */
52 /* CALLS */
53 /* */
54 /* _txm_module_kernel_call_dispatcher */
55 /* */
56 /* CALLED BY */
57 /* */
58 /* Module application code */
59 /* */
60 /* RELEASE HISTORY */
61 /* */
62 /* DATE NAME DESCRIPTION */
63 /* */
64 /* 09-30-2020 Scott Larson Initial Version 6.1 */
65 /* 01-31-2022 Scott Larson Modified comments and added */
66 /* CALL_NOT_USED option, */
67 /* resulting in version 6.1.10 */
68 /* */
69 /**************************************************************************/
_txe_thread_time_slice_change(TX_THREAD * thread_ptr,ULONG new_time_slice,ULONG * old_time_slice)70 UINT _txe_thread_time_slice_change(TX_THREAD *thread_ptr, ULONG new_time_slice, ULONG *old_time_slice)
71 {
72
73 UINT return_value;
74
75 /* Call module manager dispatcher. */
76 return_value = (UINT) (_txm_module_kernel_call_dispatcher)(TXM_THREAD_TIME_SLICE_CHANGE_CALL, (ALIGN_TYPE) thread_ptr, (ALIGN_TYPE) new_time_slice, (ALIGN_TYPE) old_time_slice);
77
78 /* Return value to the caller. */
79 return(return_value);
80 }
81 #endif
82