> > 
> > In practice, this yields errors when working with an odp_queue_t 
defined
> > as an union, unless you define ODP_QUEUE_INVALID as an
> > _odp_cast_scalar(<value>) which was not recommended.
> 
> ODP_QUEUE_INVALID is of type odp_queue_t, so however an 
implementation
> chooses to define that type, two variables of the same type are type
> compatible for comparison and assignment.  Which specific 
implementation
> are you having problems with and how is that type defined there?  You 
may
> have uncovered an omission in one of the validation tests if what you 
say
> is true, in which case this should be a bug report.
> 

        Hi,

        The definition is as the following:

typedef union {
        uint64_t u64;
        struct {
#ifdef __BIG_ENDIAN_BITFIELD
                uint64_t magic:16;      /* OCT_QUEUE_MAGIC */
                uint64_t res:32;        /* reserved */
                uint64_t sch_poll:1;    /* 0: schedule 1: pool */
                uint64_t in_out:1;      /* 0: inq 1: outq */
                uint64_t tag_type:2;    /* tag type (only for 
inq)*/
                uint64_t node:2;        /* node */
                uint64_t index:10;      /* 7:0 sso_grp(inq) 9:0 
DQ(ouq) */
#else
                uint64_t index:10;      /* 7:0 sso_grp(inq) 9:0 
DQ(ouq) */
                uint64_t node:2;        /* node */
                uint64_t tag_type:2;    /* tag type (only for 
inq)*/
                uint64_t in_out:1;      /* 0: inq 1: outq */
                uint64_t sch_poll:1;    /* 0: schedule 1: pool */
                uint64_t res:32;        /* reserved */
                uint64_t magic:16;      /* OCT_QUEUE_MAGIC */
#endif
        } s;
} oct_queue_t;

typedef oct_queue_t odp_queue_t;

        If you define ODP_QUEUE_INVALID like:

#define ODP_QUEUE_INVALID       _odp_cast_scalar(odp_queue_t, 
~(unsigned)0)

        The comparison you said can be performed. For any other 
definition of ODP_QUEUE_INVALID I tried, the comparison is failing because 
of incompatible types.

        Let me know if there is something I'm missing here.

        Best regards.

        José.

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to