This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GIO impemenation

Dear all,

I am going through the implementation of GIO  in ti-rtos_c600_2_00_13 for the platform c6657. Specifically, I  try to understand how the two queues (freeList and doneList) are handled.

In the function GIO_Instance_init the function QUEUE_construct is used to construct the two queues. 

The address of the root of the queues is extracted  using the function GIO_Instance_State_doneList(obj) and free list. But where do these addresses point?

In addition to this, how the IOM_Packet is connected whio GIO_Object?For example in SIO implemetnation the QUE obj is used

Thank you 

George

/* Object */
struct ti_sysbios_io_GIO_Object {
xdc_String name;
xdc_UInt mode;
xdc_UInt model;
xdc_UInt timeout;
xdc_runtime_IHeap_Handle packetHeap;
xdc_runtime_knl_ISync_Handle sync;
xdc_Bool userSync;
xdc_Ptr packets;
xdc_Int numPackets;
xdc_Int freeCount;
xdc_Int doneCount;
xdc_Int submitCount;
xdc_Ptr fxns;
xdc_Ptr mdChan;
char __dummy;
};

Thank you in advance

George 

  • Hi George,
    Moved this thread to correct(TI-RTOS) forum for faster response. Thank you.
  • Could you please help us in the aforementioned problem?
    I cannot understand where these lists are pointed.

    Also  I noticed that in GIO.xdc the definition of the structure GIO_Object is not the similar with the implementation in GIO.h.

    internal:

    /* -------- Internal Structures -------- */
    struct Instance_State {
    String name; /* name used to create inst */
    UInt mode; /* input or output */
    UInt model; /* STANARD or ISSUERECLAIM */
    UInt timeout; /* STANARD or ISSUERECLAIM */
    IHeap.Handle packetHeap; /* heap used to alloc packets */
    ISync.Handle sync; /* completion sync */
    Bool userSync; /* user supplied sync handle*/
    Queue.Object doneList; /* done packets */
    Queue.Object freeList; /* free packets */
    Ptr packets; /* allocated packet block */
    Int numPackets; /* total # of packets */
    Int freeCount; /* # of free packets */
    Int doneCount; /* # of completed packets */
    Int submitCount; /* # packets submitted to driver */

    Ptr fxns; /* device function table */
    Ptr mdChan; /* pointer to driver chan object */
    };
    }

    And in GIO.h the fields Queue.Object doneList; /* done packets */ Queue.Object freeList; /* free packets */ are missing.

    Also is any example?
    Best regards
    George

  • Hi Giorgos,

    giorgos tsoumplekas said:

    In the function GIO_Instance_init the function QUEUE_construct is used to construct the two queues. 

    The address of the root of the queues is extracted  using the function GIO_Instance_State_doneList(obj) and free list. But where do these addresses point?

    The GIO object (created through a GIO_create() call), has doneList and freeList pointer fields that point to a queue internally represented as doubly linked-list.

    The freeList maintains a list of free packets while the doneList maintains a list of packets that have been processed. When a packet needs to be sent to the device, a free packet is dequeued from the freeList and sent/submitted to the device's channel (GIO_issue() would for example do this). Once the packet is processed, it is added to the doneList and can be reclaimed i.e. put back on the free list (GIO_reclaim() would for example do this).

    For a more complete understanding of the GIO model, please read the section on "GIO Drivers" and "IOM Interface" in the SYS/BIOS (TI-RTOS kernel) user guide.

    giorgos tsoumplekas said:

    In addition to this, how the IOM_Packet is connected whio GIO_Object?For example in SIO implemetnation the QUE obj is used

    GIO_create() allocates one large buffer whose size is (Size of IOM_Packet * number of IOM_Packets specified in GIO_Params). This buffer gets broken up into individual packets and added to the free list. These packets are tracked through the free and done lists I mentioned above.

    So, when the application calls GIO_issue() for example, an IOM_Packet is removed from the free list and filled with the buffer addres, size, etc. This packet is then sent to the device for processing.

    Best,

    Ashish