eclipse-threadx / usbx

Eclipse ThreadX - USBX is a high-performance USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Eclipse ThreadX RTOS
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/usbx/index.md
MIT License
154 stars 89 forks source link

USBX Are there plans to support 64-bit compilers? #45

Closed HelloByeAll closed 2 years ago

HelloByeAll commented 2 years ago

As you can see, if you use a 64-bit compiler, the compiled structure address offset will be inconsistent with the OHCI specification, and it will require 8 DWords


/* Define OHCI ED structure.  */

typedef struct UX_OHCI_ED_STRUCT
{

    ULONG           ux_ohci_ed_dw0;
    struct UX_OHCI_TD_STRUCT               
                    *ux_ohci_ed_tail_td;
    struct UX_OHCI_TD_STRUCT               
                    *ux_ohci_ed_head_td;
    struct UX_OHCI_ED_STRUCT               
                    *ux_ohci_ed_next_ed;
    struct UX_OHCI_ED_STRUCT               
                    *ux_ohci_ed_previous_ed;
    ULONG           ux_ohci_ed_status;
    struct UX_ENDPOINT_STRUCT          
                    *ux_ohci_ed_endpoint;
    ULONG           ux_ohci_ed_frame;
} UX_OHCI_ED;

/* Define OHCI TD structure.  */

typedef struct UX_OHCI_TD_STRUCT
{                                                
    ULONG           ux_ohci_td_dw0;
    UCHAR *         ux_ohci_td_cbp;
    struct UX_OHCI_TD_STRUCT              
                    *ux_ohci_td_next_td;
    UCHAR *         ux_ohci_td_be;
    ULONG           ux_ohci_td_reserved_1[4];
    struct UX_TRANSFER_STRUCT          
                    *ux_ohci_td_transfer_request;
    struct UX_OHCI_TD_STRUCT              
                    *ux_ohci_td_next_td_transfer_request;
    struct UX_OHCI_ED_STRUCT              
                    *ux_ohci_td_ed;
    ULONG           ux_ohci_td_length;
    ULONG           ux_ohci_td_status;
    ULONG           ux_ohci_td_reserved_2[3];
} UX_OHCI_TD;

image

image

xiaocq2001 commented 2 years ago

Thanks for the feedback. There is no plan to modify OHCI driver for 64-bit compiler yet. BTW, is there any suggested target chip for this case?

HelloByeAll commented 2 years ago

RK3308