From 2806b1b2b1937c43a66c4924958c22bef9323b44 Mon Sep 17 00:00:00 2001 From: MAY Date: Wed, 4 Mar 2026 17:37:15 +0100 Subject: [PATCH] HOST SIM: Add missing uninitialize macro in simulator host header --- common/core/inc/ux_hcd_sim_host.h | 123 +++++++++++++++--------------- 1 file changed, 62 insertions(+), 61 deletions(-) diff --git a/common/core/inc/ux_hcd_sim_host.h b/common/core/inc/ux_hcd_sim_host.h index f61dbff2..95c9ae6d 100644 --- a/common/core/inc/ux_hcd_sim_host.h +++ b/common/core/inc/ux_hcd_sim_host.h @@ -1,18 +1,18 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * 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 **************************************************************************/ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Host Simulator Controller Driver */ /** */ @@ -20,26 +20,26 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* COMPONENT DEFINITION RELEASE */ -/* */ -/* ux_hcd_sim_host.h PORTABLE C */ +/**************************************************************************/ +/* */ +/* COMPONENT DEFINITION RELEASE */ +/* */ +/* ux_hcd_sim_host.h PORTABLE C */ /* 6.1.10 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ +/* */ /* This file contains all the header and extern functions used by the */ -/* USBX host simulator. It is designed to work ONLY with the USBX */ -/* device (slave) simulator. */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* USBX host simulator. It is designed to work ONLY with the USBX */ +/* device (slave) simulator. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* added controller disable, */ @@ -66,23 +66,23 @@ #ifndef UX_HCD_SIM_HOST_H #define UX_HCD_SIM_HOST_H -/* Determine if a C++ compiler is being used. If so, ensure that standard - C is used to process the API information. */ +/* Determine if a C++ compiler is being used. If so, ensure that standard + C is used to process the API information. */ -#ifdef __cplusplus +#ifdef __cplusplus -/* Yes, C++ compiler is present. Use standard C. */ -extern "C" { +/* Yes, C++ compiler is present. Use standard C. */ +extern "C" { -#endif +#endif /* Define simulator host generic definitions. */ #define UX_HCD_SIM_HOST_CONTROLLER 99 #define UX_HCD_SIM_HOST_MAX_PAYLOAD 4096 -#define UX_HCD_SIM_HOST_FRAME_DELAY 4 -#define UX_HCD_SIM_HOST_PERIODIC_ENTRY_NB 32 +#define UX_HCD_SIM_HOST_FRAME_DELAY 4 +#define UX_HCD_SIM_HOST_PERIODIC_ENTRY_NB 32 #define UX_HCD_SIM_HOST_PERIODIC_ENTRY_MASK 0x1f #define UX_HCD_SIM_HOST_AVAILABLE_BANDWIDTH 6000 @@ -116,19 +116,19 @@ typedef struct UX_HCD_SIM_HOST_STRUCT ULONG ux_hcd_sim_host_hcor; UINT ux_hcd_sim_host_nb_root_hubs; ULONG ux_hcd_sim_host_port_status[1]; - struct UX_HCD_SIM_HOST_ED_STRUCT + struct UX_HCD_SIM_HOST_ED_STRUCT *ux_hcd_sim_host_ed_list; - struct UX_HCD_SIM_HOST_TD_STRUCT + struct UX_HCD_SIM_HOST_TD_STRUCT *ux_hcd_sim_host_td_list; - struct UX_HCD_SIM_HOST_ISO_TD_STRUCT + struct UX_HCD_SIM_HOST_ISO_TD_STRUCT *ux_hcd_sim_host_iso_td_list; - struct UX_HCD_SIM_HOST_ED_STRUCT + struct UX_HCD_SIM_HOST_ED_STRUCT *ux_hcd_sim_host_asynch_head_ed; - struct UX_HCD_SIM_HOST_ED_STRUCT + struct UX_HCD_SIM_HOST_ED_STRUCT *ux_hcd_sim_host_asynch_current_ed; - struct UX_HCD_SIM_HOST_ED_STRUCT + struct UX_HCD_SIM_HOST_ED_STRUCT *ux_hcd_sim_host_iso_head_ed; - struct UX_HCD_SIM_HOST_ED_STRUCT + struct UX_HCD_SIM_HOST_ED_STRUCT *ux_hcd_sim_host_interrupt_ed_list[32]; UINT ux_hcd_sim_host_queue_empty; UINT ux_hcd_sim_host_periodic_scheduler_active; @@ -145,19 +145,19 @@ typedef struct UX_HCD_SIM_HOST_STRUCT typedef struct UX_HCD_SIM_HOST_ED_STRUCT { - struct UX_HCD_SIM_HOST_TD_STRUCT + struct UX_HCD_SIM_HOST_TD_STRUCT *ux_sim_host_ed_tail_td; - struct UX_HCD_SIM_HOST_TD_STRUCT + struct UX_HCD_SIM_HOST_TD_STRUCT *ux_sim_host_ed_head_td; - struct UX_HCD_SIM_HOST_ED_STRUCT + struct UX_HCD_SIM_HOST_ED_STRUCT *ux_sim_host_ed_next_ed; - struct UX_HCD_SIM_HOST_ED_STRUCT + struct UX_HCD_SIM_HOST_ED_STRUCT *ux_sim_host_ed_previous_ed; ULONG ux_sim_host_ed_status; - struct UX_ENDPOINT_STRUCT + struct UX_ENDPOINT_STRUCT *ux_sim_host_ed_endpoint; - ULONG ux_sim_host_ed_toggle; - ULONG ux_sim_host_ed_frame; + ULONG ux_sim_host_ed_toggle; + ULONG ux_sim_host_ed_frame; } UX_HCD_SIM_HOST_ED; @@ -171,17 +171,17 @@ typedef struct UX_HCD_SIM_HOST_ED_STRUCT /* Define simulator host TD structure. */ typedef struct UX_HCD_SIM_HOST_TD_STRUCT -{ +{ UCHAR * ux_sim_host_td_buffer; ULONG ux_sim_host_td_length; - struct UX_HCD_SIM_HOST_TD_STRUCT + struct UX_HCD_SIM_HOST_TD_STRUCT *ux_sim_host_td_next_td; - struct UX_TRANSFER_STRUCT + struct UX_TRANSFER_STRUCT *ux_sim_host_td_transfer_request; - struct UX_HCD_SIM_HOST_TD_STRUCT + struct UX_HCD_SIM_HOST_TD_STRUCT *ux_sim_host_td_next_td_transfer_request; - struct UX_HCD_SIM_HOST_ED_STRUCT + struct UX_HCD_SIM_HOST_ED_STRUCT *ux_sim_host_td_ed; ULONG ux_sim_host_td_actual_length; ULONG ux_sim_host_td_status; @@ -192,12 +192,12 @@ typedef struct UX_HCD_SIM_HOST_TD_STRUCT /* Define simulator host TD bitmap. */ -#define UX_HCD_SIM_HOST_TD_SETUP_PHASE 0x00010000 -#define UX_HCD_SIM_HOST_TD_DATA_PHASE 0x00020000 -#define UX_HCD_SIM_HOST_TD_STATUS_PHASE 0x00040000 +#define UX_HCD_SIM_HOST_TD_SETUP_PHASE 0x00010000 +#define UX_HCD_SIM_HOST_TD_DATA_PHASE 0x00020000 +#define UX_HCD_SIM_HOST_TD_STATUS_PHASE 0x00040000 #define UX_HCD_SIM_HOST_TD_OUT 0x00000800 #define UX_HCD_SIM_HOST_TD_IN 0x00001000 -#define UX_HCD_SIM_HOST_TD_ACK_PENDING 0x00002000 +#define UX_HCD_SIM_HOST_TD_ACK_PENDING 0x00002000 #define UX_HCD_SIM_HOST_TD_TOGGLE_FROM_ED 0x80000000 @@ -208,13 +208,13 @@ typedef struct UX_HCD_SIM_HOST_ISO_TD_STRUCT UCHAR * ux_sim_host_iso_td_buffer; ULONG ux_sim_host_iso_td_length; - struct UX_HCD_SIM_HOST_ISO_TD_STRUCT + struct UX_HCD_SIM_HOST_ISO_TD_STRUCT *ux_sim_host_iso_td_next_td; - struct UX_TRANSFER_STRUCT + struct UX_TRANSFER_STRUCT *ux_sim_host_iso_td_transfer_request; - struct UX_HCD_SIM_HOST_ISO_TD_STRUCT + struct UX_HCD_SIM_HOST_ISO_TD_STRUCT *ux_sim_host_iso_td_next_td_transfer_request; - struct UX_HCD_SIM_HOST_ED_STRUCT + struct UX_HCD_SIM_HOST_ED_STRUCT *ux_sim_host_iso_td_ed; ULONG ux_sim_host_iso_td_actual_length; ULONG ux_sim_host_iso_td_status; @@ -228,7 +228,7 @@ VOID _ux_hcd_sim_host_asynch_queue_process(UX_HCD_SIM_HOST *hcd_sim_host); VOID _ux_hcd_sim_host_asynch_schedule(UX_HCD_SIM_HOST *hcd_sim_host); UINT _ux_hcd_sim_host_asynchronous_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint); UINT _ux_hcd_sim_host_asynchronous_endpoint_destroy(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint); -UX_HCD_SIM_HOST_ED +UX_HCD_SIM_HOST_ED *_ux_hcd_sim_host_ed_obtain(UX_HCD_SIM_HOST *hcd_sim_host); VOID _ux_hcd_sim_host_ed_td_clean(UX_HCD_SIM_HOST_ED *ed); UINT _ux_hcd_sim_host_endpoint_reset(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint); @@ -242,15 +242,15 @@ UINT _ux_hcd_sim_host_interrupt_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host VOID _ux_hcd_sim_host_iso_queue_process(UX_HCD_SIM_HOST *hcd_sim_host); VOID _ux_hcd_sim_host_iso_schedule(UX_HCD_SIM_HOST *hcd_sim_host); UINT _ux_hcd_sim_host_isochronous_endpoint_create(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint); -UX_HCD_SIM_HOST_ISO_TD +UX_HCD_SIM_HOST_ISO_TD *_ux_hcd_sim_host_isochronous_td_obtain(UX_HCD_SIM_HOST *hcd_sim_host); -UX_HCD_SIM_HOST_ED +UX_HCD_SIM_HOST_ED *_ux_hcd_sim_host_least_traffic_list_get(UX_HCD_SIM_HOST *hcd_sim_host); UINT _ux_hcd_sim_host_periodic_endpoint_destroy(UX_HCD_SIM_HOST *hcd_sim_host, UX_ENDPOINT *endpoint); VOID _ux_hcd_sim_host_periodic_schedule(UX_HCD_SIM_HOST *hcd_sim_host); UINT _ux_hcd_sim_host_periodic_tree_create(UX_HCD_SIM_HOST *hcd_sim_host); ULONG _ux_hcd_sim_host_port_status_get(UX_HCD_SIM_HOST *hcd_sim_host, ULONG port_index); -UX_HCD_SIM_HOST_TD +UX_HCD_SIM_HOST_TD *_ux_hcd_sim_host_regular_td_obtain(UX_HCD_SIM_HOST *hcd_sim_host); UINT _ux_hcd_sim_host_request_bulk_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request); UINT _ux_hcd_sim_host_request_control_transfer(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER *transfer_request); @@ -267,11 +267,12 @@ UINT _ux_hcd_sim_host_transfer_run(UX_HCD_SIM_HOST *hcd_sim_host, UX_TRANSFER /* Define Device Simulator Class API prototypes. */ #define ux_hcd_sim_host_initialize _ux_hcd_sim_host_initialize -/* Determine if a C++ compiler is being used. If so, complete the standard - C conditional started above. */ +#define ux_hcd_sim_host_uninitialize _ux_hcd_sim_host_uninitialize + +/* Determine if a C++ compiler is being used. If so, complete the standard + C conditional started above. */ #ifdef __cplusplus -} +} #endif #endif -