-
Notifications
You must be signed in to change notification settings - Fork 823
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Two basic structures for consideration
This is not a mergeable commit, as it includes modifications to things that should not be committed upstream.
- Loading branch information
Greg Link
committed
Jan 9, 2025
1 parent
485a02f
commit 73756fd
Showing
9 changed files
with
122 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*************************************************************************** | ||
* Copyright (c) 2025 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 | ||
**************************************************************************/ | ||
|
||
/* Include necessary system files. */ | ||
|
||
#include "tx_api.h" | ||
#include "tx_trace.h" | ||
#include "tx_thread.h" | ||
#include "tx_initialize.h" | ||
|
||
/* Test only, demo of user extension. If the below is not defined, | ||
no need to include this function at all - it will never be called */ | ||
#ifdef TX_ENABLE_THREAD_SYSTEM_RESUME_EXTENSION | ||
|
||
UINT _tx_thread_system_resume_extension(TX_THREAD *thread_ptr) | ||
{ | ||
UINT status = 0; | ||
if (!thread_ptr->resume_recorded) | ||
{ | ||
thread_ptr->resume_recorded_at += 1; | ||
} | ||
|
||
/* Return completion status. */ | ||
return(status); | ||
} | ||
|
||
#endif //TX_ENABLE_THREAD_SYSTEM_RESUME_EXTENSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*************************************************************************** | ||
* 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 | ||
**************************************************************************/ | ||
|
||
#ifndef TX_USER_H | ||
#define TX_USER_H | ||
|
||
/* Define user-specified additional fields to be stored in TX_THREAD */ | ||
#define TX_THREAD_USER_EXTENSION UCHAR resume_recorded; \ | ||
ULONG resume_recorded_at; \ | ||
UCHAR suspend_recorded; \ | ||
ULONG suspend_recorded_at; | ||
|
||
/* This is one way to define the extension. Because it's a macro, it | ||
cannot handle static allocations internally, nor does it have a | ||
proper calling context for tracing purposes. */ | ||
#define TX_THREAD_SYSTEM_SUSPEND_EXTENSION(thread_ptr) \ | ||
do { \ | ||
if (!thread_ptr->suspend_recorded) \ | ||
{ \ | ||
thread_ptr->suspend_recorded_at += 1; \ | ||
thread_ptr->suspend_recorded = 1; \ | ||
} \ | ||
} while(0) | ||
|
||
#endif | ||
|