Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion common/core/inc/ux_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* SPDX-License-Identifier: MIT
**************************************************************************/
// Portions of this file were generated with AI assistance.


/**************************************************************************/
Expand Down Expand Up @@ -1168,7 +1169,9 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL
#define UX_NON_CONTROL_TRANSFER_TIMEOUT 50000
#endif
#define UX_PORT_ENABLE_WAIT 50
#ifndef UX_DEVICE_ADDRESS_SET_WAIT
#define UX_DEVICE_ADDRESS_SET_WAIT 50
#endif
#define UX_HIGH_SPEED_DETECTION_HANDSHAKE_SUSPEND_WAIT 200
#define UX_ENUMERATION_THREAD_WAIT 200

Expand Down Expand Up @@ -1543,8 +1546,16 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL

/* Define USBX root HUB constants. */

#ifndef UX_RH_ENUMERATION_RETRY
#define UX_RH_ENUMERATION_RETRY 3
#endif
#ifndef UX_RH_ENUMERATION_RETRY_DELAY
#define UX_RH_ENUMERATION_RETRY_DELAY 100
#endif
/* USB spec minimum debounce interval (ms) on device attach. */
#ifndef UX_HOST_STACK_DEVICE_ATTACH_DEBOUNCE_DELAY
#define UX_HOST_STACK_DEVICE_ATTACH_DEBOUNCE_DELAY 100
#endif


/* Define USBX PCI driver constants. */
Expand Down Expand Up @@ -2856,4 +2867,3 @@ UINT ux_device_stack_transfer_run(UX_SLAVE_TRANSFER *transfer_request, ULONG

#endif


3 changes: 2 additions & 1 deletion common/core/src/ux_host_stack_rh_device_insertion.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* SPDX-License-Identifier: MIT
**************************************************************************/
// Portions of this file were generated with AI assistance.


/**************************************************************************/
Expand Down Expand Up @@ -112,7 +113,7 @@ UINT status;
return(port_status);

/* A debounce interval with a minimum duration of 100 ms on attach. */
_ux_utility_delay_ms(100);
_ux_utility_delay_ms(UX_HOST_STACK_DEVICE_ATTACH_DEBOUNCE_DELAY);

/* The first attempts to do a device enumeration may fail.
Typically, after the port is reset and the first command is sent to
Expand Down
3 changes: 3 additions & 0 deletions common/usbx_host_classes/inc/ux_host_class_cdc_acm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* SPDX-License-Identifier: MIT
**************************************************************************/
// Portions of this file were generated with AI assistance.


/**************************************************************************/
Expand Down Expand Up @@ -61,7 +62,9 @@ extern "C" {

/* Define CDC ACM Class constants. */

#ifndef UX_HOST_CLASS_CDC_ACM_DEVICE_INIT_DELAY
#define UX_HOST_CLASS_CDC_ACM_DEVICE_INIT_DELAY 1000
#endif
#define UX_HOST_CLASS_CDC_ACM_CLASS_TRANSFER_TIMEOUT 300000
#define UX_HOST_CLASS_CDC_DATA_CLASS 0x0A
#define UX_HOST_CLASS_CDC_CONTROL_CLASS 0x02
Expand Down
5 changes: 5 additions & 0 deletions common/usbx_host_classes/inc/ux_host_class_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* SPDX-License-Identifier: MIT
**************************************************************************/
// Portions of this file were generated with AI assistance.


/**************************************************************************/
Expand Down Expand Up @@ -131,8 +132,12 @@ extern "C" {

/* Define Storage Class constants. */

#ifndef UX_HOST_CLASS_STORAGE_DEVICE_INIT_DELAY
#define UX_HOST_CLASS_STORAGE_DEVICE_INIT_DELAY (200)
#endif
#ifndef UX_HOST_CLASS_STORAGE_THREAD_SLEEP_TIME
#define UX_HOST_CLASS_STORAGE_THREAD_SLEEP_TIME (2000)
#endif
#define UX_HOST_CLASS_STORAGE_INSTANCE_SHUTDOWN_TIMER (10)
#define UX_HOST_CLASS_STORAGE_THREAD_PRIORITY_CLASS 20
#define UX_HOST_CLASS_STORAGE_TRANSFER_TIMEOUT 10000
Expand Down
10 changes: 10 additions & 0 deletions ports/win32/vs_2019/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2026 Eclipse ThreadX contributors
#
# SPDX-License-Identifier: MIT
#
# AI Disclosure: This file was largely AI-generated by Copilot (Claude Opus 4.8).

target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
# Portions of this file were generated with AI assistance.
271 changes: 271 additions & 0 deletions ports/win32/vs_2019/inc/ux_port.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (C) 2026 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
**************************************************************************/
// Portions of this file were generated with AI assistance.

/* AI Disclosure: This file was largely AI-generated by Copilot (Claude Opus 4.8). */

/**************************************************************************/
/**************************************************************************/
/** */
/** USBX Component */
/** */
/** Port Specific */
/** */
/**************************************************************************/
/**************************************************************************/


/**************************************************************************/
/* */
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* ux_port.h Win32/VS 2019 */
/* 6.5.2.202603 */
/* */
/* AUTHOR */
/* */
/* Frédéric Desbiens */
/* */
/* DESCRIPTION */
/* */
/* This file contains data type definitions that make USBX function */
/* identically on a variety of different processor architectures. */
/* This port targets the Win32 simulation environment (MSVC, 32-bit) */
/* for use with the USBX regression test suite. It is not intended */
/* for production use. */
/* */
/**************************************************************************/

#ifndef UX_PORT_H
#define UX_PORT_H


/* Determine if the optional USBX user define file should be used. */

#ifdef UX_INCLUDE_USER_DEFINE_FILE
#include "ux_user.h"
#endif


/* Include required system headers. */

#include <stdio.h>
#include <string.h>
#include <stdint.h>


#if !defined(UX_STANDALONE)
#include "tx_api.h"
#else

/* Standalone build: define TX-compatible types when tx_api.h is absent. */
#if !defined(TX_API_H) && !defined(TX_PORT_H)

#ifndef VOID
#define VOID void
typedef char CHAR;
typedef unsigned char UCHAR;
typedef int INT;
typedef unsigned int UINT;
typedef long LONG;
typedef unsigned long ULONG;
typedef short SHORT;
typedef unsigned short USHORT;
#endif

#ifndef ULONG64_DEFINED
typedef uint64_t ULONG64;
#define ULONG64_DEFINED
#endif

#ifndef ALIGN_TYPE_DEFINED
#define ALIGN_TYPE ULONG
#define ALIGN_TYPE_DEFINED
#endif

#endif /* !TX_API_H && !TX_PORT_H */
#endif /* UX_STANDALONE */


/* Remap Windows SDK macros that clash with USBX identifiers.
These must appear AFTER Windows headers (pulled in by tx_api.h) so that the
Windows SDK definition of "interface" (struct __declspec(novtable)) is
overridden here. "class" does not need remapping since USBX is compiled
as C (not C++), where "class" is a plain identifier. */

#ifdef interface
#undef interface
#endif
#define interface usbx_interface


/* CPU definition — no preemptive timer required on x86/x64 simulation. */

#undef THREADX_X86_NO_PTIMER


/* Memory-mapped I/O (no IN/OUT instructions on x86). Use UX_USE_IO_INSTRUCTIONS
to disable these macros when function implementations are provided (e.g. test
utility mocks). */

#ifndef UX_USE_IO_INSTRUCTIONS
#define inpb(a) (*((UCHAR *)(a)))
#define inpw(a) (*((USHORT *)(a)))
#define inpl(a) (*((ULONG *)(a)))
#define outpb(a,b) (*((UCHAR *)(a)) = (UCHAR )(b))
#define outpw(a,b) (*((USHORT *)(a)) = (USHORT)(b))
#define outpl(a,b) (*((ULONG *)(a)) = (ULONG )(b))
#else

/* Function prototypes when I/O function implementations are provided. */

UCHAR inpb(ULONG);
ULONG inpl(ULONG);

UCHAR outpb(ULONG,UCHAR);
ULONG outpl(ULONG,ULONG);

/* MSVC treats inpw/outpw as built-in intrinsics that emit privileged x86 IN/OUT
instructions — these fault in user mode. The test utility provides mock
implementations named inpw_mok / outpw_mok; redirect all callers to them. */
#ifdef _MSC_VER
USHORT inpw_mok(ULONG);
USHORT outpw_mok(ULONG, USHORT);
#define inpw(a) inpw_mok(a)
#define outpw(a, b) outpw_mok((a), (b))
#else
USHORT inpw(ULONG);
USHORT outpw(ULONG, USHORT);
#endif

#endif

/* Additional generic USBX type. */

#ifndef SLONG_DEFINED
typedef LONG SLONG;
#define SLONG_DEFINED
#endif


/* Generic USBX project constants. All are wrapped in #ifndef so they can
be overridden from ux_user.h or the command line. */

#ifndef UX_PERIODIC_RATE
#define UX_PERIODIC_RATE 100
#endif

#ifndef UX_MAX_CLASS_DRIVER
#define UX_MAX_CLASS_DRIVER 8
#endif

#ifndef UX_MAX_SLAVE_CLASS_DRIVER
#define UX_MAX_SLAVE_CLASS_DRIVER 3
#endif

#ifndef UX_MAX_HCD
#define UX_MAX_HCD 2
#endif

#ifndef UX_MAX_DEVICES
#define UX_MAX_DEVICES 8
#endif

#ifndef UX_MAX_ED
#define UX_MAX_ED 80
#endif

#ifndef UX_MAX_TD
#define UX_MAX_TD 32
#endif

#ifndef UX_MAX_ISO_TD
#define UX_MAX_ISO_TD 128
#endif

#ifndef UX_HOST_ENUM_THREAD_STACK_SIZE
#define UX_HOST_ENUM_THREAD_STACK_SIZE (2*1024)
#endif

#ifndef UX_THREAD_STACK_SIZE
#define UX_THREAD_STACK_SIZE (1*1024)
#endif

#ifndef UX_THREAD_PRIORITY_ENUM
#define UX_THREAD_PRIORITY_ENUM 20
#endif

#ifndef UX_THREAD_PRIORITY_CLASS
#define UX_THREAD_PRIORITY_CLASS 20
#endif

#ifndef UX_THREAD_PRIORITY_KEYBOARD
#define UX_THREAD_PRIORITY_KEYBOARD 20
#endif

#ifndef UX_THREAD_PRIORITY_HCD
#define UX_THREAD_PRIORITY_HCD 2
#endif

#ifndef UX_THREAD_PRIORITY_DCD
#define UX_THREAD_PRIORITY_DCD 2
#endif

#ifndef UX_NO_TIME_SLICE
#define UX_NO_TIME_SLICE 0
#endif

#ifndef UX_MAX_SLAVE_LUN
#define UX_MAX_SLAVE_LUN 2
#endif

#ifndef UX_MAX_HOST_LUN
#define UX_MAX_HOST_LUN 2
#endif

#ifndef UX_HOST_CLASS_STORAGE_MAX_MEDIA
#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2
#endif

#ifndef UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT
#define UX_HOST_CLASS_STORAGE_MAX_PARTITIONS_COUNT 8
#endif

#ifndef UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH
#define UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH 256
#endif

#ifndef UX_SLAVE_REQUEST_DATA_MAX_LENGTH
#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH 4096
#endif


/* Interrupt lockout constructs used to protect allocation/release that may
occur under ISR in the device stack. */

#ifdef TX_API_H
#define UX_INT_SAVE_AREA unsigned int old_interrupt_posture;
#define UX_DISABLE_INTS old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
#define UX_RESTORE_INTS tx_interrupt_control(old_interrupt_posture);
#endif


/* Version ID string. */

#ifdef UX_SYSTEM_INIT
CHAR _ux_version_id[] =
"(c) 2024 Microsoft Corp. (c) 2026 Eclipse ThreadX contributors."
" * USBX Win32/VS 2019 Version 6.5.2.202603 *";
#else
extern CHAR _ux_version_id[];
#endif

#endif /* UX_PORT_H */
10 changes: 10 additions & 0 deletions ports/win64/vs_2022/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2026 Eclipse ThreadX contributors
#
# SPDX-License-Identifier: MIT
#
# AI Disclosure: This file was largely AI-generated by Copilot (Claude Sonnet 4.6).

target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
# Portions of this file were generated with AI assistance.
Loading