diff options
author | Ilias Apalodimas <ilias.apalodimas@linaro.org> | 2018-01-16 21:09:35 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-01-18 22:19:45 +0300 |
commit | 5a4502fc6bc53e6503169da3028f456b64811a0b (patch) | |
tree | 61a249560d8c4dfa7232676c326088a8f12ec923 /platform/linux-generic/include/odp_packet_io_ring_internal.h | |
parent | ccb6eb85729ad0657b5c852cb2a6ddb519d60898 (diff) |
linux-gen: align: Fix alignment for typedef definitions
* typedef struct { } ODP_ALIGN() test_t; is correct
* typedef struct ODP_ALIGN() {} test_t; is correct and
preferred from gcc standards
* typedef struct {} test_t ODP_ALIGN() discards align
Had segfauls on gcc-7 using that
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/include/odp_packet_io_ring_internal.h')
-rw-r--r-- | platform/linux-generic/include/odp_packet_io_ring_internal.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/linux-generic/include/odp_packet_io_ring_internal.h b/platform/linux-generic/include/odp_packet_io_ring_internal.h index d044f9319..5a60a4ee3 100644 --- a/platform/linux-generic/include/odp_packet_io_ring_internal.h +++ b/platform/linux-generic/include/odp_packet_io_ring_internal.h @@ -132,26 +132,26 @@ typedef struct _ring { int flags; /** @private Producer */ - struct _prod { + struct ODP_ALIGNED_CACHE _prod { uint32_t watermark; /* Maximum items */ uint32_t sp_enqueue; /* True, if single producer. */ uint32_t size; /* Size of ring. */ uint32_t mask; /* Mask (size-1) of ring. */ volatile uint32_t head; /* Producer head. */ volatile uint32_t tail; /* Producer tail. */ - } prod ODP_ALIGNED_CACHE; + } prod; /** @private Consumer */ - struct _cons { + struct ODP_ALIGNED_CACHE _cons { uint32_t sc_dequeue; /* True, if single consumer. */ uint32_t size; /* Size of the ring. */ uint32_t mask; /* Mask (size-1) of ring. */ volatile uint32_t head; /* Consumer head. */ volatile uint32_t tail; /* Consumer tail. */ - } cons ODP_ALIGNED_CACHE; + } cons; /** @private Memory space of ring starts here. */ - void *ring[0] ODP_ALIGNED_CACHE; + void ODP_ALIGNED_CACHE *ring[0]; } _ring_t; /* The default enqueue is "single-producer".*/ |