Skip to content

Commit

Permalink
drivers/virtio: PR-unikraft#1076 Use correct type for vring_avail_eve…
Browse files Browse the repository at this point in the history
…nt field

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
  • Loading branch information
mschlumpp authored and michpappas committed Sep 27, 2023
1 parent 0885a2b commit 0e868e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/virtio/ring/include/virtio/virtio_ring.h
Expand Up @@ -157,7 +157,9 @@ struct vring {
* versa. They are at the end for backwards compatibility.
*/
#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
#define vring_avail_event(vr) (*(__virtio16 *)&(vr)->used->ring[(vr)->num])
typedef __virtio_le16 __may_alias __virtio_le16_ma;
#define vring_avail_event(vr) \
(*(__virtio_le16_ma *)&(vr)->used->ring[(vr)->num])

static inline void vring_init(struct vring *vr, unsigned int num, uint8_t *p,
unsigned long align)
Expand Down
3 changes: 3 additions & 0 deletions include/uk/essentials.h
Expand Up @@ -99,6 +99,9 @@ extern "C" {
#ifndef __check_result
#define __check_result __attribute__((warn_unused_result))
#endif
#ifndef __may_alias
#define __may_alias __attribute__((may_alias))
#endif

#ifndef __alias
#define __alias(old, new) \
Expand Down

0 comments on commit 0e868e7

Please sign in to comment.