/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * Copyright (c) 2026-present Eclipse ThreadX contributors * * 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 **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** USBX Component */ /** */ /** Utility */ /** */ /**************************************************************************/ /**************************************************************************/ /* Include necessary system files. */ #define UX_SOURCE_CODE #include "ux_api.h" #if !defined(UX_STANDALONE) #include "tx_thread.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _ux_utility_thread_identify PORTABLE C */ /* 6.1.11 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function return a pointer to the calling thread. */ /* */ /* INPUT */ /* */ /* None */ /* */ /* OUTPUT */ /* */ /* Completion Status */ /* */ /* CALLS */ /* */ /* tx_thread_identify ThreadX identify function */ /* */ /* CALLED BY */ /* */ /* USBX Components */ /* */ /**************************************************************************/ UX_THREAD *_ux_utility_thread_identify(VOID) { /* If we're under interrupt, the thread returned by tx_thread_identify is the thread running prior to the ISR. Instead, we set it to null. */ return(UX_THREAD_GET_SYSTEM_STATE() ? UX_NULL : tx_thread_identify()); } #endif